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
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets
arkts
MARK: - DayOf 类定义 日份
export class DayOf { // MARK: - 私有属性 /** * 第几天 (start from 0) */ private _num: number; /** * 每天的Box的List */ private _boxes: Box[]; // MARK: - Getter 方法 /** * 获取天数编号 */ get num(): number { return this._num; } /** * 获取boxes数组 */ get boxes(): Box[] { return this._...
AST#export_declaration#Left export AST#class_declaration#Left class DayOf AST#class_body#Left { // MARK: - 私有属性 /** * 第几天 (start from 0) */ AST#property_declaration#Left private _num : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration...
export class DayOf { private _num: number; private _boxes: Box[]; get num(): number { return this._num; } get boxes(): Box[] { return this._boxes; } constructor(num: number, boxes: Box[]) { this._num = num; this._boxes = boxes; } get numString(): ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets#L10-L168
50bc21120ff0696547cbf24aa12b24c271a206d5
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/plan/plan.ets
arkts
测试 function test( beginDay:string){ promptAction.showToast({ message: beginDay }) } 获取每个周周一的日期
export function getMondayOfWeek(inputDate: Date | string): string { // 处理日期参数,统一转换为Date对象 const targetDate: Date = typeof inputDate === 'string' ? new Date(inputDate) : new Date(inputDate); // 验证日期有效性 if (isNaN(targetDate.getTime())) { throw new Error('Invalid date input: 请提供有效的日期格式'); } // 获取当前日期是一周...
AST#export_declaration#Left export AST#function_declaration#Left function getMondayOfWeek AST#parameter_list#Left ( AST#parameter#Left inputDate : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Date AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST...
export function getMondayOfWeek(inputDate: Date | string): string { const targetDate: Date = typeof inputDate === 'string' ? new Date(inputDate) : new Date(inputDate); if (isNaN(targetDate.getTime())) { throw new Error('Invalid date input: 请提供有效的日期格式'); } const day: number = targetDate.getDay();...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/plan/plan.ets#L16-L44
bd0eb4193e939f8f86f7ba4003fc7d2e8ce8c0d3
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/viewmodel/WorldClockViewModel.ets
arkts
batchRemoveCities
批量从城市列表中移除指定索引的城市。 @param indexesToRemove 要移除的城市索引数组
public batchRemoveCities(indexesToRemove: Array<number>) { indexesToRemove.forEach(index => this.cities.splice(index, 1)) this.setCitiesToDatabase() }
AST#method_declaration#Left public batchRemoveCities AST#parameter_list#Left ( AST#parameter#Left indexesToRemove : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ...
public batchRemoveCities(indexesToRemove: Array<number>) { indexesToRemove.forEach(index => this.cities.splice(index, 1)) this.setCitiesToDatabase() }
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/WorldClockViewModel.ets#L147-L150
7f405bf05f0b1003c0323572d3a55e98f3b99e0c
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/LanguageSettingsPage.ets
arkts
updateUseSystemLocale
更新系统区域设置
private async updateUseSystemLocale(enabled: boolean): Promise<void> { try { await this.i18nManager.updateConfig({ useSystemLocale: enabled }); this.config.useSystemLocale = enabled; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to update system locale se...
AST#method_declaration#Left private async updateUseSystemLocale AST#parameter_list#Left ( AST#parameter#Left enabled : 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#primary_type#Left A...
private async updateUseSystemLocale(enabled: boolean): Promise<void> { try { await this.i18nManager.updateConfig({ useSystemLocale: enabled }); this.config.useSystemLocale = enabled; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to update system locale se...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LanguageSettingsPage.ets#L612-L619
83d16b6360820fe87137f2c8d6d825d21ea61215
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/auth/src/main/ets/viewmodel/RegisterViewModel.ets
arkts
register
注册按钮点击 @returns {void} 无返回值
register(): void { }
AST#method_declaration#Left register 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#builder_function_body#Right AST#method_declaration#Right
register(): void { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/viewmodel/RegisterViewModel.ets#L53-L54
21c522067e10d8a7057d30dc7946c4ef2b2965a0
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
update_is_loading
Asks the tab to update its loading state, usually called when the tab starts loading or finishes loading.
update_is_loading(is_loading: boolean) { this.is_loading = is_loading; return this.is_loading; }
AST#method_declaration#Left update_is_loading AST#parameter_list#Left ( AST#parameter#Left is_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#block_statement#Left { AST#statement#Left AST#expression_stat...
update_is_loading(is_loading: boolean) { this.is_loading = is_loading; return this.is_loading; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L848-L851
6ddb5045d2a841446419fcc47a03d495a74eb1ed
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
picker_utils/src/main/ets/Utils.ets
arkts
closeSync
关闭文件,以同步方法。 @param file 已打开的File对象或已打开的文件描述符fd。
static closeSync(file: fs.File | number) { fs.closeSync(file); }
AST#method_declaration#Left static closeSync AST#parameter_list#Left ( AST#parameter#Left file : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left fs . File AST#qualified_type#Right AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right...
static closeSync(file: fs.File | number) { fs.closeSync(file); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/Utils.ets#L155-L157
4386716bb6d1c503772987d3e31704826914702b
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/ui/src/main/ets/component/navdestination/AppNavDestination.ets
arkts
AppNavDestination
@file 通用导航容器:统一 NavDestination 与 ViewModel 生命周期转发 @author Joker.X
@ComponentV2 export struct AppNavDestination { /** * 传入的视图模型实例(必传) */ @Param @Require viewModel: BaseViewModel; /** * 业务内容渲染 */ @BuilderParam content: CustomBuilder; /** * 是否启用安全区(默认开启) */ @Param safeAreaEnabled: boolean = true; /** * 是否隐藏标题栏(默认不隐藏) */ @Param hideTitleB...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct AppNavDestination AST#component_body#Left { /** * 传入的视图模型实例(必传) */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right AST#decorator#Left @ Require AST#decorator#Right viewModel : AST#...
@ComponentV2 export struct AppNavDestination { @Param @Require viewModel: BaseViewModel; @BuilderParam content: CustomBuilder; @Param safeAreaEnabled: boolean = true; @Param hideTitleBar: boolean = false; @Param title: string | CustomBuilder | NavDestinationCommonTitle | NavDestinat...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ui/src/main/ets/component/navdestination/AppNavDestination.ets#L8-L153
32e06345b8618ec48d587200a2bd325d20e26978
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/ReminderScheduler.ets
arkts
提醒类型枚举
export enum ReminderType { BIRTHDAY_ALARM = 'birthday_alarm', ANNIVERSARY_ALARM = 'anniversary_alarm', PREPARATION_REMINDER = 'preparation_reminder', WEEKLY_SUMMARY = 'weekly_summary' }
AST#export_declaration#Left export AST#enum_declaration#Left enum ReminderType AST#enum_body#Left { AST#enum_member#Left BIRTHDAY_ALARM = AST#expression#Left 'birthday_alarm' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left ANNIVERSARY_ALARM = AST#expression#Left 'anniversary_alarm' AST#expression#Righ...
export enum ReminderType { BIRTHDAY_ALARM = 'birthday_alarm', ANNIVERSARY_ALARM = 'anniversary_alarm', PREPARATION_REMINDER = 'preparation_reminder', WEEKLY_SUMMARY = 'weekly_summary' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/ReminderScheduler.ets#L19-L24
76f830bc2111b27557cb020d3ce5ec9cec1d72d1
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/jobs/ViewPortJob.ets
arkts
Runnable that is used for viewport modifications since they cannot be executed at any time. This can be used to delay the execution of viewport modifications until the onSizeChanged(...) method of the chart-view is called. This is especially important if viewport modifying methods are called on the chart directly after...
export default abstract class ViewPortJob extends Runnable { protected pts: number[] = new Array(2); protected mViewPortHandler: ViewPortHandler; protected xValue: number = 0; protected yValue: number = 0; protected mTrans: Transformer; protected view: Chart<any>; constructor(viewPortHandl...
AST#export_declaration#Left export default AST#class_declaration#Left abstract class ViewPortJob extends AST#type_annotation#Left AST#primary_type#Left Runnable AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left protected pts : AST#type_annotation#Left AST#primary_type#...
export default abstract class ViewPortJob extends Runnable { protected pts: number[] = new Array(2); protected mViewPortHandler: ViewPortHandler; protected xValue: number = 0; protected yValue: number = 0; protected mTrans: Transformer; protected view: Chart<any>; constructor(viewPortHandl...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/jobs/ViewPortJob.ets#L30-L55
2e4eca8a22cfadc0d06b619e5454434bb28191aa
gitee
GikkiAres/todolist.git
3a7571832fd2985ffc1a4eb4673b370ef715fe8e
entry/src/main/ets/pages/ToDoListPage.ets
arkts
updateList
更新filterTodos
updateList() { let todos = getApp().getAllTodo(); this.filteredTodos = todos.filter((item)=>(item.state == this.filterState)); }
AST#method_declaration#Left updateList AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left todos = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left...
updateList() { let todos = getApp().getAllTodo(); this.filteredTodos = todos.filter((item)=>(item.state == this.filterState)); }
https://github.com/GikkiAres/todolist.git/blob/3a7571832fd2985ffc1a4eb4673b370ef715fe8e/entry/src/main/ets/pages/ToDoListPage.ets#L160-L163
0d3e25cfb82062f692997ce0294070834aa75fde
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets
arkts
calcMinMaxY
Calc minimum and maximum y-values over all DataSets. Tell DataSets to recalculate their min and max y-values, this is only needed for autoScaleMinMax. @param fromX the x-value to start the calculation from @param toX the x-value to which the calculation should be performed
public calcMinMaxY(fromX: number, toX: number): void { for (let i = 0; i < this.mDataSets.listSize; i++) { let data: T = this.mDataSets.at(i); data.calcMinMaxY(fromX, toX); } // apply the new data this.calcMinMax(); }
AST#method_declaration#Left public calcMinMaxY AST#parameter_list#Left ( AST#parameter#Left fromX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left toX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type...
public calcMinMaxY(fromX: number, toX: number): void { for (let i = 0; i < this.mDataSets.listSize; i++) { let data: T = this.mDataSets.at(i); data.calcMinMaxY(fromX, toX); } this.calcMinMax(); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets#L110-L117
bd22e2d54e282d145f8d787b94392f2a0fcfba1b
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
picker_utils/src/main/ets/PickerUtil.ets
arkts
TODO 拍照、文件(文件、图片、视频、音频)选择和保存,工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class PickerUtil { /** * 调用系统相机,拍照、录视频 * @param options * @returns */ static async cameraEasy(options: CameraOptions = new CameraOptions()): Promise<string> { let pickerResult = await PickerUtil.camera(options); return pickerResult.resultUri; } /** * 调用系统相机,拍照、录视频 * @param o...
AST#export_declaration#Left export AST#class_declaration#Left class PickerUtil AST#class_body#Left { /** * 调用系统相机,拍照、录视频 * @param options * @returns */ AST#method_declaration#Left static async cameraEasy AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left Ca...
export class PickerUtil { static async cameraEasy(options: CameraOptions = new CameraOptions()): Promise<string> { let pickerResult = await PickerUtil.camera(options); return pickerResult.resultUri; } static async camera(options: CameraOptions = new CameraOptions()): Promise<cameraPicker.PickerR...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/PickerUtil.ets#L28-L179
4bf3c2fba9df74efde309370fd9b174cf2243d4f
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/navigation/src/main/ets/common/CommonNavigator.ets
arkts
toPrivacyPolicy
跳转到隐私政策 @returns {void} 无返回值
static toPrivacyPolicy(): void { navigateTo(CommonRoutes.PrivacyPolicy); }
AST#method_declaration#Left static toPrivacyPolicy 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_custom_component_statement#Left navigateTo ( AST#expression#Left AST#memb...
static toPrivacyPolicy(): void { navigateTo(CommonRoutes.PrivacyPolicy); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/common/CommonNavigator.ets#L38-L40
ffd6553ad6f0ef2af7c43659780bfde68171630e
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets
arkts
getNextId
Get component ID
public getNextId(): number { this.idGen += 1; return this.idGen; }
AST#method_declaration#Left public getNextId 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#expression_statement#Left AST#expression#Left AST#assignment_expres...
public getNextId(): number { this.idGen += 1; return this.idGen; }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets#L83-L86
f3d6275b7598f26be62ea5d57bd03369c184b7bd
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/VirtualEconomyService.ets
arkts
虚拟货币类型枚举
export enum CurrencyType { GOLD_COIN = 'gold_coin', // 金币 SILVER_COIN = 'silver_coin', // 银币 DIAMOND = 'diamond', // 钻石 ENERGY = 'energy', // 能量 EXPERIENCE = 'experience' // 经验值 }
AST#export_declaration#Left export AST#enum_declaration#Left enum CurrencyType AST#enum_body#Left { AST#enum_member#Left GOLD_COIN = AST#expression#Left 'gold_coin' AST#expression#Right AST#enum_member#Right , // 金币 AST#enum_member#Left SILVER_COIN = AST#expression#Left 'silver_coin' AST#expression#Right AST#enum_membe...
export enum CurrencyType { GOLD_COIN = 'gold_coin', SILVER_COIN = 'silver_coin', DIAMOND = 'diamond', ENERGY = 'energy', EXPERIENCE = 'experience' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L15-L21
e4fe9ca218ace4a7dcc67e240dab1123162f533c
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/lunar/LunarService.ets
arkts
isNetworkAvailable
检查网络连接是否可用
async isNetworkAvailable(): Promise<boolean> { return await this.onlineLunarService.isNetworkAvailable(); }
AST#method_declaration#Left async isNetworkAvailable 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 boolean AST#primary_type#Right AST#type_annotation#Right > AST...
async isNetworkAvailable(): Promise<boolean> { return await this.onlineLunarService.isNetworkAvailable(); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/lunar/LunarService.ets#L417-L419
51b08be0cfa2c4753e8ba980e8c2f6a245bee166
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/common/utils/src/main/ets/utils/NWebUtils.ets
arkts
makeNode
必须要重写的方法,用于构建节点数、返回节点挂载在对应NodeContainer中 在对应NodeContainer创建的时候调用、或者通过rebuild方法调用刷新
makeNode(uiContext: UIContext): FrameNode | null { if (this.rootNode) { return this.rootNode.getFrameNode(); } return null; // 返回null控制动态组件脱离绑定节点 }
AST#method_declaration#Left makeNode 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#Left Fram...
makeNode(uiContext: UIContext): FrameNode | null { if (this.rootNode) { return this.rootNode.getFrameNode(); } return null; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/common/utils/src/main/ets/utils/NWebUtils.ets#L61-L66
7e28ee0555d8177d42d5ba616789698fe4da24c1
gitee
sedlei/Smart-park-system.git
253228f73e419e92fd83777f564889d202f7c699
@huaweicloud/iot-device-sdk/src/main/ets/client/DeviceClient.d.ets
arkts
set
设置设备影子监听器,用于接收设备侧请求平台下发的设备影子数据。 此监听器只能接收平台到直连设备的请求,子设备的请求由AbstractGateway处理 @param shadowListener 设备影子监听器
set shadowListener(value: ShadowListener | null);
AST#method_declaration#Left set AST#ERROR#Left shadow List ener AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ShadowListener AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_...
set shadowListener(value: ShadowListener | null);
https://github.com/sedlei/Smart-park-system.git/blob/253228f73e419e92fd83777f564889d202f7c699/@huaweicloud/iot-device-sdk/src/main/ets/client/DeviceClient.d.ets#L55-L55
269ff0e8f425845682062ec770c797994be4cf8b
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/view/UserAgreementPage.ets
arkts
UserAgreementContent
用户协议页面内容视图 @returns {void} 无返回值
@Builder private UserAgreementContent() { Text("用户协议页面内容视图") }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private UserAgreementContent 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 Text ( AST#expression#Left "用户协议页面内容视图" AST#e...
@Builder private UserAgreementContent() { Text("用户协议页面内容视图") }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/view/UserAgreementPage.ets#L33-L36
87d79035b921fdaaa0fe9d1e3a9be856e21b73fe
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
PerformanceAnalysis/BptaDelayAnalysis/entry/src/main/ets/components/AudioPlayerService.ets
arkts
[StartExclude audio_player_service] [StartExclude audio_player_service1] private constructor
private constructor() { this.initAudioPlayer(); }
AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right ...
private constructor() { this.initAudioPlayer(); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/PerformanceAnalysis/BptaDelayAnalysis/entry/src/main/ets/components/AudioPlayerService.ets#L24-L26
7710b5d19c7bd9d048b12d7834a052eca465eac8
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/component/HomeCategorySection.ets
arkts
categoryItem
分类项视图 @param {Category} category - 分类数据 @returns {void} 无返回值
@Builder private categoryItem(category: Category): void { Column() { NetWorkImage({ model: category.pic ?? null, sizeValue: this.getImageSize(), cornerRadius: this.getImageRadius(), showBackground: true, backgroundColorValue: $r("app.color.bg_grey") }); S...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private categoryItem AST#parameter_list#Left ( AST#parameter#Left category : AST#type_annotation#Left AST#primary_type#Left Category AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_ann...
@Builder private categoryItem(category: Category): void { Column() { NetWorkImage({ model: category.pic ?? null, sizeValue: this.getImageSize(), cornerRadius: this.getImageRadius(), showBackground: true, backgroundColorValue: $r("app.color.bg_grey") }); S...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/component/HomeCategorySection.ets#L51-L77
2a1d0bd104fd200e732d9e6359694e530e3151d6
github
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/CameraService.ets
arkts
摄像头服务类 负责管理摄像头设备列表获取和视频流URL生成
export class CameraService { // 摄像头服务认证头 private static readonly AUTH_HEADER = 'Basic YWRtaW4xMjM6QWRtaW5AMTIz'; /** * 获取摄像头设备列表 * @returns Promise<CameraDevice[]> 摄像头设备列表 */ static async getCameraDevices(): Promise<CameraDevice[]> { try { console.info('[CameraService] 📹 开始获取摄像头设备列表'); ...
AST#export_declaration#Left export AST#class_declaration#Left class CameraService AST#class_body#Left { // 摄像头服务认证头 AST#property_declaration#Left private static readonly AUTH_HEADER = AST#expression#Left 'Basic YWRtaW4xMjM6QWRtaW5AMTIz' AST#expression#Right ; AST#property_declaration#Right /** * 获取摄像头设备列表 * @retu...
export class CameraService { private static readonly AUTH_HEADER = 'Basic YWRtaW4xMjM6QWRtaW5AMTIz'; static async getCameraDevices(): Promise<CameraDevice[]> { try { console.info('[CameraService] 📹 开始获取摄像头设备列表'); const url = `${AppConstants.CAMERA_BASE_URL}/devices?page=1&size=999&s...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/CameraService.ets#L90-L260
0d9c44b8dbcea5ea2037ba9b9e68367a04faa805
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/GameificationService.ets
arkts
getUserGameData
获取用户游戏数据
getUserGameData(): UserGameData | null { return this.userGameData; }
AST#method_declaration#Left getUserGameData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left UserGameData AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement...
getUserGameData(): UserGameData | null { return this.userGameData; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L433-L435
50205af5fc170611400ee0bffa695e721cfc076b
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets
arkts
get
MARK: - Getter 方法 获取天数编号
get num(): number { return this._num; }
AST#method_declaration#Left get AST#ERROR#Left num AST#ERROR#Right 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#L...
get num(): number { return this._num; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets#L28-L30
f4fa09cb6769f94b0b83701d2d49a631873a8229
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/component/Community.ets
arkts
onSortOrderChange
切换排序顺序
private onSortOrderChange() { this.sortOrder = this.sortOrder === 'newest' ? 'oldest' : 'newest' this.filterAndSortPosts() }
AST#method_declaration#Left private onSortOrderChange 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 . sortOrder AST#member_exp...
private onSortOrderChange() { this.sortOrder = this.sortOrder === 'newest' ? 'oldest' : 'newest' this.filterAndSortPosts() }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/component/Community.ets#L95-L98
a76a56540f931f62204516880ae7820c9e57961c
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videotrimmer/src/main/ets/videotrimmer/RangeSeekBarView.ets
arkts
pointInArea
区域判断
pointInArea(x: number, y: number, area: Array<number>): boolean { logger.info(TAG, ' x=' + x + " y=" + y + " area =" + area) if (area.length == 4) { if (x >= area[0] && x <= area[2]) { return true; } else { return false; } } else { return false; } }
AST#method_declaration#Left pointInArea AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#ty...
pointInArea(x: number, y: number, area: Array<number>): boolean { logger.info(TAG, ' x=' + x + " y=" + y + " area =" + area) if (area.length == 4) { if (x >= area[0] && x <= area[2]) { return true; } else { return false; } } else { return false; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/src/main/ets/videotrimmer/RangeSeekBarView.ets#L459-L471
6e0e063606759510467b804f2f8afaa09fc49092
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/player/VHWatchLivePlayerComponent.ets
arkts
onCastPlayDuration
投屏播放时长。 @param duration:number 播放总时长 ,单位ms
onCastPlayDuration(duration: number) { }
AST#method_declaration#Left onCastPlayDuration AST#parameter_list#Left ( AST#parameter#Left duration : 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#builder_function_body#Left { } AST#builder_function_body#Right ...
onCastPlayDuration(duration: number) { }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWatchLivePlayerComponent.ets#L305-L307
22548e36778df15f95318df79c78303d64ee7425
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/networks/HttpUtils.ets
arkts
Http Header中的参数名
export class Header { // 每次发起Http请求 都需要在Header中 加入下面这4个参数 static readonly appKey: string = "appkey"; static readonly timestamp: string = "timestamp"; static readonly sign: string = "sign"; // MD5 static readonly sign2: string = "sign2"; // SHA256 static readonly device: string ...
AST#export_declaration#Left export AST#class_declaration#Left class Header AST#class_body#Left { // 每次发起Http请求 都需要在Header中 加入下面这4个参数 AST#property_declaration#Left static readonly appKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "appkey...
export class Header { static readonly appKey: string = "appkey"; static readonly timestamp: string = "timestamp"; static readonly sign: string = "sign"; static readonly sign2: string = "sign2"; static readonly device: string = "device"; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/HttpUtils.ets#L37-L44
fa0ceaf7c9f39c934e08e77e84b453bb3bc172fd
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index_backup.ets
arkts
buildGreetingsContent
构建祝福语内容占位符
@Builder buildGreetingsContent() { Text('祝福语页面') .fontSize(18) .fontColor('#333333') .textAlign(TextAlign.Center) .width('100%') .height('100%') }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingsContent 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 Text ( AST#expression#Left '祝福语页面' AST#expression#Ri...
@Builder buildGreetingsContent() { Text('祝福语页面') .fontSize(18) .fontColor('#333333') .textAlign(TextAlign.Center) .width('100%') .height('100%') }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L750-L758
bb033089a43ead85f5c037bead3fef36d7f258e6
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/VersionChecker/VersionChecker.ets
arkts
runVersionUpdateIfNeeded
/ 如果需要更新,则执行更新逻辑
public async runVersionUpdateIfNeeded(updateProcess: (oldVersion: string, newVersion: string) => void): Promise<void> { // 仅在首次启动且当前版本未执行过更新时,才执行更新逻辑 if (!await this.isFirstLaunchOfCurrentVersion()) { return; } // 执行更新 updateProcess(this._oldVersion, this._newVersion); // 更新版本历史 awai...
AST#method_declaration#Left public async runVersionUpdateIfNeeded AST#parameter_list#Left ( AST#parameter#Left updateProcess : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left oldVersion : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_a...
public async runVersionUpdateIfNeeded(updateProcess: (oldVersion: string, newVersion: string) => void): Promise<void> { if (!await this.isFirstLaunchOfCurrentVersion()) { return; } updateProcess(this._oldVersion, this._newVersion); await this.markVersionAsUpdated(); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/VersionChecker/VersionChecker.ets#L61-L72
3a52ff07c7c1e983cfb9731571d71d1df7891273
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/data_operation_tools.ets
arkts
Determines if a label-link pair (label, link) matches the key word. @param label The label. @param link The link. @param key The key to be searched. @param filter The filter mode. 0 = Label, 1 = Link, 2 = Both. @returns True if matches and False if doesn't meet requirement.
export function label_link_match_key(label: string, link: string, key: string[], filter: number, match_coefficient: number): boolean { if (filter == 0) { return match_with_coefficient(label, key, match_coefficient); } if (filter == 1) { return match_with_coefficient(link, key, match_coefficient); } re...
AST#export_declaration#Left export AST#function_declaration#Left function label_link_match_key AST#parameter_list#Left ( AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left link : AST#type_annotation#L...
export function label_link_match_key(label: string, link: string, key: string[], filter: number, match_coefficient: number): boolean { if (filter == 0) { return match_with_coefficient(label, key, match_coefficient); } if (filter == 1) { return match_with_coefficient(link, key, match_coefficient); } re...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/data_operation_tools.ets#L40-L48
459bdb6b05c69ef74f574447e4fa53fd323ead97
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/member/MemberManager.ets
arkts
checkAutoPronUsable
============================================================ MARK: - Check Lock functions / 检查 是否可以使用自动发音
public checkAutoPronUsable(showMessage: boolean = true): boolean { if (!this.nonMember.isLockedAutoPron) { return true } // 非会员 锁定自动发音 功能是否启用 if (this.isActive) { return true } // 非会员才做检查 if (showMessage) { Toast.showMessage($r('app.string.member_manager_msg_limit_auto_pron')) } return false...
AST#method_declaration#Left public checkAutoPronUsable AST#parameter_list#Left ( AST#parameter#Left showMessage : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST...
public checkAutoPronUsable(showMessage: boolean = true): boolean { if (!this.nonMember.isLockedAutoPron) { return true } if (this.isActive) { return true } if (showMessage) { Toast.showMessage($r('app.string.member_manager_msg_limit_auto_pron')) } return false }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/MemberManager.ets#L290-L299
c79f8c861f4d1b7a74274186528f7f1999006d25
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/utils/PromptUtils.ets
arkts
显示成功提示 @param message 消息内容
export function showSuccess(message: string) { try { promptAction.showToast({ message: message, duration: 2000 }); } catch (error) { console.error('显示成功提示失败:', error); } }
AST#export_declaration#Left export AST#function_declaration#Left function showSuccess AST#parameter_list#Left ( AST#parameter#Left message : 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 { AS...
export function showSuccess(message: string) { try { promptAction.showToast({ message: message, duration: 2000 }); } catch (error) { console.error('显示成功提示失败:', error); } }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/PromptUtils.ets#L93-L102
348b0d5377327d55e8589a4c0f9f22b055ff840f
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets
arkts
sha1_kt
Determine the appropriate additive constant for the current iteration 返回对应的Kt值
sha1_kt(t: number) { return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514; }
AST#method_declaration#Left sha1_kt AST#parameter_list#Left ( AST#parameter#Left t : 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#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#ex...
sha1_kt(t: number) { return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets#L146-L150
9854d73a9b9d532e6cfd4a326246068ed3ffba5c
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/modules/live/LiveManager.ets
arkts
play
播放直播
async play(): Promise<boolean> { try { if (!this.currentRoom) { return false; } Logger.info('LiveManager', 'Playing live stream'); this.liveStatus.isPlaying = true; EventBus.emit('LIVE_PLAYING'); return true; } catch (error) { Logger.error('LiveManager', `Failed...
AST#method_declaration#Left async play 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 boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_argument...
async play(): Promise<boolean> { try { if (!this.currentRoom) { return false; } Logger.info('LiveManager', 'Playing live stream'); this.liveStatus.isPlaying = true; EventBus.emit('LIVE_PLAYING'); return true; } catch (error) { Logger.error('LiveManager', `Failed...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/modules/live/LiveManager.ets#L105-L118
20ed5dee087cd2c2d853654e598987dcd7e53a4c
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/arkweb/ArkJsObject.ets
arkts
getName
接口注册用到
getName(): string { return this.name; }
AST#method_declaration#Left getName 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_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left ...
getName(): string { return this.name; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkJsObject.ets#L25-L27
a5464aef91578a66ee103a56c51f91bb51e1bcd4
gitee
lulululing/calendar.git
c87b7e3ffb50a34941a5db50afe6a513c113bd0b
entry/src/main/ets/utils/LunarUtil.ets
arkts
getSolarFestival
获取阳历节日
static getSolarFestival(date: Date): string { const month = date.getMonth() + 1 const day = date.getDate() const key = `${month}-${day}` return LunarUtil.solarFestivals.get(key) || '' }
AST#method_declaration#Left static getSolarFestival 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 string AST#primary_...
static getSolarFestival(date: Date): string { const month = date.getMonth() + 1 const day = date.getDate() const key = `${month}-${day}` return LunarUtil.solarFestivals.get(key) || '' }
https://github.com/lulululing/calendar.git/blob/c87b7e3ffb50a34941a5db50afe6a513c113bd0b/entry/src/main/ets/utils/LunarUtil.ets#L203-L208
ab1b87e2712e4772b12e0f27d450147a45b4c81a
github
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/Shangpingsousuoyoujieguo.ets
arkts
highlightFanText
高亮"风扇"文字为粉色
private highlightFanText(name: string): string { return name.replace('风扇', '风扇'); }
AST#method_declaration#Left private highlightFanText AST#parameter_list#Left ( AST#parameter#Left name : 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 string AST#prima...
private highlightFanText(name: string): string { return name.replace('风扇', '风扇'); }
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/Shangpingsousuoyoujieguo.ets#L132-L134
756513a0722ea6c5ea00e889bc4712de3ff30d52
github
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/DApp/DMPAppLifecycle.ets
arkts
onShow
框架接口 / 小程序 App / App https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onHide
static onShow() { DMPAppLifecycle.onAppShow() }
AST#method_declaration#Left static onShow 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 DMPAppLifecycle AST#expression#Right . onAppShow A...
static onShow() { DMPAppLifecycle.onAppShow() }
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/DApp/DMPAppLifecycle.ets#L23-L25
78d00d478fc431b2dd7a19ed4dd046038e3ab5cb
github
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/dialog/DialogHelper.ets
arkts
defaultNoTitleDialog
默认无标题弹框 @param message 内容 @param operator 回调
function defaultNoTitleDialog(message: string | Resource, operator ?: DialogOperator): void { showDialog(null, message, $r('app.string.button_know'), operator); }
AST#function_declaration#Left function defaultNoTitleDialog AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#p...
function defaultNoTitleDialog(message: string | Resource, operator ?: DialogOperator): void { showDialog(null, message, $r('app.string.button_know'), operator); }
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/dialog/DialogHelper.ets#L154-L156
813994b7e04667723a0c03e9df9e6df92698c511
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_json/src/main/ets/json/JSONObject.ets
arkts
@Author csx @DateTime 2024/4/25 19:25:04 @TODO JSONObject 定义json对象 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_json
export class JSONObject extends HashMap<string, JSONValue> { /** * json字符串转换为JSONObject对象 * @param jsonStr json字符串 * @returns JSONObject 对象 */ public static parse(jsonStr: string): JSONObject { let json = new JSONObject(); //去除字符串中的换行符 const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').re...
AST#export_declaration#Left export AST#class_declaration#Left class JSONObject extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left HashMap AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotation#Left ...
export class JSONObject extends HashMap<string, JSONValue> { public static parse(jsonStr: string): JSONObject { let json = new JSONObject(); const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').replace(/\r/g, '\\r').replace(/\n/g, '\\n'); let jVal: Record<string, JSONValue> = JSON.parse(repl...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_json/src/main/ets/json/JSONObject.ets#L30-L263
86cda44e4eec44d3a305939c82a37316a3b2dd06
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/array/ArrayStringUtils.ets
arkts
字符串数组扩展
export class ArrayWords { /** * 如果有词语,需要用空格连接,全部是单字汉字时,直接连接 * 如: * 有词语: [中国, 今天,大,家里, 人口] -> "中国 今天 大 家里 人口" * 全部是单字: [中,国,人] -> "中国人" * @param seperator 默认是半角空格 */ static joinedWordsString(arr: string[], seperator: string = " "): string { // 如果只有一个词语时 if (arr.length ==...
AST#export_declaration#Left export AST#class_declaration#Left class ArrayWords AST#class_body#Left { /** * 如果有词语,需要用空格连接,全部是单字汉字时,直接连接 * 如: * 有词语: [中国, 今天,大,家里, 人口] -> "中国 今天 大 家里 人口" * 全部是单字: [中,国,人] -> "中国人" * @param seperator 默认是半角空格 */ AST#method_declaration#Left static joinedW...
export class ArrayWords { static joinedWordsString(arr: string[], seperator: string = " "): string { if (arr.length === 1 && arr.filter(item => item.trim().length > 1).length > 0) { ,因为不会有空格连接,所以会被当成单个的字显示如:[中国] → [中] [国] return arr.join('') + seperator; } return arr.filter(ite...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/array/ArrayStringUtils.ets#L2-L80
2006a0f3144a266026ee56322354f306e0ef1206
github
azhuge233/ASFShortcut-HN.git
d1669c920c56317611b5b0375aa5315c1b91211b
entry/src/main/ets/common/utils/ASF.ets
arkts
sendRequest
发送请求
private async sendRequest(address: string, password: string, command: string) { Logger.debug(this.LOG_TAG, `sendRequest() ASF 服务器地址:${address}`); Logger.debug(this.LOG_TAG, `sendRequest() ASF 密码:${password}`); Logger.debug(this.LOG_TAG, `sendRequest() ASF 指令:${command}`); const httpRequ...
AST#method_declaration#Left private async sendRequest AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left password : AST#type_annotation#Left AST#primary_type#Left string AS...
private async sendRequest(address: string, password: string, command: string) { Logger.debug(this.LOG_TAG, `sendRequest() ASF 服务器地址:${address}`); Logger.debug(this.LOG_TAG, `sendRequest() ASF 密码:${password}`); Logger.debug(this.LOG_TAG, `sendRequest() ASF 指令:${command}`); const httpRequ...
https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/common/utils/ASF.ets#L57-L92
f7f25a0ab36cfaa8b5240581d0e60509edbf8820
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/shortcut/ShortcutManager.ets
arkts
getShortcutTypeById
根据ID获取快捷方式类型
private getShortcutTypeById(shortcutId: string): ShortcutType { if (shortcutId.includes('greeting')) return ShortcutType.QUICK_GREETING; if (shortcutId.includes('calendar')) return ShortcutType.OPEN_CALENDAR; if (shortcutId.includes('statistics')) return ShortcutType.VIEW_STATISTICS; return ShortcutType...
AST#method_declaration#Left private getShortcutTypeById AST#parameter_list#Left ( AST#parameter#Left shortcutId : 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 Shortcu...
private getShortcutTypeById(shortcutId: string): ShortcutType { if (shortcutId.includes('greeting')) return ShortcutType.QUICK_GREETING; if (shortcutId.includes('calendar')) return ShortcutType.OPEN_CALENDAR; if (shortcutId.includes('statistics')) return ShortcutType.VIEW_STATISTICS; return ShortcutType...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/shortcut/ShortcutManager.ets#L452-L457
9efceb9fff1daab1865e78ba2a79143614f55771
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Picker/Picker_Special_Cases/entry/src/main/ets/pages/MultiTextPicker.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 interface RegionNode { name: string; code: string; children?: RegionNode[]; }
AST#export_declaration#Left export AST#interface_declaration#Left interface RegionNode AST#object_type#Left { AST#type_member#Left name : 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 code : AST#type_annotation#Left AS...
export interface RegionNode { name: string; code: string; children?: RegionNode[]; }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Picker/Picker_Special_Cases/entry/src/main/ets/pages/MultiTextPicker.ets#L16-L20
7211d3d5d2065e2a3067a01fcbb8be1bb42e7d26
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/utils/IconUtils.ets
arkts
根据名称获取图标资源 - 导航栏专用方法 由于ArkTS限制,不能使用动态字符串拼接资源路径,此方法专为导航栏设计 @param name 图标名称 @param selected 是否选中状态 @returns 图标资源
export function getNavIconByName(name: string, selected: boolean = false): ResourceStr { if (name === '首页' || name === 'home') { return selected ? AppIcons.home_selected : AppIcons.home; } else if (name === '梦想' || name === 'dream') { return selected ? AppIcons.dream_selected : AppIcons.dream; } else if (...
AST#export_declaration#Left export AST#function_declaration#Left function getNavIconByName AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left selected : AST#type_annotation#Le...
export function getNavIconByName(name: string, selected: boolean = false): ResourceStr { if (name === '首页' || name === 'home') { return selected ? AppIcons.home_selected : AppIcons.home; } else if (name === '梦想' || name === 'dream') { return selected ? AppIcons.dream_selected : AppIcons.dream; } else if (...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/IconUtils.ets#L112-L126
a2df9681ac10e1ad30b5acac28b32a845c2fe0b9
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets
arkts
Common crop function. @param pixelMap. @param cropWidth. @param cropHeight. @param cropPosition.
export async function cropCommon(pixelMap: PixelMap, cropWidth: number, cropHeight: number, cropPosition: RegionItem) { pixelMap.crop({ size: { width: cropWidth, height: cropHeight }, x: cropPosition.x, y: cropPosition.y }); }
AST#export_declaration#Left export AST#function_declaration#Left async function cropCommon AST#parameter_list#Left ( AST#parameter#Left pixelMap : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left cropWidth : AST#type_annota...
export async function cropCommon(pixelMap: PixelMap, cropWidth: number, cropHeight: number, cropPosition: RegionItem) { pixelMap.crop({ size: { width: cropWidth, height: cropHeight }, x: cropPosition.x, y: cropPosition.y }); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets#L56-L65
b0fcd68b9bfb9da1dbe8ec9239e7b93145070cc4
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderListPage.ets
arkts
OrderListItem
渲染订单列表项 @param {Order} item - 订单数据 @returns {void} 无返回值
@Builder private OrderListItem(item: Order): void { OrderCard({ order: item, toOrderDetail: (orderId: number): void => OrderNavigator.toDetail(orderId), toPay: (): void => this.vm.toPay(item), toGoodsDetail: (): void => this.vm.handleRebuy(item), toLogistics: (): void => OrderNavigat...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private OrderListItem AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotatio...
@Builder private OrderListItem(item: Order): void { OrderCard({ order: item, toOrderDetail: (orderId: number): void => OrderNavigator.toDetail(orderId), toPay: (): void => this.vm.toPay(item), toGoodsDetail: (): void => this.vm.handleRebuy(item), toLogistics: (): void => OrderNavigat...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderListPage.ets#L92-L103
657953f0e587c99892034e799a46f56e9aef2b09
github
euler1129/Cloud-flash-payment.git
dfb70c1c67b3b69447f4384661e16b60f40495de
entry/src/main/ets/pages/card/Index.ets
arkts
TabContentItem
tabContent的内容封装
@Builder TabContentItem (content, bg) { Column() { Text(content) .fontColor('#fff') .fontSize(40) .fontWeight(FontWeight.Bold) }.TabContentStyle(bg) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TabContentItem AST#parameter_list#Left ( AST#parameter#Left content AST#parameter#Right , AST#parameter#Left bg AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modif...
@Builder TabContentItem (content, bg) { Column() { Text(content) .fontColor('#fff') .fontSize(40) .fontWeight(FontWeight.Bold) }.TabContentStyle(bg) }
https://github.com/euler1129/Cloud-flash-payment.git/blob/dfb70c1c67b3b69447f4384661e16b60f40495de/entry/src/main/ets/pages/card/Index.ets#L33-L40
550b948e2dd45e9ab7a83ca5c6ebe3c7b26fbe79
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/SimpleAIService.ets
arkts
generateGiftRecommendations
生成礼物推荐(使用真实AI API)
async generateGiftRecommendations(params: GiftRequestParams): Promise<string[]> { if (!this.isConfigured) { throw new Error('AI模型尚未配置,请先配置API密钥'); } const modelName = this.currentConfig?.model || 'unknown'; hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[SimpleAIService] Generat...
AST#method_declaration#Left async generateGiftRecommendations AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left GiftRequestParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type...
async generateGiftRecommendations(params: GiftRequestParams): Promise<string[]> { if (!this.isConfigured) { throw new Error('AI模型尚未配置,请先配置API密钥'); } const modelName = this.currentConfig?.model || 'unknown'; hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[SimpleAIService] Generat...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/SimpleAIService.ets#L170-L202
7e847c9f242463d922291dcf4ecac5a33b7eacf5
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/watermark/src/main/ets/utils/WaterMarkModel.ets
arkts
水印类
export class WaterMarkModel { /** * 图片添加水印。通过OffscreenCanvas绘制水印,并生成一个新的pixelMap对象进行保存 * @param {image.PixelMap} pixelMap - 原图pixelMap数据 * @param {Size} imageInfo - 图片尺寸 * @param {TextModify} textModify - 水印文本属性 * @returns {image.PixelMap} 返回带水印pixelMap数据 */ async addImageWaterMark(pixelMap: image...
AST#export_declaration#Left export AST#class_declaration#Left class WaterMarkModel AST#class_body#Left { /** * 图片添加水印。通过OffscreenCanvas绘制水印,并生成一个新的pixelMap对象进行保存 * @param {image.PixelMap} pixelMap - 原图pixelMap数据 * @param {Size} imageInfo - 图片尺寸 * @param {TextModify} textModify - 水印文本属性 * @returns {image....
export class WaterMarkModel { async addImageWaterMark(pixelMap: image.PixelMap, imageInfo: Size, textModify: TextModify) { const offScreenCanvas = new OffscreenCanvas(imageInfo.width, imageInfo.height); const offScreenContext: OffscreenCanvasRenderingContext2D = offScreenCanvas.getContext('2d'); o...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/watermark/src/main/ets/utils/WaterMarkModel.ets#L23-L51
5d367c8b63d888b9a466a743e48a5142eacef1ea
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/LocalSocketWorker.ets
arkts
stringToArrayBuffer
字符串转 `ArrayBuffer`
function stringToArrayBuffer(str: string): ArrayBuffer { const buf = new ArrayBuffer(str.length); const bufView = new Uint8Array(buf); for (let i = 0; i < str.length; i++) { bufView[i] = str.charCodeAt(i); } return buf; }
AST#function_declaration#Left function stringToArrayBuffer AST#parameter_list#Left ( AST#parameter#Left str : 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 ArrayBuffer...
function stringToArrayBuffer(str: string): ArrayBuffer { const buf = new ArrayBuffer(str.length); const bufView = new Uint8Array(buf); for (let i = 0; i < str.length; i++) { bufView[i] = str.charCodeAt(i); } return buf; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/LocalSocketWorker.ets#L42-L49
c05e60d0be7ce382767ab4f215c924a1a33fac08
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_history.ets
arkts
A class holding a history_record[] array, in which there stores history_record objects. @param no_init Will not open any data from disk nor do anything else. Usually set true if this object is only created to sit the place of StorageLink initialization.
constructor(no_init?: boolean) { let t0 = Date.now(); if (no_init == true) { return; } let first_launch = false; // Creates folders for history and index try { fs.mkdirSync(meowContext().filesDir + '/history', true); } catch (e) { // console.log('[Meow][bunch_of_history]...
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left no_init ? : 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#block_statement#Left { AST#statement#Left AST#variable_declarat...
constructor(no_init?: boolean) { let t0 = Date.now(); if (no_init == true) { return; } let first_launch = false; try { fs.mkdirSync(meowContext().filesDir + '/history', true); } catch (e) { } try { fs.mkdirSync(meowContext().filesDir + '/history-index', t...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history.ets#L59-L130
2dd104fe4ff5a2e55a043ca16a0d0cef031d8572
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets
arkts
Default constructor.
constructor(dataSets?: JArrayList<T>) { if (!dataSets) { this.mDataSets = new JArrayList<T>(); } else { this.mDataSets = new JArrayList<T>(); this.mDataSets.addAll(dataSets); this.notifyDataChanged(); } }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left dataSets ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right > AST#type_ar...
constructor(dataSets?: JArrayList<T>) { if (!dataSets) { this.mDataSets = new JArrayList<T>(); } else { this.mDataSets = new JArrayList<T>(); this.mDataSets.addAll(dataSets); this.notifyDataChanged(); } }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets#L67-L75
6af3b679471e58630b3593aab846ef6f3c2b202d
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets
arkts
onSelectItem
选择子菜单 @param item @param hasInputText
async onSelectItem(item: TaskData, hasInputText: boolean = false): Promise<void> { if (hasInputText || item.task !== Tasks.TEXT) { // 只有hasInputText,才是图片素材模式,其他都是贴纸 this.isTextMaterial = hasInputText; this.resourceIndex = 0; this.isCancelQuit = false; this.currentTask = item.task as nu...
AST#method_declaration#Left async onSelectItem AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left TaskData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left hasInputText : AST#type_annotation#Left AST#primary_type#Left boolean AST#p...
async onSelectItem(item: TaskData, hasInputText: boolean = false): Promise<void> { if (hasInputText || item.task !== Tasks.TEXT) { this.isTextMaterial = hasInputText; this.resourceIndex = 0; this.isCancelQuit = false; this.currentTask = item.task as number; this.cancelOkText = i...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets#L154-L168
bc3aba6fccef284040d068e09035e1c0712ed483
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
spinkit/src/main/ets/components/SpinL.ets
arkts
SpinL
TODO SpinKit动画组件 author: 桃花镇童长老 since: 2024/05/01
@ComponentV2 export struct SpinL { @Require @Param spinSize: number = 36; @Require @Param spinColor: ResourceColor; @Local round1: number = this.spinSize * 0.16 @Local opacity1: number = 0; @Local opacity2: number = 0; @Local opacity3: number = 0; @Local opacity4: number = 0; @Local opacity5: number = 0...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpinL AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right spinSize : AST#type_annotation#Left AST#primary_type#Left...
@ComponentV2 export struct SpinL { @Require @Param spinSize: number = 36; @Require @Param spinColor: ResourceColor; @Local round1: number = this.spinSize * 0.16 @Local opacity1: number = 0; @Local opacity2: number = 0; @Local opacity3: number = 0; @Local opacity4: number = 0; @Local opacity5: number = 0...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/spinkit/src/main/ets/components/SpinL.ets#L21-L281
96f4edcbf052941c101618275a39a0c27f233785
gitee
xinkai-hu/MyDay.git
dcbc82036cf47b8561b0f2a7783ff0078a7fe61d
entry/src/main/ets/pages/SearchSchedule.ets
arkts
aboutToAppear
初始化用户名、日程记录数据。
public aboutToAppear(): void { if (router.getParams()?.['username']) { this.username = router.getParams()['username']; } this.scheduleTable.getRdbStore(() => { this.scheduleTable.queryData(SortRule.DEFAULT, (results: Array<Schedule>) => { this.allSchedules = results; }); }); ...
AST#method_declaration#Left public aboutToAppear 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#sub...
public aboutToAppear(): void { if (router.getParams()?.['username']) { this.username = router.getParams()['username']; } this.scheduleTable.getRdbStore(() => { this.scheduleTable.queryData(SortRule.DEFAULT, (results: Array<Schedule>) => { this.allSchedules = results; }); }); ...
https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/pages/SearchSchedule.ets#L65-L75
8a61c297a359a600dbaee1518499c55b2f868beb
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/AESSync.ets
arkts
decodeGCM
解密-GCM模式 @param str 加密的字符串 @param aesKey AES密钥 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param dataCoding 入参字符串编码方式(hex/base64) - 不传默认为base64
static decodeGCM(str: string, aesKey: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { //转换密钥 let symKey = CryptoSyncUtil.convertKeyFromStr(aesKey, 'AES256', 256, keyCoding); // 初始化加解密操作环境:开始解密 let mode = crypto.CryptoMode.DECRYPT_MODE; //...
AST#method_declaration#Left static decodeGCM AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#...
static decodeGCM(str: string, aesKey: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { let symKey = CryptoSyncUtil.convertKeyFromStr(aesKey, 'AES256', 256, keyCoding); let mode = crypto.CryptoMode.DECRYPT_MODE; let cipher = crypto.c...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/AESSync.ets#L205-L221
c6faa35d05891195c765c2e809d18068f4aaac38
gitee
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
setting/src/main/ets/viewmodel/TipsViewModel.ets
arkts
getGestureList
获取所有列表数据(返回副本防止外部修改)
getGestureList(): TipsListItemModel[] { return [...this.gestureList]; }
AST#method_declaration#Left getGestureList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TipsListItemModel [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statem...
getGestureList(): TipsListItemModel[] { return [...this.gestureList]; }
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/setting/src/main/ets/viewmodel/TipsViewModel.ets#L29-L31
e66599bc1b3df274845b2f2847e8f68f28a88c30
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/h5cache/src/main/ets/common/ResponseDataType.ets
arkts
响应数据类型
export type ResponseDataType = ArrayBuffer | string;
AST#export_declaration#Left export AST#type_declaration#Left type ResponseDataType = AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right ; AST#type_declaration#Right AST...
export type ResponseDataType = ArrayBuffer | string;
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/h5cache/src/main/ets/common/ResponseDataType.ets#L17-L17
b7c91c5161324c3fbfff4738042decf61cdc435c
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/animation/NavAnimationMgr.ets
arkts
getAnimParamBuilder
如果已经注册了路由动画,则获取动画参数构建器,没注册则返回空 @param modifier
getAnimParamBuilder(component: object): NavAnimParamBuilder | undefined { const ctx = this.navContextMap.get(this.getKey(component)) if (ctx?.pageId) { const callback = this.customTransitionMap.get(ctx?.pageId) if (callback) { return NavAnimParamBuilder.builder(callback) } } re...
AST#method_declaration#Left getAnimParamBuilder AST#parameter_list#Left ( AST#parameter#Left component : 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#union_type#Left AST#primary_type#L...
getAnimParamBuilder(component: object): NavAnimParamBuilder | undefined { const ctx = this.navContextMap.get(this.getKey(component)) if (ctx?.pageId) { const callback = this.customTransitionMap.get(ctx?.pageId) if (callback) { return NavAnimParamBuilder.builder(callback) } } re...
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L342-L351
75211af44166c715e1e0e4ba5da477fe8f057211
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/pages/Index.ets
arkts
removeCriticalAsset
[Start remove_critical_asset]
async function removeCriticalAsset(): Promise<string> { let result: string = ''; let attr: asset.AssetMap = new Map(); let query: asset.AssetMap = new Map(); query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); // 此处指定别名删除单条数据,也可不指定别名删除多条数据 try { await asset.remove(query).then(() => { console.in...
AST#function_declaration#Left async function removeCriticalAsset 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 string AST#primary_type#Right AST#type_annotation#...
async function removeCriticalAsset(): Promise<string> { let result: string = ''; let attr: asset.AssetMap = new Map(); let query: asset.AssetMap = new Map(); query.set(asset.Tag.ALIAS, stringToArray('demo_alias')); try { await asset.remove(query).then(() => { console.info(`Asset removed successfull...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/AssetStoreKit/AssetStoreArkTS/entry/src/main/ets/pages/Index.ets#L183-L202
c9d0fcdb05aed50aaa3bd89ad535a0f2741469b2
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
fdatasync
实现文件内容数据同步,使用Promise异步回调。 @param fd number 已打开的文件描述符。 @returns
static fdatasync(fd: number): Promise<void> { return fs.fdatasync(fd); }
AST#method_declaration#Left static fdatasync AST#parameter_list#Left ( AST#parameter#Left fd : 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#generic_type#Left Prom...
static fdatasync(fd: number): Promise<void> { return fs.fdatasync(fd); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L754-L756
a24251805cdc5746559b2b7c279b2a92d63ed9d7
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatDetailPage.ets
arkts
layoutWeight参数
export class WantModel { srcImage: string = ''; textContent: string = ''; senderId: number = 0; constructor(srcImage?: string, text?: string, senderId?: number) { if (srcImage !== undefined) { this.srcImage = srcImage; } if (text !== undefined) { this.textContent = text; } if (s...
AST#export_declaration#Left export AST#class_declaration#Left class WantModel AST#class_body#Left { AST#property_declaration#Left srcImage : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Rig...
export class WantModel { srcImage: string = ''; textContent: string = ''; senderId: number = 0; constructor(srcImage?: string, text?: string, senderId?: number) { if (srcImage !== undefined) { this.srcImage = srcImage; } if (text !== undefined) { this.textContent = text; } if (s...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatDetailPage.ets#L35-L55
f4fb5d009a61de364e35b98212c8399ed8ec4929
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/common/types/SettingsTypes.ets
arkts
隐私设置接口(为PrivacySettings别名)
export interface PrivacySettings extends PrivacyConfig { // 继承PrivacyConfig的所有属性 }
AST#export_declaration#Left export AST#interface_declaration#Left interface PrivacySettings AST#extends_clause#Left extends PrivacyConfig AST#extends_clause#Right AST#object_type#Left { // 继承PrivacyConfig的所有属性 } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface PrivacySettings extends PrivacyConfig { }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L172-L174
e90b7a52c2ed2883958505a277f4f035d49c4431
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/web/WebSearchService.ets
arkts
searchGifts
搜索礼物推荐
public async searchGifts(params: GiftSearchParams): Promise<SearchResult[]> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[WebSearchService] Searching gifts with keyword: ${params.keyword}`); // 由于这是示例代码,我们返回模拟的搜索结果 // 在实际应用中,这里应该调用真实的搜索API const mockResults = t...
AST#method_declaration#Left public async searchGifts AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left GiftSearchParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#...
public async searchGifts(params: GiftSearchParams): Promise<SearchResult[]> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[WebSearchService] Searching gifts with keyword: ${params.keyword}`); const mockResults = this.generateMockSearchResults(params); h...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/web/WebSearchService.ets#L101-L119
1a574d855174d227b9e84b6105d352d2d56df684
github
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/common/dialog/CommonDateAndTimeDialog.ets
arkts
CommonDateAndTimeDialog
Icon+Text自定义弹窗
@CustomDialog export struct CommonDateAndTimeDialog { controller?: CustomDialogController @Link currentDate:string @State config: DateTimePickerConfig = { format: DateTimeFormat.YmdHm, start: '1900-01-01 00:00', end: '2099-12-31 23:59', selected: (this.currentDate=='')?DateUtil.getTodayStr('yyyy-M...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct CommonDateAndTimeDialog 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 ...
@CustomDialog export struct CommonDateAndTimeDialog { controller?: CustomDialogController @Link currentDate:string @State config: DateTimePickerConfig = { format: DateTimeFormat.YmdHm, start: '1900-01-01 00:00', end: '2099-12-31 23:59', selected: (this.currentDate=='')?DateUtil.getTodayStr('yyyy-M...
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/common/dialog/CommonDateAndTimeDialog.ets#L13-L116
dbc808c69b2d0f34e5740eacdb22a4dea1db16b8
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets
arkts
equals
MARK: - 等价比较(Equatable) 判断两个DayOf对象是否相等 @param other - 另一个DayOf对象
equals(other: DayOf): boolean { return this.num === other.num; }
AST#method_declaration#Left equals AST#parameter_list#Left ( AST#parameter#Left other : AST#type_annotation#Left AST#primary_type#Left DayOf 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_type#Right AST...
equals(other: DayOf): boolean { return this.num === other.num; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets#L96-L98
ada47dfd1b1449d3fc640bcf90a36f75758f2531
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/task/TaskProgressPage.ets
arkts
loadTaskDetails
加载任务详情
async loadTaskDetails(): Promise<void> { if (!this.taskId) return; this.isLoading = true; try { const task = await getTaskById(this.taskId); if (task) { this.task = task; } else { const toastOptions: promptAction.ShowToastOptions = { message: '无法找到任务信息', ...
AST#method_declaration#Left async loadTaskDetails 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 > AST#type_...
async loadTaskDetails(): Promise<void> { if (!this.taskId) return; this.isLoading = true; try { const task = await getTaskById(this.taskId); if (task) { this.task = task; } else { const toastOptions: promptAction.ShowToastOptions = { message: '无法找到任务信息', ...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/task/TaskProgressPage.ets#L54-L81
d98c29e4cab4b8d886dea04991d1369cc9e97d8e
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/onlinesearch/OnlineWordManager.ets
arkts
MARK: - OnlineWordManager 管理器
export class OnlineWordManager { private static instance: OnlineWordManager | null = null private constructor() { // 私有构造函数 } /// 获取单例实例 static get shared(): OnlineWordManager { if (!OnlineWordManager.instance) { OnlineWordManager.instance = new OnlineWordManager() } return OnlineWordM...
AST#export_declaration#Left export AST#class_declaration#Left class OnlineWordManager AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left OnlineWordManager AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Ri...
export class OnlineWordManager { private static instance: OnlineWordManager | null = null private constructor() { } static get shared(): OnlineWordManager { if (!OnlineWordManager.instance) { OnlineWordManager.instance = new OnlineWordManager() } return OnlineWordManager.instance }...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/onlinesearch/OnlineWordManager.ets#L8-L92
3225b17b3b67b613e4760d0fc79b0135c8c03a6b
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.SegmentButtonV2.d.ets
arkts
SegmentButtonV2Item
Defines segmented button item. @interface SegmentButtonV2Item @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
@ObservedV2 export declare class SegmentButtonV2Item { /** * Sets the text of the segmented button item. * * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ @Trace text?: ResourceStr; /** * Set...
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right class SegmentButtonV2Item AST#class_body#Left { /** * Sets the text of the segmented button item. * * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI...
@ObservedV2 export declare class SegmentButtonV2Item { @Trace text?: ResourceStr; @Trace icon?: ResourceStr; @Trace symbol?: Resource; @Trace enabled: boolean; @Trace textModifier?: TextModifier; @Trace iconModifier?: ImageModifier; @Trace symbolModif...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.SegmentButtonV2.d.ets#L180-L314
8bf8c4414043db047eb071eadf31dbdf435572e8
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/ChartModel.ets
arkts
setData
Sets a new data object for the chart. The data object contains all values and information needed for displaying. @param data
public setData(data: T | null) { this.mData = data; this.mOffsetsCalculated = false; if (data == null) { return; } // calculate how many digits are needed // 缺失方法 this.setupDefaultFormatter(data.getYMin(), data.getYMax()); if (this.mData) { const dataSets = this.mData.get...
AST#method_declaration#Left public setData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left T AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#paramete...
public setData(data: T | null) { this.mData = data; this.mOffsetsCalculated = false; if (data == null) { return; } this.setupDefaultFormatter(data.getYMin(), data.getYMax()); if (this.mData) { const dataSets = this.mData.getDataSets(); for (let i = 0; i < dataSets...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/ChartModel.ets#L212-L243
b22ff6ea0969031ab561a77898887f5c303575c9
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatListPage.ets
arkts
deleteAction
List的item左划时显示的删除按钮
@Builder deleteAction(msg: ChatModel) { Row() { Image(($r('app.media.icon_delete'))) .onClick(() => { animateTo({ duration: DELETE_ANIMATION_DURATION }, () => { if (this.lazyForEach) { this.chatListLazy.deleteData(msg); } else { let index...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right deleteAction AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left ChatModel AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#...
@Builder deleteAction(msg: ChatModel) { Row() { Image(($r('app.media.icon_delete'))) .onClick(() => { animateTo({ duration: DELETE_ANIMATION_DURATION }, () => { if (this.lazyForEach) { this.chatListLazy.deleteData(msg); } else { let index...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/IM/Chat/features/chatlist/src/main/ets/pages/ChatListPage.ets#L85-L105
3111ab40555f66dd65117d6b4a9f8758eb0422df
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets
arkts
组件工厂,可以注册TabInfo对象并使用
export class ComponentFactory { // tabInfo对象集合 private tabsInfo: Map<string, TabInfo>; // 注册标题集合 private keys: string[] = []; /** * 构造器 */ public constructor() { this.tabsInfo = new Map(); } /** * 设置tab项内容 * @param name - tab项标题 * @param content - tab项内容 */ public set(name: st...
AST#export_declaration#Left export AST#class_declaration#Left class ComponentFactory AST#class_body#Left { // tabInfo对象集合 AST#property_declaration#Left private tabsInfo : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Map AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left str...
export class ComponentFactory { private tabsInfo: Map<string, TabInfo>; private keys: string[] = []; public constructor() { this.tabsInfo = new Map(); } public set(name: string, tabInfo: TabInfo) { this.tabsInfo.set(name, tabInfo); } public getContent(name: string): WrappedBuild...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets#L22-L96
14d0c62304c85ded700f2a772c1fea6dfd701aaa
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets
arkts
getInstance
获取WindowModel单例实例 @returns {WindowModel} WindowModel
static getInstance(): WindowModel { if (!WindowModel.instance) { WindowModel.instance = new WindowModel(); } return WindowModel.instance; }
AST#method_declaration#Left static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left WindowModel 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 AS...
static getInstance(): WindowModel { if (!WindowModel.instance) { WindowModel.instance = new WindowModel(); } return WindowModel.instance; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets#L35-L40
657e9390e41e705c680c3f993e41e0dfefb303bb
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_speech/src/main/ets/AudioCapturerHelper.ets
arkts
录音工具类
export class AudioCapturerHelper{ private static audioCapturer: audio.AudioCapturer | undefined = undefined; private static file: fs.File | undefined = undefined; /** * 开始录音 * @returns */ static async startRecord(): Promise<string> { let filePath = Helper.getCacheDirPath('audio', `audio_${Helper...
AST#export_declaration#Left export AST#class_declaration#Left class AudioCapturerHelper AST#class_body#Left { AST#property_declaration#Left private static audioCapturer : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left audio . AudioCapturer AST#qualified_type#Right AST#primary...
export class AudioCapturerHelper{ private static audioCapturer: audio.AudioCapturer | undefined = undefined; private static file: fs.File | undefined = undefined; static async startRecord(): Promise<string> { let filePath = Helper.getCacheDirPath('audio', `audio_${Helper.getTodayStr('yyyyMMddHHmmssfff')...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/AudioCapturerHelper.ets#L10-L154
6aceda60122d818be06fc6ffce905e82a32def0b
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/ThreadUtils.ets
arkts
主线程检查工具类
export class ThreadUtils { /** * 判断当前是否为主线程 */ static isMainThread(): boolean { return process.tid === process.pid; // 主线程时两者相等 } /** * 打印完整线程信息 */ /** * 获取当前线程诊断信息 */ static dumpThreadInfo(): string { const pm = new process.ProcessManager(); const str = ` Process ID: $...
AST#export_declaration#Left export AST#class_declaration#Left class ThreadUtils AST#class_body#Left { /** * 判断当前是否为主线程 */ AST#method_declaration#Left static isMainThread AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_an...
export class ThreadUtils { static isMainThread(): boolean { return process.tid === process.pid; } static dumpThreadInfo(): string { const pm = new process.ProcessManager(); const str = ` Process ID: ${process.pid} Thread ID: ${process.tid} Is Main: ${process.tid === proce...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ThreadUtils.ets#L5-L34
6a70121431989c5cfba101e7f47498261a2662a8
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/WeatherManager.ets
arkts
isCacheValid
检查缓存是否有效
isCacheValid(): boolean { const now = Date.now(); const cacheDuration = this.TEST_MODE ? 10 * 1000 : this.CACHE_DURATION; return this.cachedWeatherData !== null && (now - this.lastUpdateTime) < cacheDuration; }
AST#method_declaration#Left isCacheValid 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#variable_declaration#Left const AST#variable_declarator#Left now = AST...
isCacheValid(): boolean { const now = Date.now(); const cacheDuration = this.TEST_MODE ? 10 * 1000 : this.CACHE_DURATION; return this.cachedWeatherData !== null && (now - this.lastUpdateTime) < cacheDuration; }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/WeatherManager.ets#L194-L198
2f9a1c9bb66a9c1cc648c9fc88f5416e1778cc4a
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets
arkts
getData
获取数据函数
public getData(index: number) { return this.originDataArray[index]; }
AST#method_declaration#Left public getData 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_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left re...
public getData(index: number) { return this.originDataArray[index]; }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets#L53-L55
bb400a48db558043b28043581b9c6161f040a190
gitee
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets
arkts
UI
build() { Stack() { Column({ space: 10 }) { // 顶部导航栏保持不变 Row() { Image($r("app.media.img2_10")) .width(12) .height(24) .zIndex(1) .margin({ right: 10 }) .onClick(() => { router.back(); }) ...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_p...
build() { Stack() { Column({ space: 10 }) { Row() { Image($r("app.media.img2_10")) .width(12) .height(24) .zIndex(1) .margin({ right: 10 }) .onClick(() => { router.back(); }) Text('购物车') ...
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets#L444-L588
ec23cf6c35e02e5c11b8fde223ce47685f518895
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/main/sub/report/RadarView.ets
arkts
buildCanvas
========== Canvas 区域构建器 ==========
@Builder buildCanvas() { Column() { Canvas(this.ctx) .width(this.chartWidth) .height(this.chartHeight) .onReady(() => { this.isCanvasReady = true; this.drawCanvas(); }) } .layoutWeight(1) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCanvas 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#container_content_body#Left { AST#arkts_ui_elem...
@Builder buildCanvas() { Column() { Canvas(this.ctx) .width(this.chartWidth) .height(this.chartHeight) .onReady(() => { this.isCanvasReady = true; this.drawCanvas(); }) } .layoutWeight(1) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L61-L73
b00492a469c4423afc41809b5ed065e530f36ec1
github
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/pages/MainPage.ets
arkts
buildPodcastItem
播客项
@Builder buildPodcastItem(podcast: Podcast) { Row() { // 播客封面 Image(podcast.imageUrl) .width(80) .height(80) .borderRadius(8) .objectFit(ImageFit.Cover) .alt($r('app.media.app_icon')) // 播客信息 Column() { Text(podcast.title) .fontSiz...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildPodcastItem AST#parameter_list#Left ( AST#parameter#Left podcast : AST#type_annotation#Left AST#primary_type#Left Podcast AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function...
@Builder buildPodcastItem(podcast: Podcast) { Row() { Image(podcast.imageUrl) .width(80) .height(80) .borderRadius(8) .objectFit(ImageFit.Cover) .alt($r('app.media.app_icon')) Column() { Text(podcast.title) .fontSize(16) ...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/MainPage.ets#L1017-L1061
10ca57e504388b77a612cc3ea9d2915fe101198b
github
texiwustion/chinese-herbal-shopping--arkts.git
3f71338f3c6d88bc74342e0322867f3a0c2c17d1
entry/src/main/ets/pages/LoginPage.ets
arkts
inputStyle
公共的样式函数
@Extend(TextInput) function inputStyle() { .placeholderColor(ColorConstants.PLACEHOLDER) .padding(StyleConstants.TEXT_INPUT_PADDING) .margin(StyleConstants.TEXT_INPUT_MARGIN) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left TextInput AST#expression#Right ) AST#decorator#Right function inputStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . placeholderColor ( AST#expression#L...
@Extend(TextInput) function inputStyle() { .placeholderColor(ColorConstants.PLACEHOLDER) .padding(StyleConstants.TEXT_INPUT_PADDING) .margin(StyleConstants.TEXT_INPUT_MARGIN) }
https://github.com/texiwustion/chinese-herbal-shopping--arkts.git/blob/3f71338f3c6d88bc74342e0322867f3a0c2c17d1/entry/src/main/ets/pages/LoginPage.ets#L178-L182
91393a141dfcbac8402ded9450e36230fc52ddf2
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/CryptoUtil.ets
arkts
verifySegmentSync
对数据进行分段验签,同步 @param data 待验签数据 @param signDataBlob 签名数据 @param pubKey 公钥 @param algName 指定签名算法(RSA1024|PKCS1|SHA256、RSA2048|PKCS1|SHA256、ECC256|SHA256、SM2_256|SM3、等)。 @param len 自定义的数据拆分长度。 @returns
static verifySegmentSync(data: Uint8Array, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string, len: number): boolean { let verifier = cryptoFramework.createVerify(algName); verifier.initSync(pubKey); for (let i = 0; i < data.length; i += len) { let updateData =...
AST#method_declaration#Left static verifySegmentSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left signDataBlob : AST#type_annotation#Left AST#primary_type#Left AST#q...
static verifySegmentSync(data: Uint8Array, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string, len: number): boolean { let verifier = cryptoFramework.createVerify(algName); verifier.initSync(pubKey); for (let i = 0; i < data.length; i += len) { let updateData =...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L420-L432
be31f4a1ed06763ccdd4357a3a94d8af464e58d5
gitee
tobias910903/komue-harmonyapp.git
cd4dd4e7859ec5b33a5140bdd1d050377f13175b
entry/src/main/ets/utils/request.ets
arkts
getErrorMsg
错误信息处理(替换UI提示为console.log)
function getErrorMsg(error: AxiosError): string { if (error.response) { switch (error.response.status) { case 400: return '请求参数错误'; case 403: return '没有权限访问'; case 404: return '请求资源不存在'; case 500: return '服务器内部错误'; default: return `请求失败: ${error.response.status}`; } }
AST#function_declaration#Left function getErrorMsg AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left AxiosError 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#pr...
function getErrorMsg(error: AxiosError): string { if (error.response) { switch (error.response.status) { case 400: return '请求参数错误'; case 403: return '没有权限访问'; case 404: return '请求资源不存在'; case 500: return '服务器内部错误'; default: return `请求失败: ${error.response.status}`; } }
https://github.com/tobias910903/komue-harmonyapp.git/blob/cd4dd4e7859ec5b33a5140bdd1d050377f13175b/entry/src/main/ets/utils/request.ets#L72-L81
9dec869b3b1a8217e4205b49871301ad89325ef4
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/common/types/CommonTypes.ets
arkts
祝福语风格枚举
export enum GreetingStyle { WARM = 'warm', // 温馨 FUNNY = 'funny', // 幽默 FORMAL = 'formal', // 正式 CREATIVE = 'creative' // 创意 }
AST#export_declaration#Left export AST#enum_declaration#Left enum GreetingStyle AST#enum_body#Left { AST#enum_member#Left WARM = AST#expression#Left 'warm' AST#expression#Right AST#enum_member#Right , // 温馨 AST#enum_member#Left FUNNY = AST#expression#Left 'funny' AST#expression#Right AST#enum_member#Right , // 幽默 AST#e...
export enum GreetingStyle { WARM = 'warm', FUNNY = 'funny', FORMAL = 'formal', CREATIVE = 'creative' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/CommonTypes.ets#L65-L70
a7026a4e0458ef1a2e8e593242439ec07e2876d1
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.InnerFullScreenLaunchComponent.d.ets
arkts
Declare type LaunchController @syscap SystemCapability.ArkUI.ArkUI.Full @systemapi @since 12
export declare class LaunchController { /** * Function to launch atomicservice. * * @type { LaunchAtomicServiceCallback } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 12 **/ public launchAtomicService: LaunchAtomicServiceCallback; }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class LaunchController AST#class_body#Left { /** * Function to launch atomicservice. * * @type { LaunchAtomicServiceCallback } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 12 **...
export declare class LaunchController { public launchAtomicService: LaunchAtomicServiceCallback; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.InnerFullScreenLaunchComponent.d.ets#L66-L77
bc796e10804b8d19e8187ce505b7535d4c43a470
gitee
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/services/FlawService.ets
arkts
分页返回结果接口
export interface TableDataInfo<T> { total: number; rows: T[]; code: number; msg: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface TableDataInfo AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#object_type#Left { AST#type_member#Left total : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#R...
export interface TableDataInfo<T> { total: number; rows: T[]; code: number; msg: string; }
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/FlawService.ets#L39-L44
63d10473a05cb2d459cd23007843bfdb1727aaed
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SuperFeature/DistributedAppDev/DistributedJotNote/entry/src/main/ets/entryability/EntryAbility.ets
arkts
checkAccessToken
获取当前应用的权限的授予状态:grantStatus(授予返回:0,未授予:-1)
async checkAccessToken(permission: Permissions): Promise<abilityAccessCtrl.GrantStatus> { let atManager = abilityAccessCtrl.createAtManager(); let grantStatus: abilityAccessCtrl.GrantStatus = -1; //获取tokenId: let tokenId: number = 0; try { let bundleInfo: bundleManager.BundleInfo = await bund...
AST#method_declaration#Left async checkAccessToken AST#parameter_list#Left ( AST#parameter#Left permission : AST#type_annotation#Left AST#primary_type#Left Permissions 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...
async checkAccessToken(permission: Permissions): Promise<abilityAccessCtrl.GrantStatus> { let atManager = abilityAccessCtrl.createAtManager(); let grantStatus: abilityAccessCtrl.GrantStatus = -1; let tokenId: number = 0; try { let bundleInfo: bundleManager.BundleInfo = await bundleManager.ge...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SuperFeature/DistributedAppDev/DistributedJotNote/entry/src/main/ets/entryability/EntryAbility.ets#L55-L77
28e0470f1de18b6c3b9b1a20b015c35be350ed12
gitee
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
time_bar/src/main/ets/components/interface/TimeBarOption.ets
arkts
Container options for the time bar host canvas.
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/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/components/interface/TimeBarOption.ets#L19-L19
82cc3fd4b3cdc112b71bde89fda80cf4a113423e
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/viewData/HelpInfo.ets
arkts
@author 2008 @datetime 2024/6/29 1:07 @className: HelpInfo 帮助信息
export class HelpInfo { static readonly HELP_INFO_MESSAGE = '除本地阅读外,如需在线阅读,请先导入第三方书源后再使用,本应用提供粘贴导入和本地导入两种导入方式,将他人分享的书源链接复制后点击发现界面右上角加号,选择粘贴导入即可,若他人分享的书源为压缩包或是Json文件,可以将文件解压后点击选择用开源阅读打开,或记住文件下载保存的位置,点击发现界面右上角加号,选择本地导入。如何获取书源?用户可自行百度或微信搜索获取第三方书源或于其他任何途径获取,如QQ频道或酷安等社区。' }
AST#export_declaration#Left export AST#class_declaration#Left class HelpInfo AST#class_body#Left { AST#property_declaration#Left static readonly HELP_INFO_MESSAGE = AST#expression#Left '除本地阅读外,如需在线阅读,请先导入第三方书源后再使用,本应用提供粘贴导入和本地导入两种导入方式,将他人分享的书源链接复制后点击发现界面右上角加号,选择粘贴导入即可,若他人分享的书源为压缩包或是Json文件,可以将文件解压后点击选择用开源阅读打开,或记住文件下载保存的...
export class HelpInfo { static readonly HELP_INFO_MESSAGE = '除本地阅读外,如需在线阅读,请先导入第三方书源后再使用,本应用提供粘贴导入和本地导入两种导入方式,将他人分享的书源链接复制后点击发现界面右上角加号,选择粘贴导入即可,若他人分享的书源为压缩包或是Json文件,可以将文件解压后点击选择用开源阅读打开,或记住文件下载保存的位置,点击发现界面右上角加号,选择本地导入。如何获取书源?用户可自行百度或微信搜索获取第三方书源或于其他任何途径获取,如QQ频道或酷安等社区。' }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/viewData/HelpInfo.ets#L7-L9
1dc6b1818c9d2f36d3f85a482771c3a0eb7dc6b9
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/StateManagement/entry/src/main/ets/segment/segment4.ets
arkts
Segment04Builder
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain 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...
@Builder export function Segment04Builder() { NavDestination(){ Index() } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function Segment04Builder 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 NavDestination ( ) AST#containe...
@Builder export function Segment04Builder() { NavDestination(){ Index() } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/StateManagement/entry/src/main/ets/segment/segment4.ets#L15-L20
e925d8f042b94df3d2b93f5f11e9dce8f692c37e
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/LoginSample/entry/src/main/ets/viewmodel/LoginViewMode.ets
arkts
getPersonalListItems
Get personal information of MainPage. @return {Array<ListItemData>} personalListItems.
getPersonalListItems(): Array<ListItemData> { let personalListItems: Array<ListItemData> = []; for (let index = 1; index <= CommonConstants.LIST_SIZE; index++) { let personalListItem = new ListItemData(); personalListItem.title = $r('app.string.component_list_item_text', index); personalListIt...
AST#method_declaration#Left getPersonalListItems AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ListItemData AST#primary_type#Right AST#type_annotation#Right > AST#...
getPersonalListItems(): Array<ListItemData> { let personalListItems: Array<ListItemData> = []; for (let index = 1; index <= CommonConstants.LIST_SIZE; index++) { let personalListItem = new ListItemData(); personalListItem.title = $r('app.string.component_list_item_text', index); personalListIt...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/LoginSample/entry/src/main/ets/viewmodel/LoginViewMode.ets#L13-L21
8c6e4606ecd0727bc932e401319f1c3de1c2f2f0
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/DragAndExchange/casesfeature/dragandexchange/src/main/ets/view/ListSceneView.ets
arkts
ListSceneView
列表默认间隔 实现List场景,拖拽交换子组件位置: 通过ListItem的onDragStart()方法指定拖拽开始时的行为,通过List的onTouch()指定拖拽释放时的行为。
@Component export struct ListSceneView { @State dataSource: DataSource = new DataSource(); @State dragIndex: number = 0; aboutToAppear() { for (let index = 0; index < ICON_NUM_IN_LIST; index++) { this.dataSource.pushData(new AppInfo($r(`app.media.drag_and_exchange_ic_public_game${index + 1}`), ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ListSceneView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right dataSource : AST#type_annotation#Left AST#primary_type#Left DataSource AST#primary_type#Right AST#ty...
@Component export struct ListSceneView { @State dataSource: DataSource = new DataSource(); @State dragIndex: number = 0; aboutToAppear() { for (let index = 0; index < ICON_NUM_IN_LIST; index++) { this.dataSource.pushData(new AppInfo($r(`app.media.drag_and_exchange_ic_public_game${index + 1}`), ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/DragAndExchange/casesfeature/dragandexchange/src/main/ets/view/ListSceneView.ets#L25-L101
8fd61d3d95ce97af0bcd084f00bb8223e56db959
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/websocket/WebSocketClient/entry/src/main/ets/pages/Index.ets
arkts
wsSocket
收到消息时的处理
wsSocket.on('message', (err, value) => { this.msgHistory += "服务端:" + value + "\r\n" this.scroller.scrollEdge(Edge.Bottom) }
AST#method_declaration#Left wsSocket AST#ERROR#Left . on ( 'message' , AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right , AST#parameter#Left value AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left => AST#ERROR#Right AST#builder_function_body#Left { AST#expression_statemen...
wsSocket.on('message', (err, value) => { this.msgHistory += "服务端:" + value + "\r\n" this.scroller.scrollEdge(Edge.Bottom) }
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/websocket/WebSocketClient/entry/src/main/ets/pages/Index.ets#L38-L41
f6c6bbc96c7d30c0bf219fb8eb0adc2c06833fd4
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/interface_class/simple_class/simple_class_003_T.ets
arkts
Introduction 简单类字段
export function simple_class_003_T(taint_src : string) : void { let a = new A(taint_src); taint.Sink(a.data); }
AST#export_declaration#Left export AST#function_declaration#Left function simple_class_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#type_annotatio...
export function simple_class_003_T(taint_src : string) : void { let a = new A(taint_src); taint.Sink(a.data); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/interface_class/simple_class/simple_class_003_T.ets#L5-L8
1bd78798c7246341db7b4a3d373b739657a88077
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/MoneyTrack-master/features/statistics/src/main/ets/commons/Constants.ets
arkts
argb
export const INCOME_BAR_INIT_COLOR: number = 0x80f2992c;
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left INCOME_BAR_INIT_COLOR : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0x80f2992c AST#expression#Right AST#variable_declarator#Right ; AST#var...
export const INCOME_BAR_INIT_COLOR: number = 0x80f2992c;
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/features/statistics/src/main/ets/commons/Constants.ets#L15-L15
bb09fc9eb9049ae885b06380c8d35a4022b8233f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/ReminderScheduler.ets
arkts
updateReminder
更新提醒配置
async updateReminder(reminderId: string, updates: Partial<ReminderConfig>): Promise<void> { try { const existingConfig = this.activeReminders.get(reminderId); if (!existingConfig) { throw new Error('提醒不存在'); } const updatedConfig = { ...existingConfig, ...updates }; // 如果更新了时...
AST#method_declaration#Left async updateReminder AST#parameter_list#Left ( AST#parameter#Left reminderId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left updates : AST#type_annotation#Left AST#primary_type#Left AST#generic_...
async updateReminder(reminderId: string, updates: Partial<ReminderConfig>): Promise<void> { try { const existingConfig = this.activeReminders.get(reminderId); if (!existingConfig) { throw new Error('提醒不存在'); } const updatedConfig = { ...existingConfig, ...updates }; if...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/ReminderScheduler.ets#L318-L352
a741ca0ce83140c968272e0f33b358e6b200fe1e
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SettingsPage.ets
arkts
buildContent
构建页面内容
@Builder buildContent() { Scroll() { Column({ space: 16 }) { // 用户信息卡片 this.buildUserInfoCard() // 设置分组 ForEach(this.getSettingsGroups(), (group: SettingsGroup) => { this.buildSettingsGroup(group) }) // 底部信息 this.buildFooter...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContent 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 Scroll ( ) AST#container_content_body#Left { AST#arkts_ui_ele...
@Builder buildContent() { Scroll() { Column({ space: 16 }) { this.buildUserInfoCard() ForEach(this.getSettingsGroups(), (group: SettingsGroup) => { this.buildSettingsGroup(group) }) this.buildFooterInfo() } .p...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SettingsPage.ets#L386-L405
e7b4fcdca506298b6240eeb950fb6b4188da3d40
github