nwo
stringclasses
304 values
sha
stringclasses
304 values
path
stringlengths
9
214
language
stringclasses
1 value
identifier
stringlengths
0
49
docstring
stringlengths
1
34.2k
function
stringlengths
8
59.4k
ast_function
stringlengths
71
497k
obf_function
stringlengths
8
39.4k
url
stringlengths
102
324
function_sha
stringlengths
40
40
source
stringclasses
2 values
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/arkts/@arkts.collections.d.ets
arkts
create
Creates an ArkTS Array with arrayLength elements initialized to initialValue. @param { number } arrayLength - The length of the array. @param { T } initialValue - Element initial value that will be filled into the Array. @returns { Array<T> } A new Array instance @throws { BusinessError } 401 - Parameter error. @throw...
static create<T>(arrayLength: number, initialValue: T): Array<T>;
AST#method_declaration#Left static create AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left arrayLength : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parame...
static create<T>(arrayLength: number, initialValue: T): Array<T>;
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.collections.d.ets#L220-L220
328aa06bbc7fcb5715cf989fb7f0e4d57dce21d1
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.SubHeaderV2.d.ets
arkts
The callback function that will be invoked when the title build. @typedef { function } SubHeaderV2TitleBuilder @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
export type SubHeaderV2TitleBuilder = () => void;
AST#export_declaration#Left export AST#type_declaration#Left type SubHeaderV2TitleBuilder = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#function_type#Right...
export type SubHeaderV2TitleBuilder = () => void;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.SubHeaderV2.d.ets#L531-L531
03a7612d09904d03750a5847505120ad58e8a6a5
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
isDrawEntryLabelsEnabled
Returns true if drawing the entry labels is enabled, false if not. @return
public isDrawEntryLabelsEnabled(): boolean { return this.mDrawEntryLabels; }
AST#method_declaration#Left public isDrawEntryLabelsEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AS...
public isDrawEntryLabelsEnabled(): boolean { return this.mDrawEntryLabels; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L710-L712
b5adf679bad6a1392397f02d0f42e409676cc8df
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.batteryInfo.d.ets
arkts
Battery charging status of a device. @enum { int } @syscap SystemCapability.PowerManager.BatteryManager.Core @since 20
export enum BatteryChargeState { /** * Unknown state. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 20 */ NONE, /** * The battery is being charged. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 20 */ ENAB...
AST#export_declaration#Left export AST#enum_declaration#Left enum BatteryChargeState AST#enum_body#Left { /** * Unknown state. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 20 */ AST#enum_member#Left NONE AST#enum_member#Right , /** * The battery is being charged. ...
export enum BatteryChargeState { NONE, ENABLE, DISABLE, FULL }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.batteryInfo.d.ets#L241-L270
7c0fbea4ce53adaadab7a09c0e0c770a5b928fa7
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
hasTodoOnDay
判断指定日期是否有代办事项
private hasTodoOnDay(date: Date): boolean { return this.getTodosOnDate(date).length > 0; }
AST#method_declaration#Left private hasTodoOnDay AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_ty...
private hasTodoOnDay(date: Date): boolean { return this.getTodosOnDate(date).length > 0; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L2790-L2792
503329062c4237e8d6d2f2ffbc89e7ef8d08d9c3
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/AppUtils.ets
arkts
getMinCompatibleVersionCode
获取应用兼容最低版本
static getMinCompatibleVersionCode(): number { return AppUtils.getBundleInfoSync().minCompatibleVersionCode }
AST#method_declaration#Left static getMinCompatibleVersionCode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left ...
static getMinCompatibleVersionCode(): number { return AppUtils.getBundleInfoSync().minCompatibleVersionCode }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/AppUtils.ets#L142-L144
60b3c5114aa80c577206cb1e2c0e222bd8dbcd9a
gitee
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/FlawService.ets
arkts
checkAllConfirmed
检查任务缺陷是否已全部确认 @param taskId 任务ID @returns 检查结果
static async checkAllConfirmed(taskId: number): Promise<boolean> { try { console.info(`[FlawService] 🔍 检查任务缺陷是否已全部确认,任务ID: ${taskId}`); const response = await HttpUtil.get(`/agv/flaw/check/${taskId}`); console.info('[FlawService] ✅ 检查完成,全部确认:', response.data); return response.data === true;...
AST#method_declaration#Left static async checkAllConfirmed AST#parameter_list#Left ( AST#parameter#Left taskId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gene...
static async checkAllConfirmed(taskId: number): Promise<boolean> { try { console.info(`[FlawService] 🔍 检查任务缺陷是否已全部确认,任务ID: ${taskId}`); const response = await HttpUtil.get(`/agv/flaw/check/${taskId}`); console.info('[FlawService] ✅ 检查完成,全部确认:', response.data); return response.data === true;...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/FlawService.ets#L236-L246
e894ec717b9209de239cf4bbf0084409627dd1b2
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/common/utils/src/main/ets/utils/NWebUtils.ets
arkts
loadUrl
复用webview
function loadUrl(url: string): void { if (currentNode.webController) { currentNode.url = url; try { currentNode.webController.loadUrl(url); } catch (err) { logger.info(TAG, "currentNode.webController.loadUrl(url) " + JSON.stringify(err)); } } }
AST#function_declaration#Left function loadUrl AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R...
function loadUrl(url: string): void { if (currentNode.webController) { currentNode.url = url; try { currentNode.webController.loadUrl(url); } catch (err) { logger.info(TAG, "currentNode.webController.loadUrl(url) " + JSON.stringify(err)); } } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/common/utils/src/main/ets/utils/NWebUtils.ets#L92-L101
b9147032589c33582bd00d80cc89690492e2c10f
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/goods/src/main/ets/component/CommentItem.ets
arkts
handleTap
处理点击事件 @returns {void} 无返回值
private handleTap(): void { if (this.onTap) { this.onTap(); } }
AST#method_declaration#Left private handleTap AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member...
private handleTap(): void { if (this.onTap) { this.onTap(); } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/goods/src/main/ets/component/CommentItem.ets#L114-L118
f5a64638325c4737ce92b0820bc43fb31be3f800
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/components/QRCodeScanComponent.ets
arkts
QRCodeScanComponent
二维码扫描组件
@Component export default struct QRCodeScanComponent { private cameraService: CameraService = new CameraService(); private qrCodeParser: QRCodeParser = new QRCodeParser(); private xComponentController: XComponentController = new XComponentController(); private context: common.Context = getContext(this); @Stor...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct QRCodeScanComponent AST#component_body#Left { AST#property_declaration#Left private cameraService : AST#type_annotation#Left AST#primary_type#Left CameraService AST#primary_type#Right AST#type_annotation#Right...
@Component export default struct QRCodeScanComponent { private cameraService: CameraService = new CameraService(); private qrCodeParser: QRCodeParser = new QRCodeParser(); private xComponentController: XComponentController = new XComponentController(); private context: common.Context = getContext(this); @Stor...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/components/QRCodeScanComponent.ets#L36-L283
0e4b8a74096a180b97d7bc0f87e5556ba657e5ef
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/multiplescreening/Index.ets
arkts
CustomTabBar
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { CustomTabBar } from './src/main/ets/components/CustomComponent';
AST#export_declaration#Left export { CustomTabBar } from './src/main/ets/components/CustomComponent' ; AST#export_declaration#Right
export { CustomTabBar } from './src/main/ets/components/CustomComponent';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multiplescreening/Index.ets#L30-L30
f695f06b3bef0724ed06d4e4563c6b441747ec90
gitee
Neptune-EX/OS_System_Design.git
c728a82d48079ae0c52d50c4a2e2586b69f4ce55
entry/build/default/generated/profile/default/BuildProfile.ets
arkts
Use these variables when you tailor your ArkTS code. They must be of the const type.
export const BUNDLE_NAME = 'com.example.filesmanger';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left BUNDLE_NAME = AST#expression#Left 'com.example.filesmanger' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const BUNDLE_NAME = 'com.example.filesmanger';
https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/build/default/generated/profile/default/BuildProfile.ets#L4-L4
fa59eb68cfc87ab6043a0f4161894c45a675f8d5
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imageviewer/src/main/ets/view/PicturePreviewImage.ets
arkts
calcFitScaleRatio
TODO:知识点:根据图片大小(宽高<=屏幕宽高)和屏幕大小计算图片放大适配屏幕进行显示的缩放倍率 @param imageSize:图片当前大小 @param windowSize:窗口大小 @returns:缩放倍率
calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number { let ratio: number = 1.0; if (windowSize.width > imageSize.width) { ratio = windowSize.width / imageSize.width; } else { ratio = windowSize.height / imageSize.height; } return ratio; }
AST#method_declaration#Left calcFitScaleRatio AST#parameter_list#Left ( AST#parameter#Left imageSize : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . Size AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left windowSize : AST#t...
calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number { let ratio: number = 1.0; if (windowSize.width > imageSize.width) { ratio = windowSize.width / imageSize.width; } else { ratio = windowSize.height / imageSize.height; } return ratio; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageviewer/src/main/ets/view/PicturePreviewImage.ets#L133-L141
10709e9b4a6fc7c05b434885ffd7c316dc22a94b
gitee
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/common/ThemeManager.ets
arkts
页面主题控制器接口
export interface PageThemeController { pageName: string; applyTheme(theme: ThemeModel): void; resetTheme(): void; }
AST#export_declaration#Left export AST#interface_declaration#Left interface PageThemeController AST#object_type#Left { AST#type_member#Left pageName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left applyTheme AST#parame...
export interface PageThemeController { pageName: string; applyTheme(theme: ThemeModel): void; resetTheme(): void; }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/ThemeManager.ets#L28-L32
41747e4aa1f82363ea85a6569c9253e3b7c3dfd4
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/TwoWayTlsWorker.ets
arkts
handleMessage
处理不同类型的任务
function handleMessage(message: TlsTwoWayMessage) { switch (message.type) { case 'loadFile': if (message.fileUri) { loadFile(message.fileUri); } break; case 'connectServer': if (message.serverIp && message.serverPort && message.ca && message.cert && message.privateKey) { ...
AST#function_declaration#Left function handleMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left TlsTwoWayMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#ex...
function handleMessage(message: TlsTwoWayMessage) { switch (message.type) { case 'loadFile': if (message.fileUri) { loadFile(message.fileUri); } break; case 'connectServer': if (message.serverIp && message.serverPort && message.ca && message.cert && message.privateKey) { ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/TwoWayTlsWorker.ets#L60-L79
5ecbaa67e74744b954e5bfee9a5bee31f8cc4b1e
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/utils/DrawingUtils.ets
arkts
drawSplitLine
Draw split line. @param ctx @param crop @param split @param isShow
static drawSplitLine(ctx: CanvasRenderingContext2D, crop: RectF, split: number, isShow: boolean) { if (!isShow) { return; } ctx.lineWidth = CommonConstants.DEFAULT_LINE_WIDTH; ctx.strokeStyle = CommonConstants.DEFAULT_LINE_COLOR; let w = Math.ceil(crop.getWidth() / split); let h = Math.cei...
AST#method_declaration#Left static drawSplitLine AST#parameter_list#Left ( AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left crop : AST#type_annotation#Left AST#primary_type#Left Rect...
static drawSplitLine(ctx: CanvasRenderingContext2D, crop: RectF, split: number, isShow: boolean) { if (!isShow) { return; } ctx.lineWidth = CommonConstants.DEFAULT_LINE_WIDTH; ctx.strokeStyle = CommonConstants.DEFAULT_LINE_COLOR; let w = Math.ceil(crop.getWidth() / split); let h = Math.cei...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/utils/DrawingUtils.ets#L79-L93
5d9f261a786b649a0a9ea8d0a0eb0d46e7e98972
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/FoldableAdaptation/entry/src/main/ets/pages/HomePage.ets
arkts
onWindowSizeChange
屏幕尺寸发生改变时触发navMode改变
onWindowSizeChange() { if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM) { this.navMode = NavMode.HomePageMode; } else { this.navMode = NavMode.FoldMode; } }
AST#method_declaration#Left onWindowSizeChange AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_express...
onWindowSizeChange() { if (this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM) { this.navMode = NavMode.HomePageMode; } else { this.navMode = NavMode.FoldMode; } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/FoldableAdaptation/entry/src/main/ets/pages/HomePage.ets#L92-L98
27fe74c714e71609568aa6badaedb1aed88a62f4
gitee
851432669/Smart-Home-ArkTs-Hi3861.git
0451f85f072ed3281cc23d9cdc2843d79f60f975
entry/src/main/ets/common/utils/GlobalDataManager.ets
arkts
updateRoomCount
更新房间数量
updateRoomCount(count: number): void { if (count >= 0) { this.userInfo.roomCount = count; } }
AST#method_declaration#Left updateRoomCount AST#parameter_list#Left ( AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Ri...
updateRoomCount(count: number): void { if (count >= 0) { this.userInfo.roomCount = count; } }
https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/common/utils/GlobalDataManager.ets#L183-L187
11ef7c5df381f0d973df60395513942c3957a5c9
github
queueit/harmony-sdk.git
ba7b4b38c03730bfbe305789acba6db0012d5f5c
queueit_sdk/src/main/ets/Index.ets
arkts
QueueItViewManager
Export the manager needed to control the QueueView state via @Link
export { QueueItViewManager as QueueITViewManager } from './view/QueueItViewManager';
AST#export_declaration#Left export { QueueItViewManager as QueueITViewManager } from './view/QueueItViewManager' ; AST#export_declaration#Right
export { QueueItViewManager as QueueITViewManager } from './view/QueueItViewManager';
https://github.com/queueit/harmony-sdk.git/blob/ba7b4b38c03730bfbe305789acba6db0012d5f5c/queueit_sdk/src/main/ets/Index.ets#L28-L28
035aacb9d3bbdcc03c65ccc3eebedff69d68057f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
显示配置接口
export interface DisplayConfig { showLunarCalendar: boolean; showAge: boolean; showZodiac: boolean; showCountdown: boolean; calendarView: CalendarViewType; contactListView: ContactListViewType; dateFormat: DateFormat; timeFormat: TimeFormat; weekStartsOn: WeekDay; }
AST#export_declaration#Left export AST#interface_declaration#Left interface DisplayConfig AST#object_type#Left { AST#type_member#Left showLunarCalendar : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left showAge : AST#typ...
export interface DisplayConfig { showLunarCalendar: boolean; showAge: boolean; showZodiac: boolean; showCountdown: boolean; calendarView: CalendarViewType; contactListView: ContactListViewType; dateFormat: DateFormat; timeFormat: TimeFormat; weekStartsOn: WeekDay; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L356-L366
6c77470b513e2ef35b404d7444df29dfd74b39dd
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement03_api12/entry/src/main/ets/MainAbility/common/Rect.ets
arkts
Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
export default class RectValue { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; }
AST#export_declaration#Left export default AST#class_declaration#Left class RectValue AST#class_body#Left { AST#property_declaration#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#...
export default class RectValue { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement03_api12/entry/src/main/ets/MainAbility/common/Rect.ets#L16-L21
fb32540220caf31a585e6455e9e0ebfdd869132b
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
DealStrideSolution/entry/src/main/ets/utils/CameraServiceThree.ets
arkts
getCameraManagerFn
Get the Camera Manager instance
getCameraManagerFn(uiContext:UIContext): camera.CameraManager | undefined { if (this.cameraManager) { return this.cameraManager; } let cameraManager: camera.CameraManager | undefined = undefined; try { cameraManager = camera.getCameraManager(uiContext.getHostContext()); Logger.info(TAG...
AST#method_declaration#Left getCameraManagerFn AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type...
getCameraManagerFn(uiContext:UIContext): camera.CameraManager | undefined { if (this.cameraManager) { return this.cameraManager; } let cameraManager: camera.CameraManager | undefined = undefined; try { cameraManager = camera.getCameraManager(uiContext.getHostContext()); Logger.info(TAG...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/DealStrideSolution/entry/src/main/ets/utils/CameraServiceThree.ets#L205-L217
bea5cc876be75330a991e51a0d5e765d520970e5
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets
arkts
BottomBar
自定义封装底部bar组件
@Component export struct BottomBar { @State buttonName: Resource = $r('app.string.dynamicattributes_settlement'); @State barType: BarType = BarType.SHOPPING_CART; build() { Row() { Column() { if (this.barType === BarType.DETAILS) { Button($r('app.string.dynamicattributes_add_cart')) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BottomBar AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right buttonName : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_ann...
@Component export struct BottomBar { @State buttonName: Resource = $r('app.string.dynamicattributes_settlement'); @State barType: BarType = BarType.SHOPPING_CART; build() { Row() { Column() { if (this.barType === BarType.DETAILS) { Button($r('app.string.dynamicattributes_add_cart')) ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets#L88-L119
99b38100ed65018b169694deef39e8ead65647c5
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineRadarDataSet.ets
arkts
copyTo
public setShowFillLine(showFillLine: boolean): void { this.mShowFillLine = showFillLine; } public getShowFillLine(): boolean { return this.mShowFillLine; }
protected copyTo(lineRadarDataSet: LineRadarDataSet<T>): void { super.copyTo(lineRadarDataSet); lineRadarDataSet.mDrawFilled = this.mDrawFilled; lineRadarDataSet.mFillAlpha = this.mFillAlpha; lineRadarDataSet.mFillColor = this.mFillColor; lineRadarDataSet.mFillDrawable = this.mFillDrawable; line...
AST#method_declaration#Left protected copyTo AST#parameter_list#Left ( AST#parameter#Left lineRadarDataSet : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left LineRadarDataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right >...
protected copyTo(lineRadarDataSet: LineRadarDataSet<T>): void { super.copyTo(lineRadarDataSet); lineRadarDataSet.mDrawFilled = this.mDrawFilled; lineRadarDataSet.mFillAlpha = this.mFillAlpha; lineRadarDataSet.mFillColor = this.mFillColor; lineRadarDataSet.mFillDrawable = this.mFillDrawable; line...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineRadarDataSet.ets#L147-L154
8fee71b0da89c0d94a602a2ccfac347c89656b9c
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/common/RdbHelper.ets
arkts
getDailySummariesForMonth
Get daily summaries for a month @param year - Year @param month - Month (1-12) @returns Array of DailySummary objects
async getDailySummariesForMonth(year: number, month: number): Promise<DailySummary[]> { if (!this.rdbStore) { throw new Error('Database not initialized'); } const monthStr = String(month).padStart(2, '0'); const startDate = `${year}-${monthStr}-01`; const endDate = `${year}-${monthStr}-31`; ...
AST#method_declaration#Left async getDailySummariesForMonth AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AS...
async getDailySummariesForMonth(year: number, month: number): Promise<DailySummary[]> { if (!this.rdbStore) { throw new Error('Database not initialized'); } const monthStr = String(month).padStart(2, '0'); const startDate = `${year}-${monthStr}-01`; const endDate = `${year}-${monthStr}-31`; ...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/RdbHelper.ets#L839-L878
101f1b1e44bc7139e0d1aa2c5dbc8de21b7c4102
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/user/User.ets
arkts
登录类型枚举
export enum LoginType { email = 'email', wechat = 'wechat', wechat_qr = 'wechat_qr', huawei = 'huawei', qq = 'qq', }
AST#export_declaration#Left export AST#enum_declaration#Left enum LoginType AST#enum_body#Left { AST#enum_member#Left email = AST#expression#Left 'email' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left wechat = AST#expression#Left 'wechat' AST#expression#Right AST#enum_member#Right , AST#enum_member#L...
export enum LoginType { email = 'email', wechat = 'wechat', wechat_qr = 'wechat_qr', huawei = 'huawei', qq = 'qq', }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/user/User.ets#L2-L8
cf36eec0421ce907b967dd506c854b3c1788889d
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/navigation/NavigationWithArgsNav.ets
arkts
NavigationWithArgsNav
@file 带参跳转示例页导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function NavigationWithArgsNav(): void { NavigationWithArgsPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function NavigationWithArgsNav AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui...
@Builder export function NavigationWithArgsNav(): void { NavigationWithArgsPage(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/navigation/NavigationWithArgsNav.ets#L8-L11
edefa6ae103d1c0192075ef1b41542c106c8a6a0
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/WeatherManager.ets
arkts
forceRefreshWeatherData
强制刷新天气数据(忽略缓存)
async forceRefreshWeatherData(city: string = '北京'): Promise<WeatherData> { console.log(`[WeatherManager] 强制刷新${city}天气数据`); try { const weatherData = await this.fetchWeatherFromAPI(city); // 更新缓存 this.cachedWeatherData = weatherData; this.lastUpdateTime = Date.now(); console.log(...
AST#method_declaration#Left async forceRefreshWeatherData AST#parameter_list#Left ( AST#parameter#Left city : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '北京' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_a...
async forceRefreshWeatherData(city: string = '北京'): Promise<WeatherData> { console.log(`[WeatherManager] 强制刷新${city}天气数据`); try { const weatherData = await this.fetchWeatherFromAPI(city); this.cachedWeatherData = weatherData; this.lastUpdateTime = Date.now(); console.log(`[Weath...
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/WeatherManager.ets#L201-L224
3d8a4c2e8af8cf65ea6bbe47080d3be423ae590b
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/PullToRefresh/pulltorefresh/src/main/ets/viewModel/BasicDataSource.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class BasicDataSource implements IDataSource { private listeners: DataChangeListener[] = []; public totalCount(): number { return 0; } public getData(index: number): Object { return index; } // 为LazyForEach组件向其数据源处添加listener监听 registerDataChangeListener(listener: DataChangeListener): voi...
AST#export_declaration#Left export AST#class_declaration#Left class BasicDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener ...
export class BasicDataSource implements IDataSource { private listeners: DataChangeListener[] = []; public totalCount(): number { return 0; } public getData(index: number): Object { return index; } registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/PullToRefresh/pulltorefresh/src/main/ets/viewModel/BasicDataSource.ets#L16-L75
527061a27c00e7183f316ada2e00d6c3433bf64f
gitee
openharmony/applications_launcher
f75dfb6bf7276e942793b75e7a9081bbcd015843
feature/smartdock/component.ets
arkts
SmartDock
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { SmartDock } from './src/main/ets/default/layout/SmartDock';
AST#export_declaration#Left export { SmartDock } from './src/main/ets/default/layout/SmartDock' ; AST#export_declaration#Right
export { SmartDock } from './src/main/ets/default/layout/SmartDock';
https://github.com/openharmony/applications_launcher/blob/f75dfb6bf7276e942793b75e7a9081bbcd015843/feature/smartdock/component.ets#L16-L16
676e6f0ce33f52e2ae4ae1f1c1e91bfc04923a6e
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets
arkts
Base-class of all axes (previously called labels).
export default abstract class AxisBase extends ComponentBase { /** * custom formatter that is used instead of the auto-formatter if set */ protected mAxisValueFormatter: IAxisValueFormatter; private mGridColor: number = Color.Gray; private mGridLineWidth: number = 1; private mAxisLineColor: number = Col...
AST#export_declaration#Left export default AST#class_declaration#Left abstract class AxisBase extends AST#type_annotation#Left AST#primary_type#Left ComponentBase AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { /** * custom formatter that is used instead of the auto-formatter if set */ AST#...
export default abstract class AxisBase extends ComponentBase { protected mAxisValueFormatter: IAxisValueFormatter; private mGridColor: number = Color.Gray; private mGridLineWidth: number = 1; private mAxisLineColor: number = Color.Gray; private mAxisLineWidth: number = 1; public mEntries: number[] = ...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets#L27-L802
3589b35889b5685aec4d1f7f9e1c91bd225549c6
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/auth/src/main/ets/viewmodel/AccountLoginViewModel.ets
arkts
updatePassword
更新密码输入 @param {string} value - 密码值 @returns {void} 无返回值
updatePassword(value: string): void { this.password = value; }
AST#method_declaration#Left updatePassword AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Rig...
updatePassword(value: string): void { this.password = value; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/viewmodel/AccountLoginViewModel.ets#L136-L138
dd9b38e0eb56007ef02526abd2f4fec581c8a6ec
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/base/ImgLayerUtil.ets
arkts
getDrawableDescriptor
获取DrawableDescriptor @param ctx @param resource @returns
private static async getDrawableDescriptor(ctx: UIContext, resource: Resource): Promise<DrawableDescriptor | undefined> { const resManager = ctx.getHostContext()?.resourceManager; if (!resManager) { return undefined; } return (resManager.getDrawableDescriptor(resource.id)) as DrawableDescripto...
AST#method_declaration#Left private static async getDrawableDescriptor AST#parameter_list#Left ( AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resource : AST#type_annotation#Left AST#primary_typ...
private static async getDrawableDescriptor(ctx: UIContext, resource: Resource): Promise<DrawableDescriptor | undefined> { const resManager = ctx.getHostContext()?.resourceManager; if (!resManager) { return undefined; } return (resManager.getDrawableDescriptor(resource.id)) as DrawableDescripto...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/ImgLayerUtil.ets#L42-L49
093d1aca0bb30c71fdf6ba34179e1ecf1444de1b
gitee
SeaEpoch/SepWeather.git
e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c
entry/src/main/ets/common/database/Rdb.ets
arkts
insertData
插入
insertData(data: relationalStore.ValuesBucket, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'insertData() has no callback!'); return; } let resFlag: boolean = false; const valueBucket: r...
AST#method_declaration#Left insertData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ValuesBucket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : A...
insertData(data: relationalStore.ValuesBucket, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'insertData() has no callback!'); return; } let resFlag: boolean = false; const valueBucket: r...
https://github.com/SeaEpoch/SepWeather.git/blob/e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c/entry/src/main/ets/common/database/Rdb.ets#L44-L63
235bcf82b5655dc9363feb80f7ee80a6face9790
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/floatingSample/FloatingWindowSample.ets
arkts
aboutToAppear
触摸结束时间
aboutToAppear() { display.getAllDisplays((err, data) => { // 拿到屏幕宽高的一半,作为判断基准值 this.displayHalfWidth = data[0].width / 2; this.displayHalfHeight = data[0].height / 2; // 将拿到的px转为vp Logger.info(TAG, `aboutToAppear getAllDisplays data 1 width:${this.displayHalfWidth}, height:${this.displ...
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left display AST#expression#Right . getAllDisplays AST#...
aboutToAppear() { display.getAllDisplays((err, data) => { this.displayHalfWidth = data[0].width / 2; this.displayHalfHeight = data[0].height / 2; Logger.info(TAG, `aboutToAppear getAllDisplays data 1 width:${this.displayHalfWidth}, height:${this.displayHalfHeight}`); this.displ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/floatingSample/FloatingWindowSample.ets#L41-L52
72261328522681b078cdf2126134a07847999ba6
gitee
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/pages/TaskExecuteView.ets
arkts
stopPolling
移除自动摄像头轮询,改为手动刷新 startCameraPolling() { this.cameraTimer = setInterval(() => { this.checkCameraConnection(); }, 10000); // 每10秒检查一次摄像头连接状态 }
stopPolling() { if (this.statusTimer !== -1) { clearInterval(this.statusTimer); this.statusTimer = -1; } if (this.flawTimer !== -1) { clearInterval(this.flawTimer); this.flawTimer = -1; } // 移除摄像头定时器相关逻辑 // if (this.cameraTimer !== -1) { // clearInterval(this.camera...
AST#method_declaration#Left stopPolling AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right...
stopPolling() { if (this.statusTimer !== -1) { clearInterval(this.statusTimer); this.statusTimer = -1; } if (this.flawTimer !== -1) { clearInterval(this.flawTimer); this.flawTimer = -1; } }
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/TaskExecuteView.ets#L216-L230
a042987ebee46aa6b00a48dcb9fcbef17be27287
github
ni202383/Chenguang-Calendar.git
c04543db2c394d662bc1336d098335134ff1e9a5
entry/src/main/ets/pages/Model/cardShare.ets
arkts
读取 boolean(给 FormExtensionAbility 用)
export async function loadFromPrefs(ctx: common.Context): Promise<boolean> { const prefs = await dataPreferences.getPreferences(ctx, PREF_NAME); const v = await prefs.get(KEY_IS_SOMETHING, false); // 默认 false return v as boolean; }
AST#export_declaration#Left export AST#function_declaration#Left async function loadFromPrefs AST#parameter_list#Left ( AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter...
export async function loadFromPrefs(ctx: common.Context): Promise<boolean> { const prefs = await dataPreferences.getPreferences(ctx, PREF_NAME); const v = await prefs.get(KEY_IS_SOMETHING, false); return v as boolean; }
https://github.com/ni202383/Chenguang-Calendar.git/blob/c04543db2c394d662bc1336d098335134ff1e9a5/entry/src/main/ets/pages/Model/cardShare.ets#L15-L19
c85929f392467a15d43f46488804d3caaa7ac7cc
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/home/suggestion.ets
arkts
feedbackType
***********************************反馈类型*******************************************//
@Builder feedbackType(){ Column({ space: 16 }) { Text('反馈类型') .fontSize(16) .fontColor('#333333') .alignSelf(ItemAlign.Start) Column({ space: 12 }) { ForEach(this.feedbackTypes, (type: string, index: number) => { Row() { Checkbox() ....
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right feedbackType AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parame...
@Builder feedbackType(){ Column({ space: 16 }) { Text('反馈类型') .fontSize(16) .fontColor('#333333') .alignSelf(ItemAlign.Start) Column({ space: 12 }) { ForEach(this.feedbackTypes, (type: string, index: number) => { Row() { Checkbox() ....
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/home/suggestion.ets#L144-L176
1974d54bda8923b6a68d42f7adfa5bbb69514276
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ResUtil.ets
arkts
closeRawFd
用户关闭resources/rawfile目录下rawfile文件所在hap的descriptor信息 @param path rawfile文件路径 @returns
static async closeRawFd(path: string) { return ResUtil.getResourceManager().closeRawFd(path); }
AST#method_declaration#Left static async closeRawFd AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement...
static async closeRawFd(path: string) { return ResUtil.getResourceManager().closeRawFd(path); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L495-L497
bca36ee111a9382aca59e62be24ac3f5b79b81e9
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ResponsiveLayout/entry/src/main/ets/pages/UpdateWidthExample.ets
arkts
UpdateWidthExample
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Component export struct UpdateWidthExample { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: WidthBreakpoint = WidthBreakpoint.WIDTH_SM; build() { Column() { // [Start example_text_test] Text('Test') .fontSize(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_LG ? '16fp'...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct UpdateWidthExample AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'currentWidthBreakpoint' AST#expression#Right ) AST#decorator#Right currentWidthBreakpo...
@Component export struct UpdateWidthExample { @StorageLink('currentWidthBreakpoint') currentWidthBreakpoint: WidthBreakpoint = WidthBreakpoint.WIDTH_SM; build() { Column() { Text('Test') .fontSize(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_LG ? '16fp' : '14fp') } } ...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ResponsiveLayout/entry/src/main/ets/pages/UpdateWidthExample.ets#L16-L28
d1ed54170a2e33254a0972c21b57735daf3fdf82
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/markAnchor/ListItemGroupView.ets
arkts
ListItemGroupView
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Component export struct ListItemGroupView { @Link _markAnchor: Position; private componentKey: string; private parentWidth: number; private parentHeight: number; private subassemblyWidth: number; private subassemblyHeight: number; private projects: string[] = ['Chinese', 'mathematics', 'English'] @Bui...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ListItemGroupView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right _markAnchor : AST#type_annotation#Left AST#primary_type#Left Position AST#primary_type#Right AST#...
@Component export struct ListItemGroupView { @Link _markAnchor: Position; private componentKey: string; private parentWidth: number; private parentHeight: number; private subassemblyWidth: number; private subassemblyHeight: number; private projects: string[] = ['Chinese', 'mathematics', 'English'] @Bui...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/markAnchor/ListItemGroupView.ets#L16-L81
16d1e721ffdb04c1627792b892b3e4d6a5b4c7a3
gitee
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/common/beans/ClassifiedStatistic.ets
arkts
构造函数,用于创建 ClassifiedStatistic 类的实例
constructor(typeText: string, accountType: number, amount: number = 0, count: number = 0) { // 将传入的参数赋值给实例的各个属性 this.typeText = typeText; this.accountType = accountType; this.amount = amount; this.count = count; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left typeText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left accountType : AST#type_annotation#Left AST#primary_type#Left number AST#pri...
constructor(typeText: string, accountType: number, amount: number = 0, count: number = 0) { this.typeText = typeText; this.accountType = accountType; this.amount = amount; this.count = count; }
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/beans/ClassifiedStatistic.ets#L16-L22
c00d7a3b4074e5a1c74a0c642660ccf4df174fd4
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/modalwindow/src/main/ets/model/OtherWaysToLogin.ets
arkts
OtherWaysToLogin
其他账号登录:主要提供短信验证码登录方式,以及其他三方应用登录方式
@Component export struct OtherWaysToLogin { // 发送验证码按钮的颜色 @State buttonColor: ResourceColor = Color.Grey; // 发送验证码按钮的内容 @State buttonContent: ResourceStr = $r('app.string.modalwindow_verify'); // 手机号是否可用 phoneNumberAvailable: boolean = false; // 可发送验证码的倒计时秒数 countdownSeconds: number = 0; // 是否勾选阅读并同意服...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct OtherWaysToLogin AST#component_body#Left { // 发送验证码按钮的颜色 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right buttonColor : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#prim...
@Component export struct OtherWaysToLogin { @State buttonColor: ResourceColor = Color.Grey; @State buttonContent: ResourceStr = $r('app.string.modalwindow_verify'); phoneNumberAvailable: boolean = false; countdownSeconds: number = 0; isAgree: boolean = false; loginIcons: Resource[] = [$r('app...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/modalwindow/src/main/ets/model/OtherWaysToLogin.ets#L27-L150
7db3131abb18f66333d23916d989539e970b1abe
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/goods/VHGoodsComponent.ets
arkts
VHOrdersSucceed
订单创建成功页面
@CustomDialog export struct VHOrdersSucceed { Controller: CustomDialogController build() { Column({ space: 10 }) { Image($r('app.media.close_gray')) .width(20) .aspectRatio(1) .position({ x: '90%', y: '5%' }) .onClick(() => { this.Controller.close() }) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct VHOrdersSucceed AST#component_body#Left { AST#property_declaration#Left Controller : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#prope...
@CustomDialog export struct VHOrdersSucceed { Controller: CustomDialogController build() { Column({ space: 10 }) { Image($r('app.media.close_gray')) .width(20) .aspectRatio(1) .position({ x: '90%', y: '5%' }) .onClick(() => { this.Controller.close() }) ...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/goods/VHGoodsComponent.ets#L1270-L1296
daafaa08e45f80eba226460022cffab5b24a8b0a
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/managers/SendableData.ets
arkts
SendableData
[Start define_sendable_class]
@Sendable export class SendableData { public name: string = 'Tom'; public age: number = 20; public gender: number = 1; public likes: number = 1; public follow: boolean = false; }
AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export class SendableData AST#class_body#Left { AST#property_declaration#Left public name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'Tom' AST#expre...
@Sendable export class SendableData { public name: string = 'Tom'; public age: number = 20; public gender: number = 1; public likes: number = 1; public follow: boolean = false; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/managers/SendableData.ets#L17-L24
235b02b46a9ed75564a6d79f9a9be6b6fdf5e47f
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets
arkts
updateProgress
Update data based on index and progress values and update date. @param index of update item. @param updateValue of update item. @param updateDate of update item.
updateProgress(index: number, updateValue: number, updateDate: string): boolean { if (!this.targetData[index]) { return false; } this.targetData[index].progressValue = updateValue; this.targetData[index].updateDate = updateDate; return true; }
AST#method_declaration#Left updateProgress AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left updateValue : AST#type_annotation#Left AST#primary_type#Left number AST#primary_...
updateProgress(index: number, updateValue: number, updateDate: string): boolean { if (!this.targetData[index]) { return false; } this.targetData[index].progressValue = updateValue; this.targetData[index].updateDate = updateDate; return true; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets#L87-L94
b813b930d5856198693e83a7811b4facdeb2ee25
gitee
ark-ui/MiniCanvas
2a9a12127ed5ea5b6b87da252d258c8ad5700f56
mini_canvas/src/main/ets/components/canvas/paint.ets
arkts
画笔
export class Paint { /** * 是否离屏绘制绘制,默认为false,表示不离屏绘制。 * 离屏绘制是指将需要绘制的内容先绘制在缓存区,然后将其转换成图片,一次性绘制绘制到canvas上,加快了绘制速度。 */ private offScreen: boolean = false; /** * 画笔是否是绘制轮廓,默认为false */ private stroke: boolean = false; /** * 画布的透明度,范围[0 ~ 1],默认为1 */ priva...
AST#export_declaration#Left export AST#class_declaration#Left class Paint AST#class_body#Left { /** * 是否离屏绘制绘制,默认为false,表示不离屏绘制。 * 离屏绘制是指将需要绘制的内容先绘制在缓存区,然后将其转换成图片,一次性绘制绘制到canvas上,加快了绘制速度。 */ AST#property_declaration#Left private offScreen : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_typ...
export class Paint { private offScreen: boolean = false; private stroke: boolean = false; private alpha: number = 1; private color: string = "#000000"; private strokeWidth: number = 2; private...
https://github.com/ark-ui/MiniCanvas/blob/2a9a12127ed5ea5b6b87da252d258c8ad5700f56/mini_canvas/src/main/ets/components/canvas/paint.ets#L17-L116
456be4044f65c3d681576391c90564f3e8da9056
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/strings/StringCrypto.ets
arkts
加密工具类 (Stage 模型) 提供字符串的 SHA1、SHA256 和 MD5 哈希计算功能(Promise模式) 所有方法直接返回Promise,无需回调函数
export class StringCrypto { /** * 计算字符串的 SHA1 哈希值 * @param input 输入字符串 * @returns 十六进制格式的哈希值 */ static async sha1(input: string): Promise<string> { return StringCrypto._computeHash(input, 'SHA1'); } /** * 计算字符串的 SHA256 哈希值 * @param input 输入字符串 * @returns 十六进制格式的哈希值 */ static asyn...
AST#export_declaration#Left export AST#class_declaration#Left class StringCrypto AST#class_body#Left { /** * 计算字符串的 SHA1 哈希值 * @param input 输入字符串 * @returns 十六进制格式的哈希值 */ AST#method_declaration#Left static async sha1 AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_t...
export class StringCrypto { static async sha1(input: string): Promise<string> { return StringCrypto._computeHash(input, 'SHA1'); } static async sha256(input: string): Promise<string> { return StringCrypto._computeHash(input, 'SHA256'); } static async md5(input: string): Promise<string> { ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringCrypto.ets#L11-L85
494a47a120b193713690ce66ce91ccedbaccb966
github
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/ciphers/VigenereCipher.ets
arkts
decrypt
解密文本 @param text 要解密的文本 @param key 密钥 @returns 解密后的文本
static decrypt(text: string, key: string): string { if (!text || !key) { return ''; } const normalizedKey = key.toUpperCase(); let result = ''; let keyIndex = 0; for (let i = 0; i < text.length; i++) { const char = text[i]; if (char >= 'A' && char <= 'Z') { // 大写字母 ...
AST#method_declaration#Left static decrypt AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Righ...
static decrypt(text: string, key: string): string { if (!text || !key) { return ''; } const normalizedKey = key.toUpperCase(); let result = ''; let keyIndex = 0; for (let i = 0; i < text.length; i++) { const char = text[i]; if (char >= 'A' && char <= 'Z') { c...
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/VigenereCipher.ets#L48-L76
1aab641c2bb8c6a8acf4e11c2032ecaf974179f1
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/dialog/SecuritySettingView.ets
arkts
SecuritySettingView
安全设置底部弹窗视图
@Component export struct SecuritySettingView { private sectionActionItems: ActionItem[] = [{ id: '0', title: $r('app.string.limited_height_bottom_dialog_account_center'), subTitle: '' }, { id: '1', title: $r('app.string.limited_height_bottom_dialog_modify_password'), subTitle: '' }, { id: '2', title:...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SecuritySettingView AST#component_body#Left { AST#property_declaration#Left private sectionActionItems : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ActionItem [ ] AST#array_type#Right AST#prima...
@Component export struct SecuritySettingView { private sectionActionItems: ActionItem[] = [{ id: '0', title: $r('app.string.limited_height_bottom_dialog_account_center'), subTitle: '' }, { id: '1', title: $r('app.string.limited_height_bottom_dialog_modify_password'), subTitle: '' }, { id: '2', title:...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/dialog/SecuritySettingView.ets#L22-L44
00bacc6be0fc1702023ea469751969173831e316
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/TypeUtil.ets
arkts
isAsyncFunction
检查是否为异步函数类型。 @param value @returns
static isAsyncFunction(value: Object): boolean { return new util.types().isAsyncFunction(value); }
AST#method_declaration#Left static isAsyncFunction AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#prima...
static isAsyncFunction(value: Object): boolean { return new util.types().isAsyncFunction(value); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L239-L241
d592b0a98c25cb4e492166a952302a6cf5b32497
gitee
softfatgay/harmony-netease.git
5f3d226b72ba8579cacfbd229e4eb0054d63abef
entry/src/main/ets/base/Api.ets
arkts
/ kingkong
export const URL_KING_KONG = baseUrl + '/item/list.json';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left URL_KING_KONG = AST#expression#Left AST#binary_expression#Left AST#expression#Left baseUrl AST#expression#Right + AST#expression#Left '/item/list.json' AST#expression#Right AST#binary_expression#Right AST#expression#Righ...
export const URL_KING_KONG = baseUrl + '/item/list.json';
https://github.com/softfatgay/harmony-netease.git/blob/5f3d226b72ba8579cacfbd229e4eb0054d63abef/entry/src/main/ets/base/Api.ets#L31-L31
ef8cae3cdce98accf2fbd9dde4546a993c38b514
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
HDRVivid/AVCodecVideo/entry/src/main/ets/common/utils/DateTimeUtils.ets
arkts
Copyright (C) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export default class DateTimeUtil { getTime(): string { const DATETIME = new Date(); return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()); } getDate(): string { const DATETIME = new Date(); return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1...
AST#export_declaration#Left export default AST#class_declaration#Left class DateTimeUtil AST#class_body#Left { AST#method_declaration#Left getTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_state...
export default class DateTimeUtil { getTime(): string { const DATETIME = new Date(); return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()); } getDate(): string { const DATETIME = new Date(); return this.concatDate(DATETIME.getFullYear(), DATETIME.getMonth() + 1...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVCodecVideo/entry/src/main/ets/common/utils/DateTimeUtils.ets#L16-L38
7d91f01866f7db2e5dcf55e6154c272cd25fa732
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/myCenter/clearCache.ets
arkts
exitApp
弹窗关闭
exitApp() { this.clearDialogStatus = false }
AST#method_declaration#Left exitApp AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . clearDialogStatus AST#member_expression#Ri...
exitApp() { this.clearDialogStatus = false }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/myCenter/clearCache.ets#L52-L54
d7b95d79c01a8ad6d7df2b71be477a8e12c54046
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/BasicDataSource.ets
arkts
unregisterDataChangeListener
为对应的LazyForEach组件在数据源处去除listener监听
unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L...
unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/BasicDataSource.ets#L39-L44
a455a26996630eee08b1676275b4d1091c2109ed
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/view/UserAgreementPage.ets
arkts
UserAgreementPage
@file 用户协议页面视图 @author Joker.X
@ComponentV2 export struct UserAgreementPage { /** * 用户协议页面 ViewModel */ @Local private vm: UserAgreementViewModel = new UserAgreementViewModel(); /** * 构建用户协议页面 * @returns {void} 无返回值 */ build() { AppNavDestination({ title: "用户协议", viewModel: this.vm }) { this.UserAg...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct UserAgreementPage AST#component_body#Left { /** * 用户协议页面 ViewModel */ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left Us...
@ComponentV2 export struct UserAgreementPage { @Local private vm: UserAgreementViewModel = new UserAgreementViewModel(); build() { AppNavDestination({ title: "用户协议", viewModel: this.vm }) { this.UserAgreementContent(); } } @Builder private UserAgreementContent() { ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/view/UserAgreementPage.ets#L8-L37
5493178f528a04cf653da1da1e77f1aeeea3cd34
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/DateUtil.ets
arkts
isLeapYear
判断是否是闰年 @param year 不传为当前年 @returns
static isLeapYear(year: number | Date = new Date()): boolean { year = year instanceof Date ? year.getFullYear() : year; return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; }
AST#method_declaration#Left static isLeapYear AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left Date AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right = AST#expression#Left AST#...
static isLeapYear(year: number | Date = new Date()): boolean { year = year instanceof Date ? year.getFullYear() : year; return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L144-L147
e7c4f6641254dae2f12216d4a4a0de823e037adb
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/constants/ContentConstants.ets
arkts
Constants for main content area.
export class ContentConstants { /** * The max lines of play all area is 1. */ static readonly PLAY_ALL_MAX_LINES: number = 1; /** * The font size of the singer is smaller. */ static readonly SINGER_FONT_REDUCE: number = 4; /** * The font size of the album name is larger. */ static readon...
AST#export_declaration#Left export AST#class_declaration#Left class ContentConstants AST#class_body#Left { /** * The max lines of play all area is 1. */ AST#property_declaration#Left static readonly PLAY_ALL_MAX_LINES : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotati...
export class ContentConstants { static readonly PLAY_ALL_MAX_LINES: number = 1; static readonly SINGER_FONT_REDUCE: number = 4; static readonly ALBUM_FONT_PLUS: number = 2; static readonly INTRODUCTION_FONT_REDUCE: number = 2; static readonly DIVIDER_STROKE_WIDTH: number = 0.5; static...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/MultiDeviceMusic/features/content/src/main/ets/constants/ContentConstants.ets#L19-L79
d404cd80901cf98347b3699a6c38aac701b7bcd0
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/social/SocialShareService.ets
arkts
getShareStatistics
获取分享统计
async getShareStatistics(period: 'day' | 'week' | 'month' = 'week'): Promise<any> { try { // TODO: 实现分享统计查询逻辑 const stats = { totalShares: 0, platformDistribution: {}, contentTypeDistribution: {}, successRate: 100, topSharedGreetings: [], recentShares: [] ...
AST#method_declaration#Left async getShareStatistics AST#parameter_list#Left ( AST#parameter#Left period AST#ERROR#Left : 'day' | 'week' | 'month' AST#ERROR#Right = AST#expression#Left 'week' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic...
async getShareStatistics(period: 'day' | 'week' | 'month' = 'week'): Promise<any> { try { const stats = { totalShares: 0, platformDistribution: {}, contentTypeDistribution: {}, successRate: 100, topSharedGreetings: [], recentShares: [] }; ret...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/SocialShareService.ets#L371-L388
91bbe5923411bff7b653cfba82324458b684f106
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ListBeExchange/ListExchange/src/main/ets/utils/ListExchange.ets
arkts
ListExchange
功能描述: 1. 长按列表项,向上或向下拖动,当前列表项和目标列表项位置互换。 2. 列表项向左滑动,显示删除按钮。 3. 点击删除按钮,当前列表项删除。 实现原理: 1. 创建一个数组modifier来添加自定义属性对象,根据组合手势GestureGroup来控制自定义属性的值并通过attributeModifier绑定自定义属性对象来动态加载属性。 2. 然后swipeAction属性绑定删除组件,左滑显示此删除组件,点击实现列表项的删除。 @param appInfoList - 列表数据 @param appInfoList - 列表元素交换类 @param deductionView - 列表项UI模块
@Component export struct ListExchange { // -------------------对外暴露变量----------------------- @Link appInfoList: Object[]; // 控制列表项交换的类 @Link listExchangeCtrl: ListExchangeCtrl<Object>; // 列表项Builder @BuilderParam deductionView: (listInfo: Object) => void; // --------------------私有属性------------------------...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ListExchange AST#component_body#Left { // -------------------对外暴露变量----------------------- AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right appInfoList : AST#type_annotation#Left AST#primary...
@Component export struct ListExchange { @Link appInfoList: Object[]; @Link listExchangeCtrl: ListExchangeCtrl<Object>; @BuilderParam deductionView: (listInfo: Object) => void; @State currentListItem: Object | undefined = undefined; @State isLongPress: boolean = false; build() { Column...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ListBeExchange/ListExchange/src/main/ets/utils/ListExchange.ets#L35-L168
03d536ad9fe64bea5d1ef3a3214f2bc22638fb68
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/field_sensitive/references_object/field_len_003_T.ets
arkts
Introduction 路径长度
export function field_len_003_T(taint_src : string) { let a = new A(taint_src); taint.Sink(a.b.c.d.e.f.g.h.i.j.k.l.data); }
AST#export_declaration#Left export AST#function_declaration#Left function field_len_003_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Lef...
export function field_len_003_T(taint_src : string) { let a = new A(taint_src); taint.Sink(a.b.c.d.e.f.g.h.i.j.k.l.data); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/field_sensitive/references_object/field_len_003_T.ets#L6-L9
9a5cd5f349b6e331b27bc8f85bd0f7e0ee340683
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/AddressListViewModel.ets
arkts
requestListData
请求地址分页数据 @returns {Promise<NetworkResponse<NetworkPageData<Address>>>} 网络请求 Promise
protected requestListData(): Promise<NetworkResponse<NetworkPageData<Address>>> { const request: PageRequest = new PageRequest(); request.page = this.currentPage; request.size = this.pageSize; return this.repository.getAddressPage(request); }
AST#method_declaration#Left protected requestListData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left...
protected requestListData(): Promise<NetworkResponse<NetworkPageData<Address>>> { const request: PageRequest = new PageRequest(); request.page = this.currentPage; request.size = this.pageSize; return this.repository.getAddressPage(request); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressListViewModel.ets#L49-L54
30ef3dad9c4a67e4bd176cb74d597435944dd7b3
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/ZipTool.ets
arkts
createOneZip
MARK: - 压缩目录
static async createOneZip( srcPath: string, options?: zlib.Options ): Promise<string | null> { // 确保目标路径存在且为文件或文件夹 if (!FileUtility.isFileExistAt(srcPath)) { return null } // 目标zip文件路径 const zipPath = `${FileUtility.normalizePath(srcPath)}.zip` // 删除已存在的zip文件 FileUtility.de...
AST#method_declaration#Left static async createOneZip AST#parameter_list#Left ( AST#parameter#Left srcPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AST#qual...
static async createOneZip( srcPath: string, options?: zlib.Options ): Promise<string | null> { if (!FileUtility.isFileExistAt(srcPath)) { return null } const zipPath = `${FileUtility.normalizePath(srcPath)}.zip` FileUtility.deleteFileAt(zipPath) if (await ZipTool.co...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ZipTool.ets#L21-L41
ba5449d980e0dfbe67305e71d2cf7cf420270c1d
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/home/home.ets
arkts
recommend
***************************************为你推荐*****************************************//
@Builder recommend(data:show){ Image(this.getImage(data.iname)) .width(200) .height(200) .borderRadius(12) .onClick(()=>{ router.pushUrl({url:'pages/class',params:{token:this.token,courseId:data.id,vip:this.vip,userId:this.userId}}) }) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right recommend AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left show AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { ...
@Builder recommend(data:show){ Image(this.getImage(data.iname)) .width(200) .height(200) .borderRadius(12) .onClick(()=>{ router.pushUrl({url:'pages/class',params:{token:this.token,courseId:data.id,vip:this.vip,userId:this.userId}}) }) }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/home/home.ets#L179-L188
65b2ee70726d3b775ac185591508ee054c098605
github
queyun123/weatherApp-ArkTS.git
6beee6640db32ae70c342866b24fc643a9c512bf
entry/src/main/ets/utils/HttpUtil.ets
arkts
getWeatherByCityId
===================== 业务方法:根据城市ID获取天气 =====================
static async getWeatherByCityId(cityId: string): Promise<WeatherResponse> { const requestUrl = `${WEATHER_CONFIG.BASE_URL}?location=${cityId}&key=${WEATHER_CONFIG.API_KEY}`; try { const response = await HttpUtil.get<WeatherApiResponse>(requestUrl); if (response?.code === '200' && response.data?.now...
AST#method_declaration#Left static async getWeatherByCityId AST#parameter_list#Left ( AST#parameter#Left cityId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gen...
static async getWeatherByCityId(cityId: string): Promise<WeatherResponse> { const requestUrl = `${WEATHER_CONFIG.BASE_URL}?location=${cityId}&key=${WEATHER_CONFIG.API_KEY}`; try { const response = await HttpUtil.get<WeatherApiResponse>(requestUrl); if (response?.code === '200' && response.data?.now...
https://github.com/queyun123/weatherApp-ArkTS.git/blob/6beee6640db32ae70c342866b24fc643a9c512bf/entry/src/main/ets/utils/HttpUtil.ets#L52-L81
6ab76b2254ac7cbd34b2f19f67c200b5109583b7
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/utils/Methods.ets
arkts
加载动画
export function isloading(loading:boolean):boolean{ if (loading) { return true;; }else{ return false; } }
AST#export_declaration#Left export AST#function_declaration#Left function isloading AST#parameter_list#Left ( AST#parameter#Left loading : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST...
export function isloading(loading:boolean):boolean{ if (loading) { return true;; }else{ return false; } }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/Methods.ets#L16-L22
0006c1f45c5ae9548fe1c59b2d88cd6797d4989e
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/DES.ets
arkts
encryptCBCSync
加密(CBC模式),同步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @returns
static encryptCBCSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, params: cryptoFramework.ParamsSpec): cryptoFramework.DataBlob { return DES.encryptSync(data, symKey, params, '3DES192|CBC|PKCS7'); }
AST#method_declaration#Left static encryptCBCSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKe...
static encryptCBCSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, params: cryptoFramework.ParamsSpec): cryptoFramework.DataBlob { return DES.encryptSync(data, symKey, params, '3DES192|CBC|PKCS7'); }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/DES.ets#L85-L88
f950fd21389dcc52da86d260a9ed79e4e13146af
github
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/CameraService.ets
arkts
getCameraDevices
获取摄像头设备列表 @returns Promise<CameraDevice[]> 摄像头设备列表
static async getCameraDevices(): Promise<CameraDevice[]> { try { console.info('[CameraService] 📹 开始获取摄像头设备列表'); const url = `${AppConstants.CAMERA_BASE_URL}/devices?page=1&size=999&status=&id&name`; console.info('[CameraService] 📹 请求URL:', url); const response = await HttpUti...
AST#method_declaration#Left static async getCameraDevices AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CameraDevice [ ] AST#array_type#Right...
static async getCameraDevices(): Promise<CameraDevice[]> { try { console.info('[CameraService] 📹 开始获取摄像头设备列表'); const url = `${AppConstants.CAMERA_BASE_URL}/devices?page=1&size=999&status=&id&name`; console.info('[CameraService] 📹 请求URL:', url); const response = await HttpUti...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/CameraService.ets#L98-L154
e170467f99879edf393ef9de8ae01dc4ab6ab651
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videotrimmer/Index.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export * from './src/main/ets/generated/RouterBuilder';
AST#export_declaration#Left export * from './src/main/ets/generated/RouterBuilder' ; AST#export_declaration#Right
export * from './src/main/ets/generated/RouterBuilder';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/Index.ets#L30-L30
a4ab7606adda35e1b171b767a1f3c0cf98beb5ca
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/PickerUtils.ets
arkts
selectAudio
通过选择模式拉起audioPicker界面(目前拉起的是documentPicker,audioPicker在规划中),用户可以选择一个或多个音频文件。 @returns
static async selectAudio(): Promise<Array<string>> { try { let AudioSelectOptions = new picker.AudioSelectOptions(); let audioPicker = new picker.AudioViewPicker(); return await audioPicker.select(AudioSelectOptions); } catch (err) { let error = err as BusinessError; LogUtils.debug...
AST#method_declaration#Left static async selectAudio AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type...
static async selectAudio(): Promise<Array<string>> { try { let AudioSelectOptions = new picker.AudioSelectOptions(); let audioPicker = new picker.AudioViewPicker(); return await audioPicker.select(AudioSelectOptions); } catch (err) { let error = err as BusinessError; LogUtils.debug...
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PickerUtils.ets#L199-L209
e0b316976f2476cbc15e3f9aad76442f9e2c8dc9
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/book/CategoryManager.ets
arkts
getCategories
获取所有分类
getCategories(): Category[] { return [...this.categories]; }
AST#method_declaration#Left getCategories AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Category [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left r...
getCategories(): Category[] { return [...this.categories]; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/book/CategoryManager.ets#L34-L36
6b7a4bcfd08cb51136a1fc81fd4964098e0d761e
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/network/src/main/ets/interceptors/LogInterceptor.ets
arkts
buildRequestUrl
拼接请求地址 @param {InternalAxiosRequestConfig} config - 请求配置 @returns {string} 拼接后的请求地址
function buildRequestUrl(config: InternalAxiosRequestConfig): string { const baseUrl: string = config.baseURL ?? ""; const url: string = config.url ?? ""; if (url.startsWith("http://") || url.startsWith("https://")) { return url; } // 处理 baseURL 与 url 的拼接,避免双斜杠 if (baseUrl.endsWith("/") && url.startsWit...
AST#function_declaration#Left function buildRequestUrl AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left InternalAxiosRequestConfig AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_ty...
function buildRequestUrl(config: InternalAxiosRequestConfig): string { const baseUrl: string = config.baseURL ?? ""; const url: string = config.url ?? ""; if (url.startsWith("http://") || url.startsWith("https://")) { return url; } if (baseUrl.endsWith("/") && url.startsWith("/")) { return `${baseU...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/network/src/main/ets/interceptors/LogInterceptor.ets#L134-L148
fca5fa8bf589561788feac41a26fedc13305f9d6
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/cs/src/main/ets/viewmodel/ChatViewModel.ets
arkts
@file 客服聊天页面 ViewModel @author Joker.X
@ObservedV2 export default class ChatViewModel extends BaseViewModel { }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class ChatViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Right AST#c...
@ObservedV2 export default class ChatViewModel extends BaseViewModel { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/cs/src/main/ets/viewmodel/ChatViewModel.ets#L7-L9
0ab36670af7582a75cdcae52c939509532c8ddc7
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/utils/AudioCapturerManager.ets
arkts
定义一个管理音频录制的类
export class AudioCaptureManager { // 静态属性,用于存储当前的音频捕获器实例 static audioCapturer: audio.AudioCapturer | null = null; // 静态私有属性,用于存储录音文件的路径 private static recordFilePath: string = ""; // 静态私有属性,用于存储开始录音的时间戳 private static startRecordTime: number = 0; // 静态私有属性,用于存储结束录音的时间戳 private static endRecordTime: num...
AST#export_declaration#Left export AST#class_declaration#Left class AudioCaptureManager AST#class_body#Left { // 静态属性,用于存储当前的音频捕获器实例 AST#property_declaration#Left static audioCapturer : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left audio . AudioCapturer AST#qualified_type#Ri...
export class AudioCaptureManager { static audioCapturer: audio.AudioCapturer | null = null; private static recordFilePath: string = ""; private static startRecordTime: number = 0; private static endRecordTime: number = 0; static async createAudioCapturer() { if (AudioCaptureManager.audioCa...
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/AudioCapturerManager.ets#L14-L106
301c77b8fb89ecea55c107ccd01379d577ff804d
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/utils/StrUtils.ets
arkts
isNotEmpty
判断字符串是否为非空。true为非空空,否则false @param str @returns
static isNotEmpty(str: string | undefined | null): boolean { return false === StrUtils.isEmpty(str); }
AST#method_declaration#Left static isNotEmpty AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Ri...
static isNotEmpty(str: string | undefined | null): boolean { return false === StrUtils.isEmpty(str); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/StrUtils.ets#L40-L42
d18870b84986e0674ea140a671522c6527781184
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
setDataHtml
将HTML数据写入系统剪贴板,使用Promise异步回调。 @param html HTML内容 @returns
static async setDataHtml(html: string): Promise<void> { PasteboardUtil.setData(pasteboard.MIMETYPE_TEXT_HTML, html); }
AST#method_declaration#Left static async setDataHtml AST#parameter_list#Left ( AST#parameter#Left html : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type...
static async setDataHtml(html: string): Promise<void> { PasteboardUtil.setData(pasteboard.MIMETYPE_TEXT_HTML, html); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L147-L149
8cbaeced7bc05f91935379ad9fdae97b8e865dff
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/NotificationCenterService.ets
arkts
searchNotifications
搜索通知
public searchNotifications(filter: NotificationFilter, limit = 20, offset = 0): NotificationSearchResult { let filtered = this.notifications; // 按类型过滤 if (filter.types && filter.types.length > 0) { filtered = filtered.filter(n => filter.types!.includes(n.type)); } // 按优先级过滤 if (filter.pr...
AST#method_declaration#Left public searchNotifications AST#parameter_list#Left ( AST#parameter#Left filter : AST#type_annotation#Left AST#primary_type#Left NotificationFilter AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left limit = AST#expression#Left 20 AST#expression#Right AST...
public searchNotifications(filter: NotificationFilter, limit = 20, offset = 0): NotificationSearchResult { let filtered = this.notifications; if (filter.types && filter.types.length > 0) { filtered = filtered.filter(n => filter.types!.includes(n.type)); } if (filter.priorities && filte...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationCenterService.ets#L222-L267
dcd979008a3e7f3ba8f2bf2f674386d14ccab692
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/contacts/ContactDetailPage.ets
arkts
loadContactDetail
加载联系人详情
private async loadContactDetail(): Promise<void> { try { this.loading = true; // 等待数据库初始化 if (!this.databaseService.isDbInitialized()) { let waitCount = 0; while (!this.databaseService.isDbInitialized() && waitCount < 50) { await new Promise<void>((resolve: () => v...
AST#method_declaration#Left private async loadContactDetail AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right >...
private async loadContactDetail(): Promise<void> { try { this.loading = true; if (!this.databaseService.isDbInitialized()) { let waitCount = 0; while (!this.databaseService.isDbInitialized() && waitCount < 50) { await new Promise<void>((resolve: () => void) => set...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/contacts/ContactDetailPage.ets#L55-L73
e4579f344ebfca3331afab660b8f2e670637b903
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/SnapshotUtil.ets
arkts
createFromBuilder
在应用后台渲染CustomBuilder自定义组件,并输出其截图。通过Promise返回结果并支持获取离屏组件绘制区域坐标和大小。 @param builder 自定义组件构建函数。 @param delay 指定触发截图指令的延迟时间。默认值:300,单位:毫秒。 @param checkImageStatus 指定是否允许在截图之前,校验图片解码状态。默认值:false。 @param options 截图相关的自定义参数。 @returns
static createFromBuilder(builder: CustomBuilder, delay: number = 300, checkImageStatus: boolean = false, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap> { return componentSnapshot.createFromBuilder(builder, delay, checkImageStatus, options); }
AST#method_declaration#Left static createFromBuilder AST#parameter_list#Left ( AST#parameter#Left builder : AST#type_annotation#Left AST#primary_type#Left CustomBuilder AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left delay : AST#type_annotation#Left AST#primary_type#Left number...
static createFromBuilder(builder: CustomBuilder, delay: number = 300, checkImageStatus: boolean = false, options?: componentSnapshot.SnapshotOptions): Promise<image.PixelMap> { return componentSnapshot.createFromBuilder(builder, delay, checkImageStatus, options); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/SnapshotUtil.ets#L57-L60
31c721b130f60306e4cd2a135c534d876f01c4d7
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/ui_tools.ets
arkts
Updates window decor height if is in Free-window Mode. @param window_id The window id.
export function update_window_decor_height(window_id: string) { let free_window_mode = AppStorage.get('free_window_mode') as boolean; if (!free_window_mode) { console.warn('[free][update_window_decor_height] INTERCEPTED & Executed nothing because not in Free-window Mode!'); return; } // Process let h ...
AST#export_declaration#Left export AST#function_declaration#Left function update_window_decor_height AST#parameter_list#Left ( AST#parameter#Left window_id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_st...
export function update_window_decor_height(window_id: string) { let free_window_mode = AppStorage.get('free_window_mode') as boolean; if (!free_window_mode) { console.warn('[free][update_window_decor_height] INTERCEPTED & Executed nothing because not in Free-window Mode!'); return; } let h = default_...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L74-L91
048b7d456f63ba2b89223b1d5ef57867ca3183f5
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/expression/lambda_expression/lambda_expression_001_T.ets
arkts
Introduction lambda表达式
export function lambda_expression_001_T(taint_src : string) { let lambda1 = (a:string) => a; let t = lambda1(taint_src); taint.Sink(t); }
AST#export_declaration#Left export AST#function_declaration#Left function lambda_expression_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_state...
export function lambda_expression_001_T(taint_src : string) { let lambda1 = (a:string) => a; let t = lambda1(taint_src); taint.Sink(t); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/expression/lambda_expression/lambda_expression_001_T.ets#L6-L10
a60758c6c469e93da73f5663893512abc1c571aa
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/services/TaskService.ets
arkts
任务查询参数接口
export interface TaskQueryParams extends QueryParams { page?: number; size?: number; days?: number; userId?: number; keyword?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface TaskQueryParams AST#extends_clause#Left extends QueryParams AST#extends_clause#Right AST#object_type#Left { AST#type_member#Left page ? : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST...
export interface TaskQueryParams extends QueryParams { page?: number; size?: number; days?: number; userId?: number; keyword?: string; }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/services/TaskService.ets#L7-L13
43e4812f4b057e30965389f9ae9f36e38e7e6e07
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/game/VirtualShopPage.ets
arkts
buildCurrencyItem
构建货币项
@Builder buildCurrencyItem(type: CurrencyType, amount: number, color: string, icon: string) { Row({ space: 4 }) { Image($r(`app.media.${icon}`)) .width('16vp') .height('16vp') .fillColor(color) Text(amount.toString()) .fontSize(14) .fontColor($r('app.color.text...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCurrencyItem AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left CurrencyType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left amount : AST#type_annot...
@Builder buildCurrencyItem(type: CurrencyType, amount: number, color: string, icon: string) { Row({ space: 4 }) { Image($r(`app.media.${icon}`)) .width('16vp') .height('16vp') .fillColor(color) Text(amount.toString()) .fontSize(14) .fontColor($r('app.color.text...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/game/VirtualShopPage.ets#L187-L200
b1fba4ca9cf3b2b7c5e9704e00bfb90f7905734b
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/ToolsUtils.ets
arkts
@author 2008 @datetime 2024/7/29 12:44 @className: ToolsUtils 工具类方法
export class ToolsUtils { //数字转换数组 numberArrays(ids:number|number[]){ let Ids:number[] = [] if (typeof ids === 'number'){ Ids.push(ids) } else { Ids = ids } return Ids } //字符串转换数组 stringArrays(ids:string|string[]){ let Ids:string[] = [] if (typeof ids === 'string'){ ...
AST#export_declaration#Left export AST#class_declaration#Left class ToolsUtils AST#class_body#Left { //数字转换数组 AST#method_declaration#Left numberArrays AST#parameter_list#Left ( AST#parameter#Left ids : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Le...
export class ToolsUtils { numberArrays(ids:number|number[]){ let Ids:number[] = [] if (typeof ids === 'number'){ Ids.push(ids) } else { Ids = ids } return Ids } stringArrays(ids:string|string[]){ let Ids:string[] = [] if (typeof ids === 'string'){ Ids.push(ids) ...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/ToolsUtils.ets#L7-L32
70eb45438130fa3e61801c4d39334c7e17e3cdd0
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pageloading/src/main/ets/model/CommodityDataModel.ets
arkts
商品的数据类
export class CommodityDataModel { id: number; uri: ResourceStr; title: ResourceStr; price: ResourceStr; views: ResourceStr; insurance: ResourceStr; constructor(id: number, uri: ResourceStr, title: ResourceStr, price: ResourceStr, views: ResourceStr, insurance: ResourceStr) { this.id = id; this.ur...
AST#export_declaration#Left export AST#class_declaration#Left class CommodityDataModel AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left uri : AST#...
export class CommodityDataModel { id: number; uri: ResourceStr; title: ResourceStr; price: ResourceStr; views: ResourceStr; insurance: ResourceStr; constructor(id: number, uri: ResourceStr, title: ResourceStr, price: ResourceStr, views: ResourceStr, insurance: ResourceStr) { this.id = id; this.ur...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pageloading/src/main/ets/model/CommodityDataModel.ets#L19-L39
12c064b41b4835a77bf3cbe77799c14979b2f0f3
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/player/VHWarmPlayerView.ets
arkts
onCastPlayState
投屏事件回调。 @param state:VHCastPlayState
onCastPlayState(state: VHCastPickerState){ if(state == VHCastPickerState.VH_CAST_PICKER_STATE_PLAY){ this.is_start = true; this.is_playing = true; }else if(state == VHCastPickerState.VH_CAST_PICKER_STATE_PAUSE || state == VHCastPickerState.VH_CAST_PICKER_STATE_STOP){ this.is_playing = false; ...
AST#method_declaration#Left onCastPlayState AST#parameter_list#Left ( AST#parameter#Left state : AST#type_annotation#Left AST#primary_type#Left VHCastPickerState AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#...
onCastPlayState(state: VHCastPickerState){ if(state == VHCastPickerState.VH_CAST_PICKER_STATE_PLAY){ this.is_start = true; this.is_playing = true; }else if(state == VHCastPickerState.VH_CAST_PICKER_STATE_PAUSE || state == VHCastPickerState.VH_CAST_PICKER_STATE_STOP){ this.is_playing = false; ...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWarmPlayerView.ets#L243-L250
379abb05d35c09abe0d6bc6e88d155b9dadb8673
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets
arkts
aboutToDisappear
[End about_appear]
aboutToDisappear(): void { this.windowUtil.registerOffWindowSizeChange(); }
AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#express...
aboutToDisappear(): void { this.windowUtil.registerOffWindowSizeChange(); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoPlayerSample/entry/src/main/ets/pages/IndexPage.ets#L68-L70
9151ee0bc727aca5a296037e27c25ea76f3a53ea
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/data/FestivalData.ets
arkts
getFestivalById
根据ID获取节日信息
public static getFestivalById(id: string): FestivalInfo | null { return FestivalData.getAllFestivals().find(festival => festival.id === id) || null; }
AST#method_declaration#Left public static getFestivalById AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_typ...
public static getFestivalById(id: string): FestivalInfo | null { return FestivalData.getAllFestivals().find(festival => festival.id === id) || null; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/data/FestivalData.ets#L314-L316
d1d5dfcbd78297f84054f97278ab59a1d438e353
github
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/common/beans/AccountClassification.ets
arkts
导出一个名为 AccountClassification 的接口,该接口用于表示记账应用中的记账类型项信息
export default interface
AST#export_declaration#Left export default AST#expression#Left interface AST#expression#Right AST#export_declaration#Right
export default interface
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/beans/AccountClassification.ets#L2-L2
15dfc97be87434cee183a41e8ccc27a94d7256c3
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets
arkts
topComponent
顶部横向滚动列表,用于展示列标题:车型
@Builder topComponent() { Row() { Column() { Text($r('app.string.vertical_horizontal_linkage_top_left_text_message')) .fontColor(Color.Black) .fontSize($r('app.string.vertical_horizontal_linkage_top_left_message_font_size')) .fontWeight(FontWeight.Bold) } .p...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right topComponent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_elemen...
@Builder topComponent() { Row() { Column() { Text($r('app.string.vertical_horizontal_linkage_top_left_text_message')) .fontColor(Color.Black) .fontSize($r('app.string.vertical_horizontal_linkage_top_left_message_font_size')) .fontWeight(FontWeight.Bold) } .p...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets#L99-L156
63563b685db7f79caa41f5e499719a86679717f2
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_core/src/main/ets/core/const/DateConst.ets
arkts
@Author csx @DateTime 2024/1/3 20:45 @TODO DateConst 日期格式的常量 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_core
export class DateConst { /** * yyyyMMdd 格式年月日 */ static YMD: string = "yyyyMMdd"; /** * HH:mm:ss 格式时间 */ static HMS: string = "HH:mm:ss"; /** * HH:mm 格式时间 */ static HM: string = "HH:mm"; /** *yyyy-MM-dd 格式年月日 */ static YMD_HLINE: string = "yyyy-MM-dd"; /** *yyyy-MM-dd HH...
AST#export_declaration#Left export AST#class_declaration#Left class DateConst AST#class_body#Left { /** * yyyyMMdd 格式年月日 */ AST#property_declaration#Left static YMD : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "yyyyMMdd" AST#express...
export class DateConst { static YMD: string = "yyyyMMdd"; static HMS: string = "HH:mm:ss"; static HM: string = "HH:mm"; static YMD_HLINE: string = "yyyy-MM-dd"; static YMD_HLINE_HMS: string = "yyyy-MM-dd HH:mm:ss"; static YMD_HLINE_HM: string = "yyyy-MM-dd HH:mm"; static YMD_BLI...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/const/DateConst.ets#L23-L68
6e16a3b0668649a774fe3135ff79335a54c76651
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/RSA.ets
arkts
decryptSegmentSync
解密,分段,同步 @param data 加密或者解密的数据。data不能为null。 @param priKey 指定解密私钥。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(RSA1024|PKCS1、RSA2048|PKCS1、等)。 @param len 自定义的数据拆分长度。
static decryptSegmentSync(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey, transformation: crypto.RSA_TRAN = 'RSA1024|PKCS1', len: number = 128): cryptoFramework.DataBlob { let cipher = cryptoFramework.createCipher(transformation); cipher.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, ...
AST#method_declaration#Left static decryptSegmentSync AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Le...
static decryptSegmentSync(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey, transformation: crypto.RSA_TRAN = 'RSA1024|PKCS1', len: number = 128): cryptoFramework.DataBlob { let cipher = cryptoFramework.createCipher(transformation); cipher.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, ...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/RSA.ets#L164-L180
7aaba868edc5d65366b176ef384c8a52d755e652
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/TimedReminderService.ets
arkts
定时提醒服务类
export class TimedReminderService { private static instance: TimedReminderService; private activeReminders: Map<string, number> = new Map(); // reminderId -> systemId private constructor() { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[TimedReminderService] Service initialized'); } public...
AST#export_declaration#Left export AST#class_declaration#Left class TimedReminderService AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left TimedReminderService AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST...
export class TimedReminderService { private static instance: TimedReminderService; private activeReminders: Map<string, number> = new Map(); private constructor() { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[TimedReminderService] Service initialized'); } public static getInstance(): Ti...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/TimedReminderService.ets#L34-L278
f7a324b710e32c9df0aefbc6e3b374d16e2ebdb6
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
getDescContent
Get description content in MainViewModel. @param alarmItem AlarmItem @return content string
public getDescContent(alarmItem: AlarmItem): string{ return (alarmItem.name + CommonConstants.DEFAULT_STRING_COMMA + (alarmItem.isRepeat ? this.getAlarmRepeatDayContent(alarmItem.repeatDays) : CommonConstants.DEFAULT_STRING_NO_REPEAT)); }
AST#method_declaration#Left public getDescContent AST#parameter_list#Left ( AST#parameter#Left alarmItem : AST#type_annotation#Left AST#primary_type#Left AlarmItem AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#...
public getDescContent(alarmItem: AlarmItem): string{ return (alarmItem.name + CommonConstants.DEFAULT_STRING_COMMA + (alarmItem.isRepeat ? this.getAlarmRepeatDayContent(alarmItem.repeatDays) : CommonConstants.DEFAULT_STRING_NO_REPEAT)); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets#L123-L128
1abeae6a3a2d2c9030a6348e76e12362a933b144
gitee
fengmingdev/protobuf-arkts-generator.git
75888d404fd6ce52a046cba2a94807ecf1350147
runtime/arkpb/util.ets
arkts
ZigZag encode 64-bit bigint
export function zigZag64(n: bigint): bigint { return (n << 1n) ^ (n >> 63n) }
AST#export_declaration#Left export AST#function_declaration#Left function zigZag64 AST#parameter_list#Left ( AST#parameter#Left n : AST#type_annotation#Left AST#primary_type#Left bigint AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary...
export function zigZag64(n: bigint): bigint { return (n << 1n) ^ (n >> 63n) }
https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/util.ets#L122-L124
4123e236c287ea221cd14019ee3ebd8d0ac3183b
github
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Service/DMPSendableObjects.ets
arkts
WorkerAppData
这个是传递用
@Sendable export class WorkerAppData { appIndex: number = -1; appId: string = ''; jsAppVersion: string = ''; }
AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export class WorkerAppData AST#class_body#Left { AST#property_declaration#Left appIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_express...
@Sendable export class WorkerAppData { appIndex: number = -1; appId: string = ''; jsAppVersion: string = ''; }
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Service/DMPSendableObjects.ets#L7-L12
6f38719da84c54af1ee28546844a7850ff76ce75
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/todo/TodoEditPage.ets
arkts
buildCategorySection
构建分类和优先级区域
@Builder buildCategorySection() { Column({ space: 16 }) { Text('分类和优先级') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) // 类型选择 Column({ space: 8 }) { Text('类型') .fontSize(14) .fontWeight...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCategorySection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen...
@Builder buildCategorySection() { Column({ space: 16 }) { Text('分类和优先级') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor('#333333') .alignSelf(ItemAlign.Start) Column({ space: 8 }) { Text('类型') .fontSize(14) .fontWeight(FontWe...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/todo/TodoEditPage.ets#L387-L464
e91ad5e8cff193e4c9eb211fe666f8a213514acd
github
junw2024/hnchain-ArkTs.git
0cc3c182ad418709b577fa24e9fe909a205232c6
entry/src/main/ets/service/LoginService.ets
arkts
login
@param username 用户 @param password 密码 @param page 跳 转页面
public login(loginReq: LoginReq): Promise<boolean> { return post(CommonConstants.BASE_URL+'/v1/user/login',null,loginReq) .then((res: Response)=>{ if( res.code === 200){ let auth: Auth = new Auth() auth.token=res.data.accessToken auth.expire=res.data.accessExpire ...
AST#method_declaration#Left public login AST#parameter_list#Left ( AST#parameter#Left loginReq : AST#type_annotation#Left AST#primary_type#Left LoginReq AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ...
public login(loginReq: LoginReq): Promise<boolean> { return post(CommonConstants.BASE_URL+'/v1/user/login',null,loginReq) .then((res: Response)=>{ if( res.code === 200){ let auth: Auth = new Auth() auth.token=res.data.accessToken auth.expire=res.data.accessExpire ...
https://github.com/junw2024/hnchain-ArkTs.git/blob/0cc3c182ad418709b577fa24e9fe909a205232c6/entry/src/main/ets/service/LoginService.ets#L17-L35
cef2e7917d184c8189c71832ee401e4a14e62f56
github
2763981847/Klotski.git
35bfb313c07e25ea53d2f4e66df0c441dd51675b
entry/src/main/ets/view/DifficultySelectComponent.ets
arkts
DifficultySelectComponent
标记为组件
@Component export default struct DifficultySelectComponent { // 使用 @Link 注解将组件状态父组件进行双向绑定 @Link rows: number // 行数 @Link cols: number // 列数 @Link withIndex: boolean // 是否显示图片编号 // 构建组件的 UI 布局 build() { Column({ space: 10 }) { // 创建垂直列布局,指定垂直间距 Text('请选择难度') // 提示文本 .fontSize(20) ....
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct DifficultySelectComponent AST#component_body#Left { // 使用 @Link 注解将组件状态父组件进行双向绑定 AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right rows : AST#type_annotation#Left AST#primary_type#Lef...
@Component export default struct DifficultySelectComponent { @Link rows: number @Link cols: number @Link withIndex: boolean build() { Column({ space: 10 }) { Text('请选择难度') .fontSize(20) .fontColor('#182431') Row({ space: 30 }) { Row() { Select(diff...
https://github.com/2763981847/Klotski.git/blob/35bfb313c07e25ea53d2f4e66df0c441dd51675b/entry/src/main/ets/view/DifficultySelectComponent.ets#L5-L73
d82fc9cbdf4fdc7c799818bfbddd2f2922613728
github
fourseas1998/hos.RankingDemo.git
5a98167826252c3c2b5ac58fa9a3db29d5f49d02
entry/src/main/ets/pages/RankPage.ets
arkts
onBackPress
退出时调用
onBackPress(){ if(this.isShowToast()){ prompt.showToast( { message: '再按一次退出程序',duration: TIME } ); this.clickBackTimeRecord = new Date().getTime(); return true; } return false; }
AST#method_declaration#Left onBackPress AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right ....
onBackPress(){ if(this.isShowToast()){ prompt.showToast( { message: '再按一次退出程序',duration: TIME } ); this.clickBackTimeRecord = new Date().getTime(); return true; } return false; }
https://github.com/fourseas1998/hos.RankingDemo.git/blob/5a98167826252c3c2b5ac58fa9a3db29d5f49d02/entry/src/main/ets/pages/RankPage.ets#L30-L41
9bc0d9ef93a9ae71d01bafc0f0cf1a66adc868d3
github