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
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/social/CommunityService.ets
arkts
getCurrentUser
获取当前用户资料
getCurrentUser(): UserProfile | 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 UserProfile AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#L...
getCurrentUser(): UserProfile | null { return this.currentUser; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L270-L272
1222af7fa7d7063ed8e21340de7c625a7f098c96
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/control_flow/conditional_stmt/conditional_switch_001_T.ets
arkts
Introduction 条件语句-switch
export function conditional_switch_001_T(taint_src : string) { switch (2) { case 2: taint.Sink(taint_src) } }
AST#export_declaration#Left export AST#function_declaration#Left function conditional_switch_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_stat...
export function conditional_switch_001_T(taint_src : string) { switch (2) { case 2: taint.Sink(taint_src) } }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/control_flow/conditional_stmt/conditional_switch_001_T.ets#L6-L11
6f6c4d926234b3ce82adb8fb9109bdb5f34251e7
github
fengcreate/harmony-document
798534b0f76399dc84e7940f5b14b3ae4e53c6a9
BackupRestore/entry/src/main/ets/restore/sp/SpTransferManager.ets
arkts
transferSourceXmlToXmlElement
The text content of XML is an XMLElement object. @param xmlContent XML text content. @return XmlElement Object corresponding to XML.
private transferSourceXmlToXmlElement(xmlContent: string): XmlElement { let result: XmlElement = {}; if (!xmlContent) { hilog.error(0x0000, 'BackupRestore SpTransferManager', 'transferSourceXmlToXmlElement, xmlContent is empty'); return result; } try { let conv = new convertxml.Convert...
AST#method_declaration#Left private transferSourceXmlToXmlElement AST#parameter_list#Left ( AST#parameter#Left xmlContent : 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#Le...
private transferSourceXmlToXmlElement(xmlContent: string): XmlElement { let result: XmlElement = {}; if (!xmlContent) { hilog.error(0x0000, 'BackupRestore SpTransferManager', 'transferSourceXmlToXmlElement, xmlContent is empty'); return result; } try { let conv = new convertxml.Convert...
https://github.com/fengcreate/harmony-document/blob/798534b0f76399dc84e7940f5b14b3ae4e53c6a9/BackupRestore/entry/src/main/ets/restore/sp/SpTransferManager.ets#L169-L200
0e70a1d6854e82b86f406ea8c3085bdac87e5307
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_audio/src/main/ets/audio/EfAVPlayer.ets
arkts
getAVPlayer
获取AVPlayer实例 @returns media.AVPlayer
getAVPlayer() { return this.avPlayer }
AST#method_declaration#Left getAVPlayer AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#member_expression#Right AST#expression#R...
getAVPlayer() { return this.avPlayer }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_audio/src/main/ets/audio/EfAVPlayer.ets#L76-L78
f85457dcbf801f31090fbb7f48a565e9351acbfc
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/navigation/src/main/ets/NavigationService.ets
arkts
路由跳转(入栈) @param {string} name - 路由名称 @param {Any} [params] - 跳转参数 @returns {void} 无返回值
export function navigateTo(name: string, params?: Any): void { if (requiresLogin(name)) { const userState = getUserState(); if (!userState.isLoggedIn()) { hilog.info(DOMAIN, "NavSvc", `[NavigationService] Intercepting route to ${name}, redirecting to Login`); name = getLoginRoute(); } } c...
AST#export_declaration#Left export AST#function_declaration#Left function navigateTo 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 params ? : AST#type_annotation#Left AST...
export function navigateTo(name: string, params?: Any): void { if (requiresLogin(name)) { const userState = getUserState(); if (!userState.isLoggedIn()) { hilog.info(DOMAIN, "NavSvc", `[NavigationService] Intercepting route to ${name}, redirecting to Login`); name = getLoginRoute(); } } c...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/NavigationService.ets#L51-L78
538aef42963b83bdb8e0ded30106f078c52f31e7
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Native/NdkTsDrawing/entry/src/main/ets/pages/Index.ets
arkts
drawImage
将离屏绘制好的bitmap绘制到屏幕上
public async drawImage() { if (pixelMap_ === null) { console.error(TAG, 'draw image pixelMap_ is null'); return; } console.log(TAG, 'drawImage success'); this.context.drawImage(pixelMap_, 0, 100); }
AST#method_declaration#Left public async drawImage 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 pixelMap_ AST#expression#Right === AST#expression#Left AST#null_literal#Left...
public async drawImage() { if (pixelMap_ === null) { console.error(TAG, 'draw image pixelMap_ is null'); return; } console.log(TAG, 'drawImage success'); this.context.drawImage(pixelMap_, 0, 100); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Native/NdkTsDrawing/entry/src/main/ets/pages/Index.ets#L226-L233
ca921d3824734d3d7501ab631211ad4d8c65fb90
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/ItemData.ets
arkts
List item data entity.
export default class PageResource { /** * Text of list item. */ title: Resource; /** * Image of list item. */ img: Resource; /** * Other resource of list item. */ others?: Resource; constructor(title: Resource, img: Resource, others?: Resource) { this.title = title; this.img = i...
AST#export_declaration#Left export default AST#class_declaration#Left class PageResource AST#class_body#Left { /** * Text of list item. */ AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right...
export default class PageResource { title: Resource; img: Resource; others?: Resource; constructor(title: Resource, img: Resource, others?: Resource) { this.title = title; this.img = img; this.others = others; } }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/ItemData.ets#L19-L38
a9f027e4588c356022b80c872acebd64ae624b59
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ArrayUtil.ets
arkts
flatten
平铺二维数组。 @param arrays 数组 @returns 返回一个新的数组
static flatten(arrays: string[][]): string[] { return arrays.flat(); }
AST#method_declaration#Left static flatten AST#parameter_list#Left ( AST#parameter#Left arrays : 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#type_annotation#Le...
static flatten(arrays: string[][]): string[] { return arrays.flat(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ArrayUtil.ets#L157-L159
342700a60967831f7a8d1b0b4d5bba399c856418
gitee
fmtjava/Ohs_ArkTs_Eyepetizer.git
79578f394ccb926da1455e63b7fe0722df9b9a22
entry/src/main/ets/view/TopicDetailItemWidget.ets
arkts
handlePageShow
根据videoIndex、isShowVideoView和videoInfoPosition更改播放状态
handlePageShow(): void { // 判断视频界面是否进入前台,同时判断当前视频索引是否为 List 选中的视频,来决定是否播放 if (this.isShowVideoView === true && this.videoInfoPosition === this.videoIndex) { this.play(); } else { this.stop(); } }
AST#method_declaration#Left handlePageShow 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 { // 判断视频界面是否进入前台,同时判断当前视频索引是否为 List 选中的视频,来决定是否播放 AST#ui_control_flow#Left AST#ui_if_stat...
handlePageShow(): void { if (this.isShowVideoView === true && this.videoInfoPosition === this.videoIndex) { this.play(); } else { this.stop(); } }
https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/view/TopicDetailItemWidget.ets#L195-L202
5ce324ba2aa5804f8ce80ecf37075d71d88d0dd9
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/Recorder/entry/src/main/ets/model/MediaManager.ets
arkts
saveFileDuration
保存音频Duration @param name @param value @returns
async saveFileDuration(name: string, value: string): Promise<void> { if (this.storage === null) { Logger.info(TAG, 'Create storage is fail.'); return; } try { await this.storage?.put(name, value); await this.storage?.flush(); Logger.info(TAG, 'Create storage is success.'); ...
AST#method_declaration#Left async saveFileDuration 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 value : AST#type_annotation#Left AST#primary_type#Left string AST#primary...
async saveFileDuration(name: string, value: string): Promise<void> { if (this.storage === null) { Logger.info(TAG, 'Create storage is fail.'); return; } try { await this.storage?.put(name, value); await this.storage?.flush(); Logger.info(TAG, 'Create storage is success.'); ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/Recorder/entry/src/main/ets/model/MediaManager.ets#L141-L153
aea13886e022f0bb325641dcf758dd18338925b5
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Solutions/Social/GrapeSquare/feature/authorizedControl/src/main/ets/model/TrendsDataSource.ets
arkts
indexOf
查找列表中对象的index
public indexOf(data: Trends): number { Logger.info(TAG, `indexOf data , id = ${data.user.userId} , name = ${data.user.userName}`); return this.commentsList.indexOf(data); }
AST#method_declaration#Left public indexOf AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Trends 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#Ri...
public indexOf(data: Trends): number { Logger.info(TAG, `indexOf data , id = ${data.user.userId} , name = ${data.user.userName}`); return this.commentsList.indexOf(data); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Social/GrapeSquare/feature/authorizedControl/src/main/ets/model/TrendsDataSource.ets#L95-L98
1027871f3afa0c5188bfe4ecae191a7b3621240c
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LocationUtil.ets
arkts
onLocationError
订阅持续定位过程中的错误码。需要权限:ohos.permission.APPROXIMATELY_LOCATION @param callback 回调函数,返回持续定位过程中的错误码。
static onLocationError(callback: Callback<geoLocationManager.LocationError>) { geoLocationManager.on('locationError', callback); }
AST#method_declaration#Left static onLocationError AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left geoLocationManager . LocationError AST...
static onLocationError(callback: Callback<geoLocationManager.LocationError>) { geoLocationManager.on('locationError', callback); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L154-L156
2a1ec6287a23d5c32b35f7b7b6c0e9ee77abc148
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets
arkts
totalCount
获取聊天信息数组长度函数 @returns
public totalCount(): number { return this.originDataArray.length; }
AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expres...
public totalCount(): number { return this.originDataArray.length; }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets#L102-L104
03232d6ee479e0e6070d262d3436c07763e698c0
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/ui/src/main/ets/component/modal/DictSelectModal.ets
arkts
DictItemCheckbox
字典项右侧选择器 @param {string} name - 选项名称 @returns {void} 无返回值
@Builder private DictItemCheckbox(name: string): void { IBestCheckbox({ group: this.groupId, name: name }); }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private DictItemCheckbox 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_annot...
@Builder private DictItemCheckbox(name: string): void { IBestCheckbox({ group: this.groupId, name: name }); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/modal/DictSelectModal.ets#L153-L159
b66edbd693de751e2800fb33ee141d7c99cf0723
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/bookGroupUtils.ets
arkts
updateMoveGroupBookIds
分组批量移动书籍
updateMoveGroupBookIds(data:Record<number, number>){ BookGroupsDao.updateMoveBookIdsByGroupId(data) }
AST#method_declaration#Left updateMoveGroupBookIds AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right , AST#type_a...
updateMoveGroupBookIds(data:Record<number, number>){ BookGroupsDao.updateMoveBookIdsByGroupId(data) }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/bookGroupUtils.ets#L98-L100
df3d45ae2f1c91d4d3f229284662fa428f2b57b6
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/StatusBarUtils.ets
arkts
getStatusBarHeight
获取状态栏高度(单位:px) 类似于iOS中的safeAreaInsets.top[5,8](@ref) @param context 上下文对象 @returns 状态栏高度的Promise
static async getStatusBarHeight(): Promise<number> { try { const currentWindow = await window.getLastWindow(getContext(StatusBarUtil)); // 获取系统避免区域[5,8](@ref) const avoidArea = currentWindow.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); const statusBarHeightPx = avoidArea.topRect.hei...
AST#method_declaration#Left static async getStatusBarHeight 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 number AST#primary_type#Right AST#type_annotation#Right...
static async getStatusBarHeight(): Promise<number> { try { const currentWindow = await window.getLastWindow(getContext(StatusBarUtil)); const avoidArea = currentWindow.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); const statusBarHeightPx = avoidArea.topRect.height; AppStorage...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/StatusBarUtils.ets#L56-L70
755d6beeb6a58c68770ceae59ca7b73571cfa161
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/viewmodel/WebViewModel.ets
arkts
@file 网页页面 ViewModel @author Joker.X
@ObservedV2 export default class WebViewModel extends BaseViewModel { }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class WebViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Right AST#cl...
@ObservedV2 export default class WebViewModel extends BaseViewModel { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/viewmodel/WebViewModel.ets#L7-L9
6ff92f87a1042041458750e21b10487a5920942c
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/Settings.ets
arkts
SettingItemWithSwitch
带开关的设置项
@Builder SettingItemWithSwitch(icon: string, title: string, description: string, isOn: boolean, onChange: (value: boolean) => void) { Row() { Text(icon) .fontSize(24) .margin({ right: 12 }) Column() { Text(title) .fontSize(16) .fontColor('#333333') ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right SettingItemWithSwitch AST#parameter_list#Left ( AST#parameter#Left icon : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_annotati...
@Builder SettingItemWithSwitch(icon: string, title: string, description: string, isOn: boolean, onChange: (value: boolean) => void) { Row() { Text(icon) .fontSize(24) .margin({ right: 12 }) Column() { Text(title) .fontSize(16) .fontColor('#333333') ...
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/Settings.ets#L212-L240
777d94783495929dede14a102b95029db512ec81
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/ModuleLoadingSideEffects/entry/src/main/ets/pages/ModifyTheApplicationLevelArkUI/module.ets
arkts
[Start set_app_storage_var]
export let data = 'data from module';
AST#export_declaration#Left export AST#variable_declaration#Left let AST#variable_declarator#Left data = AST#expression#Left 'data from module' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export let data = 'data from module';
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/ModuleLoadingSideEffects/entry/src/main/ets/pages/ModifyTheApplicationLevelArkUI/module.ets#L17-L17
7dbcfd7f4188b8425976acb045ed4c6149e42c2f
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets
arkts
notifyDataDelete
通知控制器数据删除 @param index 数组索引
notifyDataDelete(index: number): void { this.listeners.forEach(listener => { listener.onDataDelete(index); }) }
AST#method_declaration#Left notifyDataDelete 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#type_annotation#Left AST#primary_type#Left void AST#primary_type#R...
notifyDataDelete(index: number): void { this.listeners.forEach(listener => { listener.onDataDelete(index); }) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets#L73-L77
56619001f8148a7a1e1d673956864d281a4c6d5e
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/result/src/main/ets/RequestHelper.ets
arkts
构造函数 @param {Promise<NetworkResponse<T>>} promise - 原始请求 Promise
private constructor(promise: Promise<NetworkResponse<T>>) { this.source = promise; }
AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( AST#parameter#Left promise : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left ...
private constructor(promise: Promise<NetworkResponse<T>>) { this.source = promise; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/result/src/main/ets/RequestHelper.ets#L32-L34
0f64b2e90cbde62931c7b6d35dad973edfaa06fe
github
openharmony/applications_settings
aac607310ec30e30d1d54db2e04d055655f72730
product/phone/src/main/ets/pages/dateAndTime.ets
arkts
getNowTime
get current system time
private getNowTime(): void { LogUtil.info(MODULE_TAG + 'get time come in'); this.time = DateAndTime.getSystemTime(this.is24hTimeFormat()); this.date = DateAndTime.getSystemDate(); LogUtil.info(MODULE_TAG + 'get time end in date=' + this.date); LogUtil.info(MODULE_TAG + 'get time end in time=' + this...
AST#method_declaration#Left private getNowTime 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#expre...
private getNowTime(): void { LogUtil.info(MODULE_TAG + 'get time come in'); this.time = DateAndTime.getSystemTime(this.is24hTimeFormat()); this.date = DateAndTime.getSystemDate(); LogUtil.info(MODULE_TAG + 'get time end in date=' + this.date); LogUtil.info(MODULE_TAG + 'get time end in time=' + this...
https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/pages/dateAndTime.ets#L215-L222
c1b163d010c3007feffa4ec503f2404c4a4cf52b
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customdialog/src/main/ets/components/SubWindowApi.ets
arkts
initSubWindow
创建并展示弹窗 @param { SubWindowParams } params - 页面显示的值 @param { Handler } handler - WindowStage对象
initSubWindow(handler: Handler, params: SubWindowParams): void { const windowStage = handler.windowStage; // 注册回调 this.subscribeCallback(); // 初始化参数 this.updateOrCreateParams(params); // 新建子窗口 this.createSubWindow(windowStage); }
AST#method_declaration#Left initSubWindow AST#parameter_list#Left ( AST#parameter#Left handler : AST#type_annotation#Left AST#primary_type#Left Handler AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left SubWindowParams AST#pr...
initSubWindow(handler: Handler, params: SubWindowParams): void { const windowStage = handler.windowStage; this.subscribeCallback(); this.updateOrCreateParams(params); this.createSubWindow(windowStage); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdialog/src/main/ets/components/SubWindowApi.ets#L161-L169
9110e8d84da6aafd036dd22a1b5601869888dbf3
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/component/extendableComponent.d.ets
arkts
getUIContext
Get current UIContext. @returns { UIContext } The UIContext that the custom component belongs to. @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 20
abstract getUIContext(): UIContext /** * Get uniqueId of the custom component. * * @returns { int } - The uniqueId of the custom component. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 20 */
AST#method_declaration#Left abstract getUIContext AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right /** * Get uniqueId of the custom component. * * @returns { int } - The uniqueId of the custom ...
abstract getUIContext(): UIContext
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/component/extendableComponent.d.ets#L100-L110
36743c8a7a35b8be84d7eb182c3040117b091e2c
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/util/src/main/ets/context/ContextUtil.ets
arkts
getUIAbilityCtx
获取 UIAbility 组件的上下文 @returns {common.UIAbilityContext}
static getUIAbilityCtx(): common.UIAbilityContext { return ContextUtil.context }
AST#method_declaration#Left static getUIAbilityCtx AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Le...
static getUIAbilityCtx(): common.UIAbilityContext { return ContextUtil.context }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/util/src/main/ets/context/ContextUtil.ets#L41-L43
5d7ea04565711f1d7db27a9d4c98df74d6e8fbd5
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
buildGreetingsContent
构建祝福语页面内容
@Builder buildGreetingsContent() { Column({ space: 16 }) { // AI模型状态检查 this.buildAIModelStatus() // 智能生成区域 this.buildAIGenerationSection() // 礼物推荐区域 this.buildGiftRecommendationSection() // 我的收藏和历史 this.buildMyFavoritesAndHistory() // 数据统计 this.build...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingsContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#compone...
@Builder buildGreetingsContent() { Column({ space: 16 }) { this.buildAIModelStatus() this.buildAIGenerationSection() this.buildGiftRecommendationSection() this.buildMyFavoritesAndHistory() this.buildGreetingAnalytics() } .width('100%') ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L3055-L3075
7f7c7744d9f28bba44c6d64012831a8095c79b4e
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/social/CommunityService.ets
arkts
savePost
保存帖子
async savePost(postId: string): Promise<boolean> { try { if (!this.currentUser) return false; // TODO: 保存帖子到用户收藏 hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Post saved: ${postId}`); return true; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG...
AST#method_declaration#Left async savePost AST#parameter_list#Left ( AST#parameter#Left postId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Pr...
async savePost(postId: string): Promise<boolean> { try { if (!this.currentUser) return false; hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Post saved: ${postId}`); return true; } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Fa...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L447-L459
b2ca7e34472b437880a32e01292556cc02b56c58
github
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/controlPage/common/utils/controlPageUtil.ets
arkts
getHumidifierStatusCommand
获取智能加湿器打开命令 @return Command
static getHumidifierStatusCommand(isOn:boolean):DeviceCommandModel { let param = {} if(isOn){ param["HumidifierStatus"] = "ON"; } else{ param["HumidifierStatus"] = "OFF"; } return new DeviceCommandModel("SetHumidifierStatus", "SmartHumidifier", JSON.stringify(param)); }
AST#method_declaration#Left static getHumidifierStatusCommand AST#parameter_list#Left ( AST#parameter#Left isOn : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Device...
static getHumidifierStatusCommand(isOn:boolean):DeviceCommandModel { let param = {} if(isOn){ param["HumidifierStatus"] = "ON"; } else{ param["HumidifierStatus"] = "OFF"; } return new DeviceCommandModel("SetHumidifierStatus", "SmartHumidifier", JSON.stringify(param)); }
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/controlPage/common/utils/controlPageUtil.ets#L55-L64
1d3f45f6725b2149bce46199c96675680b6e6ddb
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/addressrecognize/src/main/ets/components/loading/Loading.ets
arkts
消除loading @param loadingId
export function clearLoading(loadingId: number) { promptAction.closeCustomDialog(loadingId); }
AST#export_declaration#Left export AST#function_declaration#Left function clearLoading AST#parameter_list#Left ( AST#parameter#Left loadingId : 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 {...
export function clearLoading(loadingId: number) { promptAction.closeCustomDialog(loadingId); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/addressrecognize/src/main/ets/components/loading/Loading.ets#L52-L54
23da20784351e46e8871e506b910d87117e9e874
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/ui/carousel/Carousel.ets
arkts
轮播图组件
export interface CarouselItem { id: string; image: string | Resource; title?: string; url?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface CarouselItem AST#object_type#Left { AST#type_member#Left id : 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 image : AST#type_annotation#Left A...
export interface CarouselItem { id: string; image: string | Resource; title?: string; url?: string; }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/ui/carousel/Carousel.ets#L4-L9
a6cf1aa6de2dcff9aaf204d0de27ee93bc7816e4
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Column.ets
arkts
ColumnSpaceAroundStart
纵向环绕分布 + 水平起始
@ComponentV2 export struct ColumnSpaceAroundStart { /** * Column 构造参数 */ @Param options: ColumnOptions | ColumnOptionsV2 = {}; /** * 宽度 */ @Param widthValue: Length | undefined = undefined; /** * 高度 */ @Param heightValue: Length | undefined = undefined; /** * 尺寸(对应官方 size 属性) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct ColumnSpaceAroundStart AST#component_body#Left { /** * Column 构造参数 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left AST#union_type#Left AST#pri...
@ComponentV2 export struct ColumnSpaceAroundStart { @Param options: ColumnOptions | ColumnOptionsV2 = {}; @Param widthValue: Length | undefined = undefined; @Param heightValue: Length | undefined = undefined; @Param sizeValue: SizeOptions | undefined = undefined; @Param paddingValue: ...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Column.ets#L1105-L1180
d67443c7d9598feced5601d4ec79c0c5d877e15f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/sync/CloudSyncService.ets
arkts
performSyncPhases
执行同步各个阶段
private async performSyncPhases(syncId: string, options: SyncOptions, result: SyncResult): Promise<void> { const dataTypes = options.dataTypes || [DataType.CONTACTS, DataType.GREETINGS, DataType.SETTINGS]; // 阶段1: 准备同步 await this.updateSyncProgress(syncId, SyncPhase.PREPARING, 0, dataTypes.length); //...
AST#method_declaration#Left private async performSyncPhases AST#parameter_list#Left ( AST#parameter#Left syncId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left SyncO...
private async performSyncPhases(syncId: string, options: SyncOptions, result: SyncResult): Promise<void> { const dataTypes = options.dataTypes || [DataType.CONTACTS, DataType.GREETINGS, DataType.SETTINGS]; await this.updateSyncProgress(syncId, SyncPhase.PREPARING, 0, dataTypes.length); if (optio...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/CloudSyncService.ets#L220-L295
6f43dfb462c331be67fdc1ea38d68fbf4ad6db7b
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/objects/HistoryDataSource.ets
arkts
notifyDataMove
通知LazyForEach组件将from索引和to索引处的子组件进行交换
notifyDataMove(from: number, to: number): void { this.listeners.forEach(listener => { listener.onDataMove(from, to); // 写法2:listener.onDatasetChange( // [{type: DataOperationType.EXCHANGE, index: {start: from, end: to}}]); }); }
AST#method_declaration#Left notifyDataMove AST#parameter_list#Left ( AST#parameter#Left from : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left to : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right...
notifyDataMove(from: number, to: number): void { this.listeners.forEach(listener => { listener.onDataMove(from, to); }); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/objects/HistoryDataSource.ets#L68-L74
8fae32201e183cdc4d18658945bdaa5d76522d3f
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/EntryOhos.ets
arkts
getX
Returns the x-value of this Entry object. @return
public getX(): number { return this.x; }
AST#method_declaration#Left public getX AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#L...
public getX(): number { return this.x; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/EntryOhos.ets#L38-L40
7573284043cc4215e10e4cc14afc7a21d2f2f39b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SettingsPage.ets
arkts
getLLMConfigDescription
获取大模型配置描述
private getLLMConfigDescription(): string { const llmStatus = this.llmService.getStatus(); if (llmStatus.configured && llmStatus.provider) { const providerInfo = this.llmService.getProviderInfo(llmStatus.provider); return providerInfo ? `已配置: ${providerInfo.name}` : '已配置'; } return '未配置'; ...
AST#method_declaration#Left private getLLMConfigDescription 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_declara...
private getLLMConfigDescription(): string { const llmStatus = this.llmService.getStatus(); if (llmStatus.configured && llmStatus.provider) { const providerInfo = this.llmService.getProviderInfo(llmStatus.provider); return providerInfo ? `已配置: ${providerInfo.name}` : '已配置'; } return '未配置'; ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SettingsPage.ets#L598-L605
03f4e036b2f3f3b499fd3c6deeb30986b05f774c
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Convert.ets
arkts
genLenHex
获取16进制数据长度 @param content @returns
private genLenHex(content: string): string { let size: number = content.length / 2; let lenHex: string; if (size.toString(16).length % 2 == 1) { lenHex = '0' + size.toString(16); } else { lenHex = size.toString(16); } if (size < 0x80) { return lenHex; } let lenHex_size...
AST#method_declaration#Left private genLenHex 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_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t...
private genLenHex(content: string): string { let size: number = content.length / 2; let lenHex: string; if (size.toString(16).length % 2 == 1) { lenHex = '0' + size.toString(16); } else { lenHex = size.toString(16); } if (size < 0x80) { return lenHex; } let lenHex_size...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Convert.ets#L163-L177
2290c9e90188599d0c904c246f12f22f6937e2b4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ArkTsComponentCollection/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/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/multiplexSample/ScrollItem.ets#L114-L122
b6c74478ca781af01ae44c2749f29729f107a92b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/ContactsPage.ets
arkts
onFilterChange
筛选变更处理
private onFilterChange(filter: string): void { this.selectedFilter = filter; this.showFilterMenu = false; this.applyFilters(); }
AST#method_declaration#Left private onFilterChange AST#parameter_list#Left ( AST#parameter#Left filter : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary...
private onFilterChange(filter: string): void { this.selectedFilter = filter; this.showFilterMenu = false; this.applyFilters(); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/ContactsPage.ets#L93-L97
b598977c897e15073dc85608fa0725f73c2fd224
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/model/base/CloseReason.ets
arkts
@author pll @create 2025-07-17 10:57
export enum CloseReason { ACTION = 99, /** -------------- 以下为官方 ------------------ **/ /** * Press back * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ PRESS_BACK = 0, /** * Touch component outside * * @syscap SystemCapability.ArkUI.ArkUI.Full ...
AST#export_declaration#Left export AST#enum_declaration#Left enum CloseReason AST#enum_body#Left { AST#enum_member#Left ACTION = AST#expression#Left 99 AST#expression#Right AST#enum_member#Right , /** -------------- 以下为官方 ------------------ **/ /** * Press back * * @syscap SystemCapability.ArkUI.ArkUI.Full * @c...
export enum CloseReason { ACTION = 99, PRESS_BACK = 0, TOUCH_OUTSIDE = 1, CLOSE_BUTTON = 2, SLIDE_DOWN = 3 }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/base/CloseReason.ets#L6-L47
0259edf0fb10bf0394d5b67c3a760b5b2ad4532f
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.TreeView.d.ets
arkts
TreeView
Declare TreeView Component @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare TreeView Component @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
@Component export declare struct TreeView { /** * Node data source of TreeView. * @type TreeController * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Node data source of TreeView. * @type TreeController * @syscap SystemCapability.ArkUI.ArkUI.Full * ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct TreeView AST#component_body#Left { /** * Node data source of TreeView. * @type TreeController * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ ...
@Component export declare struct TreeView { treeController: TreeController; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TreeView.d.ets#L233-L249
0d401b333eba74c318c8cf59f064a5373584ce42
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/WindowViewModel.ets
arkts
getSecondGridData
主页第二个模块数据 @return {Array<GridItem>} secondGridData.
getSecondGridData(): Array<GridItem> { let secondGridData: GridItem[] = [ new GridItem($r('app.string.home_top'), $r('app.media.ic_top'), $r('app.string.home_text_top')), new GridItem($r('app.string.home_new'), $r('app.media.ic_new'), $r('app.string.home_text_new')), new GridItem($r('app.string.ho...
AST#method_declaration#Left getSecondGridData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GridItem AST#primary_type#Right AST#type_annotation#Right > AST#type_ar...
getSecondGridData(): Array<GridItem> { let secondGridData: GridItem[] = [ new GridItem($r('app.string.home_top'), $r('app.media.ic_top'), $r('app.string.home_text_top')), new GridItem($r('app.string.home_new'), $r('app.media.ic_new'), $r('app.string.home_text_new')), new GridItem($r('app.string.ho...
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/WindowViewModel.ets#L58-L68
e1954379a8c90517a59666e87edc196d45299bee
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Row.ets
arkts
RowEndCenter
横向末尾 + 垂直居中
@ComponentV2 export struct RowEndCenter { /** * Row 构造参数 */ @Param options: RowOptions | RowOptionsV2 = {}; /** * 宽度 */ @Param widthValue: Length | undefined = undefined; /** * 高度 */ @Param heightValue: Length | undefined = undefined; /** * 尺寸(对应官方 size 属性) */ @Param size...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RowEndCenter AST#component_body#Left { /** * Row 构造参数 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Lef...
@ComponentV2 export struct RowEndCenter { @Param options: RowOptions | RowOptionsV2 = {}; @Param widthValue: Length | undefined = undefined; @Param heightValue: Length | undefined = undefined; @Param sizeValue: SizeOptions | undefined = undefined; @Param paddingValue: Padding | Length...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L305-L380
d6dae7892390182c980cf4c1bdb30abb1be1c069
github
WinWang/HarmoneyOpenEye.git
57f0542795336009aa0d46fd9fa5b07facc2ae87
entry/src/main/ets/skelton/CommonSkeleton.ets
arkts
CommonSkeleton
//TODO-通用骨架屏---BuilderParams只能支持一个参数,多个参数不支持闭包的写法,这个很纠结。。。。目前只能简单的内置骨架屏了
@Component export struct CommonSkeleton { @State dataList: Array<string> = new Array(5) aboutToAppear() { for (let index = 0; index < 3; index++) { this.dataList.push("") } } build() { List({ space: 10 }) { ForEach(this.dataList, (item, index) => { ListItem() { this.i...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommonSkeleton AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right dataList : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_argu...
@Component export struct CommonSkeleton { @State dataList: Array<string> = new Array(5) aboutToAppear() { for (let index = 0; index < 3; index++) { this.dataList.push("") } } build() { List({ space: 10 }) { ForEach(this.dataList, (item, index) => { ListItem() { this.i...
https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/skelton/CommonSkeleton.ets#L4-L43
a6cfaf880b275226a755fcd8930358ef9e2ddbbc
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/DynamicUtil.ets
arkts
dynamicKey
动态协商密钥 @param pubKey 符合格式的非对称密钥的公钥字符串或Uint8Array字节流 @param priKey 符合格式的非对称密钥的私钥字符串或Uint8Array字节流 @param symAlgName 秘钥规格 @returns 共享密钥
static async dynamicKey(pubKey: string | Uint8Array, priKey: string | Uint8Array, symAlgName: string, keyName: number): Promise<OutDTO<string>> { //公钥数据 let pubKeyArray: Uint8Array = new Uint8Array(); //私钥数据 let priKeyArray: Uint8Array = new Uint8Array(); //转换公钥 if (typeof pubKey === 'string...
AST#method_declaration#Left static async dynamicKey AST#parameter_list#Left ( AST#parameter#Left pubKey : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Uint8Array AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#paramete...
static async dynamicKey(pubKey: string | Uint8Array, priKey: string | Uint8Array, symAlgName: string, keyName: number): Promise<OutDTO<string>> { let pubKeyArray: Uint8Array = new Uint8Array(); let priKeyArray: Uint8Array = new Uint8Array(); if (typeof pubKey === 'string') { let pk ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/DynamicUtil.ets#L37-L72
ff19130b490111bbedb0a03fc91da51a11a54d1f
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/otherCharts/ScrollCombinedChartPage.ets
arkts
getRandom
获取随机数
getRandom(range: number, start: number): number { return (Math.random() * range) + start; }
AST#method_declaration#Left getRandom AST#parameter_list#Left ( AST#parameter#Left range : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left start : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right ...
getRandom(range: number, start: number): number { return (Math.random() * range) + start; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/otherCharts/ScrollCombinedChartPage.ets#L127-L129
1e73305096733206ce1a424ec2c8e21245127e1c
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets
arkts
decode2048PKCS1
2048位解密 @param decodeStr 待解密的字符串 @param priKey 2048位RSA私钥 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param dataCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 @param isPem 秘钥是否为pem格式 - 默认为false
static decode2048PKCS1(str: string, priKey: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> { return CryptoSyncUtil.decodeAsym(str, priKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, dataCoding, isPem); }
AST#method_declaration#Left static decode2048PKCS1 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 priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary...
static decode2048PKCS1(str: string, priKey: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> { return CryptoSyncUtil.decodeAsym(str, priKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, dataCoding, isPem); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets#L137-L140
778ccff77eb67c70001ce39699f4a2c5818dcbb9
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/network/src/main/ets/datasource/page/PageNetworkDataSource.ets
arkts
@file 页面相关数据源接口 @author Joker.X
export interface PageNetworkDataSource { /** * 获取首页数据 * @returns 首页数据响应 */ getHomeData(): Promise<NetworkResponse<Home>>; /** * 获取商品详情 * @param goodsId 商品ID * @returns 商品详情响应 */ getGoodsDetail(goodsId: number): Promise<NetworkResponse<GoodsDetail>>; /** * 获取确认订单页面数据 * @returns 确认订...
AST#export_declaration#Left export AST#interface_declaration#Left interface PageNetworkDataSource AST#object_type#Left { /** * 获取首页数据 * @returns 首页数据响应 */ AST#type_member#Left getHomeData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left...
export interface PageNetworkDataSource { getHomeData(): Promise<NetworkResponse<Home>>; getGoodsDetail(goodsId: number): Promise<NetworkResponse<GoodsDetail>>; getConfirmOrder(): Promise<NetworkResponse<ConfirmOrder>>; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/page/PageNetworkDataSource.ets#L7-L26
2707e04c93940313fcc3a4cc3f06fa367ef56ed6
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets
arkts
setDrawHorizontalHighlightIndicator
Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. @param enabled
public setDrawHorizontalHighlightIndicator(enabled: boolean): void { this.mDrawHorizontalHighlightIndicator = enabled; }
AST#method_declaration#Left public setDrawHorizontalHighlightIndicator AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type...
public setDrawHorizontalHighlightIndicator(enabled: boolean): void { this.mDrawHorizontalHighlightIndicator = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets#L40-L42
5a9510aba6b3de36f5d3e7f7c5778c09da79ef69
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets
arkts
getText
Returns the description text. @return
public getText(): string { return this.text; }
AST#method_declaration#Left public getText AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expressio...
public getText(): string { return this.text; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Description.ets#L56-L58
55656083e776e187f4d76f8c84301c542ea4f559
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
writeSync
将数据写入文件,以同步方法。 @param fd number 已打开的文件描述符。 @param buffer ArrayBuffer|string 待写入文件的数据,可来自缓冲区或字符串。 @param options 支持如下选项: offset,number类型,表示期望写入文件的位置。可选,默认从当前位置开始写。 length,number类型,表示期望写入数据的长度。可选,默认缓冲区长度。 encoding,string类型,当数据是string类型时有效,表示数据的编码方式,默认 'utf-8'。当前仅支持 'utf-8'。 @returns 返回实际写入的数据长度,单位字节。
static writeSync(fd: number, buffer: ArrayBuffer | string, options?: WriteOptions): number { return fs.writeSync(fd, buffer, options) }
AST#method_declaration#Left static writeSync AST#parameter_list#Left ( AST#parameter#Left fd : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left buffer : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Array...
static writeSync(fd: number, buffer: ArrayBuffer | string, options?: WriteOptions): number { return fs.writeSync(fd, buffer, options) }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L493-L495
90f4b97edab493bbb05f3ff69698aab0fabc486d
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/Touch/ClickEvent.ets
arkts
Click
[Start click_event_handle]
@Entry @Component export struct Click { @State flag: boolean = true; @State btnMsg: string = 'show'; build() { NavDestination() { Column({ space: 12 }) { Text($r('app.string.Touch_ClickEvent_text')) .fontSize(14) .fontColor('#666') Column() { Button(this.bt...
AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct Click AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right flag : AST#type_annotation#Left AST#primary_type#Left boolean...
@Entry @Component export struct Click { @State flag: boolean = true; @State btnMsg: string = 'show'; build() { NavDestination() { Column({ space: 12 }) { Text($r('app.string.Touch_ClickEvent_text')) .fontSize(14) .fontColor('#666') Column() { Button(this.bt...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/Touch/ClickEvent.ets#L17-L52
1b9e3cd4202ad85034e9cf4b2c248152d768eca6
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/structures/Attachment.ets
arkts
_attach
应用约束:私有方法使用private修饰符(错误7)
private _attach(file: Object, name?: string): void { if (typeof file === 'string') { this.file = { attachment: file, name: name }; } else { this.setAttachment(file, name ?? ''); } }
AST#method_declaration#Left private _attach AST#parameter_list#Left ( AST#parameter#Left file : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#...
private _attach(file: Object, name?: string): void { if (typeof file === 'string') { this.file = { attachment: file, name: name }; } else { this.setAttachment(file, name ?? ''); } }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/Attachment.ets#L48-L54
3207826578186ab8022988782186fb01cf0552f9
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/services/MockDataService.ets
arkts
getVideos
获取视频列表
static getVideos(): Video[] { return [ { id: '1', title: 'HarmonyOS开发入门教程', cover: 'https://via.placeholder.com/300x200?text=Video1', author: '开发者A', authorAvatar: 'https://via.placeholder.com/40x40?text=A', duration: 1200, playCount: 12345, like...
AST#method_declaration#Left static getVideos AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Video [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left r...
static getVideos(): Video[] { return [ { id: '1', title: 'HarmonyOS开发入门教程', cover: 'https://via.placeholder.com/300x200?text=Video1', author: '开发者A', authorAvatar: 'https://via.placeholder.com/40x40?text=A', duration: 1200, playCount: 12345, like...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/services/MockDataService.ets#L303-L336
1ae59e01429e734c5e4b45441b9c619af5c34090
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/iconmaincolor/Index.ets
arkts
IconMainColorComponent
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 { IconMainColorComponent } from "./src/main/ets/components/mainpage/MainPage";
AST#export_declaration#Left export { IconMainColorComponent } from "./src/main/ets/components/mainpage/MainPage" ; AST#export_declaration#Right
export { IconMainColorComponent } from "./src/main/ets/components/mainpage/MainPage";
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/iconmaincolor/Index.ets#L16-L16
f82e78f46101224e32733e8a796de18766f34283
gitee
SeaEpoch/SepWeather.git
e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c
entry/src/main/ets/common/database/Rdb.ets
arkts
deleteData
删除
deleteData(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'deleteData() has no callback!'); return; } let resFlag: boolean = false; if (this.rdbS...
AST#method_declaration#Left deleteData AST#parameter_list#Left ( AST#parameter#Left predicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . RdbPredicates AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callb...
deleteData(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'deleteData() has no callback!'); return; } let resFlag: boolean = false; if (this.rdbS...
https://github.com/SeaEpoch/SepWeather.git/blob/e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c/entry/src/main/ets/common/database/Rdb.ets#L66-L84
1a748ad54d2eff345454b2bbcaf3acc045ed7947
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ResUtil.ets
arkts
getRawFileContent
获取resources/rawfile目录下对应的rawfile文件内容 @param path rawfile文件路径 @returns
static async getRawFileContent(path: string): Promise<Uint8Array> { return ResUtil.getResourceManager().getRawFileContent(path); }
AST#method_declaration#Left static async getRawFileContent AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generi...
static async getRawFileContent(path: string): Promise<Uint8Array> { return ResUtil.getResourceManager().getRawFileContent(path); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L437-L439
890ee2d0cd4c5d050c5b3b873788646ef9434de5
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/sendmessage/src/main/ets/components/mainpage/MessageView.ets
arkts
字体粗细 定义短信结构类
export class Contact { contactsName: string; // 接收人的名字 telephone: string; // 接收人的号码 constructor(contactsName: string, telephone: string) { this.contactsName = contactsName; this.telephone = telephone; } }
AST#export_declaration#Left export AST#class_declaration#Left class Contact AST#class_body#Left { AST#property_declaration#Left contactsName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 接收人的名字 AST#property_declaration#Left t...
export class Contact { contactsName: string; telephone: string; constructor(contactsName: string, telephone: string) { this.contactsName = contactsName; this.telephone = telephone; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/sendmessage/src/main/ets/components/mainpage/MessageView.ets#L11-L19
815c69d505cf193b48691b5d7ed2f0bc0be15c75
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/YAxis.ets
arkts
setMinWidth
Sets the minimum width that the axis should take (in vp). @param minWidth
public setMinWidth(minWidth: number): void { this.mMinWidth = minWidth; }
AST#method_declaration#Left public setMinWidth AST#parameter_list#Left ( AST#parameter#Left minWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_t...
public setMinWidth(minWidth: number): void { this.mMinWidth = minWidth; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L204-L206
aa8b948e6602a9d70f6052464546972b85be3110
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/SoundEffect/SEManager.ets
arkts
setVolume
设置音量 @param type 音效类型 @param volume 音量范围(0.0-1.0)
public async setVolume(type: SEType, volume: number): Promise<void> { if (!this.soundPool) { console.error('SoundPool not initialized'); return; } const soundId = this.soundMap.get(type); if (soundId === undefined || soundId <= 0) { console.error(`Sound ${type} not loaded`); ret...
AST#method_declaration#Left public async setVolume AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left SEType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left volume : AST#type_annotation#Left AST#primary_type#Left number AST#primar...
public async setVolume(type: SEType, volume: number): Promise<void> { if (!this.soundPool) { console.error('SoundPool not initialized'); return; } const soundId = this.soundMap.get(type); if (soundId === undefined || soundId <= 0) { console.error(`Sound ${type} not loaded`); ret...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/SoundEffect/SEManager.ets#L216-L235
d2b85574aa6eba108037b2e99fa66d262d437f3a
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/StateManagement/entry/src/main/ets/pages/home/model/CategoricalDataType.ets
arkts
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
export class FirstLevelCategory { childNodes: SecondLevelCategory[] | ThirdLevelCategory[] = []; iconSelected: Resource = $r('app.string.empty'); // The icon for the first-level category is selected icon: Resource = $r('app.string.empty'); // The icon for the first-level category is not selected tabBarName: Res...
AST#export_declaration#Left export AST#class_declaration#Left class FirstLevelCategory AST#class_body#Left { AST#property_declaration#Left childNodes : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#array_type#Left SecondLevelCategory [ ] AST#array_type#Right AST#primary_type#Right | AST#primary...
export class FirstLevelCategory { childNodes: SecondLevelCategory[] | ThirdLevelCategory[] = []; iconSelected: Resource = $r('app.string.empty'); icon: Resource = $r('app.string.empty'); tabBarName: Resource = $r('app.string.empty'); }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/StateManagement/entry/src/main/ets/pages/home/model/CategoricalDataType.ets#L16-L21
da7aea7093192ea0bb7da085c306a3c253ed95aa
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/chatwithexpression/src/main/ets/model/Message.ets
arkts
Span、ImageSpan 信息列表
constructor(self: boolean, userName: string, profilePicture: string, maxWidth: number) { this.isSelf = self; this.userName = userName; this.profilePicture = profilePicture; this.maxWidth = maxWidth; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left self : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left userName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t...
constructor(self: boolean, userName: string, profilePicture: string, maxWidth: number) { this.isSelf = self; this.userName = userName; this.profilePicture = profilePicture; this.maxWidth = maxWidth; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/model/Message.ets#L42-L47
abc4f22ef835b4d27a66c38c651ad5b04c3190f4
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/utils/GameUtils.ets
arkts
getBaseLowFPS
获得低帧率的计算标准
private static getBaseLowFPS(gameFPS: number): number { if (gameFPS >= 60) { return 45; } else if (gameFPS == 40) { return 30; } else if (gameFPS == 30) { return 25; } return 20; // 25时候返回20 }
AST#method_declaration#Left private static getBaseLowFPS AST#parameter_list#Left ( AST#parameter#Left gameFPS : 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 AS...
private static getBaseLowFPS(gameFPS: number): number { if (gameFPS >= 60) { return 45; } else if (gameFPS == 40) { return 30; } else if (gameFPS == 30) { return 25; } return 20; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/utils/GameUtils.ets#L72-L81
f5d96797e27c3f74e4417c32042ec80092999e91
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
update_web_state
Asks the tab to update its web_state array, usually called when loading or finished loading. @param force Set to true if want to ignore frequency limit.
update_web_state(force: boolean) { if (!force && ((Date.now() - this.last_update_web_state_time) < 200)) { console.warn('[update_web_state] Intercepted for too frequent update! (' + (Date.now() - this.last_update_web_state_time) + 'ms)'); return false; } try { if (this.controller) { ...
AST#method_declaration#Left update_web_state AST#parameter_list#Left ( AST#parameter#Left force : 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_statement#Left if ...
update_web_state(force: boolean) { if (!force && ((Date.now() - this.last_update_web_state_time) < 200)) { console.warn('[update_web_state] Intercepted for too frequent update! (' + (Date.now() - this.last_update_web_state_time) + 'ms)'); return false; } try { if (this.controller) { ...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L866-L882
ea97df956184f2fb8c364e1f161d9441ab5994d2
gitee
zhuanyongtester/Cpay_arkts.git
4402a8a06963d0757952513d3cbf7d5919ceb74f
entry/src/main/ets/pages/SettingPage.ets
arkts
footerItem
页脚组件 @param text 标签
@Builder footerItem(text: ResourceStr) { Text(text) .fontSize($r("sys.float.ohos_id_text_size_body2")) .fontColor(Color.Red) .margin($r("app.integer.listitem_overflow_default_margin")) .onClick(() => { if (this.popPage) { this.popPage(); } else { this.chec...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right footerItem AST#parameter_list#Left ( AST#parameter#Left text : 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...
@Builder footerItem(text: ResourceStr) { Text(text) .fontSize($r("sys.float.ohos_id_text_size_body2")) .fontColor(Color.Red) .margin($r("app.integer.listitem_overflow_default_margin")) .onClick(() => { if (this.popPage) { this.popPage(); } else { this.chec...
https://github.com/zhuanyongtester/Cpay_arkts.git/blob/4402a8a06963d0757952513d3cbf7d5919ceb74f/entry/src/main/ets/pages/SettingPage.ets#L229-L244
4010269a55f1e1ea09b6531c63fcbd77823f46f4
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/storage_tools.ets
arkts
Pick an image file from device storage, pulling up a DocumentViewPicker. @returns A string, of the chosen file's content.
export async function image_document_pick_to_ArrayBuffer() { let selected_uri: string[] = []; try { let documentPicker = new picker.DocumentViewPicker(); let buf: ArrayBuffer | undefined = undefined; await documentPicker.select({ maxSelectNumber: 1, fileSuffixFilters: [".png", ".jpg", ".jp...
AST#export_declaration#Left export AST#function_declaration#Left async function image_document_pick_to_ArrayBuffer AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left selected_uri : AST#type_annotation#Left AST...
export async function image_document_pick_to_ArrayBuffer() { let selected_uri: string[] = []; try { let documentPicker = new picker.DocumentViewPicker(); let buf: ArrayBuffer | undefined = undefined; await documentPicker.select({ maxSelectNumber: 1, fileSuffixFilters: [".png", ".jpg", ".jp...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L199-L236
0a8f788ae4f676ee971aac3e28fa9a2fdaacc456
gitee
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
entry/src/main/ets/pages/Index.ets
arkts
getIsSideBar
判断侧边栏是否显示
private getIsSideBar(): void { if (this.windowUtil.mainWindowInfo.widthBp < WidthBreakpoint.WIDTH_LG) { this.isShowSidebar = false; } else { this.isShowSidebar = true; } }
AST#method_declaration#Left private getIsSideBar 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#mem...
private getIsSideBar(): void { if (this.windowUtil.mainWindowInfo.widthBp < WidthBreakpoint.WIDTH_LG) { this.isShowSidebar = false; } else { this.isShowSidebar = true; } }
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/entry/src/main/ets/pages/Index.ets#L506-L512
dce91dee04844ff3ec03d2575539f286a86fde3d
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/AES.ets
arkts
decryptSync
解密,同步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @param params 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合。 @returns
static decryptSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, params: cryptoFramework.ParamsSpec | null, transformation: string): cryptoFramework.DataBlob { return CryptoUtil.decryptSync(data, symKey, params, transformation); }
AST#method_declaration#Left static decryptSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey :...
static decryptSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, params: cryptoFramework.ParamsSpec | null, transformation: string): cryptoFramework.DataBlob { return CryptoUtil.decryptSync(data, symKey, params, transformation); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/AES.ets#L254-L257
c36452d86be15831a40218b96eef7d76a200d733
gitee
huaweicloud/huaweicloud-iot-device-sdk-arkts.git
72954bea19e7e7f93567487b036c0664457bdaf3
huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets
arkts
disableAutoReport
关闭自动周期上报,您可以通过firePropertiesChanged触发上报
public disableAutoReport(): void { if (this.timer != null) { clearInterval(this.timer); this.timer = null; } }
AST#method_declaration#Left public disableAutoReport 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...
public disableAutoReport(): void { if (this.timer != null) { clearInterval(this.timer); this.timer = null; } }
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets#L104-L109
ef64cfda6fb2d98a24a401a6b29e387f167e8dae
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/utils/JhPreferencesUtils.ets
arkts
saveString
/ 存 String
public static saveString(key: string, value: string) { key = JhEncryptUtils.aesEncrypt(key) value = JhEncryptUtils.aesEncrypt(value) PreferencesUtil.putSync(key, value) }
AST#method_declaration#Left public static saveString AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primar...
public static saveString(key: string, value: string) { key = JhEncryptUtils.aesEncrypt(key) value = JhEncryptUtils.aesEncrypt(value) PreferencesUtil.putSync(key, value) }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/utils/JhPreferencesUtils.ets#L12-L16
dc3de82c906565873a6a59517473b095b8fcfceb
github
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets
arkts
ToolBar
Declare Component ToolBar @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare Component ToolBar @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
@Component export declare struct ToolBar { /** * Define toolbar list array. * @type { ToolBarOptions }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Define toolbar list array. * @type { ToolBarOptions }. * @syscap SystemCapability.ArkUI.ArkUI.Full ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct ToolBar AST#component_body#Left { /** * Define toolbar list array. * @type { ToolBarOptions }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */...
@Component export declare struct ToolBar { @ObjectLink toolBarList: ToolBarOptions; @Prop activateIndex?: number; controller: TabsController; @Prop dividerModifier?: DividerModifier; @Prop toolBarModifier?: ToolBarModifier; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ToolBar.d.ets#L284-L348
5190eb507442eb4cfe15a7507a4296d7c50f4216
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/utils/StyleUtils.ets
arkts
getColor
获取公历日期字体颜色(仅用于月视图和周视图) @param day 日期信息 @param month 月份 @param currentSelectDay 当前选择的日期 @param calendarViewType 日历视图类型 @param calendarStyle 自定义日历样式 @returns 返回颜色
static getColor(day: Day, month: number, currentSelectDay: DayInfo, calendarViewType: CalendarViewType, calendarStyle: CalendarStyle): Color | number | string | Resource { const IS_SELECT_DAY: boolean = currentSelectDay.year === day.dayInfo.year && currentSelectDay.month === day.dayInfo.month && c...
AST#method_declaration#Left static getColor 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 month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right...
static getColor(day: Day, month: number, currentSelectDay: DayInfo, calendarViewType: CalendarViewType, calendarStyle: CalendarStyle): Color | number | string | Resource { const IS_SELECT_DAY: boolean = currentSelectDay.year === day.dayInfo.year && currentSelectDay.month === day.dayInfo.month && c...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/utils/StyleUtils.ets#L33-L51
31aa5aef7b13e8b3f6abb73347445f6f59dff199
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/services/ApiService.ets
arkts
搜索用户的梦想 @param userId 用户ID @param keyword 搜索关键词 @returns 梦想列表分页
export function searchDreams(userId: number, keyword: string): Promise<PageResponse<Dream>> { try { const params: RequestData = { userId, keyword }; return request<PageResponse<Dream>>(RequestMethod.GET, `/dreams/search`, params as QueryParams); } catch (error) { console.error(`搜索梦想失败: ${error instanceo...
AST#export_declaration#Left export AST#function_declaration#Left function searchDreams AST#parameter_list#Left ( AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left keyword : AST#type_annotation#Left ...
export function searchDreams(userId: number, keyword: string): Promise<PageResponse<Dream>> { try { const params: RequestData = { userId, keyword }; return request<PageResponse<Dream>>(RequestMethod.GET, `/dreams/search`, params as QueryParams); } catch (error) { console.error(`搜索梦想失败: ${error instanceo...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/services/ApiService.ets#L479-L487
8c3797edf623c452c280f086ab1dfcb5bd1bab5a
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Sounds/Cloud/Manager/CDbPath.ets
arkts
get
/CloudSound的sound的sqlite位置
get sqlite(): string { return `${dAppCloudSoundFolderPath}/${this.baseName}.sqlite`; }
AST#method_declaration#Left get AST#ERROR#Left sqlite AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expressio...
get sqlite(): string { return `${dAppCloudSoundFolderPath}/${this.baseName}.sqlite`; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Manager/CDbPath.ets#L20-L22
0a3bfa0b618b6fc74851f3e604309364dc14a8d4
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets
arkts
是否接触到Web底部
build() { Scroll(this.scroller) { Column() { this.webBuilder() this.titleBuilder() this.listBuilder() } .width(CommonConstants.FULL_PERCENT) } // TODO:知识点:通过调用Scroll.onScrollFrameBegin(),在每帧开始滚动时触发时将Scroll返回的实际滚动量的offset,通过scrollBy(0, offset)方法,将Scroll的竖直方向偏移量派发给Web...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scroller AST#member_expression#Right AST#expression#Right ) AST#container_conte...
build() { Scroll(this.scroller) { Column() { this.webBuilder() this.titleBuilder() this.listBuilder() } .width(CommonConstants.FULL_PERCENT) } .onScrollFrameBegin((offset: number, state: ScrollState) => { this.getWebScrollEnd && this.getWebScrollEnd(); ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/view/Scroller.ets#L51-L92
f8a7e2a25008438889d2b7870281825f6b6faece
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/PieDataSet.ets
arkts
myCalcMinMax
@Override
public myCalcMinMax(e: PieEntry): void { if (e == null) return; super.myCalcMinMax(e); }
AST#method_declaration#Left public myCalcMinMax AST#parameter_list#Left ( AST#parameter#Left e : AST#type_annotation#Left AST#primary_type#Left PieEntry AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#...
public myCalcMinMax(e: PieEntry): void { if (e == null) return; super.myCalcMinMax(e); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieDataSet.ets#L77-L83
6c57f7080ad3b71dec2e077cbf5d30de3dbff3ae
gitee
yongoe1024/RdbPlus.git
4a3fc04ba5903bc1c1b194efbc557017976909dc
rdbplus/src/main/ets/log/DbLogger.ets
arkts
日志默认实现
export class DbLogger implements Logger { debug(...args: string[]): void { console.debug('rdb ' + args.join(' ')); } info(...args: string[]): void { console.info('rdb ' + args.join(' ')); } warn(...args: string[]): void { console.warn('rdb ' + args.join(' ')); } error(...args: string[]): vo...
AST#export_declaration#Left export AST#class_declaration#Left class DbLogger AST#implements_clause#Left implements Logger AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left debug AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#array_t...
export class DbLogger implements Logger { debug(...args: string[]): void { console.debug('rdb ' + args.join(' ')); } info(...args: string[]): void { console.info('rdb ' + args.join(' ')); } warn(...args: string[]): void { console.warn('rdb ' + args.join(' ')); } error(...args: string[]): vo...
https://github.com/yongoe1024/RdbPlus.git/blob/4a3fc04ba5903bc1c1b194efbc557017976909dc/rdbplus/src/main/ets/log/DbLogger.ets#L6-L22
502774910dcd7edd13e67a65c47812eca09e1909
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
getAvailableTemplates
获取可用的AR卡片模板
getAvailableTemplates(): ARSceneConfig[] { return Array.from(this.sceneTemplates.values()); }
AST#method_declaration#Left getAvailableTemplates AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ARSceneConfig [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_sta...
getAvailableTemplates(): ARSceneConfig[] { return Array.from(this.sceneTemplates.values()); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L568-L570
d6d43593b8a32d796ce35ffe82232c3cbccbfb0f
github
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/rephone.ets
arkts
updatePhoneNumber
更新手机号
async updatePhoneNumber(): Promise<void> { try { this.isLoading = true; const httpRequest = http.createHttp(); const response = await httpRequest.request( `${this.serverUrl}/api/user/${this.userId}/phone`, { method: http.RequestMethod.PUT, header: { ...
AST#method_declaration#Left async updatePhoneNumber 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#typ...
async updatePhoneNumber(): Promise<void> { try { this.isLoading = true; const httpRequest = http.createHttp(); const response = await httpRequest.request( `${this.serverUrl}/api/user/${this.userId}/phone`, { method: http.RequestMethod.PUT, header: { ...
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/rephone.ets#L81-L121
1fde934d2ccb49c4d123f355b6d7a0d619975b3a
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/OneAutumn/entry/src/main/ets/common/MyHttpUtils.ets
arkts
getCollectRankData
获取收藏榜数据
async getCollectRankData(){ let res = await http.createHttp().request(Constants.collectRankApi, { method: http.RequestMethod.POST, header: { 'Content-Type': 'application/json' } }) return JSON.parse(`${res.result}`) as RankListItem[] }
AST#method_declaration#Left async getCollectRankData AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left res = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#exp...
async getCollectRankData(){ let res = await http.createHttp().request(Constants.collectRankApi, { method: http.RequestMethod.POST, header: { 'Content-Type': 'application/json' } }) return JSON.parse(`${res.result}`) as RankListItem[] }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/OneAutumn/entry/src/main/ets/common/MyHttpUtils.ets#L47-L56
bfcf3676a365c37e73fd3dcd7562613f90fb9e98
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/base/src/main/ets/viewmodel/BaseViewModel.ets
arkts
aboutToBeDeleted
生命周期:销毁 @returns {void} 无返回值
aboutToBeDeleted(): void { }
AST#method_declaration#Left aboutToBeDeleted AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToBeDeleted(): void { }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/base/src/main/ets/viewmodel/BaseViewModel.ets#L47-L48
388a2e321762b21aebe3b816d4e14affbd9811b0
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/expandtitle/src/main/ets/page/MemoItem.ets
arkts
MemoItem
笔记内容视图
@Component export default struct MemoItem { @State memoItem: MemoInfo = MEMO_DATA[0]; build() { Row() { Column({ space: Constants.MEMO_COL_SPACE }) { Text(this.memoItem.title) .fontSize($r("app.float.expanded_title_font_size_normal")) .memoTextExpand() .fontColor($r(...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct MemoItem AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right memoItem : AST#type_annotation#Left AST#primary_type#Left MemoInfo AST#primary_type#Right AST#typ...
@Component export default struct MemoItem { @State memoItem: MemoInfo = MEMO_DATA[0]; build() { Row() { Column({ space: Constants.MEMO_COL_SPACE }) { Text(this.memoItem.title) .fontSize($r("app.float.expanded_title_font_size_normal")) .memoTextExpand() .fontColor($r(...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/expandtitle/src/main/ets/page/MemoItem.ets#L23-L60
833927f154300d630b9b56f78dcdf70ac05ce3de
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/model/CalendarModel.ets
arkts
ScheduleInfo
日程点相关信息
@Observed export class ScheduleInfo { public title: string; // 标题 public location: string; // 地点 public startTime: Date; // 开始时间 public endTime: Date; // 结束时间 public describe: string; // 说明 public dateString: string; // 开始时间startTime里的年月日,如'2024/11/5' public reminderTime: number[]; // 提醒时间 constructor(...
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class ScheduleInfo AST#class_body#Left { AST#property_declaration#Left public title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // ...
@Observed export class ScheduleInfo { public title: string; public location: string; public startTime: Date; public endTime: Date; public describe: string; public dateString: string; startTime里的年月日,如'2024/11/5' public reminderTime: number[]; constructor(title: string, location: string, startTime:...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/customcalendar/model/CalendarModel.ets#L60-L80
1f0ce358c8296cfc9f4d3c0ea37e31ece1c2c708
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets
arkts
totalCount
Total data count @returns: length
totalCount(): number { return this.list.length; }
AST#method_declaration#Left totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Le...
totalCount(): number { return this.list.length; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/model/CardModel.ets#L35-L37
0b0ef06a3aa886ef7452c7e74abf792713dd9212
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets
arkts
appendMemBox
MARK: - 内存操作(Operation in memo) 添加box到内存 @param box - 要添加的box
appendMemBox(box: Box): void { this._boxes.push(box); }
AST#method_declaration#Left appendMemBox AST#parameter_list#Left ( AST#parameter#Left box : AST#type_annotation#Left AST#primary_type#Left Box AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#...
appendMemBox(box: Box): void { this._boxes.push(box); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets#L67-L69
d449ef69ebeb3fec1a6aeeb67ee086140418c824
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/components/JhDialog.ets
arkts
showTextAreaDialog
中间录入弹框 - 多行 @param options
public static showTextAreaDialog(options: JhDialogInputOptions) { DialogHelper.showTextAreaDialog({ title: options.title ?? _title, text: options.inputText as string, maxLength: options.maxLength, inputFilter: options.inputFilter, controller: options.controller, placeholder: opti...
AST#method_declaration#Left public static showTextAreaDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left JhDialogInputOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#exp...
public static showTextAreaDialog(options: JhDialogInputOptions) { DialogHelper.showTextAreaDialog({ title: options.title ?? _title, text: options.inputText as string, maxLength: options.maxLength, inputFilter: options.inputFilter, controller: options.controller, placeholder: opti...
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhDialog.ets#L223-L270
f5f40795ad0a1aee34478d2d2e8ce93f3bbff08b
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/DeviceUtils.ets
arkts
startVibration
开启振动,ohos.permission.VIBRATE @param duration @param usage
static startVibration(duration: number = 1000, usage: vibrator.Usage = 'media'): Promise<void> { return vibrator.startVibration({ type: 'time', duration: duration }, { id: 0, usage: usage }); }
AST#method_declaration#Left static startVibration AST#parameter_list#Left ( AST#parameter#Left duration : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1000 AST#expression#Right AST#parameter#Right , AST#parameter#Left usage : AST#type_annot...
static startVibration(duration: number = 1000, usage: vibrator.Usage = 'media'): Promise<void> { return vibrator.startVibration({ type: 'time', duration: duration }, { id: 0, usage: usage }); }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/DeviceUtils.ets#L255-L257
46b8301272ed58326b757d8649626d9763d6f4f8
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/accessibility/AccessibilityService.ets
arkts
触觉反馈强度
export enum HapticIntensity { OFF = 'off', LIGHT = 'light', MEDIUM = 'medium', STRONG = 'strong' }
AST#export_declaration#Left export AST#enum_declaration#Left enum HapticIntensity AST#enum_body#Left { AST#enum_member#Left OFF = AST#expression#Left 'off' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LIGHT = AST#expression#Left 'light' AST#expression#Right AST#enum_member#Right , AST#enum_member#L...
export enum HapticIntensity { OFF = 'off', LIGHT = 'light', MEDIUM = 'medium', STRONG = 'strong' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/accessibility/AccessibilityService.ets#L60-L65
010d6880bdf8665df4c1e2d6a3b5dadd82395efd
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/view/EditorComponent.ets
arkts
tipsContactBuilder
Build @ contact.
@Builder tipsContactBuilder(contactName: string) { if (contactName.length !== 0) { Text(CommonConstants.TIPS_CONTACT_SYMBOL + contactName) .fontColor($r('app.color.font_color3')) .padding({ right: $r('app.integer.builder_tips_contact'), left: $r('app.integer.builder_tips_...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right tipsContactBuilder AST#parameter_list#Left ( AST#parameter#Left contactName : 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#builder_fun...
@Builder tipsContactBuilder(contactName: string) { if (contactName.length !== 0) { Text(CommonConstants.TIPS_CONTACT_SYMBOL + contactName) .fontColor($r('app.color.font_color3')) .padding({ right: $r('app.integer.builder_tips_contact'), left: $r('app.integer.builder_tips_...
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/view/EditorComponent.ets#L152-L162
140c3f2488ec9095f313c221de497e277bf05f7c
gitee
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Bridges/Widget/DMPActionSheetController.ets
arkts
setOnShowCallback
设置显示时的回调函数
setOnShowCallback(callback: (data: ActionSheetParams) => void) { this.onShow = callback; }
AST#method_declaration#Left setOnShowCallback AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left ActionSheetParams AST#primary_type#Right AST#type_annotation#Right AST#...
setOnShowCallback(callback: (data: ActionSheetParams) => void) { this.onShow = callback; }
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Bridges/Widget/DMPActionSheetController.ets#L14-L16
86e2b6defd9f0253a742e4496770ced354c9049e
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/StrUtil.ets
arkts
strToUint8Array
字符串转Uint8Array @param src 字符串 @returns Uint8Array
public static strToUint8Array(src: string, encoding: buffer.BufferEncoding = 'utf-8'): Uint8Array { const textEncoder = new util.TextEncoder(encoding); const result = textEncoder.encodeInto(src); return result; }
AST#method_declaration#Left public static strToUint8Array AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left encoding : AST#type_annotation#Left AST#primary_type#Left AST#quali...
public static strToUint8Array(src: string, encoding: buffer.BufferEncoding = 'utf-8'): Uint8Array { const textEncoder = new util.TextEncoder(encoding); const result = textEncoder.encodeInto(src); return result; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/StrUtil.ets#L242-L246
006523b1761b32936feda1d43d52fedec8227544
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_uicontext/ace_ets_module_uicontext_api13/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_ui/ace_ets_module_uicontext/ace_ets_module_uicontext_api13/entry/src/main/ets/MainAbility/common/MessageManager.ets#L15-L15
e6edc31397f645d344541e23816080d69405c51d
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets
arkts
bottomLeftList
下部分左侧纵向滚动列表里的每一个行标题 @param item 展示的数据
@Builder bottomLeftList(item: ShowData) { // TODO:性能知识点:数据量较大,使用了[LazyForEach](https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-rendering-control-lazyforeach-V5) 进行数据懒加载优化,以降低内存占用和渲染开销 LazyForEach(item.sub, (partInfo: PartInfo, index: number) => { ListItem() { bottomLeftLi...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right bottomLeftList AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left ShowData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_bod...
@Builder bottomLeftList(item: ShowData) { LazyForEach(item.sub, (partInfo: PartInfo, index: number) => { ListItem() { bottomLeftListItem({ partInfo: partInfo }); } .id(`bottomLeftListItem${index}`) }, (partInfo: PartInfo, index: number) => partInfo.part); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/verticalhorizontallinkage/src/main/ets/view/VerticalAndHorizontalList.ets#L162-L171
44e5d8ba17d53e1d50610d86126b5f21a527afda
gitee
openharmony-tpc-incubate/photo-deal-demo
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
library/src/main/ets/components/textInput/TextEditNodeController.ets
arkts
addTextInputNode
添加声明式组件节点 用于文本框创建场景 @param data 文本框模型
addTextInputNode(data: TextInputData): void { if (this.uiContext && this.rootNode) { let node = new BuilderNode<[TextInputData]>(this.uiContext); node.build(wrapBuilder<[TextInputData]>(buildTextInputComponent), data); // build之后可以拿到组件节点FrameNode直接挂载上树 let buildFrameNode = node.getFrameNode(...
AST#method_declaration#Left addTextInputNode AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left TextInputData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_...
addTextInputNode(data: TextInputData): void { if (this.uiContext && this.rootNode) { let node = new BuilderNode<[TextInputData]>(this.uiContext); node.build(wrapBuilder<[TextInputData]>(buildTextInputComponent), data); let buildFrameNode = node.getFrameNode(); if (buildFrameNode) { ...
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/components/textInput/TextEditNodeController.ets#L90-L118
ae6115447ab5e287ffae47d39dd0cbdad88e8267
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHA.ets
arkts
@Author csx @DateTime 2024/3/20 21:43 @TODO SHA
export class SHA { /** * SHA1摘要 * @param str 带摘要的字符串 * @returns 摘要后的字符串 */ static async digestSHA1(str: string): Promise<OutDTO<string>> { return CryptoUtil.digest(str, 'SHA1'); } /** * SHA224摘要 * @param str 带摘要的字符串 * @returns 摘要后的字符串 */ static async digestSHA224(str: string): Pro...
AST#export_declaration#Left export AST#class_declaration#Left class SHA AST#class_body#Left { /** * SHA1摘要 * @param str 带摘要的字符串 * @returns 摘要后的字符串 */ AST#method_declaration#Left static async digestSHA1 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string A...
export class SHA { static async digestSHA1(str: string): Promise<OutDTO<string>> { return CryptoUtil.digest(str, 'SHA1'); } static async digestSHA224(str: string): Promise<OutDTO<string>> { return CryptoUtil.digest(str, 'SHA224'); } static async digest(str: string): Promise<OutDTO<string>> ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHA.ets#L27-L81
aff742b7456ee137c462196963970e83dfbebc63
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/etswrapper/src/main/ets/wrapper/wrapper.ets
arkts
TODO:步骤四: 订阅相关事件,当窗口活跃时,设置对应的abilityID为全局的topAbility(表示当前正活跃的窗口),必须在windowStage.loadContent之后调用 @param abilityID:UIAbility的ID @param windowStage:UIAbility对应的windowStage
export function setTopAbilityID(abilityID: string, windowStage: window.WindowStage): void { windowStage.on("windowStageEvent", (data: window.WindowStageEventType) => { if (data === window.WindowStageEventType.ACTIVE) { logger.debug(`[activeAbility]${abilityID}`); // TODO:知识点:当窗口为Active时,设置当前UIAbility的...
AST#export_declaration#Left export AST#function_declaration#Left function setTopAbilityID AST#parameter_list#Left ( AST#parameter#Left abilityID : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left windowStage : AST#type_annota...
export function setTopAbilityID(abilityID: string, windowStage: window.WindowStage): void { windowStage.on("windowStageEvent", (data: window.WindowStageEventType) => { if (data === window.WindowStageEventType.ACTIVE) { logger.debug(`[activeAbility]${abilityID}`); if (etswrapper !== undefined &&...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/etswrapper/src/main/ets/wrapper/wrapper.ets#L139-L149
0ffe72a4c65d718d1ae64ca24233f487d59fad19
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
FramedRendering/entry/src/main/ets/view/DateItemView.ets
arkts
aboutToReuse
Only five-day data is updated for one frame [Start Case4]
aboutToReuse(params: Record<string, Object>): void { hiTraceMeter.startTrace('reuse_' + (params.monthItem as Month).month, 1); this.temp.push(params.monthItem as Month); hiTraceMeter.finishTrace('reuse_' + (params.monthItem as Month).month, 1); }
AST#method_declaration#Left aboutToReuse AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotatio...
aboutToReuse(params: Record<string, Object>): void { hiTraceMeter.startTrace('reuse_' + (params.monthItem as Month).month, 1); this.temp.push(params.monthItem as Month); hiTraceMeter.finishTrace('reuse_' + (params.monthItem as Month).month, 1); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/FramedRendering/entry/src/main/ets/view/DateItemView.ets#L52-L56
14625e1fa17ad55aaac98bf9cf5209c1d4f50691
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTsConcurrent/ConcurrentThreadCommunication/InterThreadCommunicationScenario/entry/src/main/ets/managers/TaskSendDataUsage.ets
arkts
loadPictureSendData
[End receive_task_message] 通过Task的sendData方法,即时通知宿主线程信息
@Concurrent export function loadPictureSendData(count: number): IconItemSource[] { let iconItemSourceList: IconItemSource[] = []; // 遍历添加6*count个IconItem的数据 for (let index = 0; index < count; index++) { const numStart: number = index * 6; // 此处循环使用6张图片资源 iconItemSourceList.push(new IconItemSource('$me...
AST#decorated_export_declaration#Left AST#decorator#Left @ Concurrent AST#decorator#Right export function loadPictureSendData 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_li...
@Concurrent export function loadPictureSendData(count: number): IconItemSource[] { let iconItemSourceList: IconItemSource[] = []; for (let index = 0; index < count; index++) { const numStart: number = index * 6; iconItemSourceList.push(new IconItemSource('$media:startIcon', `item${numStart + 1}`)); ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/ConcurrentThreadCommunication/InterThreadCommunicationScenario/entry/src/main/ets/managers/TaskSendDataUsage.ets#L28-L45
818f643402df096536110f327b85b4cd3785c867
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/ChatbotEngine.ets
arkts
generateSmartReply
生成智能回复
async generateSmartReply( intent: string, entities: Record<string, any>, context: ConversationContext ): Promise<string> { try { const templates = this.responseTemplates.get(intent); if (!templates || templates.length === 0) { return this.getDefaultResponse(); } // 选择...
AST#method_declaration#Left async generateSmartReply AST#parameter_list#Left ( AST#parameter#Left intent : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left entities : AST#type_annotation#Left AST#primary_type#Left AST#generic...
async generateSmartReply( intent: string, entities: Record<string, any>, context: ConversationContext ): Promise<string> { try { const templates = this.responseTemplates.get(intent); if (!templates || templates.length === 0) { return this.getDefaultResponse(); } ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ChatbotEngine.ets#L228-L249
90743c4b8c5a6af20f6f15c13c860a3eb1ca3a52
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/component/TextInputDialogView.ets
arkts
aboutToAppear
设置深色浅色,默认跟随系统。
aboutToAppear(): void { this.text = this.options.text ?? ""; this.modifier.inputFilter = this.options.inputFilter; this.showPassword = this.options.showPassword ?? false; if (this.options.cancelButton) { this.cancelButton = this.options.cancelButton; } this.customOptions = (this.options as...
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#assignment_expression#Left AST#memb...
aboutToAppear(): void { this.text = this.options.text ?? ""; this.modifier.inputFilter = this.options.inputFilter; this.showPassword = this.options.showPassword ?? false; if (this.options.cancelButton) { this.cancelButton = this.options.cancelButton; } this.customOptions = (this.options as...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/component/TextInputDialogView.ets#L42-L54
477230431bf206707c5d03b867cdf72352fc01f5
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.DownloadFileButton.d.ets
arkts
DownloadFileButton
Declare Component DownloadFileButton @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
@Component export declare struct DownloadFileButton { /** * Set DownloadFileButton Content. * * @type { DownloadContentOptions }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ @State contentOptions: DownloadContentOptions; /** * Set Downloa...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct DownloadFileButton AST#component_body#Left { /** * Set DownloadFileButton Content. * * @type { DownloadContentOptions }. * @syscap SystemCapability.ArkUI.ArkUI.Full ...
@Component export declare struct DownloadFileButton { @State contentOptions: DownloadContentOptions; @State styleOptions: DownloadStyleOptions; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.DownloadFileButton.d.ets#L328-L350
398bedbde3d3ab9837f402331dca7f016a5b940f
gitee