nwo
stringclasses
304 values
sha
stringclasses
304 values
path
stringlengths
9
214
language
stringclasses
1 value
identifier
stringlengths
0
49
docstring
stringlengths
1
34.2k
function
stringlengths
8
59.4k
ast_function
stringlengths
71
497k
obf_function
stringlengths
8
39.4k
url
stringlengths
102
324
function_sha
stringlengths
40
40
source
stringclasses
2 values
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/SimpleBackupManager.ets
arkts
importBackup
导入备份数据
async importBackup(jsonData: string): Promise<SimpleBackupResult> { try { const backupData: TaskExportData = JSON.parse(jsonData); // 验证数据格式 if (!backupData.tasks || !Array.isArray(backupData.tasks)) { return { success: false, message: 'Invalid backup data format', ...
AST#method_declaration#Left async importBackup AST#parameter_list#Left ( AST#parameter#Left jsonData : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#L...
async importBackup(jsonData: string): Promise<SimpleBackupResult> { try { const backupData: TaskExportData = JSON.parse(jsonData); if (!backupData.tasks || !Array.isArray(backupData.tasks)) { return { success: false, message: 'Invalid backup data format', ti...
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/SimpleBackupManager.ets#L104-L142
7392cd80f9b0a18bf9269ea65c222a353fdc35b9
github
Classaspen/ArkTS_PasswordManagement.git
66aea6e4f8ee3a78e5029c63186dba70707ca2d9
entry/src/main/ets/components/database/Database.ets
arkts
import { AccountData } from '../components/pswmanagement/PswViewModel'; 定义三表分类枚举
export enum TableCategory { IMPORTANT_FREQUENT = 'important_frequent', // 重要常用 IMPORTANT_INFREQUENT = 'important_infrequent', // 重要不常用 UNIMPORTANT = 'unimportant' // 不重要 }
AST#export_declaration#Left export AST#enum_declaration#Left enum TableCategory AST#enum_body#Left { AST#enum_member#Left IMPORTANT_FREQUENT = AST#expression#Left 'important_frequent' AST#expression#Right AST#enum_member#Right , // 重要常用 AST#enum_member#Left IMPORTANT_INFREQUENT = AST#expression#Left 'important_infreque...
export enum TableCategory { IMPORTANT_FREQUENT = 'important_frequent', IMPORTANT_INFREQUENT = 'important_infrequent', UNIMPORTANT = 'unimportant' }
https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/database/Database.ets#L11-L15
17706ae8c3cbaeda713bfc6cf1bafce12b7bf685
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/dialogs/managers/ManageListElement.ets
arkts
select_unselect
Toggles the state
select_unselect() { if (this.selected[this.index]) { this.selected_number -= 1; } else { this.selected_number += 1; } this.selected[this.index] = !this.selected[this.index]; }
AST#method_declaration#Left select_unselect 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#subscript_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expressio...
select_unselect() { if (this.selected[this.index]) { this.selected_number -= 1; } else { this.selected_number += 1; } this.selected[this.index] = !this.selected[this.index]; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/dialogs/managers/ManageListElement.ets#L65-L72
d08fd5d0dee24ed0acb6f003c9c059f376a4e02c
gitee
xixi-cquer/BiJiDaiBan.git
206dc33a837acbe6fc837feff848427e83946534
entry/src/main/ets/common/constants/CommonConstant.ets
arkts
Style constants that can be used by all modules
export default class CommonConstants { /** * Full width or height. */ static readonly FULL_LENGTH: string = '100%'; /** * Title height. */ static readonly TITLE_WIDTH: string = '80%'; /** * List default width. */ static readonly LIST_DEFAULT_WIDTH: string = '93.3%'; /** * Opacity o...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Full width or height. */ AST#property_declaration#Left static readonly FULL_LENGTH : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#...
export default class CommonConstants { static readonly FULL_LENGTH: string = '100%'; static readonly TITLE_WIDTH: string = '80%'; static readonly LIST_DEFAULT_WIDTH: string = '93.3%'; static readonly OPACITY_DEFAULT: number = 1; static readonly OPACITY_COMPLETED: number = 0.4; static ...
https://github.com/xixi-cquer/BiJiDaiBan.git/blob/206dc33a837acbe6fc837feff848427e83946534/entry/src/main/ets/common/constants/CommonConstant.ets#L19-L70
d26e2321472f1d798990de538d0d81a344ba65a2
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/palette/src/main/ets/pages/PaletteMainPage.ets
arkts
this
手指移动,绘制移动轨迹
this.currentNode.path.lineTo(positionX, positionY);
AST#method_declaration#Left this AST#ERROR#Left . currentNode . path . l in eTo AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left positionX AST#parameter#Right , AST#parameter#Left positionY AST#parameter#Right ) AST#parameter_list#Right ; AST#method_declaration#Right
this.currentNode.path.lineTo(positionX, positionY);
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/palette/src/main/ets/pages/PaletteMainPage.ets#L107-L107
b2295d531799a69b03e4d55c5da54a3c2a1125d1
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/timer/SimperTimerCountDown.ets
arkts
isActive
检查是否活跃
isActive(): boolean { return this.active; }
AST#method_declaration#Left isActive 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#return_statement#Left return AST#expression#Left AST#member_expression#Lef...
isActive(): boolean { return this.active; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/timer/SimperTimerCountDown.ets#L118-L120
5ef1b41a8c107e1ec9c700b95ad1abe61d972cac
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CFileDownloader.ets
arkts
MARK: - 腾讯云文件下载器类
export class CFileDownloader implements CFileDownloadable { ///文件名 前辍 private filePrefix: string; constructor(filePrefix: string) { this.filePrefix = filePrefix; // 初始化COS服务 CosService.shared } // MARK: - COS文件元数据获取方法 private getCFileMetaDataFromCos(fname: string, finished: (metaInfo: CMet...
AST#export_declaration#Left export AST#class_declaration#Left class CFileDownloader AST#implements_clause#Left implements CFileDownloadable AST#implements_clause#Right AST#class_body#Left { ///文件名 前辍 AST#property_declaration#Left private filePrefix : AST#type_annotation#Left AST#primary_type#Left string AST#primary_typ...
export class CFileDownloader implements CFileDownloadable { private filePrefix: string; constructor(filePrefix: string) { this.filePrefix = filePrefix; CosService.shared } private getCFileMetaDataFromCos(fname: string, finished: (metaInfo: CMetaInfo | null, error: string | null) => void...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Download/CMetaInfo_CFile/CFileDownloader.ets#L21-L205
931a0e19e155ff3c4cc8f261e42fd23fc4d7e5dc
github
yongoe1024/RdbPlus.git
4a3fc04ba5903bc1c1b194efbc557017976909dc
rdbplus/src/main/ets/core/MyWrapper.ets
arkts
build
静态工厂方法,生成一个MyWrapper对象
static build(parent: Wrapper): MyWrapper { let x = parent as MyWrapper const myWrapper = new MyWrapper(); myWrapper.selectSql = x.selectSql myWrapper.groupSql = x.groupSql myWrapper.havingSql = x.havingSql myWrapper.orderList = x.orderList myWrapper.whereList = x.whereList myWrapper.valu...
AST#method_declaration#Left static build AST#parameter_list#Left ( AST#parameter#Left parent : AST#type_annotation#Left AST#primary_type#Left Wrapper AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left MyWrapper AST#primary_typ...
static build(parent: Wrapper): MyWrapper { let x = parent as MyWrapper const myWrapper = new MyWrapper(); myWrapper.selectSql = x.selectSql myWrapper.groupSql = x.groupSql myWrapper.havingSql = x.havingSql myWrapper.orderList = x.orderList myWrapper.whereList = x.whereList myWrapper.valu...
https://github.com/yongoe1024/RdbPlus.git/blob/4a3fc04ba5903bc1c1b194efbc557017976909dc/rdbplus/src/main/ets/core/MyWrapper.ets#L9-L21
b724616d4038b3ad90aae016cd04227f69e1d556
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/GoodsRepository.ets
arkts
getGoodsSpecList
查询商品规格列表 @param {GoodsIdRequest} params - 商品 ID 请求参数 @returns {Promise<NetworkResponse<GoodsSpec[]>>} 商品规格列表
async getGoodsSpecList(params: GoodsIdRequest): Promise<NetworkResponse<GoodsSpec[]>> { return this.networkDataSource.getGoodsSpecList(params); }
AST#method_declaration#Left async getGoodsSpecList AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left GoodsIdRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gene...
async getGoodsSpecList(params: GoodsIdRequest): Promise<NetworkResponse<GoodsSpec[]>> { return this.networkDataSource.getGoodsSpecList(params); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/GoodsRepository.ets#L47-L49
fac70105eb251336e66004fad486aff3f1ecd726
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/llm/LLMService.ets
arkts
clearConfig
清除配置
clearConfig(): void { this.config = null; this.status.configured = false; this.status.errorCount = 0; }
AST#method_declaration#Left clearConfig AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member...
clearConfig(): void { this.config = null; this.status.configured = false; this.status.errorCount = 0; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/llm/LLMService.ets#L301-L305
a5af7569bb9c4ec7dacf30b498ce5aa3c19dd0e0
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
setCanvasContext
Set canvas init. @param context
setCanvasContext(context: CanvasRenderingContext2D): void { Logger.info(TAG, 'setCanvasContext'); this.ctx = context; this.refresh(); }
AST#method_declaration#Left setCanvasContext AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left voi...
setCanvasContext(context: CanvasRenderingContext2D): void { Logger.info(TAG, 'setCanvasContext'); this.ctx = context; this.refresh(); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L99-L103
c079cf5425a5c3fa6e9b78250c582f5a9f1a2ea4
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/palette/src/main/ets/data/ColorsData.ets
arkts
常用色相数据(HEX格式)
export const HEX_HUES_DATA: string[] = [ '#E84026', '#ED6F21', '#F9A01E', '#F7CE00', '#A5D61D', '#64BB5C', '#61CFBE', '#46B1E3', '#564AF7', '#AC49F5', '#E64566', '#000000' ];
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HEX_HUES_DATA : 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#expression#Left AST#array_literal#Left [ AST#expre...
export const HEX_HUES_DATA: string[] = [ '#E84026', '#ED6F21', '#F9A01E', '#F7CE00', '#A5D61D', '#64BB5C', '#61CFBE', '#46B1E3', '#564AF7', '#AC49F5', '#E64566', '#000000' ];
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/palette/src/main/ets/data/ColorsData.ets#L19-L32
92b0dca444d44c4cc4cc7baf15784960b9135d9e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/social/CommunityService.ets
arkts
getMockComments
获取模拟评论数据
private getMockComments(postId: string, limit: number): Comment[] { const mockUser = this.currentUser || this.createDefaultUser(); const comments: Comment[] = []; for (let i = 0; i < Math.min(limit, 5); i++) { comments.push({ id: `comment_${i}`, postId, authorId: mockUser.id, ...
AST#method_declaration#Left private getMockComments AST#parameter_list#Left ( AST#parameter#Left postId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left limit : AST#type_annotation#Left AST#primary_type#Left number AST#prim...
private getMockComments(postId: string, limit: number): Comment[] { const mockUser = this.currentUser || this.createDefaultUser(); const comments: Comment[] = []; for (let i = 0; i < Math.min(limit, 5); i++) { comments.push({ id: `comment_${i}`, postId, authorId: mockUser.id, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L748-L768
979ed90456baa2e58e98895f33239da31566e9f9
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/NotificationTypes.ets
arkts
通知项接口
export interface NotificationItem { id: string; type: NotificationType; title: string; content: string; priority: NotificationPriority; status: NotificationStatus; timestamp: string; expiresAt?: string; actionUrl?: string; relatedContactId?: string; metadata?: Record<string, string>; icon?: stri...
AST#export_declaration#Left export AST#interface_declaration#Left interface NotificationItem AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left type : AST#type_annotation#Lef...
export interface NotificationItem { id: string; type: NotificationType; title: string; content: string; priority: NotificationPriority; status: NotificationStatus; timestamp: string; expiresAt?: string; actionUrl?: string; relatedContactId?: string; metadata?: Record<string, string>; icon?: stri...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/NotificationTypes.ets#L47-L62
87ed9b104890ac4e9332f75c094ac18cdb36acc0
github
azhuge233/Wake-HarmonyOS.git
68c4e961f9cf5fab8699af99313dd5854ea313a1
entry/src/main/ets/model/DeviceList.ets
arkts
updateDevice
更新成功返回更新 entry 对应的所有 formID 只有更新失败返回布尔值
async updateDevice(device: Device): Promise<boolean | string[]> { try { const result = await this.db.updateDeviceByID(device); Logger.debug(this.LOG_TAG, `设备更新成功, ${result}`); const updatedFormIDs = await this.updateAllFormBelongsToDevice(device); return updated...
AST#method_declaration#Left async updateDevice AST#parameter_list#Left ( AST#parameter#Left device : AST#type_annotation#Left AST#primary_type#Left Device 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 updateDevice(device: Device): Promise<boolean | string[]> { try { const result = await this.db.updateDeviceByID(device); Logger.debug(this.LOG_TAG, `设备更新成功, ${result}`); const updatedFormIDs = await this.updateAllFormBelongsToDevice(device); return updated...
https://github.com/azhuge233/Wake-HarmonyOS.git/blob/68c4e961f9cf5fab8699af99313dd5854ea313a1/entry/src/main/ets/model/DeviceList.ets#L49-L61
09eafe8f424dc5e9bc7796c07e9585230d4253fc
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/KeyboardUtil.ets
arkts
removeKeyboardListener
取消订阅输入法软键盘显示或隐藏事件 @param callBack 监听事件,不传关闭所有事件。
static removeKeyboardListener(callback?: KeyboardCallBack): void { if (callback && KeyboardUtil.callBacks.length > 1) { ArrayUtil.remove(KeyboardUtil.callBacks, callback); } else { if (KeyboardUtil.keyboardCallBack) { AppUtil.getMainWindow().off('keyboardHeightChange', KeyboardUtil.keyboardC...
AST#method_declaration#Left static removeKeyboardListener AST#parameter_list#Left ( AST#parameter#Left callback ? : AST#type_annotation#Left AST#primary_type#Left KeyboardCallBack AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#...
static removeKeyboardListener(callback?: KeyboardCallBack): void { if (callback && KeyboardUtil.callBacks.length > 1) { ArrayUtil.remove(KeyboardUtil.callBacks, callback); } else { if (KeyboardUtil.keyboardCallBack) { AppUtil.getMainWindow().off('keyboardHeightChange', KeyboardUtil.keyboardC...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/KeyboardUtil.ets#L75-L87
959a727232960137f383d1b1121fd80dd4e2ef42
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/viewmodel/ContributorsViewModel.ets
arkts
@file 贡献者页面 ViewModel @author Joker.X
@ObservedV2 export default class ContributorsViewModel extends BaseViewModel { }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class ContributorsViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Rig...
@ObservedV2 export default class ContributorsViewModel extends BaseViewModel { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/viewmodel/ContributorsViewModel.ets#L7-L9
71d37575b2c3b96fdbb07413691dbb385da13daa
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/AddressListViewModel.ets
arkts
onAddAddress
点击新增地址 @returns {void} 无返回值
onAddAddress(): void { UserNavigator.toAddressDetail().then((result?: RefreshResult): void => { if (result?.refresh) { this.onRefresh(); } }); }
AST#method_declaration#Left onAddAddress AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#...
onAddAddress(): void { UserNavigator.toAddressDetail().then((result?: RefreshResult): void => { if (result?.refresh) { this.onRefresh(); } }); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressListViewModel.ets#L75-L81
bc087c149d2f4ddd8b297bc5a4ee59b811b35e6e
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/BarChartModel.ets
arkts
getHighlightByTouchPoint
Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the BarChart. @param x @param y @return @Override
public getHighlightByTouchPoint(x: number, y: number): Highlight | null { if (this.mData == null) { LogUtil.error(ChartModel.LOG_TAG, "Can't select by touch. No data set."); return null; } else { let highLighter: IHighlighter | null = this.getHighlighter(); if (highLighter) { le...
AST#method_declaration#Left public getHighlightByTouchPoint AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#prima...
public getHighlightByTouchPoint(x: number, y: number): Highlight | null { if (this.mData == null) { LogUtil.error(ChartModel.LOG_TAG, "Can't select by touch. No data set."); return null; } else { let highLighter: IHighlighter | null = this.getHighlighter(); if (highLighter) { le...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/BarChartModel.ets#L123-L143
436f9948c38d9223591d6adce4078f4a0a4d77e8
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LogUtil.ets
arkts
setShowLog
是否打印日志(该方法建议在Ability里调用) @param showLog
static setShowLog(showLog: boolean = true) { LogUtil.showLog = showLog }
AST#method_declaration#Left static setShowLog AST#parameter_list#Left ( AST#parameter#Left showLog : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Right AST#parameter#Ri...
static setShowLog(showLog: boolean = true) { LogUtil.showLog = showLog }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LogUtil.ets#L69-L71
487570b37271d4325ab1f2914d369003fcba5768
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pipwindow/src/main/ets/components/XComponentView.ets
arkts
XComponentView
视频播放组件 功能描述: 1.构建视频播放器 2.通过绑定相同控制器来控制视频播放页面和悬浮窗的同步 3.XComponent和AVPlayer通过surfaceId绑定 实现原理: 1.通过绑定PipManager.getInstance().getXComponentController()控制器,保持视频和悬浮穿视频同步 2.在onLoad(插件加载完成时回调事件)中绑定视频PipManager.getInstance().getXComponentController().getXComponentSurfaceId(),保证XComponent和AVPlayer绑定 3.在onLoad(插件加载完成时回调事件)中进行视...
@Component export struct XComponentView { @Link url: string; // 在线视频路径 build() { Column() { XComponent({ type: XComponentType.SURFACE, controller: PipManager.getInstance().getXComponentController() }) .onLoad(() => { // 将surfaceId设置给媒体源 PipManager.getInst...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct XComponentView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotati...
@Component export struct XComponentView { @Link url: string; build() { Column() { XComponent({ type: XComponentType.SURFACE, controller: PipManager.getInstance().getXComponentController() }) .onLoad(() => { PipManager.getInstance() .getXComp...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pipwindow/src/main/ets/components/XComponentView.ets#L32-L53
c1b0602b9ab43ce3805b97aa32302c644cfba4f6
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/todo/TodoService.ets
arkts
recordOperation
记录操作
private recordOperation( type: 'create' | 'update' | 'delete' | 'complete' | 'cancel', todoId: string, changes?: ChangeRecord, description?: string ): void { try { const record: TodoOperationRecord = { id: this.generateId(), type, todoId, changes, time...
AST#method_declaration#Left private recordOperation AST#parameter_list#Left ( AST#parameter#Left type AST#parameter#Right AST#ERROR#Left : 'create' | 'update' | 'delete' | 'complete' | 'cancel' AST#ERROR#Right , AST#parameter#Left todoId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST...
private recordOperation( type: 'create' | 'update' | 'delete' | 'complete' | 'cancel', todoId: string, changes?: ChangeRecord, description?: string ): void { try { const record: TodoOperationRecord = { id: this.generateId(), type, todoId, changes, time...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/todo/TodoService.ets#L95-L122
0f1cb35e11a1dd56aa626a84c3f85f6325b1fd65
github
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets
arkts
getAudioRenderer
获取音频渲染器(播放器)
async getAudioRenderer() { if (this.audioRenderer) { return this.audioRenderer } this.audioRenderer = await audio.createAudioRenderer({ streamInfo: this.audioStreamInfo, rendererInfo: this.audioRendererInfo }) return this.audioRenderer }
AST#method_declaration#Left async getAudioRenderer AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . audioRenderer AST#member_expression#Right AST#ex...
async getAudioRenderer() { if (this.audioRenderer) { return this.audioRenderer } this.audioRenderer = await audio.createAudioRenderer({ streamInfo: this.audioStreamInfo, rendererInfo: this.audioRendererInfo }) return this.audioRenderer }
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets#L134-L143
aa5ffa726610e5e1606fa388fe84833112d195ff
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videolinkagelist/src/main/ets/model/NewsItemModel.ets
arkts
NewsItem type. @param newsName @param newsVideoSrc
export class NewsItem { newsName: string; // 新闻标题 newsVideoSrc: Resource | string; // 新闻视频地址 constructor(newsName: string, newsVideoSrc: Resource | string) { this.newsName = newsName; this.newsVideoSrc = newsVideoSrc; } }
AST#export_declaration#Left export AST#class_declaration#Left class NewsItem AST#class_body#Left { AST#property_declaration#Left newsName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 新闻标题 AST#property_declaration#Left newsVi...
export class NewsItem { newsName: string; newsVideoSrc: Resource | string; constructor(newsName: string, newsVideoSrc: Resource | string) { this.newsName = newsName; this.newsVideoSrc = newsVideoSrc; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videolinkagelist/src/main/ets/model/NewsItemModel.ets#L22-L30
a5ef02dd451d23554baf3b73ab415ca302902859
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/settings/SettingsService.ets
arkts
updateThemeSettings
更新主题设置 @param themeSettings 主题设置 @returns 更新后的主题设置
async updateThemeSettings(themeSettings: Partial<ThemeSettings>): Promise<ThemeSettings> { const updatedSettings = await this.updateSettings({ theme: themeSettings }); return updatedSettings.theme; }
AST#method_declaration#Left async updateThemeSettings AST#parameter_list#Left ( AST#parameter#Left themeSettings : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ThemeSettings AST#primary_type#Right AST#type_annotatio...
async updateThemeSettings(themeSettings: Partial<ThemeSettings>): Promise<ThemeSettings> { const updatedSettings = await this.updateSettings({ theme: themeSettings }); return updatedSettings.theme; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/settings/SettingsService.ets#L182-L185
a9945585186031fe23d64b1c016ef364acf03c1d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/selecttextmenu/src/main/ets/model/SelectMenuOption.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export type CreateMenuCallback = (menuItems: Array<TextMenuItem>)=> Array<TextMenuItem>;
AST#export_declaration#Left export AST#type_declaration#Left type CreateMenuCallback = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left menuItems : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AS...
export type CreateMenuCallback = (menuItems: Array<TextMenuItem>)=> Array<TextMenuItem>;
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/selecttextmenu/src/main/ets/model/SelectMenuOption.ets#L16-L16
8efc5d84256c6c21cc0ea6e7f4be2287bf14d785
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/model/Model.ets
arkts
@class ConfigInitializer
export class InitConfig { isShowLog: boolean = true }
AST#export_declaration#Left export AST#class_declaration#Left class InitConfig AST#class_body#Left { AST#property_declaration#Left isShowLog : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#R...
export class InitConfig { isShowLog: boolean = true }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/model/Model.ets#L174-L176
dd458094eeb1f12b96de06008d9ed90e73041b0b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/data/ContactService_backup.ets
arkts
createContact
创建联系人 @param params 创建参数 @returns 创建的联系人
async createContact(params: CreateContactParams): Promise<Contact> { try { // 验证数据 const validationResult = ContactModel.validate(params); if (!validationResult.isValid) { throw new Error(`数据验证失败: ${validationResult.errors.join(', ')}`); } // 检查联系人数量限制 const totalCount =...
AST#method_declaration#Left async createContact AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left CreateContactParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#ge...
async createContact(params: CreateContactParams): Promise<Contact> { try { const validationResult = ContactModel.validate(params); if (!validationResult.isValid) { throw new Error(`数据验证失败: ${validationResult.errors.join(', ')}`); } const totalCount = await this.databas...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/data/ContactService_backup.ets#L113-L151
a257c4ee08fe66a46b2205c93d4bf9eeb4745da5
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/search/SearchArgs.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2025/6/16 22:47 @Version V1.0 @Description
export interface SearchArgs { word: string }
AST#export_declaration#Left export AST#interface_declaration#Left interface SearchArgs AST#object_type#Left { AST#type_member#Left word : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right } AST#object_type#Right AST#interface_declaration#Right A...
export interface SearchArgs { word: string }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/search/SearchArgs.ets#L8-L12
3139ec29292ffbc616e8b9dd79a774d908556e83
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/CandleDataSet.ets
arkts
setShadowColorSameAsCandle
Sets shadow color to be the same color as the candle color @param shadowColorSameAsCandle
public setShadowColorSameAsCandle(shadowColorSameAsCandle: boolean): void { this.mShadowColorSameAsCandle = shadowColorSameAsCandle; }
AST#method_declaration#Left public setShadowColorSameAsCandle AST#parameter_list#Left ( AST#parameter#Left shadowColorSameAsCandle : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#prima...
public setShadowColorSameAsCandle(shadowColorSameAsCandle: boolean): void { this.mShadowColorSameAsCandle = shadowColorSameAsCandle; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/CandleDataSet.ets#L282-L284
14b1ab0853080d8565ac94a77b52fe7c36913d40
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/return_value_passing/return_value_passing_001_T.ets
arkts
Introduction 返回值传递
export function return_value_passing_001_T(taint_src : string) { let t = f(taint_src); taint.Sink(t); }
AST#export_declaration#Left export AST#function_declaration#Left function return_value_passing_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_st...
export function return_value_passing_001_T(taint_src : string) { let t = f(taint_src); taint.Sink(t); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/return_value_passing/return_value_passing_001_T.ets#L6-L9
061c6f0902a520d0a817b7cc410971205899f709
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_commonEvents/ace_ets_module_commonEvents_api17/entry/src/main/ets/MainAbility/common/Rect.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export 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_commonEvents/ace_ets_module_commonEvents_api17/entry/src/main/ets/MainAbility/common/Rect.ets#L16-L21
c4ce22c561fb959b9b0c55b701cf06277603428b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/widget/pages/WidgetCalendar.ets
arkts
getDayBackgroundColor
获取日期背景颜色
private getDayBackgroundColor(day: number): string { if (day === 0) { return 'transparent'; } if (day === this.today) { return '#FF4444'; // 今天 } // 这里可以根据实际生日数据来判断 // 模拟一些生日日期 const birthdayDays = [3, 15, 22, 28]; if (birthdayDays.includes(day)) { return '#FEE2E2'; /...
AST#method_declaration#Left private getDayBackgroundColor AST#parameter_list#Left ( AST#parameter#Left day : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#p...
private getDayBackgroundColor(day: number): string { if (day === 0) { return 'transparent'; } if (day === this.today) { return '#FF4444'; } const birthdayDays = [3, 15, 22, 28]; if (birthdayDays.includes(day)) { return '#FEE2E2'; } return 'transparent'; ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widget/pages/WidgetCalendar.ets#L162-L179
68a85ec4887b89acb14b69b3aa09ff63e80b1e05
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/shareimagepage/src/main/ets/components/ListDataSource.ets
arkts
getData
获取索引对应的数据 @param index 数组索引 @returns
public getData(index: number): textDetailData { return this.dataArray[index]; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left textDetailData AST#primar...
public getData(index: number): textDetailData { return this.dataArray[index]; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/shareimagepage/src/main/ets/components/ListDataSource.ets#L36-L38
d53f9c698d48966ebaaba934d78553ab32ebaae6
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/GameificationService.ets
arkts
庆祝风格枚举
export enum CelebrationStyle { MINIMAL = 'minimal', STANDARD = 'standard', FESTIVE = 'festive' }
AST#export_declaration#Left export AST#enum_declaration#Left enum CelebrationStyle AST#enum_body#Left { AST#enum_member#Left MINIMAL = AST#expression#Left 'minimal' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left STANDARD = AST#expression#Left 'standard' AST#expression#Right AST#enum_member#Right , AS...
export enum CelebrationStyle { MINIMAL = 'minimal', STANDARD = 'standard', FESTIVE = 'festive' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L228-L232
27cc17dc7fa02be82d2bb076ccf2b38b8968ede7
github
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/pages/SettingsPage.ets
arkts
requestNotificationPermission
申请通知权限
async requestNotificationPermission(): Promise<void> { try { // 检查通知是否已启用 const isEnabled = await notificationManager.isNotificationEnabled(); if (isEnabled) { // 已有权限,直接启用 console.info('[SettingsPage] Notification permission already granted'); this.settings.enable...
AST#method_declaration#Left async requestNotificationPermission 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#Rig...
async requestNotificationPermission(): Promise<void> { try { const isEnabled = await notificationManager.isNotificationEnabled(); if (isEnabled) { console.info('[SettingsPage] Notification permission already granted'); this.settings.enableNotifications = true; ...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/SettingsPage.ets#L229-L272
a5a912d46d15b6e0b4327ec1aaaff7b031eaa977
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/view/InterceptorPage.ets
arkts
AppCate2
更多服务的组件
@Builder AppCate2() { Column() { Text(this.cateName) .fontSize(16) .width('100%') .fontWeight(FontWeight.Bold) .margin({ left: 5 }) GridRow({ columns: { sm: 8, md: 8, lg: 8 } }) { /* 性能知识点:当数据量较大时,推荐使用懒加载加载数据。 * 参考使用数据懒加载文章: * https://gitee.com...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right AppCate2 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_element...
@Builder AppCate2() { Column() { Text(this.cateName) .fontSize(16) .width('100%') .fontWeight(FontWeight.Bold) .margin({ left: 5 }) GridRow({ columns: { sm: 8, md: 8, lg: 8 } }) { ForEach(IconList2, (item: IconListType, index) => { GridCol({ s...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/view/InterceptorPage.ets#L72-L110
a45811f8ea7bd021db899f7705c6e187aa167907
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/ComponentPerson.ets
arkts
ComponentPerson
头像和名称
@Component export default struct ComponentPerson { @Link mPerson: Caller; build() { Column() { Button() { Text(this.mPerson.head) .fontSize(60) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.color_fff')) } .type(ButtonType.Circle) .enabled(...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct ComponentPerson AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right mPerson : AST#type_annotation#Left AST#primary_type#Left Caller AST#primary_type#Right AST#...
@Component export default struct ComponentPerson { @Link mPerson: Caller; build() { Column() { Button() { Text(this.mPerson.head) .fontSize(60) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.color_fff')) } .type(ButtonType.Circle) .enabled(...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/ComponentPerson.ets#L21-L47
c9ca28de4a9c6273adf435c6c83d53595ee620b3
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/feedback/src/main/ets/viewmodel/FeedbackSubmitViewModel.ets
arkts
@file 提交反馈页面 ViewModel @author Joker.X
@ObservedV2 export default class FeedbackSubmitViewModel extends BaseViewModel { }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class FeedbackSubmitViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#R...
@ObservedV2 export default class FeedbackSubmitViewModel extends BaseViewModel { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/feedback/src/main/ets/viewmodel/FeedbackSubmitViewModel.ets#L7-L9
45929c496c4b7dd94dec4acbb72725c0b23739a8
github
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/viewmodel/SettingData.ets
arkts
设置列表Item类型枚举
export enum SetItemType { TitleText, SwitchItem, ArrowItem, ProcessItem }
AST#export_declaration#Left export AST#enum_declaration#Left enum SetItemType AST#enum_body#Left { AST#enum_member#Left TitleText AST#enum_member#Right , AST#enum_member#Left SwitchItem AST#enum_member#Right , AST#enum_member#Left ArrowItem AST#enum_member#Right , AST#enum_member#Left ProcessItem AST#enum_member#Right ...
export enum SetItemType { TitleText, SwitchItem, ArrowItem, ProcessItem }
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/SettingData.ets#L40-L40
1e98d64e53c0e45ef36c2f0bc6f9eecd30001a95
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ArrayUtil.ets
arkts
distinct
将数组去重,去重后生成新的数组,原数组不变。 @param array 数组 @return 去重后的数组
static distinct<T>(array: Array<T>): T[] { return Array.from(new Set(array)); }
AST#method_declaration#Left static distinct AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotat...
static distinct<T>(array: Array<T>): T[] { return Array.from(new Set(array)); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ArrayUtil.ets#L72-L74
f0e433a3a33f00c33712f15b06194cd8e01361ba
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/TwoWayTlsWorker.ets
arkts
loadFile
[Start two-way_authentication_via_tls_socket] 读取文件并返回内容
function loadFile(fileUri: string) { try { let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY); let buf = new ArrayBuffer(1024 * 4); let readLen = fs.readSync(file.fd, buf, { offset: 0 }); let content = buf2String(buf.slice(0, readLen)); fs.closeSync(file); // 根据文件类型返回不同的内容 let respons...
AST#function_declaration#Left function loadFile AST#parameter_list#Left ( AST#parameter#Left fileUri : 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#try_statement#Lef...
function loadFile(fileUri: string) { try { let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY); let buf = new ArrayBuffer(1024 * 4); let readLen = fs.readSync(file.fd, buf, { offset: 0 }); let content = buf2String(buf.slice(0, readLen)); fs.closeSync(file); let response: TlsTwoWayMess...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/TwoWayTlsWorker.ets#L84-L106
ca1a53260622221a5072543429627db0598c8633
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pageflip/Index.ets
arkts
PageFlipComponent
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 { PageFlipComponent } from './src/main/ets/components/mainpage/PageFlip';
AST#export_declaration#Left export { PageFlipComponent } from './src/main/ets/components/mainpage/PageFlip' ; AST#export_declaration#Right
export { PageFlipComponent } from './src/main/ets/components/mainpage/PageFlip';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pageflip/Index.ets#L16-L16
94b7662fa22fa0f484b3402441929a1f35a71505
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ArcButton.d.ets
arkts
The class for ArcButtonOptions. @syscap SystemCapability.ArkUI.ArkUI.Circle @crossplatform @atomicservice @since 18
export declare class ArcButtonOptions { /** * Describes the position of button on screen. * * @type { ArcButtonPosition } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ position: ArcButtonPosition; /** * Describes t...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class ArcButtonOptions AST#class_body#Left { /** * Describes the position of button on screen. * * @type { ArcButtonPosition } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform ...
export declare class ArcButtonOptions { position: ArcButtonPosition; styleMode: ArcButtonStyleMode; status: ArcButtonStatus; label: ResourceStr; backgroundBlurStyle: BlurStyle; backgroundColor: ColorMetrics; shadowColor: ColorMetrics; shadowEnabled...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ArcButton.d.ets#L331-L505
a82733bcb1168b5981fe7a69a0c7323fd8eaf93b
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/constants/CommonConstants.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class CommonConstants { static readonly FULL_SIZE: string = '100%'; static readonly HALF_SIZE: string = '50%'; // list上部的标题高度 static readonly LIST_HEADER_HEIGHT: number = 60; // 页面状态栏标题高度 static readonly PAGE_HEADER_HEIGHT: number = 62; // 抽屉视图最小高度 static readonly BOTTOM_DRAWER_MIN_HEIGHT: number...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { AST#property_declaration#Left static readonly FULL_SIZE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '100%' AST#expression#Right ; A...
export class CommonConstants { static readonly FULL_SIZE: string = '100%'; static readonly HALF_SIZE: string = '50%'; static readonly LIST_HEADER_HEIGHT: number = 60; static readonly PAGE_HEADER_HEIGHT: number = 62; static readonly BOTTOM_DRAWER_MIN_HEIGHT: number = 195 static readonly BOTTOM_DR...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/constants/CommonConstants.ets#L16-L27
83bf02fbdc3fe5f2070331316f411284437b17ce
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Column.ets
arkts
渲染布局 @returns {void} 无返回值 @example ColumnSpaceAroundEnd() { Text("A"); Text("B"); Text("C"); }
build(): void { ColumnBase({ options: this.options, justifyContent: FlexAlign.SpaceAround, alignItems: HorizontalAlign.End, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.margin...
AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expressio...
build(): void { ColumnBase({ options: this.options, justifyContent: FlexAlign.SpaceAround, alignItems: HorizontalAlign.End, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.margin...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Column.ets#L1244-L1259
9a11ecedd0b40692e0669a13f584bdcb94fb8449
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/TipsUtil.ets
arkts
TipsUtil
@Author csx @DateTime 2024/3/27 19:55 @TODO TipsUtil 提示弹出框工具类 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_ui
@Component export struct TipsUtil { @Prop @Watch("change") options: TipsOptions = new TipsOptions(); private isChecked: boolean = true; /** * 自定义Tips */ private dialogControllerProgress: CustomDialogController = new CustomDialogController({ builder: TipsDialog({ title: this.options.title, ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TipsUtil AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right AST#decorator#Left @ Watch ( AST#expression#Left "change" AST#expression#Right ) AST#decorator#Right optio...
@Component export struct TipsUtil { @Prop @Watch("change") options: TipsOptions = new TipsOptions(); private isChecked: boolean = true; private dialogControllerProgress: CustomDialogController = new CustomDialogController({ builder: TipsDialog({ title: this.options.title, content: this.options....
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/TipsUtil.ets#L27-L91
2afcf1ccaf32b9bc43b199460298cd52f3e07bb9
gitee
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/pages/StopwatchPage.ets
arkts
onStateChange
监听计时器状态变化
onStateChange() { switch (this.state) { case 0: this.textTimerController.reset(); this.startOrPauseImage = $r('app.media.ic_play'); break; case 1: this.textTimerController.start();
AST#method_declaration#Left onStateChange AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#expression_statement#Left AST#expression#Left switch AST#expression#Right AST#ERROR#Left ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . state AST#member_e...
onStateChange() { switch (this.state) { case 0: this.textTimerController.reset(); this.startOrPauseImage = $r('app.media.ic_play'); break; case 1: this.textTimerController.start();
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/pages/StopwatchPage.ets#L34-L41
ba6715b87b9dc25a9a4d58e04b39119deeb1d6c9
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/request/FeedbackSubmitRequest.ets
arkts
@param {FeedbackSubmitRequest} init - 初始化数据
constructor(init: FeedbackSubmitRequest) { this.type = init.type; this.content = init.content; if (init.contact !== undefined) { this.contact = init.contact; } if (init.images !== undefined) { this.images = init.images; } }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init : AST#type_annotation#Left AST#primary_type#Left FeedbackSubmitRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expressi...
constructor(init: FeedbackSubmitRequest) { this.type = init.type; this.content = init.content; if (init.contact !== undefined) { this.contact = init.contact; } if (init.images !== undefined) { this.images = init.images; } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/request/FeedbackSubmitRequest.ets#L26-L35
1e309bcd4eb16ac597139f894d0e12a2f7a877fb
github
iichen-bycode/ArkTsWanandroid.git
ad128756a6c703d9a72cf7f6da128c27fc63bd00
entry/src/main/ets/http/http.ets
arkts
暴露
export default axiosClient;
AST#export_declaration#Left export default AST#expression#Left axiosClient AST#expression#Right ; AST#export_declaration#Right
export default axiosClient;
https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/http.ets#L116-L116
d87fed3f224ad42035aade8f2d661b6223620f6f
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/palette/src/main/ets/data/ColorsData.ets
arkts
渐变基本色相数据(HSL格式)
export const HSL_HUES_DATA: HslType[] = [ { hue: 359, saturation: 71, lightness: 37 }, { hue: 27, saturation: 99, lightness: 32 }, { hue: 36, saturation: 100, lightness: 32 }, { hue: 45, saturation: 100, lightness: 32 }, { hue: 81, saturation: 100, lightness: 27 }, { hue: 119, saturation: 49, lightness: 34 ...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HSL_HUES_DATA : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left HslType [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expr...
export const HSL_HUES_DATA: HslType[] = [ { hue: 359, saturation: 71, lightness: 37 }, { hue: 27, saturation: 99, lightness: 32 }, { hue: 36, saturation: 100, lightness: 32 }, { hue: 45, saturation: 100, lightness: 32 }, { hue: 81, saturation: 100, lightness: 27 }, { hue: 119, saturation: 49, lightness: 34 ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/palette/src/main/ets/data/ColorsData.ets#L35-L49
10e3d4b0ab7204173610a0d7e0698e7adeffd8a3
gitee
SageMik/sqlite3.arkts.git
b3cc750a86bdd7a93456156f90eafd7c821afb59
sqlite3_native_library/BuildProfile.ets
arkts
Use these variables when you tailor your ArkTS code. They must be of the const type.
export const HAR_VERSION = '3.46.0+1';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '3.46.0+1' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const HAR_VERSION = '3.46.0+1';
https://github.com/SageMik/sqlite3.arkts.git/blob/b3cc750a86bdd7a93456156f90eafd7c821afb59/sqlite3_native_library/BuildProfile.ets#L4-L4
8c733a0732f3b528db8d7b942282bbd3702c5fc4
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/PieDataSet.ets
arkts
setUsingSliceColorAsValueLineColor
This method is deprecated. Use setUseValueColorForLine(...) instead. @param enabled @Deprecated
public setUsingSliceColorAsValueLineColor(enabled: boolean): void { this.setUseValueColorForLine(enabled); }
AST#method_declaration#Left public setUsingSliceColorAsValueLineColor AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#...
public setUsingSliceColorAsValueLineColor(enabled: boolean): void { this.setUseValueColorForLine(enabled); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieDataSet.ets#L176-L178
b920e879cce0666ef6040dde229486e4da37249d
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
getDataEasy
读取系统剪贴板里的内容(纯文本内容、HTML内容、URI内容、Want内容、PixelMap内容)。 @returns
static getDataEasy(): string | Want | image.PixelMap | undefined { if (PasteboardUtil.hasDataSync()) { let pasteData = PasteboardUtil.getDataSync(); let mimeType = pasteData.getPrimaryMimeType(); if (mimeType === pasteboard.MIMETYPE_TEXT_PLAIN) { return pasteData.getPrimaryText(); } ...
AST#method_declaration#Left static getDataEasy AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Want AST#primary_type#Right | AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#...
static getDataEasy(): string | Want | image.PixelMap | undefined { if (PasteboardUtil.hasDataSync()) { let pasteData = PasteboardUtil.getDataSync(); let mimeType = pasteData.getPrimaryMimeType(); if (mimeType === pasteboard.MIMETYPE_TEXT_PLAIN) { return pasteData.getPrimaryText(); } ...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L333-L350
96ccabfa7ae526b60c8d64bcd5145beb6aa8c7ed
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
OptimizationAppMemoryUsage/entry/src/main/ets/utils/LRUCacheUtil.ets
arkts
getCapacity
Get the capacity of lruCache
public getCapacity(): number { return this.lruCache.getCapacity(); }
AST#method_declaration#Left public getCapacity 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#call_express...
public getCapacity(): number { return this.lruCache.getCapacity(); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/OptimizationAppMemoryUsage/entry/src/main/ets/utils/LRUCacheUtil.ets#L26-L28
dc679e22ee41e4f0b6a28ba7e5270deec30edd09
gitee
seasonZhu/HarmonyStudy.git
b55e58c962e9b39d5211337590bdd45f2c2349b3
librarySDK/src/main/ets/components/RouteConstant.ets
arkts
/ 这个是必须要的,否则根本无法从App跳转到SDK export abstract class RouteConstant { static readonly mainPage = "librarySDK_MainPage" static readonly secondPage = "librarySDK_SecondPage" }
export enum RouteConstant { mainPage = "librarySDK_MainPage", secondPage = "librarySDK_SecondPage" }
AST#export_declaration#Left export AST#enum_declaration#Left enum RouteConstant AST#enum_body#Left { AST#enum_member#Left mainPage = AST#expression#Left "librarySDK_MainPage" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left secondPage = AST#expression#Left "librarySDK_SecondPage" AST#expression#Right A...
export enum RouteConstant { mainPage = "librarySDK_MainPage", secondPage = "librarySDK_SecondPage" }
https://github.com/seasonZhu/HarmonyStudy.git/blob/b55e58c962e9b39d5211337590bdd45f2c2349b3/librarySDK/src/main/ets/components/RouteConstant.ets#L7-L10
2e189551e986ab46dc530577791663d7e161c607
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/core/storage/StorageManager.ets
arkts
setBoolean
设置布尔值
static async setBoolean(key: string, value: boolean): Promise<void> { const instance = StorageManager.getInstance(); if (!instance.dataPreferences) { await instance.init(); } try { await instance.dataPreferences?.put(key, value); await instance.dataPreferences?.flush(); } catch (e)...
AST#method_declaration#Left static async setBoolean AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left boolean AST#primar...
static async setBoolean(key: string, value: boolean): Promise<void> { const instance = StorageManager.getInstance(); if (!instance.dataPreferences) { await instance.init(); } try { await instance.dataPreferences?.put(key, value); await instance.dataPreferences?.flush(); } catch (e)...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/storage/StorageManager.ets#L144-L155
44a50416631648725db9f4ade3be831a1a6da710
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/auth/src/main/ets/component/VerificationCodeField.ets
arkts
VerificationCodeField
@file 验证码输入组件 @author Joker.X
@ComponentV2 export struct VerificationCodeField { /** * 验证码 */ @Param verificationCode: string = ""; /** * 占位提示 */ @Param placeholder: ResourceStr = $r("app.string.verification_code"); /** * 手机号是否有效 */ @Param isPhoneValid: boolean = true; /** * 验证码变更回调 */ @Param onVerifi...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct VerificationCodeField AST#component_body#Left { /** * 验证码 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right verificationCode : AST#type_annotation#Left AST#primary_type#Left strin...
@ComponentV2 export struct VerificationCodeField { @Param verificationCode: string = ""; @Param placeholder: ResourceStr = $r("app.string.verification_code"); @Param isPhoneValid: boolean = true; @Param onVerificationCodeChange: (value: string) => void = () => { }; @Param onSendVeri...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/auth/src/main/ets/component/VerificationCodeField.ets#L9-L108
8bbaed64bb925c3730c2193899855e3b73548a92
github
wovp/weather.git
3ca685d43036b9ce79257dac3e237c9935709501
entry/src/main/ets/pages/newsDetail.ets
arkts
this
获取传递过来的参数对象
this.webviewController.loadUrl(params.toString());
AST#method_declaration#Left this AST#ERROR#Left . webviewController . loadUrl ( params . toStr in g AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left ) AST#ERROR#Right ; AST#method_declaration#Right
this.webviewController.loadUrl(params.toString());
https://github.com/wovp/weather.git/blob/3ca685d43036b9ce79257dac3e237c9935709501/entry/src/main/ets/pages/newsDetail.ets#L10-L10
9f62c2164292dd30c7bc9b06a997be2da8c26181
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/sync/CloudSyncService.ets
arkts
initializeService
初始化服务
private async initializeService(): Promise<void> { try { // 加载已保存的用户信息 await this.loadUserProfile(); // 加载同步状态 await this.loadSyncState(); // 加载自动同步配置 await this.loadAutoSyncConfig(); // 初始化云存储 await this.initializeCloudStorage(); hil...
AST#method_declaration#Left private async initializeService 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 >...
private async initializeService(): Promise<void> { try { await this.loadUserProfile(); await this.loadSyncState(); await this.loadAutoSyncConfig(); await this.initializeCloudStorage(); hilog.info(LogConstants.DOMAIN_APP, LogConsta...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/CloudSyncService.ets#L54-L72
8e2365bf499b317062a7fde4f0759b7461fbc8d3
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/common/database/tables/TaskInfoApi.ets
arkts
insertData
insert taskInfo @param taskInfo @param callback
insertData(taskInfo: TaskInfo, callback: Function): void { const valueBucket = generateBucket(taskInfo); RdbUtils.insert('taskInfo', valueBucket).then(result => { callback(result); }); Logger.info('TaskInfoTable', `Insert taskInfo {${taskInfo.date}:${taskInfo.taskID}} finished.`); }
AST#method_declaration#Left insertData AST#parameter_list#Left ( AST#parameter#Left taskInfo : AST#type_annotation#Left AST#primary_type#Left TaskInfo 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_...
insertData(taskInfo: TaskInfo, callback: Function): void { const valueBucket = generateBucket(taskInfo); RdbUtils.insert('taskInfo', valueBucket).then(result => { callback(result); }); Logger.info('TaskInfoTable', `Insert taskInfo {${taskInfo.date}:${taskInfo.taskID}} finished.`); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/common/database/tables/TaskInfoApi.ets#L29-L35
138e774ef4fea4d1b8aba543224fb0b47178e104
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildSync.ets
arkts
应用约束60:使用ES模块导出代替require/module.exports
export default GuildSyncHandler;
AST#export_declaration#Left export default AST#expression#Left GuildSyncHandler AST#expression#Right ; AST#export_declaration#Right
export default GuildSyncHandler;
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildSync.ets#L15-L15
0a85870ac34fc9cfc4ba29dbbb9aca609f382379
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/RadarDataSet.ets
arkts
getHighlightCircleOuterRadius
@Override
public getHighlightCircleOuterRadius(): number { return this.mHighlightCircleOuterRadius; }
AST#method_declaration#Left public getHighlightCircleOuterRadius 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#Lef...
public getHighlightCircleOuterRadius(): number { return this.mHighlightCircleOuterRadius; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/RadarDataSet.ets#L95-L97
ae241ca27512023eb1e01640b145873680549dbd
gitee
fmtjava/Ohs_ArkTs_Eyepetizer.git
79578f394ccb926da1455e63b7fe0722df9b9a22
entry/src/main/ets/view/RankItemWidget.ets
arkts
getDurationText
获取格式化后的时长文本 @returns 格式化的时长字符串,如 "03:00"
private getDurationText(): string { if (this.itemData?.duration) { return DateUtil.formatDuration(this.itemData.duration * 1000); } return '00:00'; }
AST#method_declaration#Left private getDurationText 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#if_statement#Left if ( AST#expression#Left AST#member_expres...
private getDurationText(): string { if (this.itemData?.duration) { return DateUtil.formatDuration(this.itemData.duration * 1000); } return '00:00'; }
https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/view/RankItemWidget.ets#L137-L142
a6c9e7de145bc3b0d51b0bac245e6a7c6c4ad09d
github
openharmony/applications_settings
aac607310ec30e30d1d54db2e04d055655f72730
product/phone/src/main/ets/pages/passwordInput.ets
arkts
updateView
Update view
updateView() { this.pageTitle = this.getPageTitle(); this.inputMessage = this.getInputMessage(); this.unlockMethodList = this.getUnlockMethodList(); this.buttonVisibility = this.getButtonVisibility(); }
AST#method_declaration#Left updateView 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 . pageTitle AST#member_expression#Right =...
updateView() { this.pageTitle = this.getPageTitle(); this.inputMessage = this.getInputMessage(); this.unlockMethodList = this.getUnlockMethodList(); this.buttonVisibility = this.getButtonVisibility(); }
https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/pages/passwordInput.ets#L334-L339
85c419e634bc5382d4c89de38c4875e5d038b439
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
spinkit/src/main/ets/components/SpinA.ets
arkts
SpinA
TODO SpinKit动画组件 author: 桃花镇童长老 since: 2024/05/01
@ComponentV2 export struct SpinA { @Require @Param spinSize: number; @Require @Param spinColor: ResourceColor; @Local x: number = 0; @Local y: number = 0; @Local angle: number = 0; build() { Canvas() .width(this.spinSize) .height(this.spinSize) .backgroundColor(this.spinColor) ....
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpinA AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right spinSize : AST#type_annotation#Left AST#primary_type#Left...
@ComponentV2 export struct SpinA { @Require @Param spinSize: number; @Require @Param spinColor: ResourceColor; @Local x: number = 0; @Local y: number = 0; @Local angle: number = 0; build() { Canvas() .width(this.spinSize) .height(this.spinSize) .backgroundColor(this.spinColor) ....
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/spinkit/src/main/ets/components/SpinA.ets#L22-L68
e24e83b71e413ff373ac6d5e6a80102b9d9d3761
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/SegmentButton.ets
arkts
MARK: - SegmentItem 接口
export interface SegmentItem { title : ResourceStr // 段标题 isEnabled : boolean // 是否可用 }
AST#export_declaration#Left export AST#interface_declaration#Left interface SegmentItem AST#object_type#Left { AST#type_member#Left title : 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 isEnabled : AST#type_a...
export interface SegmentItem { title : ResourceStr isEnabled : boolean }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/SegmentButton.ets#L2-L5
c548a5634a41a7d1be477ce0b4083655b6d96932
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/settings/SettingsService.ets
arkts
getInstance
获取单例实例
static getInstance(): SettingsService { if (!SettingsService.instance) { SettingsService.instance = new SettingsService(); } return SettingsService.instance; }
AST#method_declaration#Left static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left SettingsService AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Lef...
static getInstance(): SettingsService { if (!SettingsService.instance) { SettingsService.instance = new SettingsService(); } return SettingsService.instance; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/settings/SettingsService.ets#L88-L93
9c939ea5c9c06d6f5681731e1a879c1cd95a3768
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_rcp/src/main/ets/rcp/EfBusinessCodeInterceptor.ets
arkts
extractJsonFragment
使用正则表达式提取 JSON 片段 @param jsonStr 待提取的json字符串 @param key 传入的key @returns
extractJsonFragment(jsonStr: string, key: string): string | null { // 构建正则表达式来匹配指定的键及其值 // 使用非贪婪匹配来处理可能的嵌套情况 const regex = new RegExp(`"${key}":\\s*"([^"]*)"`, 's'); const match = jsonStr.match(regex); return match ? match[0] : null; }
AST#method_declaration#Left extractJsonFragment 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 AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t...
extractJsonFragment(jsonStr: string, key: string): string | null { const regex = new RegExp(`"${key}":\\s*"([^"]*)"`, 's'); const match = jsonStr.match(regex); return match ? match[0] : null; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfBusinessCodeInterceptor.ets#L92-L98
6fccf4e6850a797c7fdce90e8e8787bae69419e6
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/CustomContentBuilderProxy.ets
arkts
buttonFlexAlign
多个按钮的容器对齐方式 @description 请根据Orientation设置对应值 @param buttonFlexAlign @returns
buttonFlexAlign(buttonFlexAlign: FlexAlign) { this.builderOptions.buttonFlexAlign = buttonFlexAlign; return this; }
AST#method_declaration#Left buttonFlexAlign AST#parameter_list#Left ( AST#parameter#Left buttonFlexAlign : AST#type_annotation#Left AST#primary_type#Left FlexAlign AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression...
buttonFlexAlign(buttonFlexAlign: FlexAlign) { this.builderOptions.buttonFlexAlign = buttonFlexAlign; return this; }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/CustomContentBuilderProxy.ets#L38-L41
812d0f1a3cb47834043fdc9fb75c7a675051edd4
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
setCustomColorTheme
设置自定义颜色主题
async setCustomColorTheme(colors: Partial<ColorTheme['colors']>): Promise<void> { try { if (this.currentTheme) { const customTheme: ColorTheme = { id: 'custom_' + Date.now(), name: '自定义主题', description: '用户自定义颜色主题', preview: colors.primary || this.currentTheme.c...
AST#method_declaration#Left async setCustomColorTheme AST#parameter_list#Left ( AST#parameter#Left colors : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ColorTheme [ AST#ERROR#Left 'colors' AST#E...
async setCustomColorTheme(colors: Partial<ColorTheme['colors']>): Promise<void> { try { if (this.currentTheme) { const customTheme: ColorTheme = { id: 'custom_' + Date.now(), name: '自定义主题', description: '用户自定义颜色主题', preview: colors.primary || this.currentTheme.c...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L243-L276
b7be351231bcb96f5e36d72a526cb2f63e460649
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.Chip.d.ets
arkts
Defines accessibility options of suffix symbol. @interface ChipSuffixSymbolGlyphOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 14
export interface ChipSuffixSymbolGlyphOptions { /** * Set normal accessibility options for suffix symbol. * * @type { ?AccessibilityOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 14 */ normalAccessibility?: AccessibilityOptions; /** * S...
AST#export_declaration#Left export AST#interface_declaration#Left interface ChipSuffixSymbolGlyphOptions AST#object_type#Left { /** * Set normal accessibility options for suffix symbol. * * @type { ?AccessibilityOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice ...
export interface ChipSuffixSymbolGlyphOptions { normalAccessibility?: AccessibilityOptions; activatedAccessibility?: AccessibilityOptions; action?: VoidCallback; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Chip.d.ets#L402-L435
87551fa1659919339243e2d118bb598dcaa7f70b
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.DialogV2.d.ets
arkts
CustomContentDialogV2
Declare custom content dialog @struct { CustomContentDialogV2 } @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
@ComponentV2 export declare struct CustomContentDialogV2 { /** * Sets the CustomContentDialogV2 title. * * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 18 */ @Param primaryTitle?: ResourceStr; /** * Sets the CustomConten...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct CustomContentDialogV2 AST#component_body#Left { /** * Sets the CustomContentDialogV2 title. * * @type { ?ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full ...
@ComponentV2 export declare struct CustomContentDialogV2 { @Param primaryTitle?: ResourceStr; @Param secondaryTitle?: ResourceStr; @BuilderParam contentBuilder: CustomBuilder; @Param contentAreaPadding?: LocalizedPadding; @Param buttons?: AdvancedDialogV2Button[]; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.DialogV2.d.ets#L651-L707
3831baa38989eb9152b11cf9eda21836e4d91271
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/base/ParamOption.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class SetParam { title?: string func?: () => void }
AST#export_declaration#Left export AST#class_declaration#Left class SetParam AST#class_body#Left { AST#property_declaration#Left title ? : AST#ERROR#Left string func ? : AST#ERROR#Right AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#p...
export class SetParam { title?: string func?: () => void }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/base/ParamOption.ets#L16-L19
082d4888708eff2f05c006385c858a0d1c56e73d
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customdecoration/src/main/ets/components/AutoAddInspector.ets
arkts
装饰器参数
export interface InspectorParam { onDraw?: string; onLayout?: string; offDraw?: string; offLayout?: string; bindId?:string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface InspectorParam AST#object_type#Left { AST#type_member#Left onDraw ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left onLayout ? : AST#type_anno...
export interface InspectorParam { onDraw?: string; onLayout?: string; offDraw?: string; offLayout?: string; bindId?:string; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdecoration/src/main/ets/components/AutoAddInspector.ets#L21-L27
f3fa808bf562306c16edc1c63e9767d02060a440
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/palette/src/main/ets/pages/PaletteMainPage.ets
arkts
initGridTemplate
根据色相数和色阶数初始化Gird的columnsTemplate和rowsTemplate
initGridTemplate() { if (this.hslHues.length === 0) { this.columnsTemplate = ''; this.rowsTemplate = ''; return; } let rowsTemplate = ''; // 初始化列模板 this.columnsTemplate = this.hslHues.map(hsl => Constants.GRID_TEMPLATE_UINT).join(' '); // 初始化行模板 for (let i = 0; i < this.lev...
AST#method_declaration#Left initGridTemplate AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expr...
initGridTemplate() { if (this.hslHues.length === 0) { this.columnsTemplate = ''; this.rowsTemplate = ''; return; } let rowsTemplate = ''; this.columnsTemplate = this.hslHues.map(hsl => Constants.GRID_TEMPLATE_UINT).join(' '); for (let i = 0; i < this.levels; i++) { ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/palette/src/main/ets/pages/PaletteMainPage.ets#L350-L368
85504b15165f8bc378e06b3c12414437f773f263
gitee
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/AppState.ets
arkts
loadFromStorage
加载存储数据
private async loadFromStorage() { if (!this.storage) return; try { const userData = await this.storage.get('userData', ''); if (userData && typeof userData === 'string') { const parsedData: StoredUserData = JSON.parse(userData) as StoredUserData; this._userInfo = parsedData.userInf...
AST#method_declaration#Left private async loadFromStorage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#R...
private async loadFromStorage() { if (!this.storage) return; try { const userData = await this.storage.get('userData', ''); if (userData && typeof userData === 'string') { const parsedData: StoredUserData = JSON.parse(userData) as StoredUserData; this._userInfo = parsedData.userInf...
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/AppState.ets#L78-L99
bb58c3e595cc4c9f9899785e4dccce6da50c40d9
github
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/api/Router.ets
arkts
getParamByName
@deprecated @see {ZRouter.getInstance().getParamByName} @param name @returns
public static getParamByName(name: string): Record<string, ObjectOrNull>[] { return ZRouter.getRouterMgr().getParamByName(name) }
AST#method_declaration#Left public static getParamByName 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#ERROR#Left AST#primary_type#Left AST#generic_type#Left ...
public static getParamByName(name: string): Record<string, ObjectOrNull>[] { return ZRouter.getRouterMgr().getParamByName(name) }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L524-L526
515f919b9c1849d4cdfde8a72c3fcf304824567a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/ContactTypes.ets
arkts
导入错误接口
export interface ImportError { row: number; data: ContactImportData; error: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ImportError AST#object_type#Left { AST#type_member#Left row : 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 data : AST#type_annotation#Left AS...
export interface ImportError { row: number; data: ContactImportData; error: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L31-L35
79828aa285b2a1e540eb0960138253dffd167df2
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/CircleClass.ets
arkts
getChamferXY
获取俩边倒角中心位置
getChamferXY(): void { this.chamferXY = utilGetChamferXY(this.circleDiameter, this.chamferRadius) }
AST#method_declaration#Left getChamferXY AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#membe...
getChamferXY(): void { this.chamferXY = utilGetChamferXY(this.circleDiameter, this.chamferRadius) }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/CircleClass.ets#L203-L205
0952bbf6d1269f7804ecd91b6863152401c40817
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/strings/StringEncrypt.ets
arkts
removedSalt
从字符串中去除盐值 @param str 加了盐的字符串 @returns 去除盐值后的字符串或null
static removedSalt(str: string | null): string | null { return SaltUtil.removeSalt(str); }
AST#method_declaration#Left static removedSalt AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#...
static removedSalt(str: string | null): string | null { return SaltUtil.removeSalt(str); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringEncrypt.ets#L42-L44
6947a6f0de22e2c272580fdd06d8b88b2d5c9658
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/timeto/TimeToManager.ets
arkts
TimeToManager:同步方法版本
export class TimeToManager { // ------------------------- // 内部统一获取 Preferences // ------------------------- private static _getPrefs(): preferences.Preferences { const context = getAppContext(); return preferences.getPreferencesSync(context, { name: TimeToKeys.PrefNamespace }); } // -------------...
AST#export_declaration#Left export AST#class_declaration#Left class TimeToManager AST#class_body#Left { // ------------------------- // 内部统一获取 Preferences // ------------------------- AST#method_declaration#Left private static _getPrefs AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST...
export class TimeToManager { private static _getPrefs(): preferences.Preferences { const context = getAppContext(); return preferences.getPreferencesSync(context, { name: TimeToKeys.PrefNamespace }); } public static isTimeTo(type: TimeToType): boolean { const limitMinute = Time...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L28-L170
3556e31d2c1b95946592415094f02b7d76e240aa
github
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/Viewmodel/DayInfo.ets
arkts
统计每日记账信息
export default class DayInfo { date: string; expense: number = 0; income: number = 0; constructor(date: string, expense: number, income: number) { this.date = date; this.expense = expense; this.income = income; } }
AST#export_declaration#Left export default AST#class_declaration#Left class DayInfo AST#class_body#Left { AST#property_declaration#Left date : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left expense : A...
export default class DayInfo { date: string; expense: number = 0; income: number = 0; constructor(date: string, expense: number, income: number) { this.date = date; this.expense = expense; this.income = income; } }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/Viewmodel/DayInfo.ets#L5-L15
36504a0194ad8ebc2dc60cebda669c45e7533bf7
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/datatype/primitives/primitives_string_002_F.ets
arkts
Introduction 基础数据类型-string
export function primitives_string_002_F(taint_src : string) : void { let _t = taint_src; let _clean = "clean"; taint.Sink(_clean); }
AST#export_declaration#Left export AST#function_declaration#Left function primitives_string_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#type_anno...
export function primitives_string_002_F(taint_src : string) : void { let _t = taint_src; let _clean = "clean"; taint.Sink(_clean); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/datatype/primitives/primitives_string_002_F.ets#L9-L13
e247dcfa9e9d65044c3c89ff6f17ff9288a6ca54
github
queueit/harmony-sdk.git
ba7b4b38c03730bfbe305789acba6db0012d5f5c
queueit_sdk/src/main/ets/Index.ets
arkts
QueueListener
Exporting the type is important for implementing the listener
export type { QueueListener } from './data/QueueListener';
AST#export_declaration#Left export AST#ERROR#Left type AST#ERROR#Right { QueueListener } from './data/QueueListener' ; AST#export_declaration#Right
export type { QueueListener } from './data/QueueListener';
https://github.com/queueit/harmony-sdk.git/blob/ba7b4b38c03730bfbe305789acba6db0012d5f5c/queueit_sdk/src/main/ets/Index.ets#L9-L9
73ca7a37a94f140a5004b3e8631a7434baa199f9
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/strings/StringEncrypt.ets
arkts
构造函数 @param str 要处理的字符串,可为null
constructor(str: string | null) { this.str = str; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#pa...
constructor(str: string | null) { this.str = str; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringEncrypt.ets#L81-L83
48cf68260bd450be1823293e795f1a6b69b67166
github
fmtjava/Ohs_ArkTs_Eyepetizer.git
79578f394ccb926da1455e63b7fe0722df9b9a22
entry/src/main/ets/common/PreferencesUtil.ets
arkts
getString
读取字符串数据 @param context 应用上下文 @param key 键 @param defaultValue 默认值 @returns 字符串值
static async getString(context: common.UIAbilityContext, key: string, defaultValue: string = ''): Promise<string> { try { const dataPreferences = await PreferencesUtil.getPreferences(context); return await dataPreferences.get(key, defaultValue) as string; } catch (error) { console.error('Prefe...
AST#method_declaration#Left static async getString AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ke...
static async getString(context: common.UIAbilityContext, key: string, defaultValue: string = ''): Promise<string> { try { const dataPreferences = await PreferencesUtil.getPreferences(context); return await dataPreferences.get(key, defaultValue) as string; } catch (error) { console.error('Prefe...
https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/common/PreferencesUtil.ets#L59-L67
aba2acb7796ef65a5e07f3fda780ad43bb2eafbd
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Learn.ets
arkts
save
/============================PlanManager 中的Extension============================ /向db中insert一条Learn数据
save(){ PlanManager.saveLearn(this) }
AST#method_declaration#Left save 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 PlanManager AST#expression#Right . saveLearn AST#member_exp...
save(){ PlanManager.saveLearn(this) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Learn.ets#L95-L97
66c4fda52cfdfe81c490afde21dda87dae730534
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_history.ets
arkts
patch_history_files_before_index_era
This migration happens between 1.7.6(1000024) and 1.7.7(1000025) to switch all original timestamps into UTC time.
patch_history_files_before_index_era() { let version_file = sandbox_read_text_sync('last_app_versionCode.txt'); if (version_file != 'undefined') { return; } console.log('[Meow][bunch_of_history] Patch old history of migration 1.7.6(1000024) to 1.7.7(1000025).'); let result: string = ""; l...
AST#method_declaration#Left patch_history_files_before_index_era AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left version_file = AST#expression#Left AST#call_expression#Left AST#expression#Left sandbox_read_...
patch_history_files_before_index_era() { let version_file = sandbox_read_text_sync('last_app_versionCode.txt'); if (version_file != 'undefined') { return; } console.log('[Meow][bunch_of_history] Patch old history of migration 1.7.6(1000024) to 1.7.7(1000025).'); let result: string = ""; l...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history.ets#L490-L521
22f8e600e2edbb9749c80ae1980feebfb8cfb974
gitee
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/Recycle2.ets
arkts
getStatusBgColor
根据订单状态获取标签背景色
getStatusBgColor(status: string): ResourceStr { switch (status) { case '待接单': return '#FFE6EC'; case '已接单': return '#E5F6F8'; case '回收中': return '#E5F6EC'; case '已完成': return '#F5F7FA'; default: return '#ECECEC'; } }
AST#method_declaration#Left getStatusBgColor AST#parameter_list#Left ( AST#parameter#Left status : 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 ResourceStr AST#primar...
getStatusBgColor(status: string): ResourceStr { switch (status) { case '待接单': return '#FFE6EC'; case '已接单': return '#E5F6F8'; case '回收中': return '#E5F6EC'; case '已完成': return '#F5F7FA'; default: return '#ECECEC'; } }
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/Recycle2.ets#L336-L344
5699dea1d850e814d6bc1311869340dc49a7a35a
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ComponentReuse/entry/src/main/ets/pages/Index.ets
arkts
[End example]
export interface NavDestinationItem { id: string, detail: Resource }
AST#export_declaration#Left export AST#interface_declaration#Left interface NavDestinationItem AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left detail : AST#type_annotation...
export interface NavDestinationItem { id: string, detail: Resource }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ComponentReuse/entry/src/main/ets/pages/Index.ets#L129-L132
489e376dc61b57b77dd01e7d8ab922d611537b32
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
PerformanceAnalysis/BptaFramePractice/entry/src/main/ets/components/DiscoverView.ets
arkts
ArticleCardView
[EndExclude discover_view] Add @Reusable Decorator Use Component Reuse
@Reusable @Component export struct ArticleCardView { // ... aboutToReuse(params: Record<string, Object>): void { // ... } Row() { ActionButtonBuilder() ActionButtonBuilder() ActionButtonBuilder() } build() { // ... } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Reusable AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct ArticleCardView AST#component_body#Left { // ... AST#method_declaration#Left aboutToReuse AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Lef...
@Reusable @Component export struct ArticleCardView { aboutToReuse(params: Record<string, Object>): void { } Row() { ActionButtonBuilder() ActionButtonBuilder() ActionButtonBuilder() } build() { } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/PerformanceAnalysis/BptaFramePractice/entry/src/main/ets/components/DiscoverView.ets#L50-L65
0383e6bcff9ebb7ed85678ab8b293efbbddc593d
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/Camera/entry/src/main/ets/views/ModeSwitchPage.ets
arkts
countTakeVideoFn
Countdown capture and video
countTakeVideoFn() { if (this.countdownNum) { // Clear Countdown if (this.countTimerOut) { clearTimeout(this.countTimerOut); } if (this.countTimerInt) { clearInterval(this.countTimerInt); } // Turn on timer this.countTimerOut = setTimeout(() => { // ...
AST#method_declaration#Left countTakeVideoFn 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#member_expression#Left AST#expression#Left this AST#expression#Right . countdownNum AST#member_expression#Righ...
countTakeVideoFn() { if (this.countdownNum) { if (this.countTimerOut) { clearTimeout(this.countTimerOut); } if (this.countTimerInt) { clearInterval(this.countTimerInt); } this.countTimerOut = setTimeout(() => { this.isVideoPhotoFn(); ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Camera/entry/src/main/ets/views/ModeSwitchPage.ets#L143-L167
09541d852952f46a0d8a9be4d582e2c067487ed7
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_dialog/ace_ets_module_dialog_api20/entry/src/main/ets/MainAbility/pages/Menu/PreviewScaleMode.ets
arkts
PreviewBuilder
菜单预览图
@Builder export function PreviewBuilder() { Image($r('app.media.icon')) .width(200) .height(120) }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function PreviewBuilder 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 Image ( AST#expression#Left AST#r...
@Builder export function PreviewBuilder() { Image($r('app.media.icon')) .width(200) .height(120) }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_dialog/ace_ets_module_dialog_api20/entry/src/main/ets/MainAbility/pages/Menu/PreviewScaleMode.ets#L17-L22
aa09527df590780d3a872cc0ff6734e2db598e31
gitee
openharmony/xts_tools
784a2e99d894e6bc2aba8c38f6bb68032442b1c8
sample/AppSampleD/entry/src/main/ets/appsampled/data/ChatBox.ets
arkts
Copyright (c) 2023 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 class ChatBox { isSend: boolean; message: string; userIcon: Resource; constructor(isSend: boolean, message: string, userIcon: Resource) { this.isSend = isSend; this.message = message; this.userIcon = userIcon; } }
AST#export_declaration#Left export AST#class_declaration#Left class ChatBox AST#class_body#Left { AST#property_declaration#Left isSend : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left message : AST#ty...
export class ChatBox { isSend: boolean; message: string; userIcon: Resource; constructor(isSend: boolean, message: string, userIcon: Resource) { this.isSend = isSend; this.message = message; this.userIcon = userIcon; } }
https://github.com/openharmony/xts_tools/blob/784a2e99d894e6bc2aba8c38f6bb68032442b1c8/sample/AppSampleD/entry/src/main/ets/appsampled/data/ChatBox.ets#L16-L26
d18180859f2f0a23cff5bf900365f55a8f90aa35
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/animation/template2/Index.ets
arkts
组件二透明度 第二步:将状态变量设置到相关可动画属性接口
build() { Row() { // 组件一 Column() { } .rotate({ angle: this.rotateValue }) .backgroundColor('#317AF7') .justifyContent(FlexAlign.Center) .width(100) .height(100) .borderRadius(30) .onClick(() => { this.getUIContext()?.animateTo({ curve: curves.spri...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { // 组件一 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { } AST#...
build() { Row() { Column() { } .rotate({ angle: this.rotateValue }) .backgroundColor('#317AF7') .justifyContent(FlexAlign.Center) .width(100) .height(100) .borderRadius(30) .onClick(() => { this.getUIContext()?.animateTo({ curve: curves.springMoti...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/Animation/entry/src/main/ets/pages/animation/template2/Index.ets#L27-L66
ca74582b2ebe0886c2ae830cd73b20210379bd66
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/result/Index.ets
arkts
RequestHelper
@file result 模块统一导出 @author Joker.X
export { RequestHelper } from './src/main/ets/RequestHelper';
AST#export_declaration#Left export { RequestHelper } from './src/main/ets/RequestHelper' ; AST#export_declaration#Right
export { RequestHelper } from './src/main/ets/RequestHelper';
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/result/Index.ets#L6-L6
cfd8db2556c4d0bbb2e2b687a825c5be84378c2c
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/component/TextPickerDialogView.ets
arkts
TextPickerDialogView
日期选择组件
@Preview @ComponentV2 export struct TextPickerDialogView { @Require @Param options: ITextPickerOptions; // @Local themeColorMode: ThemeColorMode = DialogHub.getThemeColorMode(); @Local selectValue: string | string[] = ''; @Local value: string | string[] = ''; @Local range: string[] | string[][] | Resource | T...
AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct TextPickerDialogView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator...
@Preview @ComponentV2 export struct TextPickerDialogView { @Require @Param options: ITextPickerOptions; @Local selectValue: string | string[] = ''; @Local value: string | string[] = ''; @Local range: string[] | string[][] | Resource | TextPickerRangeContent[] | TextCascadePickerRangeContent[] = []; @Local ...
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/component/TextPickerDialogView.ets#L13-L143
bf98bd88fdf74afcb128dcadfc4b8491e4792d0c
github
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
entry/src/main/ets/common/contants/CommonConstants.ets
arkts
Formatting template for millisecond time Route type define
export interface Route { title: ResourceStr; to: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface Route AST#object_type#Left { AST#type_member#Left title : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left to : AST#type_annotation#Left AST...
export interface Route { title: ResourceStr; to: string; }
https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/entry/src/main/ets/common/contants/CommonConstants.ets#L90-L93
ab1b1debc38e929769ff1112e3c9f5da5c0dd8db
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/common/utils/DateTimeUtil.ets
arkts
@file 日期工具
export default class DateTimeUtil { /** * 时分秒 */ getTime(): string { const DATETIME = new Date(); return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()); } /** * 年月日 */ getDate(): string { const DATETIME = new Date(); return this.concatDate(DATE...
AST#export_declaration#Left export default AST#class_declaration#Left class DateTimeUtil AST#class_body#Left { /** * 时分秒 */ AST#method_declaration#Left getTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Ri...
export default class DateTimeUtil { getTime(): string { const DATETIME = new Date(); return this.concatTime(DATETIME.getHours(), DATETIME.getMinutes(), DATETIME.getSeconds()); } getDate(): string { const DATETIME = new Date(); return this.concatDate(DATETIME.getFullYear(), DATETIME.getMont...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/common/utils/DateTimeUtil.ets#L19-L75
63699fa6e9c7a985a68e2731903970908f30964e
gitee