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
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/efLoading.ets
arkts
弹框形状布局
export enum LoadingShape { /** * 正方形 */ SQUARE, /** * 矩形 */ RECTANGLE }
AST#export_declaration#Left export AST#enum_declaration#Left enum LoadingShape AST#enum_body#Left { /** * 正方形 */ AST#enum_member#Left SQUARE AST#enum_member#Right , /** * 矩形 */ AST#enum_member#Left RECTANGLE AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum LoadingShape { SQUARE, RECTANGLE }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/efLoading.ets#L203-L212
22b893b813682f4d8f56a42c79ca31e3bf19c4c2
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/blocks/modules/meowTabsVertical.ets
arkts
on_scroll_to_idx
Events
on_scroll_to_idx() { if (this.scroll_to_idx < 0) { return; } this.try_scroll_to(this.scroll_to_idx) this.scroll_to_idx = -1; }
AST#method_declaration#Left on_scroll_to_idx AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scroll_...
on_scroll_to_idx() { if (this.scroll_to_idx < 0) { return; } this.try_scroll_to(this.scroll_to_idx) this.scroll_to_idx = -1; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowTabsVertical.ets#L284-L290
e40321a87b3ade8bb8e6a1d056a9e8483f7a51f3
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/interface_class/complex_class/complex_class_003_T.ets
arkts
Introduction 跨类访问
export function complex_class_003_T(taint_src : string) { let b = new B(); let a = new A(taint_src); taint.Sink(b.getData(a)); }
AST#export_declaration#Left export AST#function_declaration#Left function complex_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#block_statement...
export function complex_class_003_T(taint_src : string) { let b = new B(); let a = new A(taint_src); taint.Sink(b.getData(a)); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/interface_class/complex_class/complex_class_003_T.ets#L6-L10
42d69e9ff079dae09612c071ce0b6e465d118c8e
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/multiplexSample/ScrollItem.ets
arkts
restore
还原
restore() { let that = this; let intervalID = setInterval(() => { that.move(that.sx += 0.01); if (that.sx >= 1) { clearInterval(intervalID); } }, 10) }
AST#method_declaration#Left restore AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left that = AST#expression#Left this AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#st...
restore() { let that = this; let intervalID = setInterval(() => { that.move(that.sx += 0.01); if (that.sx >= 1) { clearInterval(intervalID); } }, 10) }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/multiplexSample/ScrollItem.ets#L113-L121
4d7a2a6e80aedee0d766c26c1340cc8bfbf5873c
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Security/StringCipherArkTS/entry/src/main/ets/pages/Register.ets
arkts
checkUserData
User name, nickname, password, and confirm password data verification. @returns Check whether the check is passed.
checkUserData(): boolean { if (this.username === '' || this.password === '' || this.confirmPassword === '') { PromptUtil.promptMessage($r('app.string.message_register_empty'), CommonConstants.PROMPT_TIME); return false; } // RegExp for matching username. let namePattern = CommonConstants.REG...
AST#method_declaration#Left checkUserData 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#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left...
checkUserData(): boolean { if (this.username === '' || this.password === '' || this.confirmPassword === '') { PromptUtil.promptMessage($r('app.string.message_register_empty'), CommonConstants.PROMPT_TIME); return false; } let namePattern = CommonConstants.REGEXP_NAME; if (!namePattern.e...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Security/StringCipherArkTS/entry/src/main/ets/pages/Register.ets#L150-L177
8b72d0061e601951929865bdd2d9f323ca0199cc
gitee
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/service/DatabaseService.ets
arkts
checkAndMigrateDatabase
检查并执行数据库迁移
private async checkAndMigrateDatabase(): Promise<void> { if (!this.rdbStore) return; try { // 获取当前数据库版本 const currentVersion = await this.getDatabaseVersion(); const targetVersion = Constants.DB_VERSION; console.info(`[DatabaseService] Current DB version: ${currentVersion}, Target vers...
AST#method_declaration#Left private async checkAndMigrateDatabase 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#R...
private async checkAndMigrateDatabase(): Promise<void> { if (!this.rdbStore) return; try { const currentVersion = await this.getDatabaseVersion(); const targetVersion = Constants.DB_VERSION; console.info(`[DatabaseService] Current DB version: ${currentVersion}, Target version: ${targe...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/DatabaseService.ets#L70-L98
634370fcc71d177d07a2c88adfaeaf35f3da42f3
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets
arkts
Type of cookie Operation.
export enum CookieOperation { GET_COOKIE = '读取cookie', SET_COOKIE = '设置cookie', DELETE_COOKIE = '删除cookie', VERIFY_COOKIE = '验证cookie' }
AST#export_declaration#Left export AST#enum_declaration#Left enum CookieOperation AST#enum_body#Left { AST#enum_member#Left GET_COOKIE = AST#expression#Left '读取cookie' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SET_COOKIE = AST#expression#Left '设置cookie' AST#expression#Right AST#enum_member#Right...
export enum CookieOperation { GET_COOKIE = '读取cookie', SET_COOKIE = '设置cookie', DELETE_COOKIE = '删除cookie', VERIFY_COOKIE = '验证cookie' }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets#L152-L157
3d48fd3551f850081e8bd57591f7bbceee3ed9ac
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customaddresspicker/src/main/ets/customaddresspicker/view/CustomAddressPicker.ets
arkts
customTabBar
自定义TabBar
@Builder customTabBar() { RelativeContainer() { Row() { // 选择的省名 this.locationItem({ index: AddressType.Province, name: this.currentSelectInfo.province }) // 选择的市名 this.locationItem({ index: AddressType.City, name: this.currentSelectInfo.city }) // 选择的区名 this....
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customTabBar 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 RelativeContainer ( ) AST#container_content_body#Left { AST#a...
@Builder customTabBar() { RelativeContainer() { Row() { this.locationItem({ index: AddressType.Province, name: this.currentSelectInfo.province }) this.locationItem({ index: AddressType.City, name: this.currentSelectInfo.city }) this.locationItem({ index: Ad...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customaddresspicker/src/main/ets/customaddresspicker/view/CustomAddressPicker.ets#L230-L280
b517002bac68dec1e93341cec6173916d0ae731d
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.batteryInfo.d.ets
arkts
Battery capacity level of a device. @enum { int } @syscap SystemCapability.PowerManager.BatteryManager.Core @since 20
export enum BatteryCapacityLevel { /** * The battery is in unknown capacity level. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 22 */ LEVEL_NONE, /** * The battery is in full capacity level. * * @syscap SystemCapability.PowerManager.BatteryMa...
AST#export_declaration#Left export AST#enum_declaration#Left enum BatteryCapacityLevel AST#enum_body#Left { /** * The battery is in unknown capacity level. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 22 */ AST#enum_member#Left LEVEL_NONE AST#enum_member#Right , /** ...
export enum BatteryCapacityLevel { LEVEL_NONE, LEVEL_FULL, LEVEL_HIGH, LEVEL_NORMAL, LEVEL_LOW, LEVEL_WARNING, LEVEL_CRITICAL, LEVEL_SHUTDOWN }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.batteryInfo.d.ets#L331-L388
0c36f9926ce5beb2773a2aae12cd18289dcd8fa5
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets
arkts
showToastMessage
信息提示
showToastMessage(message: Resource) { promptAction.showToast({ message: message, duration: CommonConstants.DURATION }); }
AST#method_declaration#Left showToastMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#e...
showToastMessage(message: Resource) { promptAction.showToast({ message: message, duration: CommonConstants.DURATION }); }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets#L99-L104
ae32208b2162b13f438c9805de9c29e9991bb11b
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/animation/param/OpacityAnimateOptions.ets
arkts
@author: HHBin @date: 2024-11-23 @desc: 渐变动画
export class OpacityAnimateOptions implements INavAnimateOptions { _options?: number | Resource; _isBeforePage: boolean = false constructor
AST#export_declaration#Left export AST#ERROR#Left class OpacityAnimateOptions AST#implements_clause#Left implements INavAnimateOptions AST#implements_clause#Right { AST#property_declaration#Left _options ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_t...
export class OpacityAnimateOptions implements INavAnimateOptions { _options?: number | Resource; _isBeforePage: boolean = false constructor
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/param/OpacityAnimateOptions.ets#L10-L14
82e8529ff85c4c72c31f509f1b4548393d97b754
gitee
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/TaskViewModel.ets
arkts
notifyListeners
通知所有监听器
private notifyListeners() { this.listeners.forEach(listener => { listener.onTasksChanged(this.tasks); }); }
AST#method_declaration#Left private notifyListeners 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 AST#member_expression#Left AST#expressio...
private notifyListeners() { this.listeners.forEach(listener => { listener.onTasksChanged(this.tasks); }); }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/TaskViewModel.ets#L49-L53
8cb55b4fa6f77cc55d6f3cc905da2a9cdfef004e
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Graphics/Graphics2d/Eraser/casesfeature/erasercomponent/src/main/ets/pages/EraserMainPage.ets
arkts
this
节点的path更新后需要调用invalidate()方法触发重新渲染
this.currentNodeDraw.invalidate();
AST#method_declaration#Left this AST#ERROR#Left . currentNodeDraw . in validate AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right ; AST#method_declaration#Right
this.currentNodeDraw.invalidate();
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Graphics/Graphics2d/Eraser/casesfeature/erasercomponent/src/main/ets/pages/EraserMainPage.ets#L302-L302
8e28dc5623a7e47a42cd0f8879f7dfbbfe813f52
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/sharebutton/src/main/ets/components/ShareButton.ets
arkts
createBarcode
生成QR方形码 @param content 内容 @param size 大小 @returns PixelMap
async function createBarcode(content: string, size: number): Promise<image.PixelMap | null> { if (canIUse("SystemCapability.Multimedia.Scan.Core") && canIUse("SystemCapability.Multimedia.Scan.GenerateBarcode")) { try { // 以QR码为例,码图生成参数 let options: generateBarcode.CreateOptions = { scanType: s...
AST#function_declaration#Left async function createBarcode AST#parameter_list#Left ( AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left number A...
async function createBarcode(content: string, size: number): Promise<image.PixelMap | null> { if (canIUse("SystemCapability.Multimedia.Scan.Core") && canIUse("SystemCapability.Multimedia.Scan.GenerateBarcode")) { try { let options: generateBarcode.CreateOptions = { scanType: scanCore.ScanType...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/sharebutton/src/main/ets/components/ShareButton.ets#L192-L213
d997248601c7185128dc68fe56850cb8643f75c7
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/buttons/IconTintButton.ets
arkts
IconTintButton
/////////////////////////////////// / png图片使用的,可以着色的图标按钮 ///////////////////////////////////
@ComponentV2 export struct IconTintButton { // 必需属性(通过@Param从外部传入) @Param icon : Resource | null = null @Param isSvg : boolean = false //默认是png @Event onClickCallBack : () => void = () => {} // 可选样式属性(通过@Param支持外部修改) @Param iconSize : number | string = 22 @Param...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct IconTintButton AST#component_body#Left { // 必需属性(通过@Param从外部传入) AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right icon : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ...
@ComponentV2 export struct IconTintButton { @Param icon : Resource | null = null @Param isSvg : boolean = false @Event onClickCallBack : () => void = () => {} @Param iconSize : number | string = 22 @Param iconColor : ResourceColor = $r('app.color.co...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/buttons/IconTintButton.ets#L8-L58
a31f8c5b87aba6308045441761679e07333648df
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/view/MePage.ets
arkts
buildOrderStatusItem
构建订单状态项 @param {OrderStatusItem} item - 订单状态数据 @returns {void} 无返回值
@Builder private buildOrderStatusItem(item: OrderStatusItem): void { Column() { IBestBadge({ content: item.count, max: 99, showZero: false, color: $r("app.color.danger"), badgePosition: "top-right" }) { CommonIcon({ icon: item.icon, i...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private buildOrderStatusItem AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left OrderStatusItem AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : A...
@Builder private buildOrderStatusItem(item: OrderStatusItem): void { Column() { IBestBadge({ content: item.count, max: 99, showZero: false, color: $r("app.color.danger"), badgePosition: "top-right" }) { CommonIcon({ icon: item.icon, i...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/MePage.ets#L354-L387
4ed712a6a6f77134c04a33ca2c1f82c5d4e238d8
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/cigen/CigenWordDbAccess.ets
arkts
getCigenWordsByCid
============================================================ 根据 CID 查询 ============================================================
async getCigenWordsByCid(cid: number): Promise<Array<CigenWord> | null> { if (!this.db) return null; const sql = ` SELECT a.${CigenTable.CWord.idx} AS CWord_idx, a.${CigenTable.CWord.cid} AS CWord_cid, a.${CigenTable.CWord.titleEn} AS CWord_titleEn, a.${Cigen...
AST#method_declaration#Left async getCigenWordsByCid AST#parameter_list#Left ( AST#parameter#Left cid : 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#...
async getCigenWordsByCid(cid: number): Promise<Array<CigenWord> | null> { if (!this.db) return null; const sql = ` SELECT a.${CigenTable.CWord.idx} AS CWord_idx, a.${CigenTable.CWord.cid} AS CWord_cid, a.${CigenTable.CWord.titleEn} AS CWord_titleEn, a.${Cigen...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/cigen/CigenWordDbAccess.ets#L120-L138
04fbd80985dbb0b8681900797e9d6a96fb6d3335
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/attribute/RowAttribute.ets
arkts
获取横向起始 + 垂直顶部的 Row 对齐修饰器 @returns {AttributeModifier<RowAttribute>} Row 对齐修饰器 @example Row() { Text("Hi"); }.attributeModifier(rowStartTop());
export function rowStartTop(): AttributeModifier<RowAttribute> { return { applyNormalAttribute: (instance: RowAttribute): void => { instance.justifyContent(FlexAlign.Start); instance.alignItems(VerticalAlign.Top); } }; }
AST#export_declaration#Left export AST#function_declaration#Left function rowStartTop AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left RowAttribute AST#pr...
export function rowStartTop(): AttributeModifier<RowAttribute> { return { applyNormalAttribute: (instance: RowAttribute): void => { instance.justifyContent(FlexAlign.Start); instance.alignItems(VerticalAlign.Top); } }; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/attribute/RowAttribute.ets#L102-L109
26d9c335ee43f75306b092ba4d294ebc43a03486
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/formatter/DefaultAxisValueFormatter.ets
arkts
Constructor that specifies to how many digits the value should be formatted. @param digits
constructor(digits: number) { this.digits = digits; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left digits : 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#expression_statement#...
constructor(digits: number) { this.digits = digits; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/formatter/DefaultAxisValueFormatter.ets#L33-L35
630729de586b57e3cc0804995fb54966bac9ec87
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets
arkts
Declare ToolBarModifier use in ToolBar @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 13
export declare class ToolBarModifier { /** * Sets the height of the toolBar. * * @param { LengthMetrics } height - toolBar's height. * @returns { ToolBarModifier } returns the instance of the ToolBarModifier. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 13...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class ToolBarModifier AST#class_body#Left { /** * Sets the height of the toolBar. * * @param { LengthMetrics } height - toolBar's height. * @returns { ToolBarModifier } returns the instance of the To...
export declare class ToolBarModifier { height(height: LengthMetrics): ToolBarModifier; backgroundColor(backgroundColor: ResourceColor): ToolBarModifier; padding(padding: LengthMetrics): ToolBarModifier; stateEffect(stateEffect: boolean): ToolBarModifier; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets#L231-L272
cbba647848643801d1075107e9fb078a058a8d05
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
网络配置接口
export interface NetworkConfig { timeout: number; retryAttempts: number; useProxy: boolean; proxyConfig?: ProxyConfig; }
AST#export_declaration#Left export AST#interface_declaration#Left interface NetworkConfig AST#object_type#Left { AST#type_member#Left timeout : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left retryAttempts : AST#type_ann...
export interface NetworkConfig { timeout: number; retryAttempts: number; useProxy: boolean; proxyConfig?: ProxyConfig; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L129-L134
679472c66fd66582fe258d6d42529b7714708ec7
github
azhuge233/ASFShortcut-HN.git
d1669c920c56317611b5b0375aa5315c1b91211b
entry/src/main/ets/pages/Index.ets
arkts
resultPopup
执行指令后,显示结果的对话框
private resultPopup(commandNickname: string, message: string) { this.pageStack.pushPath({ name: "SelectableDialog", param: [commandNickname, message], onPop: (popInfo) => { CommonUtils.returnFromSubPage(popInfo); } }); }
AST#method_declaration#Left private resultPopup AST#parameter_list#Left ( AST#parameter#Left commandNickname : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string A...
private resultPopup(commandNickname: string, message: string) { this.pageStack.pushPath({ name: "SelectableDialog", param: [commandNickname, message], onPop: (popInfo) => { CommonUtils.returnFromSubPage(popInfo); } }); }
https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/pages/Index.ets#L130-L138
8cea3728528fd2baeabc4bd910a0599ff44617a3
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/common/BillData.ets
arkts
deleteBill
Delete bill by ID
static async deleteBill(billId: string): Promise<boolean> { try { console.info('BillDataManager: 开始删除账单, ID:', billId); const bills = await BillDataManager.getAllBills(); const newBills = bills.filter(bill => bill.id !== billId); if (newBills.length === bills.length) { console...
AST#method_declaration#Left static async deleteBill AST#parameter_list#Left ( AST#parameter#Left billId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_typ...
static async deleteBill(billId: string): Promise<boolean> { try { console.info('BillDataManager: 开始删除账单, ID:', billId); const bills = await BillDataManager.getAllBills(); const newBills = bills.filter(bill => bill.id !== billId); if (newBills.length === bills.length) { console...
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/common/BillData.ets#L58-L77
e090646b30c21ccd414eddf3096cc9210f6ae06c
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index_backup.ets
arkts
initializePage
初始化页面数据
private async initializePage(): Promise<void> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Index initializePage - starting'); console.log('[Index] Starting page initialization'); // 加载生日数据 await this.loadBirthdayData(); console.log('[Index] Birthday data loaded')...
AST#method_declaration#Left private async initializePage 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 > AS...
private async initializePage(): Promise<void> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Index initializePage - starting'); console.log('[Index] Starting page initialization'); await this.loadBirthdayData(); console.log('[Index] Birthday data loaded'); ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L176-L202
7bbbc992130f162aa149e7f2af471d8297fe5cb4
github
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/default/common/components/myComponent.ets
arkts
MyComponent
首页 “我的”tab子页面
@Component export struct MyComponent { private familyName: string = "xTeam" @Prop userName: string @Prop userPhone: string @Prop userId: string /** * 列表项 */ @Builder MyComponentItem(itemImage:Resource, itemName:Resource) { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MyComponent AST#component_body#Left { AST#property_declaration#Left private familyName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "xT...
@Component export struct MyComponent { private familyName: string = "xTeam" @Prop userName: string @Prop userPhone: string @Prop userId: string @Builder MyComponentItem(itemImage:Resource, itemName:Resource) { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { Image(itemImage).w...
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/default/common/components/myComponent.ets#L20-L107
9677cf0c9a2abb16fa4c7e1518f33df973e63363
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_core/src/main/ets/core/util/ObjectUtil.ets
arkts
@Author csx @DateTime 2023/12/29 20:07 @TODO ObjectUtil 对象工具类 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_core
export class ObjectUtil { /** * 判断两个传入的数值或者是字符串是否相等 * @param source * @param target * @returns */ static equal(source: string | number, target: string | number): boolean { return source === target; } /** * 判断两个传入的数值或者是字符串是否不相等 * @param source * @param target * @returns */ st...
AST#export_declaration#Left export AST#class_declaration#Left class ObjectUtil AST#class_body#Left { /** * 判断两个传入的数值或者是字符串是否相等 * @param source * @param target * @returns */ AST#method_declaration#Left static equal AST#parameter_list#Left ( AST#parameter#Left source : AST#type_annotation#Left AST#union_ty...
export class ObjectUtil { static equal(source: string | number, target: string | number): boolean { return source === target; } static notEqual(source: string | number, target: string | number): boolean { return false == ObjectUtil.equal(source, target); } }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/ObjectUtil.ets#L23-L43
c7e99bcb006f1bb54f6030eebaed283434f3a244
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
Q2/DxinTranslate/entry/src/main/ets/fun/getData.ets
arkts
向外暴露一个函数:给我一个英文标记。返回给你一个对应中文名称
export function getLangaugeText(lang: string): string { // todo: 从 src/main/ets/common/Constants.ets数组中查 let obj: Language = Constants.languageItem.find((item: Language) => item.lang === lang) return obj.chinese }
AST#export_declaration#Left export AST#function_declaration#Left function getLangaugeText AST#parameter_list#Left ( AST#parameter#Left lang : 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 A...
export function getLangaugeText(lang: string): string { let obj: Language = Constants.languageItem.find((item: Language) => item.lang === lang) return obj.chinese }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/Q2/DxinTranslate/entry/src/main/ets/fun/getData.ets#L6-L10
ff9a0396bffa2bf3e9975cf864bcb8fca1b9e63e
gitee
zhangyuhang0914/ArkTs-HarmonyOs.git
c9773cad7ebeee413f98ee1a57cc8fba91fecf7d
entry/src/main/ets/viewmodel/TabViewModel.ets
arkts
let tabViewModel = new TabViewModel() export default tabViewModel as TabViewModel
export default TabViewModel
AST#export_declaration#Left export default AST#expression#Left TabViewModel AST#expression#Right AST#export_declaration#Right
export default TabViewModel
https://github.com/zhangyuhang0914/ArkTs-HarmonyOs.git/blob/c9773cad7ebeee413f98ee1a57cc8fba91fecf7d/entry/src/main/ets/viewmodel/TabViewModel.ets#L58-L58
12e147bd4709bf3955f0b640cf7020002ed50a9c
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/contacts/ContactDetailPage.ets
arkts
buildGreetingHistoryItem
构建祝福历史项
@Builder buildGreetingHistoryItem(history: GreetingHistory) { Column({ space: 4 }) { Row() { Text(history.occasion) .fontSize(12) .fontColor('#666666') Blank() Text(DateUtils.getRelativeTime(history.createdAt)) .fontSize(12) ....
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingHistoryItem AST#parameter_list#Left ( AST#parameter#Left history : AST#type_annotation#Left AST#primary_type#Left GreetingHistory AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#...
@Builder buildGreetingHistoryItem(history: GreetingHistory) { Column({ space: 4 }) { Row() { Text(history.occasion) .fontSize(12) .fontColor('#666666') Blank() Text(DateUtils.getRelativeTime(history.createdAt)) .fontSize(12) ....
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/contacts/ContactDetailPage.ets#L530-L557
b621f4061a18996b49f58f094fe536d683462e50
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/utils/StyleUtils.ets
arkts
getBackgroundColor
获取日期背景色(仅用于月视图和周视图) @param day 日期信息 @param currentSelectDay 当前选择的日期 @param calendarStyle 自定义日历样式 @returns 返回颜色
static getBackgroundColor(day: Day, currentSelectDay: DayInfo, calendarStyle: CalendarStyle): Color | number | string | Resource { const IS_SELECT_DAY: boolean = currentSelectDay.year === day.dayInfo.year && currentSelectDay.month === day.dayInfo.month && currentSelectDay.date === day.dayInfo.date...
AST#method_declaration#Left static getBackgroundColor AST#parameter_list#Left ( AST#parameter#Left day : AST#type_annotation#Left AST#primary_type#Left Day AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left currentSelectDay : AST#type_annotation#Left AST#primary_type#Left DayInfo ...
static getBackgroundColor(day: Day, currentSelectDay: DayInfo, calendarStyle: CalendarStyle): Color | number | string | Resource { const IS_SELECT_DAY: boolean = currentSelectDay.year === day.dayInfo.year && currentSelectDay.month === day.dayInfo.month && currentSelectDay.date === day.dayInfo.date...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/utils/StyleUtils.ets#L89-L102
bdaf13c5ccba14af95fa0ca4a9cc06da1403f8ac
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/modules/auth/AuthService.ets
arkts
getCurrentUser
获取当前用户
getCurrentUser(): UserInfo | null { return this.currentUser; }
AST#method_declaration#Left getCurrentUser AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left UserInfo AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Left...
getCurrentUser(): UserInfo | null { return this.currentUser; }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/modules/auth/AuthService.ets#L196-L198
d5a42966e7634aa5709c2203f7c01614c5833c00
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/services/analytics/AnalyticsService.ets
arkts
getGreetingStats
获取祝福语统计
async getGreetingStats(): Promise<GreetingStats> { const greetings = await this.greetingService.searchGreetings({ pageSize: 10000 }); const totalGenerated = greetings.length; const totalUsed = greetings.reduce((sum, g) => sum + g.usageCount, 0); const averageRating = greetings.length > 0 ? greet...
AST#method_declaration#Left async getGreetingStats 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 GreetingStats AST#primary_type#Right AST#type_annotation#Right >...
async getGreetingStats(): Promise<GreetingStats> { const greetings = await this.greetingService.searchGreetings({ pageSize: 10000 }); const totalGenerated = greetings.length; const totalUsed = greetings.reduce((sum, g) => sum + g.usageCount, 0); const averageRating = greetings.length > 0 ? greet...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/analytics/AnalyticsService.ets#L278-L344
77ca6cd1f7ce95fe58c787b6ccedd8579d1076d1
github
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/player/VHWarmPlayerView.ets
arkts
onVideoFrameSize
视频流播放成功后,回调视频流的宽髙。用户可根据视频流实际宽高,调整播放容器大小。 @param width 视频帧宽度 @param height 视频帧高度
onVideoFrameSize(width: number, height: number){ }
AST#method_declaration#Left onVideoFrameSize AST#parameter_list#Left ( AST#parameter#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left height : AST#type_annotation#Left AST#primary_type#Left number AST#primary_typ...
onVideoFrameSize(width: number, height: number){ }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWarmPlayerView.ets#L222-L224
f7913604c09d7b6392e63f03544434eef9e2df50
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/builder/PlayerSettingBuilder.ets
arkts
sectionStyle
section的样式
@Styles sectionStyle() { .width('100%') .backgroundColor(Color.White) .borderRadius(4) .padding({ left: 4, right:4 }) }
AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right sectionStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#Left . backgroundColo...
@Styles sectionStyle() { .width('100%') .backgroundColor(Color.White) .borderRadius(4) .padding({ left: 4, right:4 }) }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/builder/PlayerSettingBuilder.ets#L121-L130
2782b9ead9209207541f4be35a27995bd8d9ebca
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
完整农历系统设计.ets
arkts
isYearSupported
验证年份是否支持
public static isYearSupported(year: number): boolean { return AuthorityLunarDatabase.lunarYears.has(year); }
AST#method_declaration#Left public static isYearSupported AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST...
public static isYearSupported(year: number): boolean { return AuthorityLunarDatabase.lunarYears.has(year); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/完整农历系统设计.ets#L234-L236
782b978b1c99bccb2fc41a2961b430db6b9d0dcf
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Notification/CustomNotificationPush/entry/src/main/ets/feature/NotificationFilterUtil.ets
arkts
setNotificationEnableFilter
使能和去使能通知过滤功能
setNotificationEnableFilter(enable: boolean) { if (enable) { try { notification.on("checkNotification", this.OnCheckNotification); this.disableContentTypes.fill(false); } catch (error) { logger.error(`notificationManager.on error: ${JSON.stringify(error as Base.BusinessError)}`);...
AST#method_declaration#Left setNotificationEnableFilter AST#parameter_list#Left ( AST#parameter#Left enable : 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#if_statem...
setNotificationEnableFilter(enable: boolean) { if (enable) { try { notification.on("checkNotification", this.OnCheckNotification); this.disableContentTypes.fill(false); } catch (error) { logger.error(`notificationManager.on error: ${JSON.stringify(error as Base.BusinessError)}`);...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Notification/CustomNotificationPush/entry/src/main/ets/feature/NotificationFilterUtil.ets#L46-L64
891114fba09a7768830488c97eb12f244296a016
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets
arkts
digest
摘要 @param str 带摘要的字符串 @param symAlgName 秘钥规格 @param resultCoding 返回结果编码方式(hex/base64) @returns 摘要后的字符串
static digest(str: string, symAlgName: string, resultCoding: buffer.BufferEncoding): OutDTO<string> { //摘要对象 let md = crypto.createMd(symAlgName); //字符串转换的字节流对象 let messageData = new Uint8Array(buffer.from(str, 'utf-8').buffer); let updateLength = 200; // 默认以200字节为单位进行分段update for (let i = 0; i ...
AST#method_declaration#Left static digest 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 symAlgName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static digest(str: string, symAlgName: string, resultCoding: buffer.BufferEncoding): OutDTO<string> { let md = crypto.createMd(symAlgName); let messageData = new Uint8Array(buffer.from(str, 'utf-8').buffer); let updateLength = 200; for (let i = 0; i < messageData.length; i += updateLength) { ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoSyncUtil.ets#L487-L501
9de20c06728e28e71ba197809f2811a37598130e
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Row.ets
arkts
渲染布局 @returns {void} 无返回值 @example RowSpaceEvenlyCenter() { Text("A"); Text("B"); Text("C"); }
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.SpaceEvenly, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginVa...
AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left RowBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expression#L...
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.SpaceEvenly, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginVa...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L604-L619
34cd500a99197e43672aabfc317b4fefccf584fc
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
buildCalendarHeader
日历头部 - 月份导航
@Builder buildCalendarHeader() { Column({ space: 16 }) { // 月份选择器 Row() { // 上个月按钮 Row() { Text('◀') .fontSize(16) .fontColor(this.COLORS.primary) } .padding(8) .backgroundColor(this.COLORS.primaryLight) .borderRadius(8)...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCalendarHeader AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component...
@Builder buildCalendarHeader() { Column({ space: 16 }) { Row() { Row() { Text('◀') .fontSize(16) .fontColor(this.COLORS.primary) } .padding(8) .backgroundColor(this.COLORS.primaryLight) .borderRadius(8) .onClic...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L2471-L2560
f387380dbc39a7d78fb14d8fc3bbf435ab4dbb08
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxMark.ets
arkts
CheckboxMarkBuilder
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain 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 CheckboxMarkBuilder(name: string, param: Object) { CheckboxMarkExample() }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function CheckboxMarkBuilder 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 p...
@Builder export function CheckboxMarkBuilder(name: string, param: Object) { CheckboxMarkExample() }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxMark.ets#L16-L19
3cf31b930fe35557f8e03af9b2c705497bc4c474
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/services/storage/DatabaseService.ets
arkts
query
查询数据 @param tableName 表名 @param columns 查询列 @param whereClause 条件子句 @param whereArgs 条件参数 @param orderBy 排序 @param limit 限制条数 @param offset 偏移量 @returns 查询结果
async query( tableName: string, columns?: Array<string>, whereClause?: string, whereArgs?: Array<string>, orderBy?: string, limit?: number, offset?: number ): Promise<Record<string, relationalStore.ValueType>[]> { try { this.checkInitialized(); const predicates = new...
AST#method_declaration#Left async query AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left columns ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Lef...
async query( tableName: string, columns?: Array<string>, whereClause?: string, whereArgs?: Array<string>, orderBy?: string, limit?: number, offset?: number ): Promise<Record<string, relationalStore.ValueType>[]> { try { this.checkInitialized(); const predicates = new...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/storage/DatabaseService.ets#L306-L368
24cbcb2aafeb22c922e9a79da86ec7864da290cd
github
wenfujing/honms-super-market.git
0858abecd8be5db7b8dcf88dcd77b7c66d37517a
common/src/main/ets/utils/LocalDataManager.ets
arkts
deleteShopCart
Delete data from shopCartData by ids. @param ids deleted id @returns Product[]
deleteShopCart(ids: string[]) { ids.forEach((id: string) => { const result = this.shopCartData.filter((item: Product) => item.id === id); if (result.length > 0) { this.shopCartData.splice(this.shopCartData.indexOf(result[0]), 1); } }); return this.shopCartData; }
AST#method_declaration#Left deleteShopCart AST#parameter_list#Left ( AST#parameter#Left ids : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#...
deleteShopCart(ids: string[]) { ids.forEach((id: string) => { const result = this.shopCartData.filter((item: Product) => item.id === id); if (result.length > 0) { this.shopCartData.splice(this.shopCartData.indexOf(result[0]), 1); } }); return this.shopCartData; }
https://github.com/wenfujing/honms-super-market.git/blob/0858abecd8be5db7b8dcf88dcd77b7c66d37517a/common/src/main/ets/utils/LocalDataManager.ets#L93-L101
e8b3dca42a33289f34e7dac7309833779fd9cdab
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/components/JhToast.ets
arkts
showToast
/ 系统Toast
public static showToast(loadingText: ResourceStr) { promptAction.showToast({ message: loadingText, duration: _closeTime, alignment: _alignment, offset: _offset, }) }
AST#method_declaration#Left public static showToast AST#parameter_list#Left ( AST#parameter#Left loadingText : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statem...
public static showToast(loadingText: ResourceStr) { promptAction.showToast({ message: loadingText, duration: _closeTime, alignment: _alignment, offset: _offset, }) }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhToast.ets#L29-L36
cbda264599af6931b0cb89db124b1e345c3ffffd
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/DialogUtil.ets
arkts
showAlertDialog
弹出一个警告提示框 @param options { msg:警告消息, title:提示标题默认为(警告提示), subtitle:副标题, autoCancel:点击遮罩是否自动关闭默认为(false), alignment:弹框对齐方式默认为(底部Bottom), gridCount:宽度所占用栅格数默认为10, buttons:按钮, offset:弹窗相对alignment所在位置的偏移量, maskRect:弹窗遮蔽层区域 } @Param buttons:AlertDialogBtn 弹框按钮类只允许有两个第一个为确认按按,第二个为取消按钮 @Param AlertDialogBtn { value:按钮值 fontC...
static showAlertDialog(options?: AlertOption) { //设置默认值 const defaultButtons = new Array<AlertDialogBtn>(); //如果没传则初始化 if (!options) { options = new AlertOption(); } if (!options.subtitle) { options.subtitle = ''; } if (!options.title) { options.title = Const.ALERT_TIT...
AST#method_declaration#Left static showAlertDialog AST#parameter_list#Left ( AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AlertOption AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { //设置默认值 AST#statement#Left AST...
static showAlertDialog(options?: AlertOption) { const defaultButtons = new Array<AlertDialogBtn>(); if (!options) { options = new AlertOption(); } if (!options.subtitle) { options.subtitle = ''; } if (!options.title) { options.title = Const.ALERT_TITLE; } if ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/DialogUtil.ets#L142-L247
9f06bdb727c5da771e651a7ea52496f9061d083f
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/base/src/main/ets/viewmodel/BaseNetWorkViewModel.ets
arkts
aboutToAppear
页面出现时的生命周期回调 @returns {void} 无返回值
aboutToAppear(): void { this.executeRequest(); }
AST#method_declaration#Left 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#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression...
aboutToAppear(): void { this.executeRequest(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/base/src/main/ets/viewmodel/BaseNetWorkViewModel.ets#L39-L41
10ef6891a7de5d546e73cd93f511b6b835886843
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
SimpleChatList/entry/src/main/ets/pages/EdgeBlur.ets
arkts
overlayBuilder
[Start linearGradient]
@Builder overlayBuilder() { Stack().height('100%').height('100%') .linearGradient({ direction: GradientDirection.Bottom, // Gradient direction. colors: [[0x00000000, 0.0], [0xB3000000, 1.0]] }) .blendMode(BlendMode.DST_IN, BlendApplyType.OFFSCREEN) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right overlayBuilder 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 Stack ( ) AST#ui_component#Right AST#modifier_chain_express...
@Builder overlayBuilder() { Stack().height('100%').height('100%') .linearGradient({ direction: GradientDirection.Bottom, colors: [[0x00000000, 0.0], [0xB3000000, 1.0]] }) .blendMode(BlendMode.DST_IN, BlendApplyType.OFFSCREEN) }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/SimpleChatList/entry/src/main/ets/pages/EdgeBlur.ets#L23-L31
6ed91a87751e9f6926d9423b4eae920fe69d4b2b
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/others/DnsResolve/entry/src/main/ets/pages/Index.ets
arkts
resolveHost
解析域名
async resolveHost() { let netHandle = connection.getDefaultNetSync(); let addrList: ArrayList<string> = new ArrayList<string>(); await netHandle.getAddressesByName(this.hostName) .then(data => { //解析结果有一些重复的ip,这里进行去重 for (let i = 0; i < data.length; i++) { if (!addrList.has(d...
AST#method_declaration#Left async resolveHost AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left netHandle = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expr...
async resolveHost() { let netHandle = connection.getDefaultNetSync(); let addrList: ArrayList<string> = new ArrayList<string>(); await netHandle.getAddressesByName(this.hostName) .then(data => { for (let i = 0; i < data.length; i++) { if (!addrList.has(data[i].address)) { ...
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/others/DnsResolve/entry/src/main/ets/pages/Index.ets#L71-L92
289af3a5ab1e350999153d1eb66b226832401b18
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/MusicHome-master/features/musicList/src/main/ets/lyric/LyricConst.ets
arkts
Lyrics scrolling effect.
export const enum LyricScrollEffect { /** * Full line scrolling */ Line, /** * Gradient Color */ LetterGradient, /** * Single character scaling and gradation. */ LetterScaleGradient, /** * Star scrolling style. */ LetterStar }
AST#export_declaration#Left export AST#enum_declaration#Left const enum LyricScrollEffect AST#enum_body#Left { /** * Full line scrolling */ AST#enum_member#Left Line AST#enum_member#Right , /** * Gradient Color */ AST#enum_member#Left LetterGradient AST#enum_member#Right , /** * Single character scaling ...
export const enum LyricScrollEffect { Line, LetterGradient, LetterScaleGradient, LetterStar }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MusicHome-master/features/musicList/src/main/ets/lyric/LyricConst.ets#L19-L39
f1d55a29eb2bfff594cff33a299cefc17260fca7
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets
arkts
buildGreetingEditor
构建祝福语编辑器
@Builder buildGreetingEditor() { Column({ space: 12 }) { Row() { Text('祝福语内容') .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutWeight(1) // 样式选择按钮 Button(this.getStyleLabel(this.selectedStyle)) .type...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingEditor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component...
@Builder buildGreetingEditor() { Column({ space: 12 }) { Row() { Text('祝福语内容') .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutWeight(1) Button(this.getStyleLabel(this.selectedStyle)) .type(ButtonTy...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/greetings/GreetingSendPage.ets#L309-L385
cdc4d1f1ba88d2304fe3e7321c0dd42d827b2fff
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/vibrateeffect/src/main/ets/VibrateEffect.ets
arkts
startAnimation
触发提示文本抖动动画效果
startAnimation() { if (!this.uiContext) { return; } this.translateX = CONFIGURATION.POSITION_ZERO; // TODO: 知识点:通过keyframeAnimateTo关键帧动画指定状态变化过渡动效 this.uiContext.keyframeAnimateTo({ iterations: CONFIGURATION.PLAYBACK_COUNT }, [ { // 第一段动画时长为100ms,translateX属性从0到5 duration...
AST#method_declaration#Left startAnimation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_...
startAnimation() { if (!this.uiContext) { return; } this.translateX = CONFIGURATION.POSITION_ZERO; this.uiContext.keyframeAnimateTo({ iterations: CONFIGURATION.PLAYBACK_COUNT }, [ { duration: CONFIGURATION.ANIMATION_TIME, event: () => { this.translateX...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/vibrateeffect/src/main/ets/VibrateEffect.ets#L70-L92
fff422957887210f998218615b81baa3e54ef458
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/flow_sensitive/loop_stmt/for_002_F.ets
arkts
Introduction 循环结构-for
export function for_002_F(taint_src : string) { let res = "" for (let i = 0; i < 1; i++) { taint.Sink(res) res = taint_src } }
AST#export_declaration#Left export AST#function_declaration#Left function for_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AS...
export function for_002_F(taint_src : string) { let res = "" for (let i = 0; i < 1; i++) { taint.Sink(res) res = taint_src } }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/flow_sensitive/loop_stmt/for_002_F.ets#L6-L12
b6f5e3f51d6f12b907b3d08869850d71c40bc1a5
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
entry/src/main/ets/pages/index/DialogPage.ets
arkts
showBindSheet
显示自定义半模态
showBindSheet(index: number) { // let targetId = this.getUniqueId(); let targetId = "10001"; //自定义一个底部的MenuLayout let menuOptions: MenuSheetOptions = { dialogId: DialogHelper.generateId(), title: { title: "分享我的动态", }, detents: [SheetSize.FIT_CONTENT, SheetSize.MEDIUM, Sh...
AST#method_declaration#Left showBindSheet 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 { // let targetId = this.getUniqueId(); AST#statem...
showBindSheet(index: number) { let targetId = "10001"; let menuOptions: MenuSheetOptions = { dialogId: DialogHelper.generateId(), title: { title: "分享我的动态", }, detents: [SheetSize.FIT_CONTENT, SheetSize.MEDIUM, SheetSize.FIT_CONTENT], borderWidth: 10, border...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/pages/index/DialogPage.ets#L953-L976
c5f59f7ef50dbe1855cc5b6e29a218bb3ca9afad
gitee
Hyricane/Interview_Success.git
9783273fe05fc8951b99bf32d3887c605268db8f
entry/src/main/ets/models/index.ets
arkts
排序方式的枚举
export enum SortType { Default = 0, Easy2Hard = 10, Hard2Easy = 11, Low2High = 20, High2Low = 21, Recommend = 30 }
AST#export_declaration#Left export AST#enum_declaration#Left enum SortType AST#enum_body#Left { AST#enum_member#Left Default = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left Easy2Hard = AST#expression#Left 10 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left Hard...
export enum SortType { Default = 0, Easy2Hard = 10, Hard2Easy = 11, Low2High = 20, High2Low = 21, Recommend = 30 }
https://github.com/Hyricane/Interview_Success.git/blob/9783273fe05fc8951b99bf32d3887c605268db8f/entry/src/main/ets/models/index.ets#L38-L45
a90b91251bb8769a1e8b5285669a103bf161fa6f
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/model/src/main/ets/request/PasswordLoginRequest.ets
arkts
构造函数 @param {string} phone - 手机号 @param {string} password - 密码
constructor(phone: string = "", password: string = "") { this.phone = phone; this.password = password; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left phone : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "" AST#expression#Right AST#parameter#Right , AST#parameter#Left password : AST#type_annotation#L...
constructor(phone: string = "", password: string = "") { this.phone = phone; this.password = password; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/model/src/main/ets/request/PasswordLoginRequest.ets#L20-L23
b2a3b2665f98a0f6de67435b204d31344e4be30b
github
JHB11Hinson/mineMointorAPP.git
b6b853cf534021ac39e66c9b3a35113896a272b2
entry/src/main/ets/common/utils/Request.ets
arkts
post
POST 请求 @param url 接口地址 @param data 请求体数据
static async post<T>(url: string, data?: Object): Promise<T> { // 显式传入三个泛型:<T, R, D> return instance.post<T, T, Object>(url, data); }
AST#method_declaration#Left static async post AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#...
static async post<T>(url: string, data?: Object): Promise<T> { return instance.post<T, T, Object>(url, data); }
https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/common/utils/Request.ets#L39-L42
b4baeea33c89cb728692496a0afe81b1a78206c6
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement_nowear_api12/entry/src/main/ets/MainAbility/common/MessageManager.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export type Callback = (message: ESObject) => void
AST#export_declaration#Left export AST#type_declaration#Left type Callback = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ESObject AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter...
export type Callback = (message: ESObject) => void
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement_nowear_api12/entry/src/main/ets/MainAbility/common/MessageManager.ets#L15-L15
d18d326104d59b0da82ce958316508c6ae2c3f56
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
arkts/@arkts.collections.d.ets
arkts
from
Creates an ArkTS Array from an iterable object. @param { Iterable<T> } iterable - An iterable object to convert to an ArkTS Array. @returns { Array<T> } A new Array instance @throws { BusinessError } 401 - Parameter error. @throws { BusinessError } 10200011 - The from method cannot be bound. @static @syscap SystemCapa...
static from<T>(iterable: Iterable<T>): Array<T>;
AST#method_declaration#Left static from AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left iterable : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Iterable AST#type_arguments#Left < AST#type_annot...
static from<T>(iterable: Iterable<T>): Array<T>;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.collections.d.ets#L507-L507
b83993564d23e0f4589730d84a63b13830f5e613
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/model/AlertOptions.ets
arkts
TODO 操作确认类弹出框,参数类 author: 桃花镇童长老ᥫ᭡ since: 2024/08/18
export interface AlertOptions extends HmDialogOptions { primaryTitle?: ResourceStr; //确认框一级标题。 secondaryTitle?: ResourceStr; //确认框二级标题。 }
AST#export_declaration#Left export AST#interface_declaration#Left interface AlertOptions AST#extends_clause#Left extends HmDialogOptions AST#extends_clause#Right AST#object_type#Left { AST#type_member#Left primaryTitle ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annota...
export interface AlertOptions extends HmDialogOptions { primaryTitle?: ResourceStr; secondaryTitle?: ResourceStr; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/model/AlertOptions.ets#L23-L28
4553e5b627c5e1bee4886b9d69ca5b8ca5a0827d
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets
arkts
clearLearnTimes
====== 清空学习次数 ======
async clearLearnTimes(): Promise<void> { if (!this.db) return; const sql = `UPDATE ${Tables.Learn.NAME} SET ${Tables.Learn.Col.LEARN_TIMES} = 0`; await this.db.updateDb(sql); }
AST#method_declaration#Left async clearLearnTimes 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 clearLearnTimes(): Promise<void> { if (!this.db) return; const sql = `UPDATE ${Tables.Learn.NAME} SET ${Tables.Learn.Col.LEARN_TIMES} = 0`; await this.db.updateDb(sql); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/myData/WordUserDbAccess.ets#L481-L486
432d00f25be3b5153a2016c8b5146f0e87dcd7de
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/products/entry/src/main/ets/pages/mine/MineView.ets
arkts
showDevelopingToast
显示开发中提示
private showDevelopingToast() { showToast('此功能开发中'); }
AST#method_declaration#Left private showDevelopingToast AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left showToast ( AST#expression#Left '此功能开发中' AST#expression#Right ) ; AST#ui_custom_component_statement#Right } AST#builder_function_body#Right...
private showDevelopingToast() { showToast('此功能开发中'); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/products/entry/src/main/ets/pages/mine/MineView.ets#L142-L144
4d8680245adc592735200a7b6c76ccb44f69791a
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets
arkts
ensureMigrated
确保搜索历史表完成迁移 @returns {void} 无返回
private ensureMigrated(): void { if (!SearchHistoryLocalDataSourceImpl.migrated) { this.orm.migrate(SearchHistoryEntity); SearchHistoryLocalDataSourceImpl.migrated = true; } }
AST#method_declaration#Left private ensureMigrated 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#m...
private ensureMigrated(): void { if (!SearchHistoryLocalDataSourceImpl.migrated) { this.orm.migrate(SearchHistoryEntity); SearchHistoryLocalDataSourceImpl.migrated = true; } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets#L32-L37
59ba7234b367c1f4ca9878825ed6f852131773c8
github
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Train route.
export enum TrainsLine { LINE_ONE = 0, LINE_TWO = 1, LINE_THREE = 2, }
AST#export_declaration#Left export AST#enum_declaration#Left enum TrainsLine AST#enum_body#Left { AST#enum_member#Left LINE_ONE = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LINE_TWO = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LIN...
export enum TrainsLine { LINE_ONE = 0, LINE_TWO = 1, LINE_THREE = 2, }
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/common/constants/CommonConstants.ets#L539-L543
b71e61d3aa219128ede0ece96ea1295703b62aa8
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/common/Route.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 Route { title: string; name: string; items?: Route[]; description?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface Route AST#object_type#Left { AST#type_member#Left title : 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 name : AST#type_annotation#Left AST#pr...
export interface Route { title: string; name: string; items?: Route[]; description?: string; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/common/Route.ets#L16-L21
8487cad8712fdf1724c6c28357c3e4d8c4a51140
gitee
nutsus/nut-jokes
1dc09db3e87922ae4a8edb59017b63ddbe899f40
entry/src/main/ets/MainAbility/model/jokeDetailModel.ets
arkts
Copyright (c) 2021 JianGuo Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
export class JokeDetailData { content: string // 内容 hashId: string // 哈希值 unixtime: number // updatetime: string //更新时间 }
AST#export_declaration#Left export AST#class_declaration#Left class JokeDetailData AST#class_body#Left { AST#property_declaration#Left content AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right // 内容 AST#ERROR#Left h as hId AST#ERROR#R...
export class JokeDetailData { content: string hashId: string unixtime: number updatetime: string 更新时间 }
https://github.com/nutsus/nut-jokes/blob/1dc09db3e87922ae4a8edb59017b63ddbe899f40/entry/src/main/ets/MainAbility/model/jokeDetailModel.ets#L17-L24
58b05f76279c19148a05c858498aac3eb47a09db
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setLabelCount
sets the number of label entries for the y-axis max = 25, min = 2, default: 6, be aware that this number is not fixed (if force == false) and can only be approximated. @param count the number of y-axis labels that should be displayed @param force if enabled, the set label count will be forced, meaning that the exact s...
public setLabelCount(count: number, force?: boolean): void { if (count > this.getAxisMaxLabels()) count = this.getAxisMaxLabels(); if (count < this.getAxisMinLabels()) count = this.getAxisMinLabels(); this.mLabelCount = count; this.mForceLabels = false; if (force != null || force != unde...
AST#method_declaration#Left public setLabelCount AST#parameter_list#Left ( AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left force ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#prima...
public setLabelCount(count: number, force?: boolean): void { if (count > this.getAxisMaxLabels()) count = this.getAxisMaxLabels(); if (count < this.getAxisMinLabels()) count = this.getAxisMinLabels(); this.mLabelCount = count; this.mForceLabels = false; if (force != null || force != unde...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L366-L376
bd9d21c6e49a5c34abcc8fa24ea810c971505be8
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/ImageProcessing-master/scenes/picture_beautification/src/main/ets/components/StickerComponent.ets
arkts
aboutToAppear
删除回调
aboutToAppear(): void { this.clearTimer() this.borderShow = true this.timerId = setTimeout(() => { this.borderShow = false }, 2000) }
AST#method_declaration#Left 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#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression...
aboutToAppear(): void { this.clearTimer() this.borderShow = true this.timerId = setTimeout(() => { this.borderShow = false }, 2000) }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/ImageProcessing-master/scenes/picture_beautification/src/main/ets/components/StickerComponent.ets#L12-L18
c574fbbe91462e23deb6ba537b586cd3e5a68072
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets
arkts
time range
export const DEFAULT_TIME: string = '08:00';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left DEFAULT_TIME : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '08:00' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar...
export const DEFAULT_TIME: string = '08:00';
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets#L56-L56
b4e2472e6e7ae6b9be1dbb790c66ffbe574f2e3d
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/social/SearchPage.ets
arkts
buildSearchResults
构建搜索结果
@Builder buildSearchResults() { Scroll() { Column({ space: 16 }) { // 结果统计 Text(`找到 ${this.searchResults.total} 个相关结果`) .fontSize(14) .fontColor($r('app.color.text_secondary')) .width('100%') .padding({ left: 16, right: 16 }) switch (this.sele...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSearchResults AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left Scroll AST#expression#Right AST#ERROR#Left ( ) { Column ( AST#component_parameters#Le...
@Builder buildSearchResults() { Scroll() { Column({ space: 16 }) { Text(`找到 ${this.searchResults.total} 个相关结果`) .fontSize(14) .fontColor($r('app.color.text_secondary')) .width('100%') .padding({ left: 16, right: 16 }) switch (this.selectedTyp...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/social/SearchPage.ets#L417-L436
67acbf8d2284a28de634889215116809907196ea
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.TreeView.d.ets
arkts
Declare class TreeListener @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare class TreeListener @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
export declare class TreeListener { /** * Event registration and processing. * The event will not be destroyed after being processed. * * @param { type } event Registered Events. * @param { callback }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * ...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class TreeListener AST#class_body#Left { /** * Event registration and processing. * The event will not be destroyed after being processed. * * @param { type } event Registered Events. * @param {...
export declare class TreeListener { on(type: TreeListenType, callback: (callbackParam: CallbackParam) => void): void; once(type: TreeListenType, callback: (callbackParam: CallbackParam) => void): void; off(type: TreeListenType, callback?: (callbackParam: CallbackParam) => voi...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TreeView.d.ets#L114-L175
d1fc94db35402bfbead12c5d461292eed9d3085f
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/demo/entry/src/main/ets/views/FocusPage.ets
arkts
FocusPage
曝光选择
@Component export struct FocusPage { @Link focusPointBol: boolean; @Link focusPointVal: Array<number>; // 刻度、焦距值 和 对焦框不能共存的显示 @Link exposureBol: boolean; // 曝光值 @Link exposureNum: number; build() { if (this.focusPointBol) { Row() { if (this.exposureBol) { // 对焦框 Flex...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FocusPage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right focusPointBol : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_an...
@Component export struct FocusPage { @Link focusPointBol: boolean; @Link focusPointVal: Array<number>; @Link exposureBol: boolean; @Link exposureNum: number; build() { if (this.focusPointBol) { Row() { if (this.exposureBol) { Flex({ direction: FlexDirection.Column...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/demo/entry/src/main/ets/views/FocusPage.ets#L17-L142
6c9a0d0833c831e444317ee44563152e1e916398
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
aboutToAppear
页面出现生命周期 @returns {void} 无返回值
aboutToAppear(): void { if (this.shouldLoadAddress()) { this.executeRequest(); return; } this.initCreateMode(); }
AST#method_declaration#Left 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#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#...
aboutToAppear(): void { if (this.shouldLoadAddress()) { this.executeRequest(); return; } this.initCreateMode(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L119-L125
2381cdcc4c0679c661738197aa7cd250bf1cb23a
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets
arkts
分类数据
export const mockCategories: Category[] = [ { id: 1, name: '手机', pic: 'https://picsum.photos/100/100?random=11' }, { id: 2, name: '服装', pic: 'https://picsum.photos/100/100?random=12' }, { id: 3, name: '电脑', pic: 'https://picsum.photos/100/100?random=13' }, { id: 4, name: '优惠', pic: 'https://picsum.photos/100/10...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left mockCategories : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Category [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#ex...
export const mockCategories: Category[] = [ { id: 1, name: '手机', pic: 'https://picsum.photos/100/100?random=11' }, { id: 2, name: '服装', pic: 'https://picsum.photos/100/100?random=12' }, { id: 3, name: '电脑', pic: 'https://picsum.photos/100/100?random=13' }, { id: 4, name: '优惠', pic: 'https://picsum.photos/100/10...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets#L27-L38
fb672ab3dd09ceb2a155aa7a80e9e5d20cf7fc82
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets
arkts
prebuild
[EndExclude builder_node_pool] [StartExclude builder_node_pool]
prebuild(uiContext: UIContext) { this.node = new BuilderNode(uiContext); this.node.build(this.builder, this.data); }
AST#method_declaration#Left prebuild 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#builder_function_body#Left { AST#expression_statement#Left AST#expres...
prebuild(uiContext: UIContext) { this.node = new BuilderNode(uiContext); this.node.build(this.builder, this.data); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets#L56-L59
8342d25497e6eac8490353df0b49f2b59d8ae161
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customkeyboardtoh5/src/main/ets/view/CustomKeyboardToH5.ets
arkts
浏览器对象
build() { Column() { TabletTitle({ browser: $browser }) Progress({ value: this.browser.progress, total: PROGRESS_TOTAL }) .color($r('app.color.custom_keyboard_to_h5_progress_color')) .visibility(this.browser.hideProgress ? Visibility.None : Visibility.Visible) Divider() .co...
AST#build_method#Left build ( ) AST#build_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_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left TabletTitle ( AST#component_parameters#Left { AST#compo...
build() { Column() { TabletTitle({ browser: $browser }) Progress({ value: this.browser.progress, total: PROGRESS_TOTAL }) .color($r('app.color.custom_keyboard_to_h5_progress_color')) .visibility(this.browser.hideProgress ? Visibility.None : Visibility.Visible) Divider() .co...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customkeyboardtoh5/src/main/ets/view/CustomKeyboardToH5.ets#L34-L46
dc3d47d7faad75f7aa3c002d5147256429098100
gitee
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/view/HomeComponent.ets
arkts
allSize
match parent
@Styles function allSize() { .width(Const.THOUSANDTH_1000) .height(Const.THOUSANDTH_1000) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right function allSize AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#member_expression#Left AST#expression#Left Const AST#expressi...
@Styles function allSize() { .width(Const.THOUSANDTH_1000) .height(Const.THOUSANDTH_1000) }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/view/HomeComponent.ets#L14-L18
75dabe154045a632b8acca5745a8cdded45dcf69
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/lineCharts/LineChartPage.ets
arkts
menuCallback
标题栏菜单回调
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } if (this.model === null || this.model === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index...
AST#method_declaration#Left AST#decorator#Left @ Monitor ( AST#expression#Left "titleModel.index" AST#expression#Right ) AST#decorator#Right menuCallback AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression...
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } if (this.model === null || this.model === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/lineCharts/LineChartPage.ets#L301-L326
013e07195e3e5d26caf869d1ec40ed9331c02868
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/sidebaranimation/src/main/ets/constants/SideBarAnimationViewConstants.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class SideBarAnimationViewConstants { static readonly SIDEBAR_ANIMATION_DURATION: number = 500; static readonly SIDEBAR_WIDTH: number = 200; static readonly GROUP_NAME_FONT_WEIGHT: number = 16; static readonly MEMBER_COUNT: number = 10; static readonly SIDEBAR_OPACITY_SHOW: number = 1; static readonl...
AST#export_declaration#Left export AST#class_declaration#Left class SideBarAnimationViewConstants AST#class_body#Left { AST#property_declaration#Left static readonly SIDEBAR_ANIMATION_DURATION : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left ...
export class SideBarAnimationViewConstants { static readonly SIDEBAR_ANIMATION_DURATION: number = 500; static readonly SIDEBAR_WIDTH: number = 200; static readonly GROUP_NAME_FONT_WEIGHT: number = 16; static readonly MEMBER_COUNT: number = 10; static readonly SIDEBAR_OPACITY_SHOW: number = 1; static readonl...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/sidebaranimation/src/main/ets/constants/SideBarAnimationViewConstants.ets#L16-L26
da66752db17c9185146473d717214fe8c6317742
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/MyMath.ets
arkts
toRadians
Converts an angle measured in degrees to an approximately equivalent angle measured in radians. The conversion from degrees to radians is generally inexact. @param angdeg an angle, in degrees @return the measurement of the angle {@code angdeg} in radians.
public static toRadians(ang: number): number { return ang * MyMath.degrees; }
AST#method_declaration#Left public static toRadians AST#parameter_list#Left ( AST#parameter#Left ang : 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 number AST#primary...
public static toRadians(ang: number): number { return ang * MyMath.degrees; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/MyMath.ets#L37-L39
65c70817f4c331a27000081299c8acab383592a9
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/tls/Tls2Way/entry/src/main/ets/pages/Index.ets
arkts
loadCert
加载客户端证书文件内容
loadCert() { try { this.cert = this.readStringFromFile(certFileUri) this.certLoaded = true } catch (e) { this.msgHistory += 'readText failed ' + e.message + "\r\n"; } }
AST#method_declaration#Left loadCert AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST...
loadCert() { try { this.cert = this.readStringFromFile(certFileUri) this.certLoaded = true } catch (e) { this.msgHistory += 'readText failed ' + e.message + "\r\n"; } }
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tls/Tls2Way/entry/src/main/ets/pages/Index.ets#L331-L339
30cdc3e3b7d000e956e4be8c34ee04a4bf43c3d7
gitee
JHB11Hinson/mineMointorAPP.git
b6b853cf534021ac39e66c9b3a35113896a272b2
entry/src/main/ets/model/HomeModel.ets
arkts
历史记录接口
export interface RecordItem { id: number; handler: string; source: string; result: string; time: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface RecordItem AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left handler : AST#type_annotation#Left A...
export interface RecordItem { id: number; handler: string; source: string; result: string; time: string; }
https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/model/HomeModel.ets#L21-L27
28f0002fa397a4f092aa5c4c1505070ac136bc9b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/GameificationService.ets
arkts
calculateUserLevel
计算用户等级
private calculateUserLevel(experience: number): UserLevel { for (let i = this.levelConfig.length - 1; i >= 0; i--) { if (experience >= this.levelConfig[i].requiredExp) { return this.levelConfig[i]; } } return this.levelConfig[0]; }
AST#method_declaration#Left private calculateUserLevel AST#parameter_list#Left ( AST#parameter#Left experience : 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 UserLeve...
private calculateUserLevel(experience: number): UserLevel { for (let i = this.levelConfig.length - 1; i >= 0; i--) { if (experience >= this.levelConfig[i].requiredExp) { return this.levelConfig[i]; } } return this.levelConfig[0]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L689-L696
43ba6d895bc577cdd330e5d16863770284d933b7
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/ui/chart/BaseChart.ets
arkts
基础图表组件 支持折线图、柱状图、饼图等
export interface ChartData { label: string; value: number; color?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ChartData AST#object_type#Left { AST#type_member#Left label : 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 value : AST#type_annotation#Left A...
export interface ChartData { label: string; value: number; color?: string; }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/ui/chart/BaseChart.ets#L5-L9
abc6d24384a289dd869c4642be4aa713da2861b6
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/component/TextInputDialogView.ets
arkts
getVpByStr
获取vp数据 @param str @returns
private getVpByStr(str: string): number { if (str.toLowerCase().endsWith('vp')) { str = str.replaceAll('vp', ''); return parseInt(str); } else if (str.toLowerCase().endsWith('px')) { str = str.replaceAll('px', ''); return px2vp(parseInt(str)); } else if (str.toLowerCase().endsWith('...
AST#method_declaration#Left private getVpByStr 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 number AST#primary_type...
private getVpByStr(str: string): number { if (str.toLowerCase().endsWith('vp')) { str = str.replaceAll('vp', ''); return parseInt(str); } else if (str.toLowerCase().endsWith('px')) { str = str.replaceAll('px', ''); return px2vp(parseInt(str)); } else if (str.toLowerCase().endsWith('...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/component/TextInputDialogView.ets#L226-L242
1a67d0364d8f4c4190e538bd90f618715941a49b
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/CryptoUtil.ets
arkts
TODO 加解密公用工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/07/01
export class CryptoUtil { /** * 加密,异步 * @param data 加密或者解密的数据。data不能为null。 * @param key 指定加密或解密的密钥。 * @param params 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 * @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合。 * @returns */ static async encrypt(data...
AST#export_declaration#Left export AST#class_declaration#Left class CryptoUtil AST#class_body#Left { /** * 加密,异步 * @param data 加密或者解密的数据。data不能为null。 * @param key 指定加密或解密的密钥。 * @param params 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 * @param transformation 待生成Cipher的算法名...
export class CryptoUtil { static async encrypt(data: cryptoFramework.DataBlob, key: cryptoFramework.Key, params: cryptoFramework.ParamsSpec | null, transformation: string): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await cipher.init(cryptoFramework...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L26-L652
1c9cbb872b52c2210cadccf736d30f59cdd3f4a4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/universal/UniversialData.ets
arkts
univesal/properties/InteractionSample
export let placementsNameData = ['TopLeft', 'Top', 'TopRight', 'RightTop', 'Right', 'RightBottom', 'LeftTop', 'Left', 'LeftBottom', 'BottomLeft', 'Bottom', 'BottomRight'];
AST#export_declaration#Left export AST#variable_declaration#Left let AST#variable_declarator#Left placementsNameData = AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'TopLeft' AST#expression#Right , AST#expression#Left 'Top' AST#expression#Right , AST#expression#Left 'TopRight' AST#expression#Right , ...
export let placementsNameData = ['TopLeft', 'Top', 'TopRight', 'RightTop', 'Right', 'RightBottom', 'LeftTop', 'Left', 'LeftBottom', 'BottomLeft', 'Bottom', 'BottomRight'];
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/universal/UniversialData.ets#L292-L292
7581a439034ed282514062435c5ea2a6ffee871c
gitee
conradsheeran/steam-totp.git
af0eba089e77ff73e6983ce61fa89190c628721e
src/main/ets/pages/SteamTOTP.ets
arkts
generateConfirmationCode
生成用于移动交易确认的 base64 确认密钥。该密钥只能使用一次。 @param identitySecret - 启用双重身份验证时获得的 identity_secret @param time - 生成 secret 的 Unix 时间戳,通常为当前时间 @param tag - 标识请求的标签,例如 "conf"、"details"、"allow"、"cancel" @returns { string }
public static async generateConfirmationCode(identitySecret: buffer.Buffer | string, time: number, tag: string): Promise<string> { const secretBuffer: buffer.Buffer = SteamTOTP.SecretToBuffer(identitySecret); const data = buffer.alloc(8 + buffer.byteLength(tag)); data.writeBigUInt64BE(BigInt(time), 0); ...
AST#method_declaration#Left public static async generateConfirmationCode AST#parameter_list#Left ( AST#parameter#Left identitySecret : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left buffer . Buffer AST#qualified_type#Right AST#primary_type#Right | AST#primary_type#Left string...
public static async generateConfirmationCode(identitySecret: buffer.Buffer | string, time: number, tag: string): Promise<string> { const secretBuffer: buffer.Buffer = SteamTOTP.SecretToBuffer(identitySecret); const data = buffer.alloc(8 + buffer.byteLength(tag)); data.writeBigUInt64BE(BigInt(time), 0); ...
https://github.com/conradsheeran/steam-totp.git/blob/af0eba089e77ff73e6983ce61fa89190c628721e/src/main/ets/pages/SteamTOTP.ets#L94-L105
b6f49e501bb6de424eeb49e781d36f910913a5c0
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/analytics/ReportsPage.ets
arkts
buildSearchAndFilter
构建搜索和筛选
@Builder buildSearchAndFilter() { Column({ space: 12 }) { // 搜索框 Row({ space: 8 }) { Image($r('app.media.ic_search')) .width('20vp') .height('20vp') .fillColor($r('app.color.text_secondary')) TextInput({ text: this.searchText, placeholder: '搜索报告...' }) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSearchAndFilter AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen...
@Builder buildSearchAndFilter() { Column({ space: 12 }) { Row({ space: 8 }) { Image($r('app.media.ic_search')) .width('20vp') .height('20vp') .fillColor($r('app.color.text_secondary')) TextInput({ text: this.searchText, placeholder: '搜索报告...' }) ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/analytics/ReportsPage.ets#L191-L271
5a1bd40d1beb18172d72bb508b49a5614d922323
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pipwindow/src/main/ets/model/PipManager.ets
arkts
getInstance
视频播放控制器对象
public static getInstance(): PipManager { return PipManager.instance; }
AST#method_declaration#Left public static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left PipManager AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#m...
public static getInstance(): PipManager { return PipManager.instance; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pipwindow/src/main/ets/model/PipManager.ets#L46-L48
04ecc4b573e89a7bc0ba4406edbea8137880fc29
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/api/Router.ets
arkts
popToRootWithResult
@deprecated @see {ZRouter.getInstance().popToRootWithResult} @param result @param animated
public static popToRootWithResult<T>(result: T, animated: boolean = true) { ZRouter.getRouterMgr().popToRootWithResult<T>(result, animated) }
AST#method_declaration#Left public static popToRootWithResult AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left result : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right ...
public static popToRootWithResult<T>(result: T, animated: boolean = true) { ZRouter.getRouterMgr().popToRootWithResult<T>(result, animated) }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L478-L480
a3b04759c42e0007838bc8a9c6b47963e9baf49c
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/constants/ShowToast.ets
arkts
Display the toast message based on the prompt character string or BusinessError. @param error Prompt character string or BusinessError.
export function showToast(error: BusinessError | string) { const message: string = typeof error === 'string' ? error : getErrorHint(error); promptAction.showToast({ message, duration: 2000 }); }
AST#export_declaration#Left export AST#function_declaration#Left function showToast AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left BusinessError AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#...
export function showToast(error: BusinessError | string) { const message: string = typeof error === 'string' ? error : getErrorHint(error); promptAction.showToast({ message, duration: 2000 }); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/constants/ShowToast.ets#L20-L26
a4e3bc9da28a740485f6d752792e94dbb70c46a1
github
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/store.ets
arkts
formatTime
格式化时间为 HH:MM:SS
formatTime(seconds: number): string { const hours = Math.floor(seconds / 3600); // 计算小时 const minutes = Math.floor((seconds % 3600) / 60); // 计算分钟 const remainingSeconds = seconds % 60; // 计算秒数 // 使用 padStart 来保证两位数格式 return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0'...
AST#method_declaration#Left formatTime AST#parameter_list#Left ( AST#parameter#Left seconds : 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 string AST#primary_type#Rig...
formatTime(seconds: number): string { const hours = Math.floor(seconds / 3600); const minutes = Math.floor((seconds % 3600) / 60); const remainingSeconds = seconds % 60; return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${remainingSeconds.toString().padStart(2,...
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/store.ets#L20-L27
f2f98a994fe0b6669695263ded1704ad8fe17d23
github
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/service/DatabaseService.ets
arkts
migrateToVersion
迁移到指定版本 在这里添加每个版本的迁移逻辑
private async migrateToVersion(version: number): Promise<void> { if (!this.rdbStore) return; console.info(`[DatabaseService] Migrating to v${version}`); switch (version) { case 1: // v1: 初始版本,创建基础表 await this.createTables(); break; case 2: // v2: 添加 isFetchFail...
AST#method_declaration#Left private async migrateToVersion AST#parameter_list#Left ( AST#parameter#Left version : 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#gen...
private async migrateToVersion(version: number): Promise<void> { if (!this.rdbStore) return; console.info(`[DatabaseService] Migrating to v${version}`); switch (version) { case 1: await this.createTables(); break; case 2: try { await this.rd...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/DatabaseService.ets#L154-L184
a1e32b39e148b466f7ba68ebce9f1f0ec8dd0726
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
arkts/@arkts.utils.d.ets
arkts
request
Find or create an instance of ConditionVariable using the specified name. @param { string } name - Name of the ConditionVariable to find or create. @returns { ConditionVariable } Returns an instance of ConditionVariable. @static @syscap SystemCapability.Utils.Lang @atomicservice @since 18
static request(name: string): ConditionVariable;
AST#method_declaration#Left static request 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 ConditionVariable AST#prim...
static request(name: string): ConditionVariable;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.utils.d.ets#L663-L663
adfaf2b330cb9d8673aa09379c17820921bae204
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
设置迁移配置接口
export interface SettingsMigrationConfig { fromVersion: string; toVersion: string; migrations: SettingsMigrationRule[]; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SettingsMigrationConfig AST#object_type#Left { AST#type_member#Left fromVersion : 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 toVersion : AS...
export interface SettingsMigrationConfig { fromVersion: string; toVersion: string; migrations: SettingsMigrationRule[]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L534-L538
9fb1f3af8cb96b3f53f37449d436121b7ce41a2b
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/MoodEntry.ets
arkts
getTodayDateString
Get today's date string in YYYY-MM-DD format
static getTodayDateString(): string { const now = new Date(); const year = now.getFullYear(); const month = String(now.getMonth() + 1).padStart(2, '0'); const day = String(now.getDate()).padStart(2, '0'); return `${year}-${month}-${day}`; }
AST#method_declaration#Left static getTodayDateString 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#variable_declaration#Left const AST#variable_declarator#Le...
static getTodayDateString(): string { const now = new Date(); const year = now.getFullYear(); const month = String(now.getMonth() + 1).padStart(2, '0'); const day = String(now.getDate()).padStart(2, '0'); return `${year}-${month}-${day}`; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/MoodEntry.ets#L85-L91
d6f8beecf267391a3fb865537e43d6292e38bfc2
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/processes/zone_actions.ets
arkts
Marks a window to be NO LONGER a zone. @param window_id The id of zone / window. @returns True if success, undefined if is already NOT a zone.
export function off_zone(window_id: string) { let storage = storage_of_id(window_id); let alias = storage.get('my_window_alias') as string; // Read all web_states out let zone_dir = meowContext().filesDir + '/' + 'zones/' + alias; console.log('[off_zone] zone_dir: ' + zone_dir); let tabs_list = fileIo.list...
AST#export_declaration#Left export AST#function_declaration#Left function off_zone AST#parameter_list#Left ( AST#parameter#Left window_id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST...
export function off_zone(window_id: string) { let storage = storage_of_id(window_id); let alias = storage.get('my_window_alias') as string; let zone_dir = meowContext().filesDir + '/' + 'zones/' + alias; console.log('[off_zone] zone_dir: ' + zone_dir); let tabs_list = fileIo.listFileSync(zone_dir); let ...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/zone_actions.ets#L140-L189
af68c06052277bd9820e0cfbd3a1f61007d5eac6
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/barchart/Index.ets
arkts
BarChartPage
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { BarChartPage } from './src/main/ets/view/BarChart';
AST#export_declaration#Left export { BarChartPage } from './src/main/ets/view/BarChart' ; AST#export_declaration#Right
export { BarChartPage } from './src/main/ets/view/BarChart';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/barchart/Index.ets#L16-L16
0752db8bab3f56f5801a91345f50525ba278e57f
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/widget/BirthdayWidgetFormExtension.ets
arkts
getWidgetData
获取小组件数据
private getWidgetData(formName?: string): WidgetData { try { const today = new Date(); const currentDate = `${today.getMonth() + 1}月${today.getDate()}日`; const widgetData: WidgetData = { title: 'AI生日提醒', subtitle: '今天有0人生日', todayCount: 0, upcomingCount: 0, ...
AST#method_declaration#Left private getWidgetData AST#parameter_list#Left ( AST#parameter#Left formName ? : 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 WidgetData AS...
private getWidgetData(formName?: string): WidgetData { try { const today = new Date(); const currentDate = `${today.getMonth() + 1}月${today.getDate()}日`; const widgetData: WidgetData = { title: 'AI生日提醒', subtitle: '今天有0人生日', todayCount: 0, upcomingCount: 0, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widget/BirthdayWidgetFormExtension.ets#L61-L95
ac15e6bd0589b915e0e6895ec6ca78b854560fdd
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/entry3ability/Entry3Ability.ets
arkts
onWindowStageCreate
[EndExclude create_main_window]
onWindowStageCreate(windowStage: window.WindowStage): void { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err) => { if (err.code) { hilog.error(0x0000, 'testTag', '...
AST#method_declaration#Left onWindowStageCreate AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right ...
onWindowStageCreate(windowStage: window.WindowStage): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err) => { if (err.code) { hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stri...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/entry3ability/Entry3Ability.ets#L33-L46
1e750df5fa38890f55ae0722e60f5125995fe851
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/network/HttpUtils.ets
arkts
The HttpUtils provides the capability of accessing the network through HTTP.
export class HttpUtils { httpRequest: http.HttpRequest; constructor() { this.httpRequest = http.createHttp(); } /** * The method of initiating a GET request through HTTP. */ async getHttpRequest(cacheDir: string): Promise<string> { let responsePictureUri: string = ''; await this.httpReques...
AST#export_declaration#Left export AST#class_declaration#Left class HttpUtils AST#class_body#Left { AST#property_declaration#Left httpRequest : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left http . HttpRequest AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#proper...
export class HttpUtils { httpRequest: http.HttpRequest; constructor() { this.httpRequest = http.createHttp(); } async getHttpRequest(cacheDir: string): Promise<string> { let responsePictureUri: string = ''; await this.httpRequest.request(IMAGE_URL, { method: http.RequestMethod.GET }) .the...
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/network/HttpUtils.ets#L29-L85
97dbd2347b3c9d307ae9ea31cfb9149b3d798a49
gitee