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
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/component/BottomDialogView.ets
arkts
headBuilder
标题
@Builder headBuilder() { }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right headBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
@Builder headBuilder() { }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/component/BottomDialogView.ets#L43-L45
edb13dbf463bf8676532dcd7e29db0033eeb61d8
github
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/pages/StatisticPage.ets
arkts
StatisticPage
使用@Link和@State修饰符管理组件的数据和状态
@Component export default struct StatisticPage { @Link @Watch('refreshClassifiedStatistics') accounts: Array<Account>; // 由于@State修饰Date类型可能出错,因此这里存储的是时间戳 @State @Watch('refreshClassifiedStatistics') endDate: number = getEndOfTheDay(new Date()).getTime(); @State @Watch('refreshClassifiedStatistics') beginDate: ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct StatisticPage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right AST#decorator#Left @ Watch ( AST#expression#Left 'refreshClassifiedStatistics' AST#expression...
@Component export default struct StatisticPage { @Link @Watch('refreshClassifiedStatistics') accounts: Array<Account>; @State @Watch('refreshClassifiedStatistics') endDate: number = getEndOfTheDay(new Date()).getTime(); @State @Watch('refreshClassifiedStatistics') beginDate: number = getFirstDateOfThisMonth(th...
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/pages/StatisticPage.ets#L16-L202
7b8816b54cdce04726cc68cba06063639959edd8
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_dialog/ace_ets_module_dialog_api16/entry/src/main/ets/MainAbility/common/Rect.ets
arkts
Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
export default class RectValue { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; }
AST#export_declaration#Left export default AST#class_declaration#Left class RectValue AST#class_body#Left { AST#property_declaration#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#...
export default class RectValue { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_dialog/ace_ets_module_dialog_api16/entry/src/main/ets/MainAbility/common/Rect.ets#L16-L21
3b3514d83b774ce456372ac84325ce331e0bb815
gitee
Nuist666/Alzheimer.git
c171b8e739357bfc5a3fc71c90aaea6ce5d463d1
entry/src/main/ets/pages/cmmsepage.ets
arkts
atManager
requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
atManager.requestPermissionsFromUser(context, permissions).then((data) => { let grantStatus: Array<number> = data.authResults; let length: number = grantStatus.length; for (let i = 0; i < length; i++) { if (grantStatus[i] === 0) { // 用户授权,可以继续访问目标操作 console.info('授权成功') ...
AST#method_declaration#Left atManager AST#ERROR#Left . requestPermissionsFromUser AST#parameter_list#Left ( AST#parameter#Left context AST#parameter#Right , AST#parameter#Left permissions AST#parameter#Right ) AST#parameter_list#Right . then ( AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left data AST#parame...
atManager.requestPermissionsFromUser(context, permissions).then((data) => { let grantStatus: Array<number> = data.authResults; let length: number = grantStatus.length; for (let i = 0; i < length; i++) { if (grantStatus[i] === 0) { console.info('授权成功') if (this.au...
https://github.com/Nuist666/Alzheimer.git/blob/c171b8e739357bfc5a3fc71c90aaea6ce5d463d1/entry/src/main/ets/pages/cmmsepage.ets#L49-L64
f7a7c3ed02198860704b6b748429098ce073b27a
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
entry/src/main/ets/pages/index/DialogPage.ets
arkts
loadingProgress
进度条加载弹框
loadingProgress(index: number) { if (index == 0) { //简单使用 this.progress = 50; let dialogId = DialogHelper.showLoadingProgress({ progress: this.progress, }); //模拟网络 let intervalID = setInterval(() => { if (this.progress < 100) { this.progress = this.progr...
AST#method_declaration#Left loadingProgress AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( ...
loadingProgress(index: number) { if (index == 0) { this.progress = 50; let dialogId = DialogHelper.showLoadingProgress({ progress: this.progress, }); let intervalID = setInterval(() => { if (this.progress < 100) { this.progress = this.progress + 1 ...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/pages/index/DialogPage.ets#L1026-L1090
c50529b824ec8abde11fe610ffbaa80db4096b16
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/SM4.ets
arkts
generateSymKey
生成对称密钥SymKey,异步 @param symAlgName 待生成对称密钥生成器的算法名称(SM4_128) @returns
static async generateSymKey(): Promise<cryptoFramework.SymKey> { return CryptoUtil.generateSymKey('SM4_128'); }
AST#method_declaration#Left static async generateSymKey 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 cryptoFramework . SymKey AST#qualif...
static async generateSymKey(): Promise<cryptoFramework.SymKey> { return CryptoUtil.generateSymKey('SM4_128'); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L385-L387
6e68a50b3318726cb22d8d45473bb6956cc40a63
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets
arkts
sendMessage
发送消息方法
sendMessage() { if (this.inputText.trim()) { this.messages = [...this.messages, { id: Date.now(), content: this.inputText, sender: '观众' }] this.inputText = '' } }
AST#method_declaration#Left sendMessage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left ...
sendMessage() { if (this.inputText.trim()) { this.messages = [...this.messages, { id: Date.now(), content: this.inputText, sender: '观众' }] this.inputText = '' } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/ListChatRoom.ets#L44-L53
b2f29e23e69bb6fbe88d5170ce928be4d333eafb
gitee
texiwustion/chinese-herbal-shopping--arkts.git
3f71338f3c6d88bc74342e0322867f3a0c2c17d1
entry/src/main/ets/database/UserTable.ets
arkts
query
查询用户数据的方法
query(username, callback: Function) { // 初始化操作数据库的谓词对象 let predicates = new relationalStore.RdbPredicates(CommonConstants.USER_TABLE.tableName); // 使用谓词执行userTable的查询方法,此时谓词匹配指定username predicates.equalTo('username', username); this.userTable.query(predicates, (resultSet: relationalStore.ResultSet) ...
AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left username AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { /...
query(username, callback: Function) { let predicates = new relationalStore.RdbPredicates(CommonConstants.USER_TABLE.tableName); predicates.equalTo('username', username); this.userTable.query(predicates, (resultSet: relationalStore.ResultSet) => { let count: number = resultSet.rowCount...
https://github.com/texiwustion/chinese-herbal-shopping--arkts.git/blob/3f71338f3c6d88bc74342e0322867f3a0c2c17d1/entry/src/main/ets/database/UserTable.ets#L64-L97
c0d06f47785bec8a87729b275256ef1df0ff9657
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ResUtil.ets
arkts
getRawFileListSync
获取resources/rawfile目录下文件夹及文件列表(若文件夹中无文件,则不返回;若文件夹中有文件,则返回文件夹及文件列表) @param path rawfile文件夹路径。 @returns
static getRawFileListSync(path: string): Array<string> { return ResUtil.getResourceManager().getRawFileListSync(path); }
AST#method_declaration#Left static getRawFileListSync AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_typ...
static getRawFileListSync(path: string): Array<string> { return ResUtil.getResourceManager().getRawFileListSync(path); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L467-L469
8ebe134a9a0404a3b33d81ebab55618149544cbe
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagedepthcopy/src/main/ets/model/AdjustData.ets
arkts
Copyright (c) 2024 Hunan OpenValley Digital Industry Development 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 l...
export enum CropTasks { ORIGIN, ONE_ONE, THREE_FOUR, NINE_SIXTH, NONE = 99 }
AST#export_declaration#Left export AST#enum_declaration#Left enum CropTasks AST#enum_body#Left { AST#enum_member#Left ORIGIN AST#enum_member#Right , AST#enum_member#Left ONE_ONE AST#enum_member#Right , AST#enum_member#Left THREE_FOUR AST#enum_member#Right , AST#enum_member#Left NINE_SIXTH AST#enum_member#Right , AST#en...
export enum CropTasks { ORIGIN, ONE_ONE, THREE_FOUR, NINE_SIXTH, NONE = 99 }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagedepthcopy/src/main/ets/model/AdjustData.ets#L16-L22
d02e54cf46c1cd04ffa7ad78fa14011106edb8ce
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Security/StringCipherArkTS/entry/src/main/ets/common/utils/PromptUtil.ets
arkts
promptMessage
A dialog box is displayed. @param message Message info. @param Time duration.
promptMessage(message: string | Resource, time: number, bottom: string | number = CommonConstants.PROMPT_BOTTOM) { promptAction.showToast({ message: message, duration: time, bottom: bottom }); }
AST#method_declaration#Left promptMessage AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , A...
promptMessage(message: string | Resource, time: number, bottom: string | number = CommonConstants.PROMPT_BOTTOM) { promptAction.showToast({ message: message, duration: time, bottom: bottom }); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Security/StringCipherArkTS/entry/src/main/ets/common/utils/PromptUtil.ets#L29-L35
a862da2123640ee86e9c1582ff35a2ae5c678b98
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets
arkts
通用常量
export class CommonConstants { // 颜色常量 static readonly COLOR_PRIMARY: string = '#4D8CFE'; static readonly COLOR_PRIMARY_LIGHT: string = '#6BA0FF'; static readonly COLOR_SECONDARY: string = '#4CAF50'; static readonly COLOR_ACCENT: string = '#FF6B6B'; static readonly COLOR_BACKGROUND: string = '#F5F7FA'; /...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { // 颜色常量 AST#property_declaration#Left static readonly COLOR_PRIMARY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '#4D8CFE' AST#expre...
export class CommonConstants { static readonly COLOR_PRIMARY: string = '#4D8CFE'; static readonly COLOR_PRIMARY_LIGHT: string = '#6BA0FF'; static readonly COLOR_SECONDARY: string = '#4CAF50'; static readonly COLOR_ACCENT: string = '#FF6B6B'; static readonly COLOR_BACKGROUND: string = '#F5F7FA'; stati...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets#L4-L38
47d4a423b879dbd5c5dc9d3e310650133df6be88
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
isDataView
Check whether the entered value is of DataView type. @param { Object } value - A DataView value @returns { boolean } Returns true if the value is a built-in DataView instance. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
isDataView(value: Object): boolean;
AST#method_declaration#Left isDataView 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#Righ...
isDataView(value: Object): boolean;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1191-L1191
6c4bbdc35bb8fb644eb8d7d0c0b1249a8fc42844
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/common/utils/Index.ets
arkts
logger
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { logger } from './src/main/ets/log/Logger';
AST#export_declaration#Left export { logger } from './src/main/ets/log/Logger' ; AST#export_declaration#Right
export { logger } from './src/main/ets/log/Logger';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/common/utils/Index.ets#L16-L16
b82b4e6af779012d884542f7460ae0f8c02d54da
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/calendar/LunarService.ets
arkts
getDateDetail
获取日期的详细信息
async getDateDetail(date: Date, birthdays: Contact[] = [], todos: TodoItem[] = []): Promise<DateDetail> { const lunarDate = await this.getLunarInfo(date); const festivals = this.getFestivals(date, lunarDate); const solarTerm = await this.getSolarTerm(date); const weekdays = ['星期日', '星期一', '星期二', '星期三',...
AST#method_declaration#Left async getDateDetail AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left birthdays : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left...
async getDateDetail(date: Date, birthdays: Contact[] = [], todos: TodoItem[] = []): Promise<DateDetail> { const lunarDate = await this.getLunarInfo(date); const festivals = this.getFestivals(date, lunarDate); const solarTerm = await this.getSolarTerm(date); const weekdays = ['星期日', '星期一', '星期二', '星期三',...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/LunarService.ets#L266-L289
668d4078ff22c7a1cc822dbc005dab9a94301b7b
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets
arkts
encode
加密 @param encodeStr 待加密的字符串 @param pubKey SM2公钥 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
static encode(str: string, pubKey: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.encodeAsym(str, pubKey, 'SM2_256', 'SM2_256|SM3', 256, keyCoding, resultCoding, false); }
AST#method_declaration#Left static encode AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pubKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Rig...
static encode(str: string, pubKey: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.encodeAsym(str, pubKey, 'SM2_256', 'SM2_256|SM3', 256, keyCoding, resultCoding, false); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets#L45-L48
fc7bb21d2a6dacfee452cb77a8e09654b22cac42
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/BoxType.ets
arkts
/ DistanceFromBase 是相距 base 的天数: base + distance
export type DistanceFromBase = number;
AST#export_declaration#Left export AST#type_declaration#Left type DistanceFromBase = AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#type_declaration#Right AST#export_declaration#Right
export type DistanceFromBase = number;
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/BoxType.ets#L7-L7
63f0f2feba7094d0057685d465e524256e15bd25
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/CommonTypes.ets
arkts
祝福语语言枚举
export enum GreetingLanguage { ZH_CN = 'zh_CN', // 中文 EN_US = 'en_US' // 英文 }
AST#export_declaration#Left export AST#enum_declaration#Left enum GreetingLanguage AST#enum_body#Left { AST#enum_member#Left ZH_CN = AST#expression#Left 'zh_CN' AST#expression#Right AST#enum_member#Right , // 中文 AST#enum_member#Left EN_US = AST#expression#Left 'en_US' AST#expression#Right AST#enum_member#Right // 英文 } ...
export enum GreetingLanguage { ZH_CN = 'zh_CN', EN_US = 'en_US' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L92-L95
fd9a62d3b8debae66719a4446c3933de0d246fae
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/shortcut/ShortcutManager.ets
arkts
recordShortcutUsage
记录快捷方式使用统计
private async recordShortcutUsage(shortcutId: string, type: ShortcutType): Promise<void> { try { // TODO: 实现使用统计记录 const usage = { shortcutId, type, timestamp: new Date().toISOString(), count: 1 }; hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_A...
AST#method_declaration#Left private async recordShortcutUsage AST#parameter_list#Left ( AST#parameter#Left shortcutId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left Sh...
private async recordShortcutUsage(shortcutId: string, type: ShortcutType): Promise<void> { try { const usage = { shortcutId, type, timestamp: new Date().toISOString(), count: 1 }; hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Sho...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/shortcut/ShortcutManager.ets#L462-L477
0c04b665080bf617c7a4b23b5cfa9fdbb72af8d6
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imageresizable/src/main/ets/common/constants/CommonConstants.ets
arkts
通用常量
export default class CommonConstants { /** * 商品mock数据 */ static readonly PRODUCT_DATA_ARR_MOCK = [ ['1', '商品A', '200减30券', 200, '537'], ['2', '商品B', '8折促销', 18999, '500'], ['3', '商品C', '20元无门槛券', 3500, '2000+'], ['4', '商品D', '满5000减50', 39999, '9999'], ['5', '商品E', '2件减20', 249, '5000+'], ...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * 商品mock数据 */ AST#property_declaration#Left static readonly PRODUCT_DATA_ARR_MOCK = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#array_literal#Left [ AST#expression#Left '1...
export default class CommonConstants { static readonly PRODUCT_DATA_ARR_MOCK = [ ['1', '商品A', '200减30券', 200, '537'], ['2', '商品B', '8折促销', 18999, '500'], ['3', '商品C', '20元无门槛券', 3500, '2000+'], ['4', '商品D', '满5000减50', 39999, '9999'], ['5', '商品E', '2件减20', 249, '5000+'], ['3', '商品F', '任选3件8...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageresizable/src/main/ets/common/constants/CommonConstants.ets#L19-L54
ff1c6dff82a404d999fc197f61bb4ef38cdfd948
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets
arkts
The font size of application.
export enum FontSize { SMALL = 14, MIDDLE = 16, LARGE = 20, };
AST#export_declaration#Left export AST#enum_declaration#Left enum FontSize AST#enum_body#Left { AST#enum_member#Left SMALL = AST#expression#Left 14 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MIDDLE = AST#expression#Left 16 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LARGE = ...
export enum FontSize { SMALL = 14, MIDDLE = 16, LARGE = 20, };
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets#L21-L25
5b6949df6c87c184aea8c0bcce7a84224d5a7a70
gitee
wenfujing/honms-super-market.git
0858abecd8be5db7b8dcf88dcd77b7c66d37517a
common/src/main/ets/constants/StyleConstants.ets
arkts
Constants for common style.
export class StyleConstants { /** * Component width percentage: 100%. */ static readonly FULL_WIDTH: string = '100%'; /** * Component height percentage: 100%. */ static readonly FULL_HEIGHT: string = '100%'; /** * Component height percentage: 70%. */ static readonly SEVENTY_HEIGHT: strin...
AST#export_declaration#Left export AST#class_declaration#Left class StyleConstants AST#class_body#Left { /** * Component width percentage: 100%. */ AST#property_declaration#Left static readonly FULL_WIDTH : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AS...
export class StyleConstants { static readonly FULL_WIDTH: string = '100%'; static readonly FULL_HEIGHT: string = '100%'; static readonly SEVENTY_HEIGHT: string = '70%'; static readonly SIXTY_HEIGHT: string = '60%'; static readonly SIXTY_WIDTH: string = '60%'; static readonly FIFTY_HEI...
https://github.com/wenfujing/honms-super-market.git/blob/0858abecd8be5db7b8dcf88dcd77b7c66d37517a/common/src/main/ets/constants/StyleConstants.ets#L19-L164
b1ce1a1abd91725d5d42e89a6a3fa85069764744
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/sdk/TimerSdk.ets
arkts
TimerSdk
[Start define_timer_module]
@Sendable export class TimerSdk { static init(): TimerSdk { let timer = new TimerSdk(); return timer; } async Countdown(time: number) { return new Promise((resolve: (value: boolean) => void) => { setTimeout(() => { resolve(true); }, time); }); } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export class TimerSdk AST#class_body#Left { AST#method_declaration#Left static init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TimerSdk AST#primary_type#Right AST#type_annot...
@Sendable export class TimerSdk { static init(): TimerSdk { let timer = new TimerSdk(); return timer; } async Countdown(time: number) { return new Promise((resolve: (value: boolean) => void) => { setTimeout(() => { resolve(true); }, time); }); } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/sdk/TimerSdk.ets#L17-L31
f214b664e02c7f84308ee27306a41c64ec35acb9
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets
arkts
isBluetoothEnabled
蓝牙功能是否可用
isBluetoothEnabled(): boolean { Log.showInfo(TAG, `isBluetoothEnabled`); const state: access.BluetoothState = access.getState(); Log.showInfo(TAG, `isBluetoothEnabled: state = ${state}`); if (state === access.BluetoothState.STATE_ON || state === access.BluetoothState.STATE_TURNING_ON) { return tru...
AST#method_declaration#Left isBluetoothEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expressio...
isBluetoothEnabled(): boolean { Log.showInfo(TAG, `isBluetoothEnabled`); const state: access.BluetoothState = access.getState(); Log.showInfo(TAG, `isBluetoothEnabled: state = ${state}`); if (state === access.BluetoothState.STATE_ON || state === access.BluetoothState.STATE_TURNING_ON) { return tru...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets#L43-L51
c4fe57b202192f020a7835dc2e02d321c104043a
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
eftool/index.ets
arkts
PrefUtil
export { TypeWritingUtil } from './src/main/ets/device/keyboard/TypeWritingUtil';
export { PrefUtil } from './src/main/ets/device/PrefUtil';
AST#export_declaration#Left export { PrefUtil } from './src/main/ets/device/PrefUtil' ; AST#export_declaration#Right
export { PrefUtil } from './src/main/ets/device/PrefUtil';
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/index.ets#L113-L113
ba25a417b56b5c2a47ad2c8e9aa9a36c1cf0281f
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/StateManagement/entry/src/main/ets/segment/segment9.ets
arkts
jumpDetail
5.Centralize the jump processing logic of the 3 components in the parent component
jumpDetail(item: LearningResource): void { if (this.currentBreakpoint === 'BreakpointTypeEnum.LG') { this.discoverPathStack.pushPathByName('articleDetail', item); } else { this.appPathStack.pushPathByName('articleDetail', item); } }
AST#method_declaration#Left jumpDetail AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left LearningResource 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_typ...
jumpDetail(item: LearningResource): void { if (this.currentBreakpoint === 'BreakpointTypeEnum.LG') { this.discoverPathStack.pushPathByName('articleDetail', item); } else { this.appPathStack.pushPathByName('articleDetail', item); } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/StateManagement/entry/src/main/ets/segment/segment9.ets#L75-L81
11c73dc6e0119dfbedf87214b6961c6c4c118f5b
gitee
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/service/PodcastService.ets
arkts
searchPodcasts
搜索播客 @param keyword 搜索关键词 @param offset 偏移量(iTunes API 不支持,保留为兼容) @param limit 每页数量(默认50,最大200)
async searchPodcasts(keyword: string, offset: number = 0, limit: number = 50): Promise<Podcast[]> { // iTunes Search API 不支持 offset 分页,只支持 limit // 如果 offset > 0,返回空数组表示没有更多 if (offset > 0) { return []; } const searchUrl = `https://itunes.apple.com/search?term=${encodeURIComponent(keyword...
AST#method_declaration#Left async searchPodcasts AST#parameter_list#Left ( AST#parameter#Left keyword : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left offset : AST#type_annotation#Left AST#primary_type#Left number AST#prima...
async searchPodcasts(keyword: string, offset: number = 0, limit: number = 50): Promise<Podcast[]> { if (offset > 0) { return []; } const searchUrl = `https://itunes.apple.com/search?term=${encodeURIComponent(keyword)}&media=podcast&limit=${limit}`; try { const response = ...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/PodcastService.ets#L76-L92
d2d42edb11813881291645a914367fb13c8ba628
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/NavBarView.ets
arkts
定义按钮项的数据结构
export interface NavButtonItem { text?: ResourceStr // 文本(可选) icon?: Resource // 图标(可选) isSvg?: boolean // 默认是png color?: ResourceColor // 颜色 onClick?: () => void // 点击回调(可选) }
AST#export_declaration#Left export AST#interface_declaration#Left interface NavButtonItem AST#object_type#Left { AST#type_member#Left text ? : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right // 文本(可选) AST#type_member#Left icon ? : AST#typ...
export interface NavButtonItem { text?: ResourceStr icon?: Resource isSvg?: boolean color?: ResourceColor onClick?: () => void }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/NavBarView.ets#L5-L11
1850ef00f3e5fdc67e8663fe3e8ea892e005144d
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/data/src/main/ets/repository/DemoRepository.ets
arkts
getAll
获取所有 Demo 记录,按更新时间倒序 @returns {Promise<DemoEntity[]>} Demo 列表
async getAll(): Promise<DemoEntity[]> { return this.demoLocalDataSource.getAllItems(); }
AST#method_declaration#Left async getAll AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DemoEntity [ ] AST#array_type#Right AST#primary_type#R...
async getAll(): Promise<DemoEntity[]> { return this.demoLocalDataSource.getAllItems(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/data/src/main/ets/repository/DemoRepository.ets#L61-L63
e0ee52a6d5caaaf6a24ff3f0783b234225aae409
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/WindowUtil.ets
arkts
setWindowBrightness
设置屏幕亮度值,使用Promise异步回调。 @param brightness 屏幕亮度值。该参数为浮点数,取值范围为[0.0, 1.0]或-1.0。1.0表示最亮,-1.0表示默认亮度。 @param windowClass 不传该值,默认主窗口。 @returns
static async setWindowBrightness(brightness: number, windowClass: window.Window = AppUtil.getMainWindow()): Promise<void> { return windowClass.setWindowBrightness(brightness); }
AST#method_declaration#Left static async setWindowBrightness AST#parameter_list#Left ( AST#parameter#Left brightness : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#L...
static async setWindowBrightness(brightness: number, windowClass: window.Window = AppUtil.getMainWindow()): Promise<void> { return windowClass.setWindowBrightness(brightness); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WindowUtil.ets#L232-L235
ba92091e111a9cba1b6216f40cfb0a7a8865c915
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/EmojiDetail.ets
arkts
popupBuilder
popup表情详情弹框
@Builder popupBuilder() { Column() { Image(this.EmojiItem?.imgSrc) .width(FaceGridConstants.EMOJI_IMAGE_SIZE * 2) // 2, 放大两倍 .height(FaceGridConstants.EMOJI_IMAGE_SIZE * 2) // 2, 放大两倍 .id('popupImage') Text(this.EmojiItem?.meaning) } .justifyContent(FlexAlign.SpaceAroun...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right popupBuilder 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 popupBuilder() { Column() { Image(this.EmojiItem?.imgSrc) .width(FaceGridConstants.EMOJI_IMAGE_SIZE * 2) .height(FaceGridConstants.EMOJI_IMAGE_SIZE * 2) .id('popupImage') Text(this.EmojiItem?.meaning) } .justifyContent(FlexAlign.SpaceAround) .padding($r('...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/view/EmojiDetail.ets#L35-L46
2b46f1065614a97f33d82e278ecfa24831fc3eb4
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagetheft/src/main/ets/constants/Constants.ets
arkts
图片组件高度
export const IMAGE_THEFT_IMAGEKNIFE_COMPONENT_HEIGHT: number = 360;
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left IMAGE_THEFT_IMAGEKNIFE_COMPONENT_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 360 AST#expression#Right AST#variable_declarator#Righ...
export const IMAGE_THEFT_IMAGEKNIFE_COMPONENT_HEIGHT: number = 360;
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagetheft/src/main/ets/constants/Constants.ets#L29-L29
68ff96d83450b3c496afe4cf1264cd74d636d582
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/InputKeyManager.ets
arkts
InputKeyEventManager
输入按键事件管理
@Preview @Component export struct InputKeyEventManager { @State mKeyEventData: string = '' // 按键数据 build() { Scroll() { Column({ space: 12 }) { Column({ space: 8 }) { Text($r('app.string.input_key_event_listener')) .fontColor($r('sys.color.ohos_id_color_text_primary')) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct InputKeyEventManager AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right mKeyEventData : AST#type_annotation#Left AST...
@Preview @Component export struct InputKeyEventManager { @State mKeyEventData: string = '' build() { Scroll() { Column({ space: 12 }) { Column({ space: 8 }) { Text($r('app.string.input_key_event_listener')) .fontColor($r('sys.color.ohos_id_color_text_primary')) ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/InputKeyManager.ets#L19-L79
78dd1a06bf0ce089c5a331f8b5fc59ec741dd1f1
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/dynamicattributes/src/main/ets/common/AttributeModifier.ets
arkts
自定义class实现row组件的AttributeModifier接口
export class BarModifier implements AttributeModifier<RowAttribute> { applyNormalAttribute(instance: RowAttribute): void { instance.height($r('app.float.dynamicattributes_float_60')); instance.width($r('app.string.dynamicattributes_max_size')); instance.padding($r('app.float.dynamicattributes_float_15'));...
AST#export_declaration#Left export AST#class_declaration#Left class BarModifier AST#implements_clause#Left implements AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left RowAttribute AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right ...
export class BarModifier implements AttributeModifier<RowAttribute> { applyNormalAttribute(instance: RowAttribute): void { instance.height($r('app.float.dynamicattributes_float_60')); instance.width($r('app.string.dynamicattributes_max_size')); instance.padding($r('app.float.dynamicattributes_float_15'));...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dynamicattributes/src/main/ets/common/AttributeModifier.ets#L92-L104
fc46478cd302df2744c6438716b912f954336ce1
gitee
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Bridges/PhotoView/AssetUtil.ets
arkts
getAssetSource
获取图片imageSource @param asset 图片 @returns 返回imageSource
static getAssetSource(asset: string | AssetModel) { let path = typeof asset == 'string' ? asset : asset.localPath; const imageSource = image.createImageSource(path); return imageSource }
AST#method_declaration#Left static getAssetSource AST#parameter_list#Left ( AST#parameter#Left asset : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left AssetModel AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#R...
static getAssetSource(asset: string | AssetModel) { let path = typeof asset == 'string' ? asset : asset.localPath; const imageSource = image.createImageSource(path); return imageSource }
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Bridges/PhotoView/AssetUtil.ets#L16-L20
d0a7874ee5c014e814f351a96434f85b5c6f02f6
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/common/Utils.ets
arkts
getEndOfToday
Get end of today (23:59:59) as timestamp @returns Timestamp of end of today
static getEndOfToday(): number { const now = new Date(); now.setHours(23, 59, 59, 999); return now.getTime(); }
AST#method_declaration#Left static getEndOfToday 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#variable_declaration#Left const AST#variable_declarator#Left no...
static getEndOfToday(): number { const now = new Date(); now.setHours(23, 59, 59, 999); return now.getTime(); }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/Utils.ets#L53-L57
a5e50178b6847181cf99cb3424ed0fde54c9061b
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
arkts/@arkts.utils.d.ets
arkts
wait
Waits for the ConditionVariable to be notified. @returns { Promise<void> } A promise will be resolved once the ConditionVariable is notified.. @syscap SystemCapability.Utils.Lang @atomicservice @since 18
wait(): Promise<void>;
AST#method_declaration#Left wait AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right A...
wait(): Promise<void>;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.utils.d.ets#L672-L672
77301e74a4ca06314c0554a34b7bf7e2942fb51c
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/actions/MessageCreate.ets
arkts
应用ArkTS约束:使用export default代替module.exports(约束60)
export default MessageCreateAction;
AST#export_declaration#Left export default AST#expression#Left MessageCreateAction AST#expression#Right ; AST#export_declaration#Right
export default MessageCreateAction;
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/MessageCreate.ets#L68-L68
86721d0e1a0a7f83c433dc08ee95b5961d0c6475
github
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/player/VHWarmPlayerView.ets
arkts
onValidDefinitions
当前房间支持的清晰度列表 @param definitions 支持的清晰度列表
onValidDefinitions(definitions: VHPlayDefinition[]){ let hasDef:boolean = false; this.definitions_list = []; this.playDefinitionList = []; definitions.forEach((item)=>{ this.definitions_list.push(item); if(this.player_config?.default_definition == item){ hasDef = true; } ...
AST#method_declaration#Left onValidDefinitions AST#parameter_list#Left ( AST#parameter#Left definitions : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left VHPlayDefinition [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block...
onValidDefinitions(definitions: VHPlayDefinition[]){ let hasDef:boolean = false; this.definitions_list = []; this.playDefinitionList = []; definitions.forEach((item)=>{ this.definitions_list.push(item); if(this.player_config?.default_definition == item){ hasDef = true; } ...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/player/VHWarmPlayerView.ets#L195-L216
725bf79d1b0708fd1012ac2d0b338c50c6bbdbcf
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/MediaManager.ets
arkts
stopAudioRecording
停止录音
async stopAudioRecording(): Promise<string> { if (!this.audioRecorder) { throw new Error('录音器未初始化'); } try { await this.audioRecorder.stop(); const outputPath = this.defaultAudioConfig.outputPath; await this.audioRecorder.release(); this.audioRecorder = null; hil...
AST#method_declaration#Left async stopAudioRecording AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#...
async stopAudioRecording(): Promise<string> { if (!this.audioRecorder) { throw new Error('录音器未初始化'); } try { await this.audioRecorder.stop(); const outputPath = this.defaultAudioConfig.outputPath; await this.audioRecorder.release(); this.audioRecorder = null; hil...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/MediaManager.ets#L435-L453
49c217c296abe4960a59137ac091cfc06eef8612
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SimpleBirthdayApp.ets
arkts
buildSettingsSection
构建设置分组
@Builder buildSettingsSection(icon: string, title: string, items: SettingsItem[]) { Column({ space: 12 }) { Row({ space: 12 }) { Text(icon) .fontSize(20) Text(title) .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutW...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSettingsSection AST#parameter_list#Left ( AST#parameter#Left icon : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_annotatio...
@Builder buildSettingsSection(icon: string, title: string, items: SettingsItem[]) { Column({ space: 12 }) { Row({ space: 12 }) { Text(icon) .fontSize(20) Text(title) .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor('#333333') .layoutW...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L1342-L1368
e91f45f5e67036a0f514a7cfea8313b53fac3163
github
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
time_bar/src/main/ets/contants/CommonConstants.ets
arkts
log identifier Enum defining the alignment options for time axis tick marks Used to specify the vertical positioning of tick lines on a time scale
export enum ScaleAlignment { /** * Tick marks are displayed at the top of the time axis */ TOP = 0, /** * Tick marks are displayed in the center of the time axis */ CENTER = 1, /** * Tick marks are displayed at the bottom of the time axis */ BOTTOM = 2 }
AST#export_declaration#Left export AST#enum_declaration#Left enum ScaleAlignment AST#enum_body#Left { /** * Tick marks are displayed at the top of the time axis */ AST#enum_member#Left TOP = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , /** * Tick marks are displayed in the center of the t...
export enum ScaleAlignment { TOP = 0, CENTER = 1, BOTTOM = 2 }
https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/contants/CommonConstants.ets#L44-L59
e8f50b619cfe24395e09f5d97a912095e7d159e4
gitee
CongDuang/PlayHarmony.git
674a0459e1b20db9de8c837dff6a8d1f06330e79
entry/src/main/ets/pages/main/view/ProjectView.ets
arkts
getProjectCategory
获取项目分类
private async getProjectCategory() { const resp = await HttpUtil.getInstance().get<CategoryModel[], undefined>('/project/tree/json'); if (resp.errorCode === ErroCode.OK && resp.data && resp.data.length > 0) { this.categoryList = resp.data; } }
AST#method_declaration#Left private async getProjectCategory AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left resp = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#L...
private async getProjectCategory() { const resp = await HttpUtil.getInstance().get<CategoryModel[], undefined>('/project/tree/json'); if (resp.errorCode === ErroCode.OK && resp.data && resp.data.length > 0) { this.categoryList = resp.data; } }
https://github.com/CongDuang/PlayHarmony.git/blob/674a0459e1b20db9de8c837dff6a8d1f06330e79/entry/src/main/ets/pages/main/view/ProjectView.ets#L26-L31
15e44bbbfd3b76977cb9b7284778918bf0447187
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Security/DLPManager/entry/src/main/ets/pages/Index.ets
arkts
onOpenDlpFile
监听DLP文件打开
async onOpenDlpFile() { try { dlpPermission.on('openDLPFile', (info: dlpPermission.AccessedDLPFileInfo) => { Logger.info(TAG, 'openDlpFile event:' + info.uri + info.lastOpenTime); promptAction.showToast({ message: 'openDlpFile event:' + decodeURIComponent(info.uri) + info.lastOpenTim...
AST#method_declaration#Left async onOpenDlpFile AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#m...
async onOpenDlpFile() { try { dlpPermission.on('openDLPFile', (info: dlpPermission.AccessedDLPFileInfo) => { Logger.info(TAG, 'openDlpFile event:' + info.uri + info.lastOpenTime); promptAction.showToast({ message: 'openDlpFile event:' + decodeURIComponent(info.uri) + info.lastOpenTim...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/DLPManager/entry/src/main/ets/pages/Index.ets#L302-L314
8ec2767531b114530c451d50eda052d9cbc7b696
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets
arkts
manufacture
获取设备厂家名称
static manufacture(): string { return deviceInfo.manufacture }
AST#method_declaration#Left static manufacture AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expre...
static manufacture(): string { return deviceInfo.manufacture }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L29-L31
cbeffeadce77bac6472731ea8c402ba9b98b1df3
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/formatter/DefaultValueFormatter.ets
arkts
getDecimalDigits
Returns the number of decimal digits this formatter uses. @return
public getDecimalDigits(): number { return this.mDecimalDigits; }
AST#method_declaration#Left public getDecimalDigits 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_...
public getDecimalDigits(): number { return this.mDecimalDigits; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/formatter/DefaultValueFormatter.ets#L76-L78
6e8984273f57f6ba0ad40654d34ea13cf8089e7e
gitee
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/common/database/Tables/DayInfoApi.ets
arkts
query
根据日期查询单个数据 若不存在则初始化一个数据
query(date: string, callback: Function): void { let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates(Const.DAY_INFO.tableName); predicates.equalTo('date', date); RdbUtils.query(predicates).then((resultSet) => { let count: Number = resultSet.rowCount; if (count === -1) { let ...
AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_type#Right ...
query(date: string, callback: Function): void { let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates(Const.DAY_INFO.tableName); predicates.equalTo('date', date); RdbUtils.query(predicates).then((resultSet) => { let count: Number = resultSet.rowCount; if (count === -1) { let ...
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Tables/DayInfoApi.ets#L31-L51
455c40e9e613418036bd3dac2c55827b71056b92
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Security/DLPManager/entry/src/main/ets/media/dlpPage.ets
arkts
setSandboxFile
设置沙箱保留
async setSandboxFile(): Promise<void> { try { let docUris: Array<string> = [this.dlpUri]; dlpPermission.setRetentionState(docUris); // 设置沙箱保留 promptAction.showToast({ message: 'set success', duration: 2000 }); } catch (err) { Logger.error(TAG, 'setRetentionState error' + (err as Business...
AST#method_declaration#Left async setSandboxFile AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_a...
async setSandboxFile(): Promise<void> { try { let docUris: Array<string> = [this.dlpUri]; dlpPermission.setRetentionState(docUris); promptAction.showToast({ message: 'set success', duration: 2000 }); } catch (err) { Logger.error(TAG, 'setRetentionState error' + (err as BusinessError).co...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/DLPManager/entry/src/main/ets/media/dlpPage.ets#L204-L212
b3af0d5bb26f7207831980d08524bdb7955639cd
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets
arkts
createCameraInputFn
创建cameraInput输出对象
createCameraInputFn(cameraManager: camera.CameraManager, cameraDevice: camera.CameraDevice): camera.CameraInput | undefined { Logger.info(TAG, 'createCameraInputFn is called.'); let cameraInput: camera.CameraInput | undefined = undefined; try { cameraInput = cameraManager.createCameraInput(cameraD...
AST#method_declaration#Left createCameraInputFn AST#parameter_list#Left ( AST#parameter#Left cameraManager : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . CameraManager AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ca...
createCameraInputFn(cameraManager: camera.CameraManager, cameraDevice: camera.CameraDevice): camera.CameraInput | undefined { Logger.info(TAG, 'createCameraInputFn is called.'); let cameraInput: camera.CameraInput | undefined = undefined; try { cameraInput = cameraManager.createCameraInput(cameraD...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets#L467-L479
40fca7074c938812f48bdf9b87ee61701359b34f
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets
arkts
getXOffset
Returns the used offset on the x-axis for drawing the axis or legend labels. This offset is applied before and after the label. @return
public getXOffset(): number { return this.mXOffset; }
AST#method_declaration#Left public getXOffset 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 getXOffset(): number { return this.mXOffset; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets#L61-L63
e28f799f5224f3ac931c0ae53e0696e002bfaf29
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxIndicator.ets
arkts
CheckboxIndicatorBuilder
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 CheckboxIndicatorBuilder(name: string, param: Object) { CheckboxIndicatorExample() }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function CheckboxIndicatorBuilder 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#L...
@Builder export function CheckboxIndicatorBuilder(name: string, param: Object) { CheckboxIndicatorExample() }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxIndicator.ets#L16-L19
7dfaae1d5a95607391d5ddbfbe402482fe0f3c2a
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ComponentReuse/entry/src/main/ets/view/WithReuseId.ets
arkts
getWithReuseId
[End opt_reuseId] [End with_reuse_id]
@Builder function getWithReuseId(name: string): void { if (name === Constants.NAV_DESTINATION_ITEM_2) { NavDestination() { WithReuseId() } .title(title()) .backgroundColor('#F1F3F5') } }
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function getWithReuseId 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 getWithReuseId(name: string): void { if (name === Constants.NAV_DESTINATION_ITEM_2) { NavDestination() { WithReuseId() } .title(title()) .backgroundColor('#F1F3F5') } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ComponentReuse/entry/src/main/ets/view/WithReuseId.ets#L99-L108
c991bd0376ffcd16b6cdea309e81c6a8cf6737f3
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/AchievementInfo.ets
arkts
Achievement info
export default class AchievementInfo { achievementLevel: number = 0; showAchievement: boolean = false; }
AST#export_declaration#Left export default AST#class_declaration#Left class AchievementInfo AST#class_body#Left { AST#property_declaration#Left achievementLevel : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#pro...
export default class AchievementInfo { achievementLevel: number = 0; showAchievement: boolean = false; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/AchievementInfo.ets#L19-L22
a7ba301f2c0dbe534537d7824cbabc2986f16bde
gitee
Hyricane/Interview_Success.git
9783273fe05fc8951b99bf32d3887c605268db8f
entry/src/main/ets/commons/utils/Http.ets
arkts
改造一个更好用的axios
export class Http { // AxiosRequestConfig axios提供的请求对象类型 request<T, R = Object>(obj: AxiosRequestConfig<R>) { // !之前第二个泛型很复杂 因为返回的数据没剥离 // !现在数据剥离了 而且剥离干干净净 就是你要的数据 所以类型就是你要的数据的类型 return instance<null, T, R>(obj) } }
AST#export_declaration#Left export AST#class_declaration#Left class Http AST#class_body#Left { // AxiosRequestConfig axios提供的请求对象类型 AST#method_declaration#Left request AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right , AST#type_parameter#Left R = AST#type_annotation#Left AST#primary_type#Le...
export class Http { request<T, R = Object>(obj: AxiosRequestConfig<R>) { return instance<null, T, R>(obj) } }
https://github.com/Hyricane/Interview_Success.git/blob/9783273fe05fc8951b99bf32d3887c605268db8f/entry/src/main/ets/commons/utils/Http.ets#L74-L81
3fa832dd6c1030afba945a265091f151b170ad70
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/utils/SpeechRecognizerManager.ets
arkts
finish
结束识别
static finish() { SpeechRecognizerManager.asrEngine?.finish(SpeechRecognizerManager.sessionId) }
AST#method_declaration#Left static finish AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Spe...
static finish() { SpeechRecognizerManager.asrEngine?.finish(SpeechRecognizerManager.sessionId) }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/utils/SpeechRecognizerManager.ets#L115-L117
9dba5c11d85e7de1d15c67e6c4321a882ae5f9ab
gitee
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/model/ImageKnifeData.ets
arkts
区分是src,placehodler,还是error_holder
export enum ImageKnifeRequestSource { SRC, PLACE_HOLDER, ERROR_HOLDER }
AST#export_declaration#Left export AST#enum_declaration#Left enum ImageKnifeRequestSource AST#enum_body#Left { AST#enum_member#Left SRC AST#enum_member#Right , AST#enum_member#Left PLACE_HOLDER AST#enum_member#Right , AST#enum_member#Left ERROR_HOLDER AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Rig...
export enum ImageKnifeRequestSource { SRC, PLACE_HOLDER, ERROR_HOLDER }
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/model/ImageKnifeData.ets#L100-L104
75ab62ea52e201426819acd7216519f7a0232a59
gitee
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/util/VersionUtils.ets
arkts
版本工具 @since 2022-06-06
export namespace VersionUtils { /** * 计算升级包大小 * * @param newVersionInfo 新版本信息 * @return 升级包大小 */ export function calculatePackageSize(newVersion: update.NewVersionInfo): number { let totalSize: number = 0; for (let index = 0; index < newVersion?.versionComponents?.length; index++) { tot...
AST#export_declaration#Left export AST#ERROR#Left namespace VersionUtils { /** * 计算升级包大小 * * @param newVersionInfo 新版本信息 * @return 升级包大小 */ export AST#ERROR#Right AST#function_declaration#Left function calculatePackageSize AST#parameter_list#Left ( AST#parameter#Left newVersion : AST#type_annotation#Left...
export namespace VersionUtils { export function calculatePackageSize(newVersion: update.NewVersionInfo): number { let totalSize: number = 0; for (let index = 0; index < newVersion?.versionComponents?.length; index++) { totalSize += Number(newVersion?.versionComponents?.[index]?.size); } LogUt...
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/util/VersionUtils.ets#L32-L46
3ef3a1a6009c7edd6294e3f58516869ec8fe72f8
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets
arkts
osFullName
系统版本
static osFullName(): string { return deviceInfo.osFullName }
AST#method_declaration#Left static osFullName AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expres...
static osFullName(): string { return deviceInfo.osFullName }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L134-L136
911bbddd8d33a82ef1a3f5eb8ad3c665adca529b
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets
arkts
generate2048RSAKey
生成2048位RSA的非对称密钥 @param resultCoding 生成RSA秘钥的字符串格式(hex/base64)-默认不传为base64格式 @returns 2048位RSA密钥{publicKey:2048位公钥,privateKey:2048位私钥}
static generate2048RSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('RSA2048', resultCoding); }
AST#method_declaration#Left static generate2048RSAKey AST#parameter_list#Left ( AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#ex...
static generate2048RSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('RSA2048', resultCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets#L44-L46
28469022161ea390ceef842b9d919c70ed28d83a
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/advertisingpage/src/main/ets/components/AdvertisingPage.ets
arkts
timerInterval
控制页面显示倒计时
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
AST#method_declaration#Left timerInterval AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . timer AST#member_expression#Right = ...
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/advertisingpage/src/main/ets/components/AdvertisingPage.ets#L59-L68
0ae841d780d81bee5998dccb9ccb8a2771dd5eec
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/dbUtils/DBAccessor.ets
arkts
attachDatabase
附加其他数据库 @param path - 需要附加的数据库路径
private async attachDatabase(path: string): Promise<void> { if (!this.rdbStore) return; // 从路径中提取数据库名称(去除路径和扩展名) const dbName = path.substring( path.lastIndexOf('/') + 1, // 获取文件名 path.lastIndexOf('.sqlite') // 去除.db后缀 ); try { await this.rdbStore.executeSql(`ATTACH DATABAS...
AST#method_declaration#Left private async attachDatabase AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_...
private async attachDatabase(path: string): Promise<void> { if (!this.rdbStore) return; const dbName = path.substring( path.lastIndexOf('/') + 1, path.lastIndexOf('.sqlite') ); try { await this.rdbStore.executeSql(`ATTACH DATABASE '${path}' AS ${dbName}`); DebugLog...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBAccessor.ets#L108-L124
4651f8ab561a4dfc82f7235102168aa013f24f3e
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setCenterTextColor
Sets the color of the center text of the PieChart. @param color
public setCenterTextColor(color: number): void { ( /*(PieChartRenderer)*/ this.mRenderer as PieChartRenderer).getPaintCenterText().setColor(color); }
AST#method_declaration#Left public setCenterTextColor AST#parameter_list#Left ( AST#parameter#Left color : 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#prima...
public setCenterTextColor(color: number): void { ( this.mRenderer as PieChartRenderer).getPaintCenterText().setColor(color); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L612-L615
abcd26c3f4af211a3dccec28ca4190b183f90a68
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/auth/src/main/ets/view/LoginPage.ets
arkts
构建登录页 @returns {void} 无返回值
build() { AppNavDestination({ title: $r("app.string.login_title"), viewModel: this.vm }) { this.LoginContent(); } }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.login_ti...
build() { AppNavDestination({ title: $r("app.string.login_title"), viewModel: this.vm }) { this.LoginContent(); } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/auth/src/main/ets/view/LoginPage.ets#L22-L29
c72f57fc9b856ac1239ca7ed8c10dab5f9145d19
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/BuildProfile.ets
arkts
Use these variables when you tailor your ArkTS code. They must be of the const type.
export const HAR_VERSION = '1.4.0';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '1.4.0' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const HAR_VERSION = '1.4.0';
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/BuildProfile.ets#L4-L4
238899f05b5371ebd2e21b3fb7bf97d986af5dcb
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets
arkts
buildColorPreview
构建颜色预览
@Builder buildColorPreview(label: string, color: string) { Column({ space: 4 }) { Circle({ width: 32, height: 32 }) .fill(color) .border({ width: 1, color: $r('app.color.divider') }) Text(label) .fontSize(UIConstants.FONT_SIZE_CAPTION) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildColorPreview AST#parameter_list#Left ( AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left color : AST#type_annotation#...
@Builder buildColorPreview(label: string, color: string) { Column({ space: 4 }) { Circle({ width: 32, height: 32 }) .fill(color) .border({ width: 1, color: $r('app.color.divider') }) Text(label) .fontSize(UIConstants.FONT_SIZE_CAPTION) ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L319-L334
13e6eb8368272397c4878171910e822030e76c9c
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets
arkts
定义defaultTheme变量
export const defaultTheme: SelectionMenuTheme = { imageSize: 24, buttonSize: 48, menuSpacing: 8, editorOptionMargin: 1, expandedOptionPadding: 3, defaultMenuWidth: 256, imageFillColor: $r('sys.color.ohos_id_color_primary'), backGroundColor: $r('sys.color.ohos_id_color_dialog_bg'), iconBorderRadius: $r...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left defaultTheme : AST#type_annotation#Left AST#primary_type#Left SelectionMenuTheme AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_...
export const defaultTheme: SelectionMenuTheme = { imageSize: 24, buttonSize: 48, menuSpacing: 8, editorOptionMargin: 1, expandedOptionPadding: 3, defaultMenuWidth: 256, imageFillColor: $r('sys.color.ohos_id_color_primary'), backGroundColor: $r('sys.color.ohos_id_color_dialog_bg'), iconBorderRadius: $r...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/TextComponent/entry/src/main/ets/pages/richEditor/SetAttributes.ets#L44-L65
649548bb73a85bbb20a6ae896b707057f1882bcf
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/function_var/function_var_002_F.ets
arkts
Introduction 变量函数
export function function_var_002_F(taint_src : string){ let _t = taint_src; let _clean = "clean"; let f = taint.Sink; f(_clean); }
AST#export_declaration#Left export AST#function_declaration#Left function function_var_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#...
export function function_var_002_F(taint_src : string){ let _t = taint_src; let _clean = "clean"; let f = taint.Sink; f(_clean); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/function_var/function_var_002_F.ets#L6-L11
c9e1b3c3c9c207e7895cebbe7fd41f5575cccac1
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/ui/src/main/ets/component/loading/Loading.ets
arkts
Loading
@file Loading 组件 @author Joker.X
@ComponentV2 export struct Loading { @Param loadSize: number = 40; /** * 构建 Loading 视图 * @returns void */ build(): void { LoadingProgress() .width(this.loadSize); } }
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct Loading AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right loadSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotat...
@ComponentV2 export struct Loading { @Param loadSize: number = 40; build(): void { LoadingProgress() .width(this.loadSize); } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ui/src/main/ets/component/loading/Loading.ets#L5-L18
95021b42a2a0b36997b651aeec6c5164ffa69e11
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Alarm/PermissionManager.ets
arkts
showRationale
显示权限说明弹窗(私有方法) @param message 说明文案 @returns Promise对象,用户点击"继续"后resolve
private static async showRationale(message: string | Resource): Promise<boolean> { return new Promise((resolve) => { // 创建系统弹窗(类似SwiftUI的Alert) promptAction.showDialog({ title: '权限说明', message, buttons: [ { text: '取消', color: '#999999' }, { text: '继续', color: ...
AST#method_declaration#Left private static async showRationale AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AS...
private static async showRationale(message: string | Resource): Promise<boolean> { return new Promise((resolve) => { promptAction.showDialog({ title: '权限说明', message, buttons: [ { text: '取消', color: '#999999' }, { text: '继续', color: '#0A59F7' }, ] ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Alarm/PermissionManager.ets#L168-L186
4bfef35f731edc0c147ee753083cb522c6c41707
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/ContactTypes.ets
arkts
性别统计接口
export interface GenderStats { male: number; female: number; unknown: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GenderStats AST#object_type#Left { AST#type_member#Left male : 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 female : AST#type_annotation#Left...
export interface GenderStats { male: number; female: number; unknown: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L226-L230
7836a017c92e687f9d5a66c29bf981ef59ed2d2b
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/view/LimitedHeightBottomDialogComponent.ets
arkts
createCommonSettingView
弹窗可滚动区域最大高度 创建常用设置底部弹窗视图
@Builder function createCommonSettingView() { CommonSettingView() }
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function createCommonSettingView 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 CommonSettingView ( ) AST#ui_...
@Builder function createCommonSettingView() { CommonSettingView() }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/limitedheightbottomdialog/src/main/ets/view/LimitedHeightBottomDialogComponent.ets#L28-L31
23087fa61f81787e3450a2b617b4ab164f95646e
gitee
kumaleap/ArkSwipeDeck.git
5afa77b9b2a2a531595d31f895c54a3371e4249a
library/src/main/ets/components/SwipeCardStack.ets
arkts
getCardTranslate
获取卡片位移
private getCardTranslate(stackIndex: number, dataIndex: number): TranslateOptions { if (dataIndex === this.currentIndex) { // 当前卡片 const translateOptions: TranslateOptions = { x: this.topCardAnimation.translateX, y: this.topCardAnimation.translateY, z: 0 }; return tra...
AST#method_declaration#Left private getCardTranslate AST#parameter_list#Left ( AST#parameter#Left stackIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataIndex : AST#type_annotation#Left AST#primary_type#Left number...
private getCardTranslate(stackIndex: number, dataIndex: number): TranslateOptions { if (dataIndex === this.currentIndex) { const translateOptions: TranslateOptions = { x: this.topCardAnimation.translateX, y: this.topCardAnimation.translateY, z: 0 }; return translateO...
https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/components/SwipeCardStack.ets#L269-L300
3a749b373a4e7d7410477fe4d401305fc1b09fdb
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/calendar/LunarService.ets
arkts
getLunarInfo
获取农历信息(通过API)
async getLunarInfo(date: Date): Promise<LunarDate> { try { const dateStr = this.formatDate(date); const url = `https://www.sojson.com/api/lunar/?date=${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, ...
AST#method_declaration#Left async getLunarInfo AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Pr...
async getLunarInfo(date: Date): Promise<LunarDate> { try { const dateStr = this.formatDate(date); const url = `https://www.sojson.com/api/lunar/?date=${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/LunarService.ets#L145-L172
c3a66fa3316530b293fc5f4a087013659f29f137
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets
arkts
startCustomScan
启动自定义扫码 @returns {void}
startCustomScan(): void { logger.info('startCustomScan'); try { const viewControl: customScan.ViewControl = { width: this.cameraCompWidth, height: this.cameraCompHeight, surfaceId: this.surfaceId }; customScan.start(viewControl).then((result) => { // TODO:知识点 请求...
AST#method_declaration#Left startCustomScan 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#expression_statement#Left AST#expression#Left AST#call_expression#Left...
startCustomScan(): void { logger.info('startCustomScan'); try { const viewControl: customScan.ViewControl = { width: this.cameraCompWidth, height: this.cameraCompHeight, surfaceId: this.surfaceId }; customScan.start(viewControl).then((result) => { this....
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets#L305-L323
9c6bf723fb789438139b89097e33de84dbfdeeaf
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BaseEntry.ets
arkts
getY
Returns the y value of this Entry. @return
public getY(): number { return this.y; }
AST#method_declaration#Left public getY AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#L...
public getY(): number { return this.y; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BaseEntry.ets#L43-L45
1462c836cc1758c6bb96f792270867413df042ac
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/demo/entry/src/main/ets/views/FlashingLightPage.ets
arkts
getImageDefault
返回选中图片
getImageDefault(): Resource | undefined { if (this.flashingNum == 0) { return $r('app.media.ic_camera_public_flash_off'); } if (this.flashingNum == 1) { return $r('app.media.ic_camera_public_flash_on'); } if (this.flashingNum == 2) { return $r('app.media.ic_camera_public_flash_auto...
AST#method_declaration#Left getImageDefault AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Resource AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statemen...
getImageDefault(): Resource | undefined { if (this.flashingNum == 0) { return $r('app.media.ic_camera_public_flash_off'); } if (this.flashingNum == 1) { return $r('app.media.ic_camera_public_flash_on'); } if (this.flashingNum == 2) { return $r('app.media.ic_camera_public_flash_auto...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/demo/entry/src/main/ets/views/FlashingLightPage.ets#L34-L48
0bb3db9208d95b37ae18bbf36a502bf5f1b2b567
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets
arkts
verify
验签 @param signStr 已签名的字符串 @param verifyStr 需要验签的字符串 @param pubKey 给定秘钥规格公钥 @param symAlgName 秘钥规格 @param symEncryptName 加密规格 @returns 验签结果OutDTO对象,其中Msg为验签结果
static async verify(signStr: string, verifyStr: string, pubKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> { //将公钥转换 let pubPair = await CryptoUtil.convertPubKeyFromStr(pubKey, symAlgName, keyName); //验签器 let verifyer = crypto.createVerify(symEncryptNam...
AST#method_declaration#Left static async verify AST#parameter_list#Left ( AST#parameter#Left signStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left verifyStr : AST#type_annotation#Left AST#primary_type#Left string AST#pri...
static async verify(signStr: string, verifyStr: string, pubKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> { let pubPair = await CryptoUtil.convertPubKeyFromStr(pubKey, symAlgName, keyName); let verifyer = crypto.createVerify(symEncryptName); ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets#L377-L395
5bba1c9e4b0be283c8cb4a6ffd40cb50fc916b45
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/personal/MinePage.ets
arkts
handleMenuItemClick
处理菜单项点击
handleMenuItemClick(index: number) { console.info(`Navigate to ${this.menuRoutes[index]}`); // 根据不同的菜单项执行不同的路由跳转 switch(this.menuRoutes[index]) { case 'myPosts': // 跳转到我的动态页面 router.pushUrl({ url: 'pages/personal/UserPostsPage', params: { userId: th...
AST#method_declaration#Left handleMenuItemClick AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#ex...
handleMenuItemClick(index: number) { console.info(`Navigate to ${this.menuRoutes[index]}`); switch(this.menuRoutes[index]) { case 'myPosts': router.pushUrl({ url: 'pages/personal/UserPostsPage', params: { userId: this.userInfo.id, user...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/personal/MinePage.ets#L166-L180
8300ca040c5d7a7b3f6374d84fe7ec0c3fec51c9
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/function_override/polymorphism_001_T.ets
arkts
Introduction 函数重载-多态 Level 2
export function polymorphism_001_T(taint_src : string) { let sub = new Sub1() taint.Sink(sub.call(taint_src)); }
AST#export_declaration#Left export AST#function_declaration#Left function polymorphism_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#...
export function polymorphism_001_T(taint_src : string) { let sub = new Sub1() taint.Sink(sub.call(taint_src)); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/function_override/polymorphism_001_T.ets#L7-L10
ff4dfa45e0c242bc12ca3be2e7121acd21d55ef3
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/Index.ets
arkts
initializePage
初始化页面数据
private async initializePage(): Promise<void> { try { // 加载主题设置 await this.loadThemeSettings(); // 加载生日数据 await this.loadBirthdayData(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to initialize page: ${error}`); } }
AST#method_declaration#Left private async initializePage AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AS...
private async initializePage(): Promise<void> { try { await this.loadThemeSettings(); await this.loadBirthdayData(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to initialize page: ${error}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/Index.ets#L44-L54
0fdf1dea6119e0c758d8f2e9bb46e3e1e93ac295
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/LLMConfigManager.ets
arkts
addConfig
添加新配置
async addConfig(config: LLMConfig): Promise<boolean> { try { const now = new Date(); // 如果是默认配置,清除其他配置的默认状态 if (config.isDefault) { this.configs.forEach(c => c.isDefault = false); } const newConfig: LLMConfig = { url: config.url, modelName: config.modelName, ...
AST#method_declaration#Left async addConfig AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left LLMConfig 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#Lef...
async addConfig(config: LLMConfig): Promise<boolean> { try { const now = new Date(); if (config.isDefault) { this.configs.forEach(c => c.isDefault = false); } const newConfig: LLMConfig = { url: config.url, modelName: config.modelName, apiKey: config....
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/LLMConfigManager.ets#L99-L127
43ee429f71cb40a6a4e7cbe9db96476f0fce2223
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/UIAnswer.ets
arkts
UIAnswer
被呼叫页 提示语不同,头像相同 按钮group: 拒绝,接听
@Component export default struct UIAnswer { private controller: IndexController | null = null; @Link mRemote: Caller; @State use: boolean = true; build() { Column() { ComponentVoiceBg({ tips: $r('app.string.tips_answer'), mPerson: $mRemote }) { Row() { //拒绝 ComponentOption...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct UIAnswer AST#component_body#Left { AST#property_declaration#Left private controller : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left IndexController AST#primary_type#Right | AST#primary_typ...
@Component export default struct UIAnswer { private controller: IndexController | null = null; @Link mRemote: Caller; @State use: boolean = true; build() { Column() { ComponentVoiceBg({ tips: $r('app.string.tips_answer'), mPerson: $mRemote }) { Row() { ComponentOption({ ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/UIAnswer.ets#L26-L79
8d9e3a29df868a45e5d72944e916842da30b0885
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_json/src/main/ets/json/JSONObject.ets
arkts
parseObject
json字符串转换为实体对象 @param jsonStr json字符串 @param convertDateStr 是否将日期字符串转换成日期对象 - 默认为true @returns T 对象
public static parseObject<T>(jsonStr: string, convertDateStr: boolean = true): T { //处理如果带有转义符号的 const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').replace(/\r/g, '\\r').replace(/\n/g, '\\n'); //转换 let json: Record<string, JSONValue> = JSON.parse(replaceStr); let data: T = JSONObject.parseNestedO...
AST#method_declaration#Left public static parseObject AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left jsonStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AS...
public static parseObject<T>(jsonStr: string, convertDateStr: boolean = true): T { const replaceStr = jsonStr.replace(/\r\n/g, '\\r\\n').replace(/\r/g, '\\r').replace(/\n/g, '\\n'); let json: Record<string, JSONValue> = JSON.parse(replaceStr); let data: T = JSONObject.parseNestedObject<T>(json, co...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_json/src/main/ets/json/JSONObject.ets#L102-L109
0d301f2e76a07415675aa6ee8f89f2e431de2ec2
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagemosaic/src/main/ets/view/ImageMosaicView.ets
arkts
getImageContent
获取图片内容
@Concurrent async function getImageContent(imgPath: string, context: Context): Promise<Uint8Array | undefined> { // 获取resourceManager资源管理 const resourceMgr: resourceManager.ResourceManager = context.resourceManager; // 获取rawfile中的图片资源 const fileData: Uint8Array = await resourceMgr.getRawFileContent(imgPath); ...
AST#decorated_function_declaration#Left AST#decorator#Left @ Concurrent AST#decorator#Right async function getImageContent AST#parameter_list#Left ( AST#parameter#Left imgPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Lef...
@Concurrent async function getImageContent(imgPath: string, context: Context): Promise<Uint8Array | undefined> { const resourceMgr: resourceManager.ResourceManager = context.resourceManager; const fileData: Uint8Array = await resourceMgr.getRawFileContent(imgPath); return fileData; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagemosaic/src/main/ets/view/ImageMosaicView.ets#L27-L34
b116fb460af1bcdaed4747fd4e52a8e59d3a2d6b
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/services/ApiService.ets
arkts
获取用户即将到期的任务列表 @param userId 用户ID @param days 天数 @param page 页码 @param size 每页大小 @returns 即将到期的任务列表
export function getUpcomingTasks(userId: number, days: number = 7, page: number = 0, size: number = 5): Promise<PageResponse<Task>> { const params: RequestData = { days, page, size }; try { return request<PageResponse<Task>>( RequestMethod.GET, `/tasks/user/${userId}/upcoming`, params as QueryPa...
AST#export_declaration#Left export AST#function_declaration#Left function getUpcomingTasks AST#parameter_list#Left ( AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left days : AST#type_annotation#Left...
export function getUpcomingTasks(userId: number, days: number = 7, page: number = 0, size: number = 5): Promise<PageResponse<Task>> { const params: RequestData = { days, page, size }; try { return request<PageResponse<Task>>( RequestMethod.GET, `/tasks/user/${userId}/upcoming`, params as QueryPa...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/services/ApiService.ets#L405-L417
6be773167ea8e1cb3d60a0f06a8378f290734d34
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/search/SearchViewModel.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2024/11/28 21:14 @Version V1.0 @Description
export class SearchViewModel extends ListViewModel { private readonly word: string constructor
AST#export_declaration#Left export AST#ERROR#Left class SearchViewModel extends AST#type_annotation#Left AST#primary_type#Left ListViewModel AST#primary_type#Right AST#type_annotation#Right { private readonly word : string AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#varia...
export class SearchViewModel extends ListViewModel { private readonly word: string constructor
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/search/SearchViewModel.ets#L12-L16
ba1e570c39279a8786392b7d3f85a6bef23abddc
github
wcmzllx/axis-render
34a330085691968cf1c132095e5ce078aa7ee933
AxisRenderLibrary/src/main/ets/common/AxisRender.ets
arkts
setStandardScale
设置标准刻度 @param valuePerTick @param pixelsPerTick
setStandardScale(valuePerTick: number, pixelsPerTick: number) { this.getInstance().setStandardScale(valuePerTick, pixelsPerTick) this.invalidate() }
AST#method_declaration#Left setStandardScale AST#parameter_list#Left ( AST#parameter#Left valuePerTick : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pixelsPerTick : AST#type_annotation#Left AST#primary_type#Left number A...
setStandardScale(valuePerTick: number, pixelsPerTick: number) { this.getInstance().setStandardScale(valuePerTick, pixelsPerTick) this.invalidate() }
https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L438-L441
1daaec267908dadf6f6a57ae64803d026bc9e0d1
gitee
xinkai-hu/MyDay.git
dcbc82036cf47b8561b0f2a7783ff0078a7fe61d
entry/src/main/ets/common/constants/MainConstant.ets
arkts
Main page constant description.
export default class MainConstant { /** * Default horizontal angle. */ static readonly DEFAULT_HORIZONTAL_ANGLE: number = 180; /** * Default clock time font size unit. */ static readonly CLOCK_TIME_FONT_SIZE_UNIT: string = 'px'; /** * Hour pointer image url. */ static readonly HOUR_POINTER...
AST#export_declaration#Left export default AST#class_declaration#Left class MainConstant AST#class_body#Left { /** * Default horizontal angle. */ AST#property_declaration#Left static readonly DEFAULT_HORIZONTAL_ANGLE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotatio...
export default class MainConstant { static readonly DEFAULT_HORIZONTAL_ANGLE: number = 180; static readonly CLOCK_TIME_FONT_SIZE_UNIT: string = 'px'; static readonly HOUR_POINTER_IMAGE_URL: string = '../../../resources/rawfile/clock/ic_hour_pointer.png'; static readonly MINUTE_POINTER_IMAGE_URL: str...
https://github.com/xinkai-hu/MyDay.git/blob/dcbc82036cf47b8561b0f2a7783ff0078a7fe61d/entry/src/main/ets/common/constants/MainConstant.ets#L19-L44
86cbe55174a47d6a4dd665099d25dea8fc801ed1
github
GAOMUgenius/SounderHarbor.git
ac0efa1a290980999e38aa868259d32c2f107bb2
features/mine/src/main/ets/pages/MainPage.ets
arkts
animateFontSize
新增:字体大小动画函数
private animateFontSize(targetIndex: number, currentIndex: number) { animateTo({ duration: this.animationDuration, curve: Curve.Linear, iterations: 1, playMode: PlayMode.Normal }, () => { // 重置所有字体大小 for (let i = 0; i < this.tabFontSizes.length; i++) { this.tabFontSiz...
AST#method_declaration#Left private animateFontSize AST#parameter_list#Left ( AST#parameter#Left targetIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left currentIndex : AST#type_annotation#Left AST#primary_type#Left num...
private animateFontSize(targetIndex: number, currentIndex: number) { animateTo({ duration: this.animationDuration, curve: Curve.Linear, iterations: 1, playMode: PlayMode.Normal }, () => { for (let i = 0; i < this.tabFontSizes.length; i++) { this.tabFontSizes[i] = 18 ...
https://github.com/GAOMUgenius/SounderHarbor.git/blob/ac0efa1a290980999e38aa868259d32c2f107bb2/features/mine/src/main/ets/pages/MainPage.ets#L332-L346
e7dfcf2f4f28a407f12d4b374bbf67aaa5796751
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/PreferencesUtils.ets
arkts
delete
删除缓存值 @param key @param preferenceName @returns
static async delete(key: string, preferenceName: string = defaultPreferenceName) { let preferences = await PreferencesUtils.getPreferences(preferenceName) //获取实例 await preferences.delete(key) return await preferences.flush() //此处一定要flush,要不然不能永久序列化到本地 }
AST#method_declaration#Left static async delete AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#pr...
static async delete(key: string, preferenceName: string = defaultPreferenceName) { let preferences = await PreferencesUtils.getPreferences(preferenceName) await preferences.delete(key) return await preferences.flush() }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PreferencesUtils.ets#L145-L149
46ac4a1fbdcec3c243c3abecaa508ba589e45ed0
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/entity/Order.ets
arkts
优惠信息详情
export class DiscountInfo { /** * ID */ id?: number | null = null; /** * 数量 */ num?: number | null = null; /** * 类型 */ type?: number | null = null; /** * 标题 */ title?: string | null = null; /** * 描述 */ description?: string | null = null; /** * 金额 */ amount?: n...
AST#export_declaration#Left export AST#class_declaration#Left class DiscountInfo AST#class_body#Left { /** * ID */ AST#property_declaration#Left id ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_typ...
export class DiscountInfo { id?: number | null = null; num?: number | null = null; type?: number | null = null; title?: string | null = null; description?: string | null = null; amount?: number | null = null; minAmount?: number | null = null; startTime?: string | null = null; ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/Order.ets#L163-L215
f673e6aa006b2e6cea9a222e3fd3fd51cc4223df
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/viewmodel/AlarmItem.ets
arkts
用于重复类型的枚举。
export enum RepeatType { NoRepeat = '仅一次', // 仅一次 Everyday = '每天', // 每天 DoubleRest = '双休制', // 双休制 SingleRest = '单休制', // 单休制 Custom = '自定义', // 自定义 }
AST#export_declaration#Left export AST#enum_declaration#Left enum RepeatType AST#enum_body#Left { AST#enum_member#Left NoRepeat = AST#expression#Left '仅一次' AST#expression#Right AST#enum_member#Right , // 仅一次 AST#enum_member#Left Everyday = AST#expression#Left '每天' AST#expression#Right AST#enum_member#Right , // 每天 AST#...
export enum RepeatType { NoRepeat = '仅一次', Everyday = '每天', DoubleRest = '双休制', SingleRest = '单休制', Custom = '自定义', }
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/AlarmItem.ets#L41-L47
f6ee8a943fe2c76efa08dd614b936a5924cc138d
github
zqf-dev/WAndroidHOS.git
e2e560a7c96110c43d13eb232826707601172b6d
entry/src/main/ets/model/ITreeBean.ets
arkts
导航
export class INav { articles: Array<INavChildren> name: string cid: string }
AST#export_declaration#Left export AST#class_declaration#Left class INav AST#class_body#Left { AST#property_declaration#Left articles : AST#ERROR#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left INavChildren AST#primary_type#Right AST#type_a...
export class INav { articles: Array<INavChildren> name: string cid: string }
https://github.com/zqf-dev/WAndroidHOS.git/blob/e2e560a7c96110c43d13eb232826707601172b6d/entry/src/main/ets/model/ITreeBean.ets#L24-L28
c2659bcbd77217d83a6aaf1ea4aceab846bd3f7c
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
mime_types/src/main/ets/Mime.ets
arkts
lookup
根据文件名获取MIME类型 @param fileName 文件名 'test.txt' @returns 输出:text/plain
static lookup(fileName: string): string { const fileExtention = Mime.getFileExtention(fileName); return Mime.contentType(fileExtention); }
AST#method_declaration#Left static lookup AST#parameter_list#Left ( AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static lookup(fileName: string): string { const fileExtention = Mime.getFileExtention(fileName); return Mime.contentType(fileExtention); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/mime_types/src/main/ets/Mime.ets#L28-L31
25e3b22acf17af9fe981535f9bf1496248d11d3e
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/entity/constraint.ets
arkts
设备ID的Key
export const DEFAULT_PREFERENCE_NAME: string = "SP_HARMONY_UTILS_PREFERENCES";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left DEFAULT_PREFERENCE_NAME : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "SP_HARMONY_UTILS_PREFERENCES" AST#expression#Right AST#variable_decl...
export const DEFAULT_PREFERENCE_NAME: string = "SP_HARMONY_UTILS_PREFERENCES";
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/entity/constraint.ets#L41-L41
4556d2ee7694741eb5d395520e181cc30bd5936e
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ArrayUtil.ets
arkts
trim
去除字符串数组的每个值的前后空格 @param strs @returns
static trim(strs: String[]): String[] { return strs.map((value) => value.trim()); }
AST#method_declaration#Left static trim AST#parameter_list#Left ( AST#parameter#Left strs : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left String [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#pr...
static trim(strs: String[]): String[] { return strs.map((value) => value.trim()); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ArrayUtil.ets#L62-L64
9bf59d310bdd0ccff7b4a3ef9f0c9a4e1b474968
gitee
softfatgay/harmony-netease.git
5f3d226b72ba8579cacfbd229e4eb0054d63abef
entry/src/main/ets/base/Api.ets
arkts
/首页
export const URL_HOME_NEW = baseUrl + '/xhr/index.json';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left URL_HOME_NEW = AST#expression#Left AST#binary_expression#Left AST#expression#Left baseUrl AST#expression#Right + AST#expression#Left '/xhr/index.json' AST#expression#Right AST#binary_expression#Right AST#expression#Right...
export const URL_HOME_NEW = baseUrl + '/xhr/index.json';
https://github.com/softfatgay/harmony-netease.git/blob/5f3d226b72ba8579cacfbd229e4eb0054d63abef/entry/src/main/ets/base/Api.ets#L7-L7
ab601aa4f83a6a003d36228ac6b9d84043574d23
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/share/SharePage.ets
arkts
confirmCustomContent
确认自定义内容
confirmCustomContent() { this.shareContent = this.customContent; this.showCustomContentDialog = false; this.showSuccessToast('内容更新成功'); }
AST#method_declaration#Left confirmCustomContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . shareContent AST#member_expre...
confirmCustomContent() { this.shareContent = this.customContent; this.showCustomContentDialog = false; this.showSuccessToast('内容更新成功'); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/share/SharePage.ets#L169-L173
5711de87671a4a2d63b3412ecc2962594d3eb183
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_bookmarks.ets
arkts
A class holding a root folder, in which there stores bookmarks and folders. @param root_label The label of root folder.
constructor(root_label: string) { this.root = new bookmark(root_label, '', undefined, undefined, true); }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left root_label : 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_statem...
constructor(root_label: string) { this.root = new bookmark(root_label, '', undefined, undefined, true); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_bookmarks.ets#L19-L21
1d527aba8c0dce636ad44d1e5b39f53aaf65daa5
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/AppUtil.ets
arkts
onApplicationStateChange
注册对当前应用前后台变化的监听。使用callback异步回调。仅支持主线程调用。 @param callback 回调函数。可以对应用从后台切换到前台,以及前台切换到后台分别定义回调。
static onApplicationStateChange(callback: ApplicationStateChangeCallback) { AppUtil.getApplicationContext().on('applicationStateChange', callback); }
AST#method_declaration#Left static onApplicationStateChange AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left ApplicationStateChangeCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left...
static onApplicationStateChange(callback: ApplicationStateChangeCallback) { AppUtil.getApplicationContext().on('applicationStateChange', callback); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AppUtil.ets#L265-L267
ff7cef933d2945d6d5a0e974bc62890319a321d1
gitee