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
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Security/Huks/entry/src/main/ets/model/HuksModel.ets
arkts
getImportKeyProperties
导入SM4密钥属性信息
function getImportKeyProperties(properties: HuksProperties[]): void { let index = 0; properties[index++] = { tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_SM4 }; properties[index++] = { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128 }...
AST#function_declaration#Left function getImportKeyProperties AST#parameter_list#Left ( AST#parameter#Left properties : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left HuksProperties [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Rig...
function getImportKeyProperties(properties: HuksProperties[]): void { let index = 0; properties[index++] = { tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_SM4 }; properties[index++] = { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128 }...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Security/Huks/entry/src/main/ets/model/HuksModel.ets#L215-L231
4050d1d8eb698b6553fc513e720767d88f2d9ed4
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/dialog/DialogBuilder.ets
arkts
ToastTipBuilder
ToastTip
@Builder export function ToastTipBuilder(options: ToastTipOptions) { ToastTipView({ options: options }); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function ToastTipBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ToastTipOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#paramete...
@Builder export function ToastTipBuilder(options: ToastTipOptions) { ToastTipView({ options: options }); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogBuilder.ets#L214-L217
76bfed14de376f356d1d2b882c71046af094b91f
gitee
wuyuanwuhui999/harmony-arkts-movie-app-ui.git
d5e9bebe1dca2759cba417d2b6b402941d3bc273
entry/src/main/ets/pages/MoviePlayPage.ets
arkts
blockStyle
电影分组
@Styles blockStyle(){ .backgroundColor(colors.blockColor) .borderRadius(size.blockBorderRaduis) .padding(size.pagePadding) .width('100%') .margin({ top: size.pagePadding }) }
AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right blockStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . backgroundColor ( AST#expression#Left AST#member_expression#Left AST#expression#Left colors AST#expression#Righ...
@Styles blockStyle(){ .backgroundColor(colors.blockColor) .borderRadius(size.blockBorderRaduis) .padding(size.pagePadding) .width('100%') .margin({ top: size.pagePadding }) }
https://github.com/wuyuanwuhui999/harmony-arkts-movie-app-ui.git/blob/d5e9bebe1dca2759cba417d2b6b402941d3bc273/entry/src/main/ets/pages/MoviePlayPage.ets#L26-L32
09085350985eb2865813151b17d3e12078af6289
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Notification/Notification/entry/src/main/ets/publish/PublishOperation.ets
arkts
notificationManager
发布通知
notificationManager.publish(notificationRequest, (err: Base.BusinessError) => { if (err) { hilog.error(DOMAIN_NUMBER, TAG, `Failed to publish notification. Code is ${err.code}, message is ${err.message}`); return; } hilog.info(DOMAIN_NUMBER, TAG, 'Succeeded in publishing noti...
AST#method_declaration#Left notificationManager AST#ERROR#Left . publish ( AST#parameter#Left notificationRequest AST#parameter#Right , AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left Base . BusinessError AST#qualified_type#Right ...
notificationManager.publish(notificationRequest, (err: Base.BusinessError) => { if (err) { hilog.error(DOMAIN_NUMBER, TAG, `Failed to publish notification. Code is ${err.code}, message is ${err.message}`); return; } hilog.info(DOMAIN_NUMBER, TAG, 'Succeeded in publishing noti...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Notification/Notification/entry/src/main/ets/publish/PublishOperation.ets#L63-L70
d661a44cb0145e3400898ccb67a5c32630060ec1
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/timeto/TimeToManager.ets
arkts
getLastResult
获取上次执行结果,返回 true/false/undefined
public static getLastResult(type: TimeToType): boolean | undefined { return TimeToManager.getLastResultByName(type); }
AST#method_declaration#Left public static getLastResult AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left TimeToType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary...
public static getLastResult(type: TimeToType): boolean | undefined { return TimeToManager.getLastResultByName(type); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L49-L51
bf470eac4421c8a9ae599f72a54c03ed6758c110
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/model/SearchConfig.ets
arkts
@author 2008 @datetime 2024/8/15 0:06 @className: SearchConfig
export class SearchConfig { path: string; method: string; body: string; charset: string; url: string; webView:boolean; constructor(path: string, method: string, body: string, charset: string, url: string, webView:boolean) { this.path = path; this.method = method.toUpperCase(); // 确保方法为大写 this...
AST#export_declaration#Left export AST#class_declaration#Left class SearchConfig AST#class_body#Left { AST#property_declaration#Left path : 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 method : AST#t...
export class SearchConfig { path: string; method: string; body: string; charset: string; url: string; webView:boolean; constructor(path: string, method: string, body: string, charset: string, url: string, webView:boolean) { this.path = path; this.method = method.toUpperCase(); this.body = bo...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/model/SearchConfig.ets#L6-L27
d1daaf16bff1f00c841a1ac99523228556039f8b
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowDataSource.ets
arkts
Delete1stItem
删除第一个元素
public Delete1stItem(): void { this.dataArray.splice(0, 1); this.notifyDataDelete(0); }
AST#method_declaration#Left public Delete1stItem 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#exp...
public Delete1stItem(): void { this.dataArray.splice(0, 1); this.notifyDataDelete(0); }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowDataSource.ets#L104-L107
14874898f7512ecdd54bea903b3fa682ba09e325
gitee
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/Cpu_info_float_windows/hap/Cpu_info_3.8/entry/src/main/ets/controller/FloatWindowController.ets
arkts
createAndShowFloatWindow
创建悬浮窗
private async createAndShowFloatWindow(context: common.UIAbilityContext) { if (context.isTerminating()) { return; } console.info(TAG,` createAndShowWindow`); let w = display.getDefaultDisplaySync().width;//获取屏幕宽度 let h = display.getDefaultDisplaySync().height;//获取屏幕宽度 // 创建应用子窗口 thi...
AST#method_declaration#Left private async createAndShowFloatWindow AST#parameter_list#Left ( AST#parameter#Left context : 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#parameter#Right ) AST#p...
private async createAndShowFloatWindow(context: common.UIAbilityContext) { if (context.isTerminating()) { return; } console.info(TAG,` createAndShowWindow`); let w = display.getDefaultDisplaySync().width; let h = display.getDefaultDisplaySync().height; this.floatWindow = await wind...
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/Cpu_info_float_windows/hap/Cpu_info_3.8/entry/src/main/ets/controller/FloatWindowController.ets#L60-L92
b8b2c6aedd0c4018c7d2edda3b9de2898aa795a1
gitee
JackJiang2011/harmonychat.git
bca3f3e1ce54d763720510f99acf595a49e37879
entry/src/main/ets/pages/utils/ToolKits.ets
arkts
setStatusBarColor
设置全面屏状态栏颜色。 @param context 上下文对象 @param statusBarContentColor 状态栏文本颜色 @param statusBarColor 状态栏背景色
static setStatusBarColor(context: common.BaseContext, statusBarContentColor: string, statusBarColor: string) { // window.getLastWindow(context).then((windowClass: window.Window) => { // 这种方式获得window对象时,在page首次启动后,为啥在onPageShow里调用setStatusBarColor没效果? try { let windowClass = AppStorage.get<window.Windo...
AST#method_declaration#Left static setStatusBarColor AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . BaseContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left statu...
static setStatusBarColor(context: common.BaseContext, statusBarContentColor: string, statusBarColor: string) { try { let windowClass = AppStorage.get<window.Window>('window') windowClass?.setWindowSystemBarProperties({ statusBarContentColor: statusBarContentColor, statusB...
https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/utils/ToolKits.ets#L47-L62
1f8e940b47725209f6d5b41ae20d7cc1fa70ff84
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SimpleBirthdayApp.ets
arkts
buildBirthdayCard
构建生日卡片
@Builder buildBirthdayCard(contact: Contact, isToday: boolean) { Row({ space: 12 }) { // 头像 Column() { Text(contact.name.charAt(0)) .fontSize(20) .fontWeight(FontWeight.Bold) .fontColor('#FFFFFF') } .width(48) .height(48) .borderRadius(24) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBirthdayCard AST#parameter_list#Left ( AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left isToday : AST#type_annota...
@Builder buildBirthdayCard(contact: Contact, isToday: boolean) { Row({ space: 12 }) { Column() { Text(contact.name.charAt(0)) .fontSize(20) .fontWeight(FontWeight.Bold) .fontColor('#FFFFFF') } .width(48) .height(48) .borderRadius(24) ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L586-L675
2ba2f28dec1696e63546d3b66c74a1c11cf16489
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/watermark/src/main/ets/view/MainView.ets
arkts
showToast
弹窗函数
showToast() { promptAction.showToast({ message: $r('app.string.water_mark_toast_message') }) }
AST#method_declaration#Left showToast AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast AST#memb...
showToast() { promptAction.showToast({ message: $r('app.string.water_mark_toast_message') }) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/watermark/src/main/ets/view/MainView.ets#L85-L89
22f261ef3fad56b16da4e39de33829079b9da55b
gitee
wasd09090030/MyHongmengProject.git
a8ed386b658ceeac69ef5bc42a92d78c7980821c
entry/src/main/ets/components/TimerPage.ets
arkts
TimerContent
倒计时内容
@Builder TimerContent() { Column() { // 显示当前关联的任务(如果有) if (this.currentTask) { Row({ space: 12 }) { SymbolGlyph($r('sys.symbol.flag_fill')) .fontSize(24) .fontColor(['#007DFF']) Column({ space: 4 }) { Text('当前专注任务') .fontSi...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TimerContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 显示当前关联的任务(如果有...
@Builder TimerContent() { Column() { if (this.currentTask) { Row({ space: 12 }) { SymbolGlyph($r('sys.symbol.flag_fill')) .fontSize(24) .fontColor(['#007DFF']) Column({ space: 4 }) { Text('当前专注任务') .fontSize(12) ...
https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/TimerPage.ets#L271-L525
9433c9d2c6e7e0d4ab62937f15c86d52bc745672
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/animation/ChartAnimator.ets
arkts
animateX
/** * Animates values along the X axis, in a linear fashion. * * @param durationMillis animation duration public animateX(durationMillis:number) { animateX(durationMillis, Easing.Linear); } Animates values along the X axis. @param durationMillis animation duration @param easing EasingFunction
public animateX(durationMillis: number): void;
AST#method_declaration#Left public animateX AST#parameter_list#Left ( AST#parameter#Left durationMillis : 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#primar...
public animateX(durationMillis: number): void;
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/animation/ChartAnimator.ets#L97-L97
0a9b58c568219b75868da27812bd2311e76385dc
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plandb/PlanDbAccess.ets
arkts
createDbIfNeeds
private constructor() { //createFolderIfNeeds(this.getDbFolder()); this.db = new DBAccessor(this.getDbPath(), null, false); this.createDbIfNeeds(); } getDbFolder():string { return BookManager.getCurrentDirectoryOfUserData() } getDbPath(): string { return BookManager.getCurrentPathOfUserData() } refreshDb(): void { t...
createDbIfNeeds(): void { if (!this.db) return; const sqlPlan = `CREATE TABLE IF NOT EXISTS "${Tables.Plan.name}" ( "${Tables.Plan.Col.planId}" INTEGER PRIMARY KEY NOT NULL, "${Tables.Plan.Col.planName}" TEXT, "${Tables.Plan.Col.bookId}" INTEGER, "${...
AST#method_declaration#Left createDbIfNeeds AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left ...
createDbIfNeeds(): void { if (!this.db) return; const sqlPlan = `CREATE TABLE IF NOT EXISTS "${Tables.Plan.name}" ( "${Tables.Plan.Col.planId}" INTEGER PRIMARY KEY NOT NULL, "${Tables.Plan.Col.planName}" TEXT, "${Tables.Plan.Col.bookId}" INTEGER, "${...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plandb/PlanDbAccess.ets#L96-L136
0e73788e66c9106c4adc40e618c95bbe2037b3c0
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/component/partView/DialogHeaderBuilder.ets
arkts
DialogHeaderBuilder
弹窗标题+按钮(如用在picker顶部,标题+按钮) @param title 中间标题 @param primaryButton 左侧按钮 @param secondaryButton 右侧按钮 @param headerStyle 样式 @param onBtnClick 点击事件
@Builder export function DialogHeaderBuilder(title: ResourceStr | undefined, headerStyle: ITextStyle | undefined, primaryButton?: CustomButtonOptions, secondaryButton?: CustomButtonOptions, onBtnClick?: (isPrimary: boolean) => void) { Row() { if (primaryButton?.value) { Button(primaryButton?.value) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function DialogHeaderBuilder AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ResourceStr AST#primary_type#Right | AST#primary_type#Left undefined AST#prim...
@Builder export function DialogHeaderBuilder(title: ResourceStr | undefined, headerStyle: ITextStyle | undefined, primaryButton?: CustomButtonOptions, secondaryButton?: CustomButtonOptions, onBtnClick?: (isPrimary: boolean) => void) { Row() { if (primaryButton?.value) { Button(primaryButton?.value) ...
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/component/partView/DialogHeaderBuilder.ets#L12-L74
f94e1ef22f703477f86ae86d707ffaa685ef42f4
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/AES.ets
arkts
encryptECBSync
加密(ECB模式),异步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(AES256|ECB|PKCS7、AES192|ECB|PKCS7、AES128|ECB|PKCS7)。 @returns
static encryptECBSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, transformation: string = 'AES256|ECB|PKCS7'): cryptoFramework.DataBlob { return AES.encryptSync(data, symKey, null, transformation); }
AST#method_declaration#Left static encryptECBSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKe...
static encryptECBSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, transformation: string = 'AES256|ECB|PKCS7'): cryptoFramework.DataBlob { return AES.encryptSync(data, symKey, null, transformation); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/AES.ets#L175-L178
8ff51ec3e7e61df61fb4bc4a453161f1ac621a1e
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseEntry.ets
arkts
getData
Returns the data, additional information that this Entry represents, or null, if no data has been specified. @return
public getData(): Object { return this.mData; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Object 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 getData(): Object { return this.mData; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/BaseEntry.ets#L79-L81
060fbb27e11a140163ac8cf9d872d87f10bd95c9
gitee
dou101101/ZenFocus-HarmonyOS.git
9364599b8b20bc6377fc55ac68b991b61ceb8496
MyApplication/entry/src/main/ets/pages/Index.ets
arkts
startAmbientAnimations
=== 动画系统 ===
startAmbientAnimations() { // 主树的呼吸效果 animateTo({ duration: 3000, curve: Curve.Smooth, iterations: -1, playMode: PlayMode.Alternate }, () => { this.breathingScale = 1.05; }); }
AST#method_declaration#Left startAmbientAnimations AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 主树的呼吸效果 AST#ui_custom_component_statement#Left animateTo ( AST#ERROR#Left AST#component_parameters#Left { AST#component_parameter#Left duration : AST#expression#Left 3000 AST#expre...
startAmbientAnimations() { animateTo({ duration: 3000, curve: Curve.Smooth, iterations: -1, playMode: PlayMode.Alternate }, () => { this.breathingScale = 1.05; }); }
https://github.com/dou101101/ZenFocus-HarmonyOS.git/blob/9364599b8b20bc6377fc55ac68b991b61ceb8496/MyApplication/entry/src/main/ets/pages/Index.ets#L210-L220
28ec8703575574f425fa2db8bcb84d1f4ac8ef87
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/structures/DMChannel.ets
arkts
setup
应用ArkTS约束:添加方法参数类型声明
setup(data: unknown): void { super.setup(data); if (data.recipients && data.recipients.length > 0) { this.recipient = this.client.dataManager.newUser(data.recipients[0]); } this.lastMessageID = data.last_message_id ?? null; this.lastPinTimestamp = data.last_pin_timestamp ? new Date(da...
AST#method_declaration#Left setup AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left unknown 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#ty...
setup(data: unknown): void { super.setup(data); if (data.recipients && data.recipients.length > 0) { this.recipient = this.client.dataManager.newUser(data.recipients[0]); } this.lastMessageID = data.last_message_id ?? null; this.lastPinTimestamp = data.last_pin_timestamp ? new Date(da...
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/DMChannel.ets#L24-L35
0b4d16b1c3c5e0d704bd1e098dce300565f3f71e
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/StateManagement/entry/src/main/ets/segment/segment6.ets
arkts
Segment06Builder
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Builder export function Segment06Builder() { NavDestination(){ UserInfoView() } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function Segment06Builder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavDestination ( ) AST#containe...
@Builder export function Segment06Builder() { NavDestination(){ UserInfoView() } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/StateManagement/entry/src/main/ets/segment/segment6.ets#L15-L20
c8c230ddb4d3df998877788c862e959c0d981b9e
gitee
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
entry/src/main/ets/model/VideoInfo.ets
arkts
Strongly-typed metadata of a single video segment.
export class VideoInfo { /** Index of the video (0-based). */ index: number = -1; /** Video source URL. */ videoSrc: string = ''; /** Video start time in ISO 8601 (if available from metadata). */ startTime: string = ''; /** Video end time in ISO 8601 (if available from metadata). */ endTime: string = ''...
AST#export_declaration#Left export AST#class_declaration#Left class VideoInfo AST#class_body#Left { /** Index of the video (0-based). */ AST#property_declaration#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression...
export class VideoInfo { index: number = -1; videoSrc: string = ''; startTime: string = ''; endTime: string = ''; duration: string = '0'; genre: string = ''; title: string = ''; videoHeight: string = '0'; videoWidth: string = '0'; videoOrientation: string = '0'; }
https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/entry/src/main/ets/model/VideoInfo.ets#L18-L39
93521c30c87d7fb13a70200401913cd644459d91
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/dialog/DialogHelper.ets
arkts
showTextPickerDialog
显示选择器弹框;入参参考TextPicker组件 @param options @returns
static showTextPickerDialog(options: TextPickerOptions): string { ActionParameter.initBaseDefault(options); ActionParameter.initTextPickerDefault(options); const dialogId = ActionBaseCore.getInstance().openCustomDialog(wrapBuilder(TextPickerDialogBuilder), options); return dialogId; }
AST#method_declaration#Left static showTextPickerDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left TextPickerOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left...
static showTextPickerDialog(options: TextPickerOptions): string { ActionParameter.initBaseDefault(options); ActionParameter.initTextPickerDefault(options); const dialogId = ActionBaseCore.getInstance().openCustomDialog(wrapBuilder(TextPickerDialogBuilder), options); return dialogId; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L258-L263
0c0822f0806a8b59276590326c3101f21a2b86ed
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/Rect.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 RectF { /** * Rect left edge. */ left: number; /** * Rect top edge. */ top: number; /** * Rect right edge. */ right: number; /** * Rect bottom edge. */ bottom: number; /** * Constructor. */ constructor() { this.left = 0; this.top = 0; this.r...
AST#export_declaration#Left export AST#class_declaration#Left class RectF AST#class_body#Left { /** * Rect left edge. */ AST#property_declaration#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * Rect top ed...
export class RectF { left: number; top: number; right: number; bottom: number; constructor() { this.left = 0; this.top = 0; this.right = 0; this.bottom = 0; } set(left: number, top: number, right: number, bottom: number): void { this.left = left; this.top = t...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets#L17-L134
ab86c9ce3baaaead6003bccaaa2b19df9f0a0b86
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkWebrenderingframework/entry/src/main/ets/pages/proxy.ets
arkts
nativeCall
[Start call]
nativeCall(channelType: string, object: string) { let objectJson = JSON.stringify(object); let resultJson :string= window.JSBridge && window.JSBridge.nativeMethod(channelType, objectJson); return resultJson && JSON.parse(resultJson); }
AST#method_declaration#Left nativeCall AST#parameter_list#Left ( AST#parameter#Left channelType : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left object : AST#type_annotation#Left AST#primary_type#Left string AST#primary_typ...
nativeCall(channelType: string, object: string) { let objectJson = JSON.stringify(object); let resultJson :string= window.JSBridge && window.JSBridge.nativeMethod(channelType, objectJson); return resultJson && JSON.parse(resultJson); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkWebrenderingframework/entry/src/main/ets/pages/proxy.ets#L103-L107
ca84dc1fd491e002a0371d80a5b18cbe2f1696a2
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/utils/EncryptUtils.ets
arkts
md5
MD5 哈希(简化实现) 注意:实际项目中应使用更安全的哈希算法
static async md5(text: string): Promise<string> { try { // 实际实现需要使用 cryptoFramework // 这里提供接口定义 return `md5_${text}`; } catch (error) { return ''; } }
AST#method_declaration#Left static async md5 AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Pr...
static async md5(text: string): Promise<string> { try { return `md5_${text}`; } catch (error) { return ''; } }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/EncryptUtils.ets#L12-L20
ae25714343f55c39b0d0dab4cccf5127b9c881c8
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/pages/TitleWindowPage.ets
arkts
subscribeCallBack
订阅公共事件回调
function subscribeCallBack(err, data) { if (data.data == '') { } else { console.error('subscriberCurData:' + data.data); that.tIndexInfo = JSON.parse(data.data) globalThis.cpu0Frequency = that.tIndexInfo.cpu0Frequency globalThis.cpu1Frequency = that.tIndexInfo.cpu1Frequency ...
AST#function_declaration#Left function subscribeCallBack AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right , AST#parameter#Left data AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left A...
function subscribeCallBack(err, data) { if (data.data == '') { } else { console.error('subscriberCurData:' + data.data); that.tIndexInfo = JSON.parse(data.data) globalThis.cpu0Frequency = that.tIndexInfo.cpu0Frequency globalThis.cpu1Frequency = that.tIndexInfo.cpu1Frequency ...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/pages/TitleWindowPage.ets#L65-L91
9bce3fddd81b7a96d07602e1a4f5e3f1afe08a9d
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/MePage.ets
arkts
OrderSection
订单管理
@Builder OrderSection() { Column() { Column({ space: AppDimensions.spaceMedium }) { // 标题行 Row() { Row({ space: AppDimensions.spaceSmall }) { Text('📋') .fontSize(18) Text('我的订单') .fontSize(AppTypography.fontSizeLarge) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right OrderSection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_ele...
@Builder OrderSection() { Column() { Column({ space: AppDimensions.spaceMedium }) { Row() { Row({ space: AppDimensions.spaceSmall }) { Text('📋') .fontSize(18) Text('我的订单') .fontSize(AppTypography.fontSizeLarge) .f...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/MePage.ets#L124-L170
a5dcd21b330de07fce56282e30bd8e89359931b1
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/ZipTool.ets
arkts
ZIP 压缩解压工具类 使用 @ohos.zlib 实现沙箱目录下的文件压缩与解压
export class ZipTool { // MARK: - 压缩目录 static async createOneZip( srcPath: string, options?: zlib.Options ): Promise<string | null> { // 确保目标路径存在且为文件或文件夹 if (!FileUtility.isFileExistAt(srcPath)) { return null } // 目标zip文件路径 const zipPath = `${FileUtility.normalizePath(srcPath)}...
AST#export_declaration#Left export AST#class_declaration#Left class ZipTool AST#class_body#Left { // MARK: - 压缩目录 AST#method_declaration#Left static async createOneZip AST#parameter_list#Left ( AST#parameter#Left srcPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#...
export class ZipTool { static async createOneZip( srcPath: string, options?: zlib.Options ): Promise<string | null> { if (!FileUtility.isFileExistAt(srcPath)) { return null } const zipPath = `${FileUtility.normalizePath(srcPath)}.zip` FileUtility.deleteFileAt(zipPa...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ZipTool.ets#L18-L168
bb4791417528f2b015c7c38ecfc8999a35f4e991
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/utils/dataSource.ets
arkts
唯一id
constructor(id: string) { this.id = id; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left...
constructor(id: string) { this.id = id; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/utils/dataSource.ets#L5-L7
a1c830951f180a2f9e169c22030d0bbce1ea61b9
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/MD5.ets
arkts
hash
散列哈希算法 @param value 待处理字符 @param enCoding 编码格式hex/base64 @returns
static hash(value: string, enCoding?: string): string { let md = new MD5(); if (enCoding && enCoding == 'base64') { let md5 = md.b64_md5(value); if (!md5.endsWith('==')) { md5 += '=='; } return md5; } return md.hex_md5(value); }
AST#method_declaration#Left static hash AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left enCoding ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static hash(value: string, enCoding?: string): string { let md = new MD5(); if (enCoding && enCoding == 'base64') { let md5 = md.b64_md5(value); if (!md5.endsWith('==')) { md5 += '=='; } return md5; } return md.hex_md5(value); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/MD5.ets#L47-L57
320746e8402bef89cca54e52cbac1da9398af423
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
entry/src/main/ets/pages/Index.ets
arkts
customTextBuilder
自定义文本
@Builder customTextBuilder(content: string) { Column() { Text(content) .fontSize(16) .padding(5) .textShadow({ color: Color.Brown, type: ShadowType.COLOR, radius: 3, offsetX: 4, offsetY: 4, fill: false }) }.paddi...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customTextBuilder 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#builder_function...
@Builder customTextBuilder(content: string) { Column() { Text(content) .fontSize(16) .padding(5) .textShadow({ color: Color.Brown, type: ShadowType.COLOR, radius: 3, offsetX: 4, offsetY: 4, fill: false }) }.paddi...
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/entry/src/main/ets/pages/Index.ets#L108-L127
d3839d04534c06f84f8e3c8630085089a9fb5d52
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Ability/UIAbilityLifeCycle/entry/src/main/ets/common/constants/CommonConstants.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, soft...
export default class CommonConstants{ /** * The text high */ static TEXT_HEIGHT: number = 50; /** * The text width */ static DEFAULT_MARGIN: number = 30; /** * Full the width. */ static FULL_WIDTH: string = '100%'; /** * Full the height. */ static FULL_HEIGHT: string = '100%';...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * The text high */ AST#property_declaration#Left static TEXT_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 5...
export default class CommonConstants{ static TEXT_HEIGHT: number = 50; static DEFAULT_MARGIN: number = 30; static FULL_WIDTH: string = '100%'; static FULL_HEIGHT: string = '100%'; static DEFAULT_FONT_SIZE: number = 30; static DOMAIN: number = 0x0000; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/UIAbilityLifeCycle/entry/src/main/ets/common/constants/CommonConstants.ets#L16-L46
f3cf71cb75278424ccf67348dc383a0abc20bece
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/search/LinearSearch.ets
arkts
findLast
查找最后一个满足条件的元素 @param arr 数组 @param predicate 判断条件函数 @returns 最后一个满足条件的元素索引,如果不存在则返回-1
public static findLast(arr: number[], predicate: (value: number) => boolean): number { if (!arr || arr.length === 0) { return -1; } for (let i = arr.length - 1; i >= 0; i--) { if (predicate(arr[i])) { return i; } } return -1; }
AST#method_declaration#Left public static findLast AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left predicate : AST#type_annotati...
public static findLast(arr: number[], predicate: (value: number) => boolean): number { if (!arr || arr.length === 0) { return -1; } for (let i = arr.length - 1; i >= 0; i--) { if (predicate(arr[i])) { return i; } } return -1; }
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/search/LinearSearch.ets#L72-L84
fd225061fd6f3bed8f655d5ad71346400d7ee02b
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets
arkts
clear
Clear data in PreferencesHandler.
public clear() { if (this.preferences != null) { this.preferences.clear(); } }
AST#method_declaration#Left public clear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Righ...
public clear() { if (this.preferences != null) { this.preferences.clear(); } }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets#L90-L94
4313ae5cb84197dcf1f5b5da4f5997e3353f9366
gitee
euler1129/Cloud-flash-payment.git
dfb70c1c67b3b69447f4384661e16b60f40495de
entry/src/main/ets/pages/card/common/utils/methods.ets
arkts
export async function takePhoto() { //打开相机 await abilityAccessCtrl.createAtManager() .requestPermissionsFromUser(getContext(this), ['ohos.permission.CAMERA', 'ohos.permission.READ_MEDIA']) let context = getContext(this) as common.UIAbilityContext let result = await context.startAbilityForResult({ action: "ohos.want.act...
export async function takePhoto() { let context = getContext() as common.UIAbilityContext let want = { 'uri': '', 'action': "ohos.want.action.imageCapture", 'parameters': {}, }; return context.startAbilityForResult(want) .then((result) => { if (result.resultCode === 0 && result.want && resul...
AST#export_declaration#Left export AST#function_declaration#Left async function takePhoto AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left context = AST#expression#Left AST#as_expression#Left AST#expression#...
export async function takePhoto() { let context = getContext() as common.UIAbilityContext let want = { 'uri': '', 'action': "ohos.want.action.imageCapture", 'parameters': {}, }; return context.startAbilityForResult(want) .then((result) => { if (result.resultCode === 0 && result.want && resul...
https://github.com/euler1129/Cloud-flash-payment.git/blob/dfb70c1c67b3b69447f4384661e16b60f40495de/entry/src/main/ets/pages/card/common/utils/methods.ets#L16-L37
c32ebdadfe0ab889d5d9ba673e9174e2859b2012
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
AtomicService/DxinPoetry/entry/src/main/ets/model/PoetryMenuEssence.ets
arkts
作者数据格式
export interface AuthorType { id: number name: string }
AST#export_declaration#Left export AST#interface_declaration#Left interface AuthorType AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right AST#type_member#Left name : AST#type_annotation#Left AST#pr...
export interface AuthorType { id: number name: string }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/DxinPoetry/entry/src/main/ets/model/PoetryMenuEssence.ets#L38-L41
0b5f967615c3b80387065a07dc976d46b2ea3ef2
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/ciphers/HillCipher.ets
arkts
numbersToText
将数字数组转换为文本 @param numbers 数字数组 @returns 文本
private static numbersToText(numbers: number[]): string { return numbers.map(num => { const index = (num % HillCipher.MOD); return HillCipher.ALPHABET.charAt(index); }).join(''); }
AST#method_declaration#Left private static numbersToText AST#parameter_list#Left ( AST#parameter#Left numbers : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_an...
private static numbersToText(numbers: number[]): string { return numbers.map(num => { const index = (num % HillCipher.MOD); return HillCipher.ALPHABET.charAt(index); }).join(''); }
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/HillCipher.ets#L74-L79
8c01a973931821e7a6ef909167079a293ab68f16
github
DEMON-coding/HarmonyOs-Clock-Demo.git
f3c71a3d5ac478d463dfed068b89582104d2f9f6
entry/src/main/ets/common/utils/ReminderService.ets
arkts
引入发布通知的方法 定时检查并发布通知 @param morningOn 是否开启早晨提醒 @param morningHour 早晨提醒的小时 @param morningMinute 早晨提醒的分钟 @param noonOn 是否开启中午提醒 @param noonHour 中午提醒的小时 @param noonMinute 中午提醒的分钟 @param eveningOn 是否开启晚上提醒 @param eveningHour 晚上提醒的小时 @param eveningMinute 晚上提醒的分钟
export function startReminderCheck( morningOn: boolean, morningHour: number, morningMinute: number, noonOn: boolean, noonHour: number, noonMinute: number, eveningOn: boolean, eveningHour: number, eveningMinute: number ) { setInterval(() => { const currentTime = new Date(); const hour = currentTime.getHo...
AST#export_declaration#Left export AST#function_declaration#Left function startReminderCheck AST#parameter_list#Left ( AST#parameter#Left morningOn : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left morningHour : AST#type_an...
export function startReminderCheck( morningOn: boolean, morningHour: number, morningMinute: number, noonOn: boolean, noonHour: number, noonMinute: number, eveningOn: boolean, eveningHour: number, eveningMinute: number ) { setInterval(() => { const currentTime = new Date(); const hour = currentTime.getHo...
https://github.com/DEMON-coding/HarmonyOs-Clock-Demo.git/blob/f3c71a3d5ac478d463dfed068b89582104d2f9f6/entry/src/main/ets/common/utils/ReminderService.ets#L15-L37
ff15ab01f46a1c3f5f998b83dcc6bd3271ca4d81
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/SwiperArkTS/entry/src/main/ets/view/common/Banner.ets
arkts
Banner
Carousel banner.
@Component export struct Banner { // Change the index value through a scheduled task to perform a round robin. @State index: number = 0; private imageArray: Array<PictureItem> = []; private swiperController: SwiperController = new SwiperController(); aboutToAppear() { // Data Initialization. this.ima...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct Banner AST#component_body#Left { // Change the index value through a scheduled task to perform a round robin. AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right index : AST#type_annotation#Le...
@Component export struct Banner { @State index: number = 0; private imageArray: Array<PictureItem> = []; private swiperController: SwiperController = new SwiperController(); aboutToAppear() { this.imageArray = initializePictures(PictureType.BANNER); startPlay(this.swiperController); } ...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SwiperArkTS/entry/src/main/ets/view/common/Banner.ets#L38-L95
f465db44a95a067e7cd5352f9a829b439d8747f4
gitee
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/PanKouComponent.ets
arkts
getCube
盘口头部的数据
getCube(): Array<Array<Array<string>>> { var cube: Array<Array<Array<string>>> = [ [ ['高', this.stockBasicInfoBean.snap.high.toString()], ['市值', (this.stockBasicInfoBean.snap.amount / 100000 / 100).toFixed(2).toString()], ['量', (this.stockBasicInfoBean.snap.volume / 10000...
AST#method_declaration#Left getCube 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 AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AS...
getCube(): Array<Array<Array<string>>> { var cube: Array<Array<Array<string>>> = [ [ ['高', this.stockBasicInfoBean.snap.high.toString()], ['市值', (this.stockBasicInfoBean.snap.amount / 100000 / 100).toFixed(2).toString()], ['量', (this.stockBasicInfoBean.snap.volume / 10000...
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/PanKouComponent.ets#L56-L76
280d08d283700dd2327e06f403fa0c430ca9781f
github
openharmony-tpc-incubate/photo-deal-demo
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
library/src/main/ets/components/textInput/TextEditNodeController.ets
arkts
modifyTopTextColor
修改顶部文本颜色 @param color 颜色
modifyTopTextColor(color: string): void { // 只修改最顶部处于编辑状态的颜色 let record: OperateRecord | undefined; for (let end = this.textRecords.length - 1; end >= 0; end--) { record = this.textRecords[end]; if (record.data instanceof TextInputData && record.data.isActivated()) { record.data.color = ...
AST#method_declaration#Left modifyTopTextColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type...
modifyTopTextColor(color: string): void { let record: OperateRecord | undefined; for (let end = this.textRecords.length - 1; end >= 0; end--) { record = this.textRecords[end]; if (record.data instanceof TextInputData && record.data.isActivated()) { record.data.color = color; ret...
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/components/textInput/TextEditNodeController.ets#L181-L191
8f04206429e31e2b8ffed07d72edcb36a9271bd0
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets
arkts
getData
获取指定索引数据。 @param {number} index - 索引值。 @returns {CustomDataType} 返回指定索引数据。
public getData(index: double): CustomDataType { return this.originDataArray[index]; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left double AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CustomDataType AST#primar...
public getData(index: double): CustomDataType { return this.originDataArray[index]; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets#L77-L79
6a20785543c13a2f99a8ffce93c0220a7ddfb31b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/game/VirtualShopPage.ets
arkts
buildHeader
构建头部
@Builder buildHeader() { Row() { Button() { Image($r('app.media.ic_back')) .width(24) .height(24) .fillColor($r('app.color.text_primary')) } .type(ButtonType.Normal) .backgroundColor(Color.Transparent) .onClick(() => { router.back(); ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildHeader AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_element...
@Builder buildHeader() { Row() { Button() { Image($r('app.media.ic_back')) .width(24) .height(24) .fillColor($r('app.color.text_primary')) } .type(ButtonType.Normal) .backgroundColor(Color.Transparent) .onClick(() => { router.back(); ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/game/VirtualShopPage.ets#L78-L124
ac97de1e8dc37f507cda5fe28bbb2fd22daf2978
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pipwindow/src/main/ets/components/ControlPanel.ets
arkts
媒体最大音量
build() { Stack() { // 亮度调节UI Image($r('app.media.pip_window_brightness')) .width($r('app.integer.pip_window_control_panel_image_width')) .aspectRatio(ASPECT_RATIO) .visibility((this.fingerPosition !== 0 && this.fingerPosition < this.videoAreaWidth / PARTITION && this.con...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( ) AST#container_content_body#Left { // 亮度调节UI AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#resource_expre...
build() { Stack() { Image($r('app.media.pip_window_brightness')) .width($r('app.integer.pip_window_control_panel_image_width')) .aspectRatio(ASPECT_RATIO) .visibility((this.fingerPosition !== 0 && this.fingerPosition < this.videoAreaWidth / PARTITION && this.controlShow)...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pipwindow/src/main/ets/components/ControlPanel.ets#L47-L89
7ebdeb35096aaf7fc3bfae746b8c7416f564614a
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/utils/ScreenUtils.ets
arkts
showKeyboard
显示键盘
static showKeyboard(): void { // 实际实现需要使用 InputMethod 相关API // InputMethod.showKeyboard(); }
AST#method_declaration#Left static showKeyboard 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 { // 实际实现需要使用 InputMethod 相关API // InputMethod.showKeyboard(); } AST#builder_function...
static showKeyboard(): void { }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/ScreenUtils.ets#L80-L83
27cea42e392861e3f9e071147df43a724c30ac3a
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/LazyForEach.ets
arkts
Developers need to implement this interface to provide data to LazyForEach component. @since 7
export interface IDataSource<T> { /** * Total data count. * @since 7 */ totalCount(): number; /** * Return the data of index. * @since 7 */ getData(index: number): T; /** * Register data change listener. * @since 7 */ registerDataChangeListener(listen...
AST#export_declaration#Left export AST#interface_declaration#Left interface IDataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#object_type#Left { /** * Total data count. * @since 7 */ AST#type_member#Left totalCount AST#parameter_list...
export interface IDataSource<T> { totalCount(): number; getData(index: number): T; registerDataChangeListener(listener: DataChangeListener): void; unregisterDataChangeListener(listener: DataChangeListener): void; }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/LazyForEach.ets#L30-L51
d2ca8fc1a098676492eb4e1f20ac67f1e15282b4
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BubbleDataSet.ets
arkts
getMaxSize
@Override
public getMaxSize(): number { return BubbleDataSet.mMaxSize; }
AST#method_declaration#Left public getMaxSize 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 getMaxSize(): number { return BubbleDataSet.mMaxSize; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BubbleDataSet.ets#L71-L73
956f82197aa0afec56756b747ae96a1fe80e2737
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Performance/PerformanceLibrary/feature/hiDumper/src/main/ets/view/VisibilityView.ets
arkts
VisibilityView
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, soft...
@Component export struct VisibilityView { @State isVisible: Visibility = Visibility.Visible; build() { Column() { Button($r('app.string.visible')) .onClick(() => { this.isVisible = Visibility.Visible; }) .margin({ top: 10 }) Button($r('app.string.hidden')) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VisibilityView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isVisible : AST#type_annotation#Left AST#primary_type#Left Visibility AST#primary_type#Right AST#ty...
@Component export struct VisibilityView { @State isVisible: Visibility = Visibility.Visible; build() { Column() { Button($r('app.string.visible')) .onClick(() => { this.isVisible = Visibility.Visible; }) .margin({ top: 10 }) Button($r('app.string.hidden')) ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Performance/PerformanceLibrary/feature/hiDumper/src/main/ets/view/VisibilityView.ets#L16-L43
df4f428195eeea40cc7a35c8f1d141998083af26
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/utils/LunarCalendar.ets
arkts
getGanZhi
获取干支年
private static getGanZhi(year: number): string { const gan = LunarCalendar.ganNames[(year - 4) % 10]; const zhi = LunarCalendar.zhiNames[(year - 4) % 12]; return gan + zhi; }
AST#method_declaration#Left private static getGanZhi AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#prima...
private static getGanZhi(year: number): string { const gan = LunarCalendar.ganNames[(year - 4) % 10]; const zhi = LunarCalendar.zhiNames[(year - 4) % 12]; return gan + zhi; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/LunarCalendar.ets#L329-L333
fee426ab5a059ca336103ee3645dac3a9f478618
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets
arkts
@Author csx @DateTime 2024/3/18 10:48:03 @TODO RS 同步操作类
export class RSASync { /** * 生成RSA的非对称密钥 * @param resultCoding 生成RSA秘钥的字符串格式(hex/base64)-默认不传为base64格式 * @returns RSA密钥{publicKey:公钥,privateKey:私钥} */ static generateRSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('RSA1024', resultC...
AST#export_declaration#Left export AST#class_declaration#Left class RSASync AST#class_body#Left { /** * 生成RSA的非对称密钥 * @param resultCoding 生成RSA秘钥的字符串格式(hex/base64)-默认不传为base64格式 * @returns RSA密钥{publicKey:公钥,privateKey:私钥} */ AST#method_declaration#Left static generateRSAKey AST#parameter_list#Left ( AST#pa...
export class RSASync { static generateRSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('RSA1024', resultCoding); } static generate2048RSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil....
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets#L29-L235
8db671026fab149a7a858c897bcb15cb18db0169
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/url_tools.ets
arkts
Determines if a url is a web page or not. @param url The url to be checked. @returns True if is a web page that can be displayed.
export function is_web_page(url: string): boolean { // Commonly seen web extensions const webPageExtensions = [ '.html', '.htm', '.xhtml', '.shtml', '.php', '.php3', '.php4', '.php5', '.phtml', '.pdf', '.asp', '.aspx', '.jsp', '.jspx', '.cgi', '.pl', '.rb', // '.r', // '.r' is what? ...
AST#export_declaration#Left export AST#function_declaration#Left function is_web_page AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#pr...
export function is_web_page(url: string): boolean { const webPageExtensions = [ '.html', '.htm', '.xhtml', '.shtml', '.php', '.php3', '.php4', '.php5', '.phtml', '.pdf', '.asp', '.aspx', '.jsp', '.jspx', '.cgi', '.pl', '.rb', '.py', '.do', '.action', '.cfm', '.dhtml...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/url_tools.ets#L403-L444
ae37a9628695c3b931318716599db671b71f2e4b
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_rcp/src/main/ets/rcp/EfBusinessCodeInterceptor.ets
arkts
@Author csx @DateTime 2024/8/15 19:07 @TODO EfBusinessCodeInterceptor 内置针对于业务系统内部请求自定义code拦截器 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_rcp
export class EfBusinessCodeInterceptor implements rcp.Interceptor { /** * 编码监听 */ private businessCodeEventListener: efRcpConfig.businessCodeEvent; constructor(businessCodeEventListener: efRcpConfig.businessCodeEvent) { this.businessCodeEventListener = businessCodeEventListener; } /** * 拦截器 ...
AST#export_declaration#Left export AST#class_declaration#Left class EfBusinessCodeInterceptor AST#implements_clause#Left implements AST#implements_clause#Right AST#ERROR#Left AST#qualified_type#Left rcp . Interceptor AST#qualified_type#Right AST#ERROR#Right AST#class_body#Left { /** * 编码监听 */ AST#property_declara...
export class EfBusinessCodeInterceptor implements rcp.Interceptor { private businessCodeEventListener: efRcpConfig.businessCodeEvent; constructor(businessCodeEventListener: efRcpConfig.businessCodeEvent) { this.businessCodeEventListener = businessCodeEventListener; } async intercept(context: rcp.Req...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfBusinessCodeInterceptor.ets#L27-L116
ff5ade42c93d14361a323412aca144ed3f37af40
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
getData
读取系统剪贴板内容,使用Promise异步回调。 @returns
static async getData(): Promise<pasteboard.PasteData> { return PasteboardUtil.getSystemPasteboard().getData(); }
AST#method_declaration#Left static async getData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left pasteboard . PasteData AST#qualified_type#...
static async getData(): Promise<pasteboard.PasteData> { return PasteboardUtil.getSystemPasteboard().getData(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L92-L94
8aabf36d3b3c46ffe63fc52b277b4e2e320ba0e1
gitee
wuyuanwuhui99/harmony-arkts-music-app-ui.git
fc75b993b76293666f9122f527ea3bc6caf7f75c
entry/src/main/ets/utils/HttpUtil.ets
arkts
post
@description: post请求函数 @param {string} url 请求地址 @param {Object} data 请求参数 @param {RequestConfig} OtherConfig request其他配置 @return {*}
public post<T>(url: string, data?: Object): Promise<MyAwesomeData<T>> { return this.request<T>(url,{ method: http.RequestMethod.POST,extraData: data}) }
AST#method_declaration#Left public post AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ...
public post<T>(url: string, data?: Object): Promise<MyAwesomeData<T>> { return this.request<T>(url,{ method: http.RequestMethod.POST,extraData: data}) }
https://github.com/wuyuanwuhui99/harmony-arkts-music-app-ui.git/blob/fc75b993b76293666f9122f527ea3bc6caf7f75c/entry/src/main/ets/utils/HttpUtil.ets#L105-L107
3547c08dda74e30314a6be3c3db1a1cef7d4f6a3
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/CategorySample/entry/src/main/ets/common/bean/IndexListItem.ets
arkts
Item info of the index list(vertical list on the left).
export class IndexListItem { /** * List item title. */ title: Resource; }
AST#export_declaration#Left export AST#class_declaration#Left class IndexListItem AST#class_body#Left { /** * List item title. */ 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 } AST#cl...
export class IndexListItem { title: Resource; }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/CategorySample/entry/src/main/ets/common/bean/IndexListItem.ets#L4-L9
dbed60115aa7ef0f2fa611e213aa2662d7d41d60
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/community/CommunityPage.ets
arkts
handleLike
处理点赞
async handleLike(post: Post) { try { if (post.isLiked) { await ApiService.unlikePost(post.id); post.likeCount = Math.max(0, post.likeCount - 1); } else { await ApiService.likePost(post.id); post.likeCount++; } post.isLiked = !post.isLiked; } catch (error) ...
AST#method_declaration#Left async handleLike AST#parameter_list#Left ( AST#parameter#Left post : AST#type_annotation#Left AST#primary_type#Left Post AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AS...
async handleLike(post: Post) { try { if (post.isLiked) { await ApiService.unlikePost(post.id); post.likeCount = Math.max(0, post.likeCount - 1); } else { await ApiService.likePost(post.id); post.likeCount++; } post.isLiked = !post.isLiked; } catch (error) ...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/community/CommunityPage.ets#L101-L125
1333f3064e856cc649eccbb0d7ef0fc403742322
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
update_backward_forward_access
Data and Statuses Updates the current_accessBackward and current_accessForward statuses.
update_backward_forward_access() { if (this.workingMainTab()) { try { this.current_accessBackward = this.workingMainTab().controller?.accessBackward() || false; this.current_accessForward = this.workingMainTab().controller?.accessForward() || false; } catch (e) { console.error('[...
AST#method_declaration#Left update_backward_forward_access AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Rig...
update_backward_forward_access() { if (this.workingMainTab()) { try { this.current_accessBackward = this.workingMainTab().controller?.accessBackward() || false; this.current_accessForward = this.workingMainTab().controller?.accessForward() || false; } catch (e) { console.error('[...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L203-L212
5287e4871609adcbb99f164dbb87026bde0a1d01
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setAxisMinLabels
The minimum number of labels on the axis
public setAxisMinLabels(labels: number): void { if (labels > 0) this.mAxisMinLabels = labels; }
AST#method_declaration#Left public setAxisMinLabels AST#parameter_list#Left ( AST#parameter#Left labels : 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#primar...
public setAxisMinLabels(labels: number): void { if (labels > 0) this.mAxisMinLabels = labels; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L157-L160
a4019d294ba856b218208430914308fa8d2dc96d
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/YAxis.ets
arkts
removeYAxisCustomLabel
Delete Y-axis custom labels @param numbers labels
public removeYAxisCustomLabel(numbers: number[]): void { let YAxisLabels: number[] = []; if (numbers != null && numbers != undefined) { let flag: boolean = false; for (let i: number = 0; i < this.customYAxisLabels.length; i ++){ flag = false; for (let index: number = 0; index < numbe...
AST#method_declaration#Left public removeYAxisCustomLabel AST#parameter_list#Left ( AST#parameter#Left numbers : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_a...
public removeYAxisCustomLabel(numbers: number[]): void { let YAxisLabels: number[] = []; if (numbers != null && numbers != undefined) { let flag: boolean = false; for (let i: number = 0; i < this.customYAxisLabels.length; i ++){ flag = false; for (let index: number = 0; index < numbe...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L151-L169
85d78379a8a6ea80e85e67e6fdd654b101c81cbb
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/VPNControl_Case/entry/src/main/ets/notification/NotificationManagementUtil.ets
arkts
setBadgeNumber
Display badge
async setBadgeNumber(num: number) { await notificationManager.setBadgeNumber(num).then(() => { this.badgeNum = num; Logger.info('displayBadge success'); }); }
AST#method_declaration#Left async setBadgeNumber AST#parameter_list#Left ( AST#parameter#Left num : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#exp...
async setBadgeNumber(num: number) { await notificationManager.setBadgeNumber(num).then(() => { this.badgeNum = num; Logger.info('displayBadge success'); }); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/VPNControl_Case/entry/src/main/ets/notification/NotificationManagementUtil.ets#L61-L66
1d4ed1573f9be1e27f169ba6f7ead67f9d0d2cfd
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/variablewatch/src/main/ets/model/GoodsModel.ets
arkts
SecondGoodsItemList
TODO: 知识点:使用@Observed装饰器,为了做到类的嵌套也可以被观察到属性的变化
@Observed /** * 表示商品列表的类型,是嵌套类的第二层 * @class */ export class SecondGoodsItemList { itemList: Array<ThirdGoodsItem>; constructor(imgSrc: Array<ThirdGoodsItem>) { this.itemList = imgSrc; } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right /** * 表示商品列表的类型,是嵌套类的第二层 * @class */ export class SecondGoodsItemList AST#class_body#Left { AST#property_declaration#Left itemList : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Le...
@Observed export class SecondGoodsItemList { itemList: Array<ThirdGoodsItem>; constructor(imgSrc: Array<ThirdGoodsItem>) { this.itemList = imgSrc; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/variablewatch/src/main/ets/model/GoodsModel.ets#L33-L44
6e9bffbbb78aa9bb13c0dfab497a32acbd37005a
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets
arkts
Defines label margin. @interface LabelMarginOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @since 11 Defines label margin. @interface LabelMarginOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface LabelMarginOptions { /** * Left label margin length. * * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Left label margin length. * * @type { ?Dimension } * @syscap SystemCapability.ArkUI....
AST#export_declaration#Left export AST#interface_declaration#Left interface LabelMarginOptions AST#object_type#Left { /** * Left label margin length. * * @type { ?Dimension } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 11 */ /** * Left label margin length...
export interface LabelMarginOptions { left?: Dimension; right?: Dimension; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets#L262-L299
53819719124bee3619481f44806d070b0058da80
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/ModelConfigService.ets
arkts
saveModelConfig
保存模型配置
public saveModelConfig(config: ModelConfig): void { this.currentConfig = config; // 存储到内存映射中 ModelConfigService.configStore.set('current', config); this.storeConfig(); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[ModelConfigService] Model config saved and stored: ${config.prov...
AST#method_declaration#Left public saveModelConfig AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left ModelConfig 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#pr...
public saveModelConfig(config: ModelConfig): void { this.currentConfig = config; ModelConfigService.configStore.set('current', config); this.storeConfig(); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[ModelConfigService] Model config saved and stored: ${config.provider}/${con...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ModelConfigService.ets#L336-L345
bd87d5c8b807ab7f3dd0a065a9f6252adebdf506
github
qwerguai/ArkTSComponents.git
58ac77d9686670d79ba7421d71e68f31870aacd5
entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Common constants for all features.
export default class CommonConstants { /** * Input length of the account. */ static readonly INPUT_ACCOUNT_LENGTH = 11; /** * Input length of the password. */ static readonly INPUT_PASSWORD_LENGTH = 8; /** * Left padding of the input box */ static readonly INPUT_PADDING_LEFT = 0; /*...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Input length of the account. */ AST#property_declaration#Left static readonly INPUT_ACCOUNT_LENGTH = AST#expression#Left 11 AST#expression#Right ; AST#property_declaration#Right /** * Input ...
export default class CommonConstants { static readonly INPUT_ACCOUNT_LENGTH = 11; static readonly INPUT_PASSWORD_LENGTH = 8; static readonly INPUT_PADDING_LEFT = 0; static readonly LOGIN_DELAY_TIME = 2000; static readonly COMMON_SPACE = 12; static readonly HOME_TITLE = '主页'; sta...
https://github.com/qwerguai/ArkTSComponents.git/blob/58ac77d9686670d79ba7421d71e68f31870aacd5/entry/src/main/ets/common/constants/CommonConstants.ets#L19-L84
2badcfd6a50bb4f6f4d661e7401acc58613d40d0
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
entry/src/main/ets/navigation/NavigationHost.ets
arkts
PagesMap
导航目标构建器 @param name 路由名称 @returns 路由构建器
@Builder PagesMap(name: string) { if (RouteBuild.getBuilder(name) !== undefined) { (RouteBuild.getBuilder(name) as WrappedBuilder<[]>).builder(); } }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right PagesMap 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#builder_function_body#Left {...
@Builder PagesMap(name: string) { if (RouteBuild.getBuilder(name) !== undefined) { (RouteBuild.getBuilder(name) as WrappedBuilder<[]>).builder(); } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/entry/src/main/ets/navigation/NavigationHost.ets#L25-L30
f58b74b032d13ab2ffe0b5daf8a839df3a8ac06f
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Overlay/entry/src/main/ets/pages/components/base/MyComponent.ets
arkts
MyComponent
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain 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...
@Preview @Component export struct MyComponent { title: string = 'test' func: () => void = () => {} @Styles pressedStyle(){ .backgroundColor(0x238E23) } @Styles normalStyles() { .backgroundColor(0x0000ff) } build() { Text(this.title) .key(this.title) .fontSize(20) .backgrou...
AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct MyComponent AST#component_body#Left { AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annota...
@Preview @Component export struct MyComponent { title: string = 'test' func: () => void = () => {} @Styles pressedStyle(){ .backgroundColor(0x238E23) } @Styles normalStyles() { .backgroundColor(0x0000ff) } build() { Text(this.title) .key(this.title) .fontSize(20) .backgrou...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/base/MyComponent.ets#L16-L40
40f872a72b63ffdebec4c86e2c1a16a862c1d2a2
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
entry/src/main/ets/pages/example/debug/network/NetworkPanelViews.ets
arkts
@author open_9527 @date 2025/11/3 @desc NetworkPanelViews
export enum NetworkPanelMode { Name = 'Name', Method = 'Method', Status = 'Status', Time = 'Time' }
AST#export_declaration#Left export AST#enum_declaration#Left enum NetworkPanelMode AST#enum_body#Left { AST#enum_member#Left Name = AST#expression#Left 'Name' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left Method = AST#expression#Left 'Method' AST#expression#Right AST#enum_member#Right , AST#enum_mem...
export enum NetworkPanelMode { Name = 'Name', Method = 'Method', Status = 'Status', Time = 'Time' }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/pages/example/debug/network/NetworkPanelViews.ets#L10-L15
3c13d0b2bdf1e8e7a1d43a73b3eb674c401552ad
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/PresenceUpdate.ets
arkts
Emitted whenever a member becomes available @event Client#guildMemberAvailable @param member The member that became available 应用规则60:使用export代替module.exports
export default PresenceUpdateHandler;
AST#export_declaration#Left export default AST#expression#Left PresenceUpdateHandler AST#expression#Right ; AST#export_declaration#Right
export default PresenceUpdateHandler;
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/PresenceUpdate.ets#L102-L102
bd11e23ae7c374b7f88d652b8a74792fbbc180d1
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/TransitionAnimation/entry/src/main/ets/pages/page/CustomTransition2.ets
arkts
pageTransition
页面转场通过全局transition方法进行配置转场参数
pageTransition() { // 页面入场组件: 进场过程中会逐帧触发onEnter回调,入参为动效的归一化进度(0% -- 100%) PageTransitionEnter({ duration: 800, curve: Curve.Smooth }) .onEnter((type?: RouteType, progress?: number) => { if (progress !== undefined) { this.myProgress = progress // 页面入场时myProgress从0变化到1 } }) ...
AST#method_declaration#Left pageTransition AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 页面入场组件: 进场过程中会逐帧触发onEnter回调,入参为动效的归一化进度(0% -- 100%) AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionEnter ( AST#component_parameters#Left {...
pageTransition() { PageTransitionEnter({ duration: 800, curve: Curve.Smooth }) .onEnter((type?: RouteType, progress?: number) => { if (progress !== undefined) { this.myProgress = progress } }) PageTransitionExit({ duration: 1000, curve: Curve.Smooth }) .on...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/TransitionAnimation/entry/src/main/ets/pages/page/CustomTransition2.ets#L38-L54
fc02d6731614fdef6b49a3c0254713956084001c
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets
arkts
getTrustedDeviceList
Obtain the list of trusted devices.
getTrustedDeviceList(): void { if (this.myDeviceManager === undefined) { Logger.error('RemoteDeviceModel', 'getTrustedDeviceList deviceManager has not initialized'); return; } try { this.trustedDeviceList = this.myDeviceManager.getTrustedDeviceListSync(); } catch (error) { Logge...
AST#method_declaration#Left getTrustedDeviceList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#...
getTrustedDeviceList(): void { if (this.myDeviceManager === undefined) { Logger.error('RemoteDeviceModel', 'getTrustedDeviceList deviceManager has not initialized'); return; } try { this.trustedDeviceList = this.myDeviceManager.getTrustedDeviceListSync(); } catch (error) { Logge...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets#L105-L117
a8feec3810b1e3a9f111cb7c93b5e12d2892a172
gitee
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/view/AiAssistantComponent.ets
arkts
scrollToBottom
滚动到底部
scrollToBottom() { setTimeout(() => { this.scroller.scrollEdge(Edge.Bottom); }, 100); }
AST#method_declaration#Left scrollToBottom AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left setTimeout ( AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#block_statement#Left { AST#statemen...
scrollToBottom() { setTimeout(() => { this.scroller.scrollEdge(Edge.Bottom); }, 100); }
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/view/AiAssistantComponent.ets#L130-L134
903dcd52771e13a730e4d2c1004ea2234940ded4
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/IndexController.ets
arkts
isSpeakerActive
扬声器是否激活
async isSpeakerActive(): Promise<boolean> { return await AudioManagerModel.isSpeakerActive(); }
AST#method_declaration#Left async isSpeakerActive AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right > AST#ty...
async isSpeakerActive(): Promise<boolean> { return await AudioManagerModel.isSpeakerActive(); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/IndexController.ets#L166-L168
c5a55f4da850a7a166ffb36a118d2201febbd4a6
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/MoodEntry.ets
arkts
getEmotionColor
Get emotion color (unified with Constants)
getEmotionColor(): string { switch (this.emotion) { case 'happy': return Constants.EMOTION_HAPPY; case 'excited': return Constants.EMOTION_EXCITED; case 'sad': return Constants.EMOTION_SAD; case 'calm': return Constants.EMOTION_CALM; case 'angry': ...
AST#method_declaration#Left getEmotionColor 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#expression_statement#Left AST#expression#Left switch AST#expression#...
getEmotionColor(): string { switch (this.emotion) { case 'happy': return Constants.EMOTION_HAPPY; case 'excited': return Constants.EMOTION_EXCITED; case 'sad': return Constants.EMOTION_SAD; case 'calm': return Constants.EMOTION_CALM; case 'angry': ...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/MoodEntry.ets#L96-L112
0e954075432b28d55bba6ba8a0f3627ba67ab36d
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/DateUtils.ets
arkts
toGMTDate
解析GMT格式日期字符串 @param dateStr GMT格式日期字符串 @returns 解析成功的Date对象,失败返回null
static toGMTDate(dateStr: string): Date | null { return DateUtils.toDate(dateStr, "EEE, dd MMM yyyy HH:mm:ss 'GMT'"); }
AST#method_declaration#Left static toGMTDate AST#parameter_list#Left ( AST#parameter#Left dateStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left D...
static toGMTDate(dateStr: string): Date | null { return DateUtils.toDate(dateStr, "EEE, dd MMM yyyy HH:mm:ss 'GMT'"); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DateUtils.ets#L226-L228
5a4989dacbdf2a666ee8cb2ac66f3a10e56e35b6
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/database/Index.ets
arkts
IBestORMInit
@file database 模块统一导出 @author Joker.X
export { IBestORMInit } from "@ibestservices/ibest-orm";
AST#export_declaration#Left export { IBestORMInit } from "@ibestservices/ibest-orm" ; AST#export_declaration#Right
export { IBestORMInit } from "@ibestservices/ibest-orm";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/database/Index.ets#L6-L6
923ff8ce221ad036c07ca6d261c7b7f4a6e7cc0e
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/todo/TodoService.ets
arkts
getTodo
获取代办事项
async getTodo(id: string): Promise<Todo | null> { return this.todos.find(todo => todo.id === id) || null; }
AST#method_declaration#Left async getTodo AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise...
async getTodo(id: string): Promise<Todo | null> { return this.todos.find(todo => todo.id === id) || null; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/todo/TodoService.ets#L321-L323
0dd3e427b05290c8b5c2d35d871e2d4109f85eb8
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/router/AppRouter.ets
arkts
clearAndPush
清空栈并跳转到指定页面 @param path 目标页面路径 @param options 跳转选项
async clearAndPush(path: string, options?: RouteOptions): Promise<void> { try { await router.clear(); await this.push(path, options); // 重置导航栈 this.navigationStack = [path]; hilog.info(0x0001, 'BirthdayReminder', `Cleared stack and navigated to: ${path}`); } catch (er...
AST#method_declaration#Left async clearAndPush 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#Left options ? : AST#type_annotation#Left AST#primary_type#Left RouteOptions AST#p...
async clearAndPush(path: string, options?: RouteOptions): Promise<void> { try { await router.clear(); await this.push(path, options); this.navigationStack = [path]; hilog.info(0x0001, 'BirthdayReminder', `Cleared stack and navigated to: ${path}`); } catch (error) { ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/router/AppRouter.ets#L165-L180
fdc44d2f0dc6be6ba3e3d1dc3f5e1bdd4e09f730
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/DeviceManagement/ScreenDetector/entry/src/main/ets/common/Warn.ets
arkts
Warn
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@CustomDialog export struct Warn { private errMsg?: Resource private limit?: string private dialogController?: CustomDialogController @Builder infoText(msg: Resource, limit: string) { Row() { Text(msg) .margin({ left: 5 }) .fontSize(18) Text(limit) .fontSize(18) } ...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct Warn AST#component_body#Left { AST#property_declaration#Left private errMsg ? : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Rig...
@CustomDialog export struct Warn { private errMsg?: Resource private limit?: string private dialogController?: CustomDialogController @Builder infoText(msg: Resource, limit: string) { Row() { Text(msg) .margin({ left: 5 }) .fontSize(18) Text(limit) .fontSize(18) } ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/DeviceManagement/ScreenDetector/entry/src/main/ets/common/Warn.ets#L16-L55
311e1439ffe890c01ecf1d1eb0f8c6b9ebffa997
gitee
ccccjiemo/egl.git
d18849c3da975ccf9373fd09874aa5637ccbe6bd
Index.d.ets
arkts
setAttribute
eglSurfaceAttrib @param attribute EGL_MIPMAP_LEVEL / EGL_MULTISAMPLE_RESOLVE / EGL_SWAP_BEHAVIOR
setAttribute(dpy: EGLDisplay, attribute: number, value: number): boolean;
AST#method_declaration#Left setAttribute AST#parameter_list#Left ( AST#parameter#Left dpy : AST#type_annotation#Left AST#primary_type#Left EGLDisplay AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left attribute : AST#type_annotation#Left AST#primary_type#Left number AST#primary_ty...
setAttribute(dpy: EGLDisplay, attribute: number, value: number): boolean;
https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/Index.d.ets#L56-L56
8dff8a71ac0faf702027660c6904318e79045861
github
weiwei0928/Eyepetizer-harmony.git
fd5947c6f616c22d42256f36ba752093b782a910
entry/src/main/ets/entryability/EntryAbility.ets
arkts
import { ImageKnife } from '@ohos/imageknife'
export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'EntryAbility onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); hilog.info(0x0000, 'te...
AST#export_declaration#Left export default AST#class_declaration#Left class EntryAbility extends AST#type_annotation#Left AST#primary_type#Left UIAbility AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left onCreate AST#parameter_list#Left ( AST#parameter#Left want : AST#ty...
export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'EntryAbility onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); hilog.info(0x0000, 'te...
https://github.com/weiwei0928/Eyepetizer-harmony.git/blob/fd5947c6f616c22d42256f36ba752093b782a910/entry/src/main/ets/entryability/EntryAbility.ets#L9-L79
1523a495817b7883bc11a2c8913df2c20cd963f0
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/AbilityUtils.ets
arkts
toNetworkSetting
跳转移动网络设置页面
static toNetworkSetting(): Promise<void> { return AbilityUtils.toAppSetting(AbilityUtils.uri_network) }
AST#method_declaration#Left static toNetworkSetting 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...
static toNetworkSetting(): Promise<void> { return AbilityUtils.toAppSetting(AbilityUtils.uri_network) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/AbilityUtils.ets#L38-L40
b721d7e1d9629c31c1e1d5f4f15365ea685a727e
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ViewPortHandler.ets
arkts
getSmallestContentExtension
Returns the smallest extension of the content rect (width or height). @return
public getSmallestContentExtension(): number { return Math.min(this.mContentRect.width(), this.mContentRect.height()); }
AST#method_declaration#Left public getSmallestContentExtension 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 ...
public getSmallestContentExtension(): number { return Math.min(this.mContentRect.width(), this.mContentRect.height()); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ViewPortHandler.ets#L177-L179
d48dbf3a127cb64d985ba66b25b2b88c2ea3d17b
gitee
qwerguai/ArkTSComponents.git
58ac77d9686670d79ba7421d71e68f31870aacd5
entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
getFirstGridData
Get data of the first grid. @return {Array<PageResource>} firstGridData.
getFirstGridData(): Array<ItemData> { let firstGridData: ItemData[] = [ new ItemData($r('app.string.my_love'), $r('app.media.shoucang')), new ItemData($r('app.string.history_record'), $r('app.media.lishi')), new ItemData($r('app.string.message'), $r('app.media.kefu')), new ItemData($r('app.s...
AST#method_declaration#Left getFirstGridData 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 ItemData AST#primary_type#Right AST#type_annotation#Right > AST#type_arg...
getFirstGridData(): Array<ItemData> { let firstGridData: ItemData[] = [ new ItemData($r('app.string.my_love'), $r('app.media.shoucang')), new ItemData($r('app.string.history_record'), $r('app.media.lishi')), new ItemData($r('app.string.message'), $r('app.media.kefu')), new ItemData($r('app.s...
https://github.com/qwerguai/ArkTSComponents.git/blob/58ac77d9686670d79ba7421d71e68f31870aacd5/entry/src/main/ets/viewmodel/MainViewModel.ets#L43-L55
d90861878a33a978d9aa57c631dba5bd0d7c661d
github
openharmony/base_location
724370a03f6f23ddc07c8eb9f49dfc61ab716bdb
services/location_ui/entry/src/main/ets/common/PermissionUtils.ets
arkts
checkBluetoothShareCallerSceneboardPermission
校验蓝牙分享UI ability调用方权限:大桌面应用允许作为调用方拉起
checkBluetoothShareCallerSceneboardPermission(want: Want): boolean { const callerBundleName = want?.parameters?.[this.WANT_PARA_KEY_CALLER_BUNDLE_NAME] as string; const callerUid = want?.parameters?.[this.WANT_PARA_KEY_CALLER_UID] as number; console.info(TAG, `checkSceneboardPermission callerUid...
AST#method_declaration#Left checkBluetoothShareCallerSceneboardPermission AST#parameter_list#Left ( AST#parameter#Left want : AST#type_annotation#Left AST#primary_type#Left Want AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Le...
checkBluetoothShareCallerSceneboardPermission(want: Want): boolean { const callerBundleName = want?.parameters?.[this.WANT_PARA_KEY_CALLER_BUNDLE_NAME] as string; const callerUid = want?.parameters?.[this.WANT_PARA_KEY_CALLER_UID] as number; console.info(TAG, `checkSceneboardPermission callerUid...
https://github.com/openharmony/base_location/blob/724370a03f6f23ddc07c8eb9f49dfc61ab716bdb/services/location_ui/entry/src/main/ets/common/PermissionUtils.ets#L48-L81
8c176d89c5dc406d6a374aa510808fb09fa99d78
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
advanced_ui_component/foldsplitcontainer/source/foldsplitcontainer.ets
arkts
The layout options for the container when the foldable screen is folded. @interface FoldedRegionLayoutOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface FoldedRegionLayoutOptions { /** * The ratio of the heights of two areas in the vertical direction. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ verticalSplitRatio?: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface FoldedRegionLayoutOptions AST#object_type#Left { /** * The ratio of the heights of two areas in the vertical direction. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @...
export interface FoldedRegionLayoutOptions { verticalSplitRatio?: number; }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/foldsplitcontainer/source/foldsplitcontainer.ets#L174-L185
189c498b41cdb22f61b9d8da889e0b769bf5fa61
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/utils/ScreenUtils.ets
arkts
dp2px
DP转像素
static dp2px(dp: number): number { return dp * (ScreenUtils.getDensity() / 160); }
AST#method_declaration#Left static dp2px AST#parameter_list#Left ( AST#parameter#Left dp : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right ...
static dp2px(dp: number): number { return dp * (ScreenUtils.getDensity() / 160); }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/ScreenUtils.ets#L52-L54
d56f3a4d944166a0e41449959d7cd632041fa536
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Spacer.ets
arkts
SpaceHorizontalLarge
创建一个大水平间距(16vp) @returns {void} 无返回值
@Builder export function SpaceHorizontalLarge(): void { Blank().width($r("app.float.space_horizontal_large")); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SpaceHorizontalLarge 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#ark...
@Builder export function SpaceHorizontalLarge(): void { Blank().width($r("app.float.space_horizontal_large")); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Spacer.ets#L82-L85
888e63b5ebaad862d680329dd5ba048f8bb1025a
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/database/types/BooksType.ets
arkts
@author 2008 @datetime 2024/7/23 11:02 @className: BooksType
export interface BooksTypeSearchParams { // 搜索关键词书源名称/书籍名称/author searchKey?: string, // 源类型 0 小说;1 漫画;2 有声书; type?: number, //分组 bookGroup?: number, //排序方式 order?: string }
AST#export_declaration#Left export AST#interface_declaration#Left interface BooksTypeSearchParams AST#object_type#Left { // 搜索关键词书源名称/书籍名称/author AST#type_member#Left searchKey ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , // 源类型 0 小说;...
export interface BooksTypeSearchParams { searchKey?: string, type?: number, bookGroup?: number, order?: string }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/database/types/BooksType.ets#L6-L15
63276af43905b3be06e85f338e534debffe8fa85
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets
arkts
getSpaceTop
Returns the top axis space in percent of the full range. Default 10f @return
public getSpaceTop(): number { return this.mSpacePercentTop; }
AST#method_declaration#Left public getSpaceTop 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_expre...
public getSpaceTop(): number { return this.mSpacePercentTop; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L281-L283
4bd7070f7a1799e26cacea4642281436cdcaae0d
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/member/EncourageManager.ets
arkts
encourage
============================================================ 对外公开方法 ============================================================ 发放奖品(对应Swift的encourage方法) @param type 激励类型 @param rewardCount 奖品数量,如果为空则使用默认奖励数量 @param limitOncePerDay 每日是否只奖励一次 @returns 是否奖励成功
public encourage(type: EncourageType, rewardCount?: number, limitOncePerDay: boolean = false): boolean { const count = rewardCount ?? EncourageTypeHelper.getRewardCount(type); const prefs = this.getPrefs(); const key = EncourageTypeHelper.getKeyWithToday(type); // 检查是否已存在今日记录 const currentValue = p...
AST#method_declaration#Left public encourage AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left EncourageType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rewardCount ? : AST#type_annotation#Left AST#primary_type#Left number AS...
public encourage(type: EncourageType, rewardCount?: number, limitOncePerDay: boolean = false): boolean { const count = rewardCount ?? EncourageTypeHelper.getRewardCount(type); const prefs = this.getPrefs(); const key = EncourageTypeHelper.getKeyWithToday(type); const currentValue = prefs.getSync(k...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/EncourageManager.ets#L161-L180
cf8c38f42fc1f0d21a44d2484ab9587c1ac7569b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/GameificationService.ets
arkts
dailyCheckIn
每日签到
async dailyCheckIn(userId: string = 'default'): Promise<PointsRecord> { try { const now = new Date(); const today = now.toDateString(); if (!this.userGameData) { throw new Error('User game data not initialized'); } // 检查是否已经签到 if (this.userGameData.lastCheckIn ===...
AST#method_declaration#Left async dailyCheckIn AST#parameter_list#Left ( AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'default' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annot...
async dailyCheckIn(userId: string = 'default'): Promise<PointsRecord> { try { const now = new Date(); const today = now.toDateString(); if (!this.userGameData) { throw new Error('User game data not initialized'); } if (this.userGameData.lastCheckIn === today) { ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L370-L428
bc97955813ca56f7fa8befd903011c32871e6147
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/core/update/UpdateManager.ets
arkts
downloadUpdate
下载更新包
async downloadUpdate(updateInfo: UpdateInfo, onProgress?: (progress: DownloadProgress) => void): Promise<boolean> { try { Logger.info('UpdateManager', `Downloading update: ${updateInfo.updateUrl}`); this.onProgressCallback = onProgress || null; // Mock 下载(实际项目中需要使用真实的下载API) // Harmon...
AST#method_declaration#Left async downloadUpdate AST#parameter_list#Left ( AST#parameter#Left updateInfo : AST#type_annotation#Left AST#primary_type#Left UpdateInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left onProgress ? : AST#type_annotation#Left AST#function_type#Left AS...
async downloadUpdate(updateInfo: UpdateInfo, onProgress?: (progress: DownloadProgress) => void): Promise<boolean> { try { Logger.info('UpdateManager', `Downloading update: ${updateInfo.updateUrl}`); this.onProgressCallback = onProgress || null; if (this.onProgr...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/update/UpdateManager.ets#L129-L171
e9978e0dabfb7092f4fe13f282477d2bb44c4711
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
isUint16Array
Check whether the entered value is the uint16array array array type. @param { Object } value - A Uint16Array value @returns { boolean } Returns true if the value is a built-in Uint16Array instance. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
isUint16Array(value: Object): boolean;
AST#method_declaration#Left isUint16Array AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#R...
isUint16Array(value: Object): boolean;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1378-L1378
997d672581a4bd619c74838d74f9bbe4ffa1e292
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/ModelConfigService.ets
arkts
getAllModels
获取所有预定义模型
public getAllModels(): ModelInfo[] { const allModels: ModelInfo[] = []; Object.values(this.predefinedModels).forEach(models => { allModels.push(...models); }); return allModels; }
AST#method_declaration#Left public getAllModels AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ModelInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declara...
public getAllModels(): ModelInfo[] { const allModels: ModelInfo[] = []; Object.values(this.predefinedModels).forEach(models => { allModels.push(...models); }); return allModels; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ModelConfigService.ets#L318-L324
4bf650505591724a6c312c0a2fb318a22676afaa
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets
arkts
The text margin of 18.
export const Text_Margin = 18;
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left Text_Margin = AST#expression#Left 18 AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const Text_Margin = 18;
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets#L55-L55
bb55e59900e86bfc2308c13cae2a9dba1a9bbd96
gitee
FantasyWind/fwrouter
eea785a7bf728862de1f88de487ef3857dee3364
router/src/main/ets/RouterManagerForNavigation.ets
arkts
canOpen
是否可以打开
canOpen(path: string): boolean { return this.builderMap.has(path) }
AST#method_declaration#Left canOpen 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 boolean AST#primary_type#Right AS...
canOpen(path: string): boolean { return this.builderMap.has(path) }
https://github.com/FantasyWind/fwrouter/blob/eea785a7bf728862de1f88de487ef3857dee3364/router/src/main/ets/RouterManagerForNavigation.ets#L88-L90
89e97f4a21fe6438c66d710aca11222a041af782
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the application binary interface (Abi) list represented by a string. @syscap SystemCapability.Startup.SystemInfo @crossplatform @since 20 @arkts 1.2
static get abiList(): string;
AST#method_declaration#Left static get AST#ERROR#Left abi List 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#method_declaration#Right
static get abiList(): string;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L175-L175
e151259543f8493680b633dc8ba7fbbf91819a56
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/ArkStructBase.ets
arkts
base class for user's structs
export class ArkStructBase<T, T_Options> extends ArkCustomComponentImpl { private isEntry:boolean constructor
AST#export_declaration#Left export AST#ERROR#Left class ArkStructBase AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right , AST#type_parameter#Left T_Options AST#type_parameter#Right > AST#type_parameters#Right extends AST#type_annotation#Left AST#primary_type#Left ArkCustomComponentImpl AST#p...
export class ArkStructBase<T, T_Options> extends ArkCustomComponentImpl { private isEntry:boolean constructor
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/ArkStructBase.ets#L24-L26
54e0450c1235dc378a16e7635817c1d79fe9be8a
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
OptimizationAppDelay/entry/src/main/ets/pages/CameraOptPage.ets
arkts
onPageHide
[Start camera_release_after] The camera page is triggered once every time it is hidden.
onPageHide() { setTimeout(this.releaseCamera, 200); }
AST#method_declaration#Left onPageHide AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left setTimeout ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . releaseCamera AST#member_expression#Right AST#ex...
onPageHide() { setTimeout(this.releaseCamera, 200); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/OptimizationAppDelay/entry/src/main/ets/pages/CameraOptPage.ets#L37-L39
2f2b309b08fd21e70bc2c8c45eef38045111b093
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Scroll.ets
arkts
构建带中等内边距的垂直滚动布局 @returns {void} 无返回值
build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"), ...
AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left VerticalScroll ( AST#component_parameters#Left { AST#component_parameter#Left scroller : AST#expression#Left AST#member_expr...
build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"), ...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L216-L227
c51d17fc180a072664ae0503c60546afb4ce1d64
github