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
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/common/database/tables/DayInfoApi.ets
arkts
queryList
Query dayInfo list. @param date @param callback
queryList(dates: string[], callback: Function): void { let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates(Const.DAY_INFO.tableName ? Const.DAY_INFO.tableName : ''); predicates.in('date', dates); RdbUtils.query(predicates).then(resultSet => { let count = resultSet.rowCount; if (cou...
AST#method_declaration#Left queryList AST#parameter_list#Left ( AST#parameter#Left dates : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#...
queryList(dates: string[], callback: Function): void { let predicates: dataRdb.RdbPredicates = new dataRdb.RdbPredicates(Const.DAY_INFO.tableName ? Const.DAY_INFO.tableName : ''); predicates.in('date', dates); RdbUtils.query(predicates).then(resultSet => { let count = resultSet.rowCount; if (cou...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/common/database/tables/DayInfoApi.ets#L87-L110
9b786759228459fb6f7a27db6ee77a999cb1b352
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SM4Sync.ets
arkts
encodeECB
加密-ECB模式 @param str 待加密的字符串 @param sm4Key SM4密钥 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 @returns
static encodeECB(str: string, sm4Key: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.encodeECB(str, sm4Key, 'SM4_128', 'SM4_128|ECB|PKCS7', 128, keyCoding, resultCoding); }
AST#method_declaration#Left static encodeECB AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sm4Key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#...
static encodeECB(str: string, sm4Key: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.encodeECB(str, sm4Key, 'SM4_128', 'SM4_128|ECB|PKCS7', 128, keyCoding, resultCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SM4Sync.ets#L45-L48
2df77d977af9777eeb8136384e76d3e8f9d3ad65
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/utils/DateHelper.ets
arkts
padZero
日期补零 @param num @returns
static padZero(num: number): string { return num.toString().padStart(2, "0"); }
AST#method_declaration#Left static padZero AST#parameter_list#Left ( AST#parameter#Left num : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Rig...
static padZero(num: number): string { return num.toString().padStart(2, "0"); }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/DateHelper.ets#L38-L40
4ea6e0aa76ce0a8b514a42ae5aa9c50a2a3a14dd
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/model/ReminderService.ets
arkts
getValidReminders
获取有效的提醒列表。 @param callback 回调函数,可选参数,用于返回有效提醒的列表
public getValidReminders(callback?: (reminderRequests: Array<reminderAgent.ReminderRequest>) => void) { reminderAgent.getValidReminders((_err, reminderRequests: Array<reminderAgent.ReminderRequest>) => { if (callback != null) { callback(reminderRequests); reminderRequests.forEach((reminderRequ...
AST#method_declaration#Left public getValidReminders AST#parameter_list#Left ( AST#parameter#Left callback ? : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left reminderRequests : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Lef...
public getValidReminders(callback?: (reminderRequests: Array<reminderAgent.ReminderRequest>) => void) { reminderAgent.getValidReminders((_err, reminderRequests: Array<reminderAgent.ReminderRequest>) => { if (callback != null) { callback(reminderRequests); reminderRequests.forEach((reminderRequ...
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/model/ReminderService.ets#L52-L59
ec546d9a0917e7f6c5e62291abe16a8673b61169
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/ApplicationModels/Launcher/entry/src/main/ets/components/FormManagerComponent.ets
arkts
getCurrentFormInfo
Get current form information by bundle name.
private async getCurrentFormInfo() { let currentBundleFormsInfo: Array<CardItemInfo> = await FormModel.getFormsInfoByBundleName(this.formAppInfo?.bundleName); AppStorage.SetOrCreate('formMgrItem', currentBundleFormsInfo); }
AST#method_declaration#Left private async getCurrentFormInfo AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left currentBundleFormsInfo : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Arr...
private async getCurrentFormInfo() { let currentBundleFormsInfo: Array<CardItemInfo> = await FormModel.getFormsInfoByBundleName(this.formAppInfo?.bundleName); AppStorage.SetOrCreate('formMgrItem', currentBundleFormsInfo); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/ApplicationModels/Launcher/entry/src/main/ets/components/FormManagerComponent.ets#L139-L142
81038f4cd91cbfa984bf639be1550c1da2425c1a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/managers/AIModelManager.ets
arkts
loadConfigurations
加载配置
private static async loadConfigurations(): Promise<void> { try { const result = await StorageManager.getItem<Record<string, AIModelConfig>>(CacheConstants.AI_CONFIG, {}); if (result.success && result.data) { for (const [provider, config] of Object.entries(result.data)) { this.configs.s...
AST#method_declaration#Left private static async loadConfigurations 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...
private static async loadConfigurations(): Promise<void> { try { const result = await StorageManager.getItem<Record<string, AIModelConfig>>(CacheConstants.AI_CONFIG, {}); if (result.success && result.data) { for (const [provider, config] of Object.entries(result.data)) { this.configs.s...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/managers/AIModelManager.ets#L79-L92
d4a6901c3f414114cbff89ce20813fa38afe14bd
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/view/Detail/dialog/RenameDialog.ets
arkts
构建组件
build() { Flex() { CommonDialog({ title: $r('app.string.alarm_name'), // 设置弹窗标题 controller: this.controller, // 确认按钮点击时的回调 onConfirm: () => { this.alarmItem.name = this.name; // 更新 AlarmItem 的名称 } }) { TextArea({ text: this.alarmItem.name }) // 显...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Flex ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left CommonDialog ( AST#component_parameters#Left { AST#compon...
build() { Flex() { CommonDialog({ title: $r('app.string.alarm_name'), controller: this.controller, onConfirm: () => { this.alarmItem.name = this.name; } }) { TextArea({ text: this.alarmItem.name }) .width(CommonConstants.FULL_LENGTH...
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/Detail/dialog/RenameDialog.ets#L20-L43
c8ea047aede6d17734fba7354c6236bc0ec206ae
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/utils/JhEncryptUtils.ets
arkts
encodeMd5
/ md5 加密 32位小写
public static encodeMd5(plainText: string) { let hash: CryptoJS.lib.WordArray = CryptoJS.MD5(plainText) return hash.toString() }
AST#method_declaration#Left public static encodeMd5 AST#parameter_list#Left ( AST#parameter#Left plainText : 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#variable_de...
public static encodeMd5(plainText: string) { let hash: CryptoJS.lib.WordArray = CryptoJS.MD5(plainText) return hash.toString() }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/utils/JhEncryptUtils.ets#L27-L30
20d8b0a28016e7092566d3770b819cde09ba5629
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets
arkts
syncHorizontalAngle
Sync horizontal angle. @param angle
syncHorizontalAngle(angle: number) { this.horizontalAngle = angle; let points = MathUtils.rectToPoints(this.cropRect); let origin = this.getDisplayCenter(); let totalAngle = -(this.rotationAngle + this.horizontalAngle); let rotated = MathUtils.rotatePoints(points, totalAngle, origin); let scale...
AST#method_declaration#Left syncHorizontalAngle AST#parameter_list#Left ( AST#parameter#Left angle : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statemen...
syncHorizontalAngle(angle: number) { this.horizontalAngle = angle; let points = MathUtils.rectToPoints(this.cropRect); let origin = this.getDisplayCenter(); let totalAngle = -(this.rotationAngle + this.horizontalAngle); let rotated = MathUtils.rotatePoints(points, totalAngle, origin); let scale...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets#L133-L142
7031fc559e62bad1329fc3e2d841c199a8783de8
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ResponsiveLayout/entry/src/main/ets/pages/VideoExample.ets
arkts
onFullScreenChange
[Start on_full_screen_change] [Start dd_on_full_screen_change] entry/src/main/ets/page/VideoExample.ets
private onFullScreenChange(): void { // Large folding screen (X series) in unfolded state and tablet state, supporting rotation && large folding screen (X series) in hover state requires landscape display and does not support rotation. if (((this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_MD && this.curre...
AST#method_declaration#Left private onFullScreenChange 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 { // Large folding screen (X series) in unfolded state and tablet state, suppo...
private onFullScreenChange(): void { if (((this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_MD && this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM) || this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_LG) && !this.isHalfFolded) { this.windowUtil?.setMainWindowOrientation(win...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ResponsiveLayout/entry/src/main/ets/pages/VideoExample.ets#L122-L153
26981e5fbdb13577fc4451f1507513d0ac2c6b96
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/gridexchange/src/main/ets/model/AppInfo.ets
arkts
AppInfo
App信息,包括图标、名字、是否可见
@Observed export class AppInfo { icon: ResourceStr = ''; name: ResourceStr = ''; visible: boolean = true; constructor(icon: ResourceStr = '', name: ResourceStr = '', visible: boolean = true) { this.icon = icon; this.name = name; this.visible = visible; } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class AppInfo AST#class_body#Left { AST#property_declaration#Left icon : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Righ...
@Observed export class AppInfo { icon: ResourceStr = ''; name: ResourceStr = ''; visible: boolean = true; constructor(icon: ResourceStr = '', name: ResourceStr = '', visible: boolean = true) { this.icon = icon; this.name = name; this.visible = visible; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/gridexchange/src/main/ets/model/AppInfo.ets#L19-L30
60590107e535691ef695874e5ee43483268f5bbc
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
LIstOptimizationBak/entry/src/main/ets/model/AppConstants.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 AppConstants { static readonly FULL_PERCENT: string = '100%'; static readonly TAB_PERCENT: string = '15%'; static readonly TAB_FONT_WEIGHT: number = 600; static readonly DEFAULT_STATUS_HEIGHT: number = 32; static readonly TAB_HEIGHT: number = 56; }
AST#export_declaration#Left export AST#class_declaration#Left class AppConstants AST#class_body#Left { AST#property_declaration#Left static readonly FULL_PERCENT : 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 AppConstants { static readonly FULL_PERCENT: string = '100%'; static readonly TAB_PERCENT: string = '15%'; static readonly TAB_FONT_WEIGHT: number = 600; static readonly DEFAULT_STATUS_HEIGHT: number = 32; static readonly TAB_HEIGHT: number = 56; }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/LIstOptimizationBak/entry/src/main/ets/model/AppConstants.ets#L16-L22
24bc3854133393b6c933f8cecd6fce4c773c7552
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/base/CameraUtil.ets
arkts
@Author csx @DateTime 2024/5/11 09:30:05 @TODO CameraUtil 相机相关工具类 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_ui
export class CameraUtil { /** * 调起照相和录屏 * @returns */ static async picker(): Promise<picker.PickerResult> { let mContext = getContext() as common.Context; let pickerProfile: picker.PickerProfile = { cameraPosition: camera.CameraPosition.CAMERA_POSITION_BACK }; let pickerResult: picker...
AST#export_declaration#Left export AST#class_declaration#Left class CameraUtil AST#class_body#Left { /** * 调起照相和录屏 * @returns */ AST#method_declaration#Left static async picker AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AS...
export class CameraUtil { static async picker(): Promise<picker.PickerResult> { let mContext = getContext() as common.Context; let pickerProfile: picker.PickerProfile = { cameraPosition: camera.CameraPosition.CAMERA_POSITION_BACK }; let pickerResult: picker.PickerResult = await picker.p...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/CameraUtil.ets#L28-L42
5c25dad40f8869baab71b1647d72d4a901e8fe1b
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/UdpSocket.ets
arkts
isConnected
空实现
async isConnected(): Promise<boolean> { return false; }
AST#method_declaration#Left async isConnected AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_a...
async isConnected(): Promise<boolean> { return false; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/UdpSocket.ets#L118-L120
206983f9249682708dea8ba6b1ec25c315b1b842
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/common/url.ets
arkts
toJSON
[Symbol.iterator](): IterableIterator<[string, string]> { return this.entries(); }
toJSON(): string { return this.toString(); }
AST#method_declaration#Left toJSON AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST...
toJSON(): string { return this.toString(); }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/url.ets#L274-L276
2ece30e45b0c44bd0d70d863b9f00969c70c8bbc
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/components/SelectUserDialog.ets
arkts
最终返回的用户id
build() { Column() { Text(this.title) .fontSize(20) .fontColor($r('app.color.COLOR_E6000000')) .fontFamily($r('app.string.font_family')) .width('90%') .textAlign(TextAlign.Start) .margin({ top: 14, bottom: 14 }) Column() { Row() { Text(...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expression#Left A...
build() { Column() { Text(this.title) .fontSize(20) .fontColor($r('app.color.COLOR_E6000000')) .fontFamily($r('app.string.font_family')) .width('90%') .textAlign(TextAlign.Start) .margin({ top: 14, bottom: 14 }) Column() { Row() { Text(...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/components/SelectUserDialog.ets#L25-L129
1f60e5e2e854b7d1be8e158cfd077178f7f41ed6
gitee
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/pages/TaskReviewView.ets
arkts
saveRemark
保存缺陷描述
async saveRemark() { if (!this.selectedFlaw) return; try { console.log('[TaskReviewView] 📝 开始保存缺陷描述,ID:', this.selectedFlaw.id); const httpRequest = http.createHttp(); const response = await httpRequest.request( `${AppConstants.API_BASE_URL}/agv/flaw`, { meth...
AST#method_declaration#Left async saveRemark AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unar...
async saveRemark() { if (!this.selectedFlaw) return; try { console.log('[TaskReviewView] 📝 开始保存缺陷描述,ID:', this.selectedFlaw.id); const httpRequest = http.createHttp(); const response = await httpRequest.request( `${AppConstants.API_BASE_URL}/agv/flaw`, { meth...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/TaskReviewView.ets#L293-L364
cc5340ed831601bdd1ad1eb6069b1e827c2ce6db
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/AES.ets
arkts
decodeECB
解密-ECB模式 @param str 加密的字符串 @param aesKey AES密钥 @returns
static async decodeECB(str: string, aesKey: string): Promise<string> { return CryptoUtil.decodeECB(str, aesKey, 'AES256', 'AES256|ECB|PKCS7', 256); }
AST#method_declaration#Left static async decodeECB AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary...
static async decodeECB(str: string, aesKey: string): Promise<string> { return CryptoUtil.decodeECB(str, aesKey, 'AES256', 'AES256|ECB|PKCS7', 256); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/AES.ets#L201-L203
3191e135ed9337f051427a23b3f69895d198e6f4
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamEditPage.ets
arkts
setDate
设置日期
setDate(day: number): void { this.date.day = day; }
AST#method_declaration#Left setDate 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 void AST#primary_type#Right AST#ty...
setDate(day: number): void { this.date.day = day; }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamEditPage.ets#L180-L182
2c8061e913e4b064bb4793c9421a1fb004ed7539
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getRequiredBaseOffset
@Override
protected getRequiredBaseOffset(): number { return 0; }
AST#method_declaration#Left protected getRequiredBaseOffset 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 0 A...
protected getRequiredBaseOffset(): number { return 0; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L525-L527
ab654bc3025bbf455d6e55632bc9667b6ff95c11
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/TextAreaBuilderProxy.ets
arkts
textAlignment
文本框整体对齐方式 @description 控制文本框在其容器内的对齐方式 @returns
textAlignment(align: TextAlignment) { this.builderOptions.align = align; return this }
AST#method_declaration#Left textAlignment AST#parameter_list#Left ( AST#parameter#Left align : AST#type_annotation#Left AST#primary_type#Left TextAlignment AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_stateme...
textAlignment(align: TextAlignment) { this.builderOptions.align = align; return this }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/TextAreaBuilderProxy.ets#L49-L52
196baebc624a3ad01a532c4b80c3cf4339b3649d
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/navigation/MeNav.ets
arkts
MeNav
@file 我的页面导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function MeNav(): void { MePage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function MeNav AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_componen...
@Builder export function MeNav(): void { MePage(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/navigation/MeNav.ets#L8-L11
1b99bbc022aa3a14c1db86e2c4219d69405c9305
github
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/downsampling/DownsampleStartegy.ets
arkts
请求尺寸大于实际尺寸不进行放大,按照原图展示
export class AtMost implements BaseDownsampling { getName() { return 'AtMost' } getScaleFactor(sourceWidth: number, sourceHeight: number, requestedWidth: number, requestedHeight: number): number { const maxIntegerFactor = Math.ceil(Math.max(sourceHeight / requestedHeight, sourceWidth / requestedWidth));...
AST#export_declaration#Left export AST#class_declaration#Left class AtMost AST#implements_clause#Left implements BaseDownsampling AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left getName AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#r...
export class AtMost implements BaseDownsampling { getName() { return 'AtMost' } getScaleFactor(sourceWidth: number, sourceHeight: number, requestedWidth: number, requestedHeight: number): number { const maxIntegerFactor = Math.ceil(Math.max(sourceHeight / requestedHeight, sourceWidth / requestedWidth));...
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/downsampling/DownsampleStartegy.ets#L68-L93
8cf8c531724d679a527f37a88c60e7004adb056f
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
picker_utils/src/main/ets/ScanUtil.ets
arkts
onDetectBarCode
调用图片识码,该方法已过时,推荐使用:ScanUtil.decode()。
static onDetectBarCode(uri: string, options?: scanBarcode.ScanOptions): Promise<Array<scanBarcode.ScanResult>> { return ScanUtil.decode(uri, options); }
AST#method_declaration#Left static onDetectBarCode AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AST#qualified_t...
static onDetectBarCode(uri: string, options?: scanBarcode.ScanOptions): Promise<Array<scanBarcode.ScanResult>> { return ScanUtil.decode(uri, options); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/ScanUtil.ets#L143-L145
79a572e3b0ef66ef2e4ffee08e3c9f808083d08c
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/commons/network/HttpUtils.ets
arkts
destroyHttpRequest
The method of destroying httpRequest.
destroyHttpRequest() { this.httpRequest.destroy(); }
AST#method_declaration#Left destroyHttpRequest AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Lef...
destroyHttpRequest() { this.httpRequest.destroy(); }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/network/HttpUtils.ets#L82-L84
0b320b45167b937fc0652fb4de4039cc139152af
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/dialog/DialogHelper.ets
arkts
showAlertDialog
显示操作确认类弹出框 @param options
static showAlertDialog(options: AlertOptions): string { ActionParameter.initBaseDefault(options); ActionParameter.initDialogDefault(options); ActionParameter.initAlertTitle(options); ActionParameter.initPrimarySecondaryButton(options); const dialogId = ActionBaseCore.getInstance().openCustomDialog(w...
AST#method_declaration#Left static showAlertDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left AlertOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AS...
static showAlertDialog(options: AlertOptions): string { ActionParameter.initBaseDefault(options); ActionParameter.initDialogDefault(options); ActionParameter.initAlertTitle(options); ActionParameter.initPrimarySecondaryButton(options); const dialogId = ActionBaseCore.getInstance().openCustomDialog(w...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L138-L145
e1d4b2a0a291f668237c385d46712ae4b3f3d2b7
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/SimpleAIService.ets
arkts
setModelConfig
设置AI模型配置
setModelConfig(config: AIModelConfig): void { this.currentConfig = config; this.isConfigured = config.enabled && config.apiKey.length > 0; hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AI model configured: ${config.name}`); }
AST#method_declaration#Left setModelConfig AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left AIModelConfig AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_...
setModelConfig(config: AIModelConfig): void { this.currentConfig = config; this.isConfigured = config.enabled && config.apiKey.length > 0; hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AI model configured: ${config.name}`); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/SimpleAIService.ets#L89-L93
a4731932fbce2be1f87071c299c5e8506da3d455
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_core/src/main/ets/core/base/OutDTO.ets
arkts
Error
失败-包含提示消息 @param msg 提示消息 @returns
static Error(msg: string): OutDTO<string> { let dto = new OutDTO<string>(false, msg, '', [], 400); return dto; }
AST#method_declaration#Left static Error AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO ...
static Error(msg: string): OutDTO<string> { let dto = new OutDTO<string>(false, msg, '', [], 400); return dto; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/base/OutDTO.ets#L101-L104
864c9a9cd53e9845d29716eb2c34073ac3629ea0
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/utils/Logger.ets
arkts
info
输出信息日志 @param message 日志信息
public static info(message: string): void { console.info(`[${Logger.TAG}] ${message}`); }
AST#method_declaration#Left public static info AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_ty...
public static info(message: string): void { console.info(`[${Logger.TAG}] ${message}`); }
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/utils/Logger.ets#L11-L13
91c597ed50ed3824ae91653bf1f79bce050cc9b4
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/variablewatch/src/main/ets/view/ProductView.ets
arkts
与父组件VariableWatchView建立双向数据同步
build() { Column() { SecondViews({ data: this.model.itemList}) } }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left SecondViews ( AST#component_parameters#Left { AST#compo...
build() { Column() { SecondViews({ data: this.model.itemList}) } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/variablewatch/src/main/ets/view/ProductView.ets#L24-L28
061f18191aa4771fe14eb378e1664d0911ee38f5
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/onlinesearch/OnlineSearchWordsView.ets
arkts
clearSearch
清空搜索
private clearSearch(): void { this.searchText = ''; this.searchResults = []; this.errorMessage = ''; }
AST#method_declaration#Left private clearSearch 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 AS...
private clearSearch(): void { this.searchText = ''; this.searchResults = []; this.errorMessage = ''; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/onlinesearch/OnlineSearchWordsView.ets#L267-L271
dee1fe8d5a4894bded5be70d80bb89a3b4ec05b9
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/ai-metrics-advisor/99.10.9/package/index.ets
arkts
toHex
处理16进制转换
function toHex(data: string): string { let bufferText = new TextEncoder().encode(data); return Array.from(bufferText) .map(byte => byte.toString(16).padStart(2, '0')) .join(''); }
AST#function_declaration#Left function toHex AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#...
function toHex(data: string): string { let bufferText = new TextEncoder().encode(data); return Array.from(bufferText) .map(byte => byte.toString(16).padStart(2, '0')) .join(''); }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/ai-metrics-advisor/99.10.9/package/index.ets#L46-L51
b32925c03dd582d4f533943a19752d93857e647b
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets
arkts
restoreLocalStorage
Read previous saved status from want if we are launched by appRecovery
restoreLocalStorage(want: Want): void { Logger.info(TAG, "RestoreLocalStorage String:${want.parameters['Page1Str']} Counter:${want.parameters['Page2Counter']}"); if (want.parameters !== undefined) { this.storage.setOrCreate<string>('FaultTriggerPageString', want.parameters['FaultTriggerPageString'] as st...
AST#method_declaration#Left restoreLocalStorage AST#parameter_list#Left ( AST#parameter#Left want : AST#type_annotation#Left AST#primary_type#Left Want AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R...
restoreLocalStorage(want: Want): void { Logger.info(TAG, "RestoreLocalStorage String:${want.parameters['Page1Str']} Counter:${want.parameters['Page2Counter']}"); if (want.parameters !== undefined) { this.storage.setOrCreate<string>('FaultTriggerPageString', want.parameters['FaultTriggerPageString'] as st...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets#L32-L39
d1d5011080ca60c8cb1a59ce05b01986ddfc7517
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/shortcut/ShortcutManager.ets
arkts
startPeriodicUpdate
启动定期更新
startPeriodicUpdate(): void { // 每天凌晨1点更新快捷方式 const scheduleUpdate = () => { const now = new Date(); const tomorrow = new Date(now); tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setHours(1, 0, 0, 0); const msUntilUpdate = tomorrow.getTime() - now.getTime(); setTimeout...
AST#method_declaration#Left startPeriodicUpdate AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { // 每天凌晨1点更新快捷方式 AST#statement#Left AST#variable_declaration#Left const AST#variable_decla...
startPeriodicUpdate(): void { const scheduleUpdate = () => { const now = new Date(); const tomorrow = new Date(now); tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setHours(1, 0, 0, 0); const msUntilUpdate = tomorrow.getTime() - now.getTime(); setTimeout(async () => { ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/shortcut/ShortcutManager.ets#L482-L501
942b06067bf6832daeda90fc754c78bb0edbda9d
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
startAutoThemeCheck
启动自动主题检查
private startAutoThemeCheck(): void { // 每小时检查一次 this.autoThemeTimer = setInterval(async () => { if (this.currentTheme && this.currentTheme.mode === ThemeMode.AUTO) { const isDark = this.isSystemDarkMode(); const targetTheme = isDark ? this.getDarkTheme() : this.getLightTheme(); ...
AST#method_declaration#Left private startAutoThemeCheck 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...
private startAutoThemeCheck(): void { this.autoThemeTimer = setInterval(async () => { if (this.currentTheme && this.currentTheme.mode === ThemeMode.AUTO) { const isDark = this.isSystemDarkMode(); const targetTheme = isDark ? this.getDarkTheme() : this.getLightTheme(); if ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L868-L887
ecd2a298aea5dd4bb0f1ff4406e928a619a27953
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/path_sensitive/explicit_jump_control/break_002_F.ets
arkts
Introduction 显式跳转控制-break
export function break_002_F(taint_src : string) { let res = '' for (let i = 0; i < 10; i++) { if (i === 3) { res = taint_src break } taint.Sink(res) } }
AST#export_declaration#Left export AST#function_declaration#Left function break_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { ...
export function break_002_F(taint_src : string) { let res = '' for (let i = 0; i < 10; i++) { if (i === 3) { res = taint_src break } taint.Sink(res) } }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/explicit_jump_control/break_002_F.ets#L6-L15
102584c9cb1d9136b08a7a263ca90b3b943db6b4
github
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/constants/AppConstants.ets
arkts
应用常量配置
export class AppConstants { // API地址配置 static readonly API_BASE_URL = 'http://192.168.2.57/prod-api'; static readonly WEBRTC_BASE_URL = 'http://192.168.2.57/webrtc-api'; static readonly CAMERA_BASE_URL = 'http://192.168.2.57/easy-api'; // API端点配置 static readonly API: ApiEndpoints = { SYSTEM_CHECK_FS:...
AST#export_declaration#Left export AST#class_declaration#Left class AppConstants AST#class_body#Left { // API地址配置 AST#property_declaration#Left static readonly API_BASE_URL = AST#expression#Left 'http://192.168.2.57/prod-api' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static rea...
export class AppConstants { static readonly API_BASE_URL = 'http://192.168.2.57/prod-api'; static readonly WEBRTC_BASE_URL = 'http://192.168.2.57/webrtc-api'; static readonly CAMERA_BASE_URL = 'http://192.168.2.57/easy-api'; static readonly API: ApiEndpoints = { SYSTEM_CHECK_FS: '/system/check/fs',...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/constants/AppConstants.ets#L64-L155
21d00135165ce05ff34d77f82d78d8f6a4094e25
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/NotificationUtil.ets
arkts
getActiveNotifications
获取当前应用未删除的通知列表。
static async getActiveNotifications(): Promise<Array<notificationManager.NotificationRequest>> { return notificationManager.getActiveNotifications(); }
AST#method_declaration#Left static async getActiveNotifications AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left...
static async getActiveNotifications(): Promise<Array<notificationManager.NotificationRequest>> { return notificationManager.getActiveNotifications(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NotificationUtil.ets#L353-L355
d67e5c93e6281a1e857986f49698a8aa2955059c
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/form.ets
arkts
validateForm
验证整个表单
private validateForm(): boolean { this.validateUsername() this.validatePassword() this.validateConfirmPassword() this.validateAddress() this.validateAgreement() return this.validation.username.valid && this.validation.password.valid && this.validation.confirmPassword.valid && this.v...
AST#method_declaration#Left private validateForm 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#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#...
private validateForm(): boolean { this.validateUsername() this.validatePassword() this.validateConfirmPassword() this.validateAddress() this.validateAgreement() return this.validation.username.valid && this.validation.password.valid && this.validation.confirmPassword.valid && this.v...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/form.ets#L179-L191
c3e43e38a8eb8366334a4d0e57bcfdb5bd4ff772
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets
arkts
unit8ArrayToStr
Uint8Array转字符串 @param src Uint8Array @returns 字符串
static unit8ArrayToStr(src: Uint8Array, encoding: buffer.BufferEncoding = 'utf-8'): string { const textDecoder = util.TextDecoder.create(encoding, { ignoreBOM: true }); const result = textDecoder.decodeToString(src, { stream: true }); return result; }
AST#method_declaration#Left static unit8ArrayToStr AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left encoding : AST#type_annotation#Left AST#primary_type#Left AST#qualifie...
static unit8ArrayToStr(src: Uint8Array, encoding: buffer.BufferEncoding = 'utf-8'): string { const textDecoder = util.TextDecoder.create(encoding, { ignoreBOM: true }); const result = textDecoder.decodeToString(src, { stream: true }); return result; }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets#L184-L188
fd6d7500c68852140722f21f67764e52f69b0334
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example4/ReusePage.ets
arkts
ReusePage
通过组件复用,加载每个月份的数据,当数据量较多时,快速滑动到底部,会出现掉帧的情况。
@Component export struct ReusePage { @State contentData: MonthDataSource = new MonthDataSource(); // 列表数据 nowDate: Date = new Date(); currentMonth: number = this.nowDate.getMonth() + 1; // 当前月份 currentDay: number = this.nowDate.getDate(); // 当前日 currentYear: number = this.nowDate.getFullYear(); // 当前年份 curr...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ReusePage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right contentData : AST#type_annotation#Left AST#primary_type#Left MonthDataSource AST#primary_type#Right AST#...
@Component export struct ReusePage { @State contentData: MonthDataSource = new MonthDataSource(); nowDate: Date = new Date(); currentMonth: number = this.nowDate.getMonth() + 1; currentDay: number = this.nowDate.getDate(); currentYear: number = this.nowDate.getFullYear(); currentWeekDay: number = new Da...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example4/ReusePage.ets#L90-L151
d84d01b5d3e2275d17414d1a1be65d3c11d53a04
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/DateUtils.ets
arkts
getDaysByMonth
获取指定月份的天数
static getDaysByMonth(year: number, month: number): number { if (month == 2) { if (DateUtils.isLeapYear(year)) { return 29; } else { return 28; } } else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { return 31; ...
AST#method_declaration#Left static getDaysByMonth AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#primary_...
static getDaysByMonth(year: number, month: number): number { if (month == 2) { if (DateUtils.isLeapYear(year)) { return 29; } else { return 28; } } else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { return 31; ...
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/DateUtils.ets#L176-L188
3fb3a0ef5c05e11f45b6f991bc0a09be28938623
gitee
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/theme/WanThemes.ets
arkts
获取主题 @param themeNum 0 light, 1 dark @returns
export function getWanTheme(themeNum: number): IWanTheme { if (themeNum = 0) { return new LightWanTheme() } else { return new DarkWanTheme() } }
AST#export_declaration#Left export AST#function_declaration#Left function getWanTheme AST#parameter_list#Left ( AST#parameter#Left themeNum : 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 A...
export function getWanTheme(themeNum: number): IWanTheme { if (themeNum = 0) { return new LightWanTheme() } else { return new DarkWanTheme() } }
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/theme/WanThemes.ets#L65-L71
aa71795588c13dc5bbd911fe66afe756415ee5f4
github
wuyuanwuhui999/harmony-arkts-movie-app-ui.git
d5e9bebe1dca2759cba417d2b6b402941d3bc273
entry/src/main/ets/components/MovieListComponent.ets
arkts
aboutToAppear
排列方向,vertical | horizontal
aboutToAppear() { this.movieItem = JSON.parse(this.movieItemStr) as MovieInterface; }
AST#method_declaration#Left aboutToAppear 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 . movieItem AST#member_expression#Righ...
aboutToAppear() { this.movieItem = JSON.parse(this.movieItemStr) as MovieInterface; }
https://github.com/wuyuanwuhui999/harmony-arkts-movie-app-ui.git/blob/d5e9bebe1dca2759cba417d2b6b402941d3bc273/entry/src/main/ets/components/MovieListComponent.ets#L53-L55
10cc959f223ca3540d27a64177f87325b7133aae
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/share/SharePage.ets
arkts
getPlatformIcon
辅助方法
private getPlatformIcon(platform: SharePlatform): Resource { const iconMap = { [SharePlatform.WECHAT]: $r('app.media.ic_wechat'), [SharePlatform.WECHAT_MOMENTS]: $r('app.media.ic_wechat_moments'), [SharePlatform.QQ]: $r('app.media.ic_qq'), [SharePlatform.QQ_ZONE]: $r('app.media.ic_qq_zone'),...
AST#method_declaration#Left private getPlatformIcon AST#parameter_list#Left ( AST#parameter#Left platform : AST#type_annotation#Left AST#primary_type#Left SharePlatform AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Resour...
private getPlatformIcon(platform: SharePlatform): Resource { const iconMap = { [SharePlatform.WECHAT]: $r('app.media.ic_wechat'), [SharePlatform.WECHAT_MOMENTS]: $r('app.media.ic_wechat_moments'), [SharePlatform.QQ]: $r('app.media.ic_qq'), [SharePlatform.QQ_ZONE]: $r('app.media.ic_qq_zone'),...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/share/SharePage.ets#L532-L545
1c0505c4a830dffa9c13385f6f5127b6ea120c9c
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/livedetectionandencryptiond/src/main/ets/pages/LiveDetectionAndEncryptionPage.ets
arkts
aboutToAppear
每次页面显示查询活体检测结果,未进行活体检测imageData值为undefined不处理
aboutToAppear() { this.timeoutId = setInterval(() => { // TODO: 活体检测窗口打开及关闭时不会触发自定义组件生命周期函数,所以此处需要使用定时器轮询检测结果 this.getDetectionResult(); }, 500); }
AST#method_declaration#Left aboutToAppear 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 . timeoutId AST#member_expression#Righ...
aboutToAppear() { this.timeoutId = setInterval(() => { this.getDetectionResult(); }, 500); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/livedetectionandencryptiond/src/main/ets/pages/LiveDetectionAndEncryptionPage.ets#L56-L61
90f9ae89be22660cc8cc06643d8c70da08845154
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/builder/Builder0070.ets
arkts
funBuilder0070
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...
@Builder function funBuilder0070(msg: string) { Text(msg) .id('tvBuilder0070GlobalBuilder') .onClick(()=>{ msg = 'HelloWorld' }) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function funBuilder0070 AST#parameter_list#Left ( AST#parameter#Left msg : 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#bu...
@Builder function funBuilder0070(msg: string) { Text(msg) .id('tvBuilder0070GlobalBuilder') .onClick(()=>{ msg = 'HelloWorld' }) }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/builder/Builder0070.ets#L16-L23
ade6c74a0d76a0086759ff434a70d6ddca68b5b8
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderDetailPage.ets
arkts
getRefundAmount
获取退款金额 @returns {number} 退款金额
private getRefundAmount(order: Order): number { return order.refund?.amount ?? 0; }
AST#method_declaration#Left private getRefundAmount AST#parameter_list#Left ( AST#parameter#Left order : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primar...
private getRefundAmount(order: Order): number { return order.refund?.amount ?? 0; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L456-L458
090044ef767e0cac73c715b09819e5548a64367e
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ComposeListItem.d.ets
arkts
Declare OperateItem @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare OperateItem @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11 Declare OperateItem @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 20
export declare class OperateItem { /** * Sets the icon. * @type { ?OperateIcon } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Sets the icon. * @type { ?OperateIcon } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ /** * Sets the i...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class OperateItem AST#class_body#Left { /** * Sets the icon. * @type { ?OperateIcon } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Sets the icon. * @type { ?OperateIcon } * @s...
export declare class OperateItem { icon?: OperateIcon; subIcon?: OperateIcon; button?: OperateButton; switch?: OperateCheck; checkbox?: OperateCheck; radio?: OperateCheck; image?: ResourceStr; symbolStyle?: SymbolGlyphModifier; ...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ComposeListItem.d.ets#L738-L962
4d09301959686332e5b1b7b44cae524735b4275b
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/Transformer.ets
arkts
Transformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards. @author Philipp Jahoda
export default class Transformer { /** * matrix to map the values to the screen pixels */ protected mMatrixValueToPx: Matrix = new Matrix(); /** * matrix for handling the different offsets of the chart */ protected mMatrixOffset: Matrix = new Matrix(); protected mViewPortHandler: ViewPortHandler;...
AST#export_declaration#Left export default AST#class_declaration#Left class Transformer AST#class_body#Left { /** * matrix to map the values to the screen pixels */ AST#property_declaration#Left protected mMatrixValueToPx : AST#type_annotation#Left AST#primary_type#Left Matrix AST#primary_type#Right AST#type_anno...
export default class Transformer { protected mMatrixValueToPx: Matrix = new Matrix(); protected mMatrixOffset: Matrix = new Matrix(); protected mViewPortHandler: ViewPortHandler; constructor(viewPortHandler: ViewPortHandler) { this.mViewPortHandler = viewPortHandler; } public prepareMatrixVa...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/Transformer.ets#L33-L409
038cd96f25293b6a693f8916dc28d5a00347bb9d
gitee
wuyukobe24/HMApp_ArkTS.git
6d09d9b07a4fdc4713e5a13b61b85bc1e7893956
entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets
arkts
loadHomeRequestIconData
获取首页金刚区数据【使用三方库Net进行网络请求,使用requestString对获取的json数据自己进行数据解析】
loadHomeRequestIconData(success:(str:string)=>void, fail:(error:NetError)=>void) { let param:Record<string, string> = { "game":"game_zone", "priority":"5", "favzone":"", "subChannel":"1", "slidetype":"0", "next":"0", } let url:string = '/go/zone/icon_card' getRequest(...
AST#method_declaration#Left loadHomeRequestIconData AST#parameter_list#Left ( AST#parameter#Left success : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#paramet...
loadHomeRequestIconData(success:(str:string)=>void, fail:(error:NetError)=>void) { let param:Record<string, string> = { "game":"game_zone", "priority":"5", "favzone":"", "subChannel":"1", "slidetype":"0", "next":"0", } let url:string = '/go/zone/icon_card' getRequest(...
https://github.com/wuyukobe24/HMApp_ArkTS.git/blob/6d09d9b07a4fdc4713e5a13b61b85bc1e7893956/entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets#L47-L63
a9a50f29d32363992b13c60b0b73b782c8122a7c
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/util/src/main/ets/notification/NotificationUtil.ets
arkts
多行文本通知配置项(适用于多条文本列表式通知)
export interface NotificationMultiLineOptions extends NotificationBasicOptions { /** 通知摘要文本(对多行内容的总结,不可为空字符串) */ summaryText: string; /** 通知展开时显示的标题(不可为空字符串) */ expandedDisplayTitle: string; /** 通知的多行文本内容列表(每行对应一条文本) */ multiLineContentList: Array<string>; }
AST#export_declaration#Left export AST#interface_declaration#Left interface NotificationMultiLineOptions AST#extends_clause#Left extends NotificationBasicOptions AST#extends_clause#Right AST#object_type#Left { /** 通知摘要文本(对多行内容的总结,不可为空字符串) */ AST#type_member#Left summaryText : AST#type_annotation#Left AST#primary_type#L...
export interface NotificationMultiLineOptions extends NotificationBasicOptions { summaryText: string; expandedDisplayTitle: string; multiLineContentList: Array<string>; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/notification/NotificationUtil.ets#L574-L581
a878791ba9a60412af186c553e9014e9dd78f54b
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/DES.ets
arkts
encodeECB
加密-ECB模式 @param str 待加密的字符串 @param desKey 3DES密钥 @returns
static async encodeECB(str: string, desKey: string): Promise<OutDTO<string>> { return CryptoUtil.encodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192); }
AST#method_declaration#Left static async encodeECB AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left desKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary...
static async encodeECB(str: string, desKey: string): Promise<OutDTO<string>> { return CryptoUtil.encodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/DES.ets#L42-L44
fdb891d243724205e32c470da8133ad8e12e339a
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/LoadingBuilderProxy.ets
arkts
加载弹窗代理
export class LoadingBuilderProxy extends BaseLoadingBuilderProxy<ILoadingOptions, LoadingDialog,ILoadingDialogStyle> { constructor(content?: string,uiContext?: UIContext) { super(uiContext) this.builderOptions.content = content } create(options: ILoadingOptions) { return new LoadingDialog(options); ...
AST#export_declaration#Left export AST#class_declaration#Left class LoadingBuilderProxy extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BaseLoadingBuilderProxy AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ILoadingOptions AST#primary_type#Right AST#type_annotation...
export class LoadingBuilderProxy extends BaseLoadingBuilderProxy<ILoadingOptions, LoadingDialog,ILoadingDialogStyle> { constructor(content?: string,uiContext?: UIContext) { super(uiContext) this.builderOptions.content = content } create(options: ILoadingOptions) { return new LoadingDialog(options); ...
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/LoadingBuilderProxy.ets#L9-L18
3181a237798c27d8279e0f4c97f81a1c8a6169ce
github
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
product/oh/base/src/main/ets/pages/index.ets
arkts
performCheckNewVersion
开始进行手动新版本检测 通过checkNewVersion()方法
private async performCheckNewVersion(): Promise<void> { this.log('checkNewVersion starting manually'); let upgradeData: UpgradeData<update.CheckResult> = await OtaUpdateManager.getInstance().checkNewVersion(); if (upgradeData.callResult == UpgradeCallResult.OK) { this.log('handle checkNewVersion:' + J...
AST#method_declaration#Left private async performCheckNewVersion 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#Ri...
private async performCheckNewVersion(): Promise<void> { this.log('checkNewVersion starting manually'); let upgradeData: UpgradeData<update.CheckResult> = await OtaUpdateManager.getInstance().checkNewVersion(); if (upgradeData.callResult == UpgradeCallResult.OK) { this.log('handle checkNewVersion:' + J...
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/product/oh/base/src/main/ets/pages/index.ets#L145-L175
6043dc20022473fba653eb6b50bbe8fadd87c8ab
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
entry/src/main/ets/pages/example/lottie/LottieView.ets
arkts
setSubframe
设置是否尽可能地更新动画帧率 @param useSubFrames 默认值是true, 值为true时尽可能的更新动画帧率, 值为false时尊重原始AE fps @since 8 @design
setSubframe(useSubFrames: boolean) { this.animationItem?.setSubframe(useSubFrames) }
AST#method_declaration#Left setSubframe AST#parameter_list#Left ( AST#parameter#Left useSubFrames : 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#builder_function_body#Left { AST#expression_statement#Left AST#ex...
setSubframe(useSubFrames: boolean) { this.animationItem?.setSubframe(useSubFrames) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/pages/example/lottie/LottieView.ets#L280-L282
d3134994ca9b0988d20f2cca2600c86f15efbac8
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Card/MovieCard/entry/src/main/ets/common/datasource/DataSource.ets
arkts
Classes required for LazyForEach loading.
export default class DataSource<T> implements IDataSource { private listData: T[]; constructor(listData: T[]) { this.listData = listData; } totalCount() { return this.listData.length; } getData(index: number) { return this.listData[index]; } registerDataChangeListener() { } unregist...
AST#export_declaration#Left export default AST#class_declaration#Left class DataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Le...
export default class DataSource<T> implements IDataSource { private listData: T[]; constructor(listData: T[]) { this.listData = listData; } totalCount() { return this.listData.length; } getData(index: number) { return this.listData[index]; } registerDataChangeListener() { } unregist...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Card/MovieCard/entry/src/main/ets/common/datasource/DataSource.ets#L19-L39
2274abbec6058ecaf29b687939310adcfb4a954e
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/OneWayTlsWorker.ets
arkts
loadCA
[Start one-way_authentication_via_tls_socket] 读取 CA 证书
function loadCA(fileUri: string) { try { let buf = new ArrayBuffer(1024 * 4); let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY); let readLen = fs.readSync(file.fd, buf, { offset: 0 }); let caContent = buf2String(buf.slice(0, readLen)); fs.closeSync(file); workerPort.postMessage({ type: '...
AST#function_declaration#Left function loadCA 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#Left ...
function loadCA(fileUri: string) { try { let buf = new ArrayBuffer(1024 * 4); let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY); let readLen = fs.readSync(file.fd, buf, { offset: 0 }); let caContent = buf2String(buf.slice(0, readLen)); fs.closeSync(file); workerPort.postMessage({ type: '...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/OneWayTlsWorker.ets#L82-L94
9560e5ee36d9e3a8c987398c5085e9754cb55531
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/data/DetailCommon.ets
arkts
FPS丢帧占比类 @param key @param value @param percent
export class FpsLostFrame { public key: string; public value: string; public percent: string; public color: Resource; constructor(key: string, value: string, percent: string, color: Resource) { this.key = key; this.value = value; this.percent = percent; this.color = color; } }
AST#export_declaration#Left export AST#class_declaration#Left class FpsLostFrame AST#class_body#Left { AST#property_declaration#Left public key : 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 public v...
export class FpsLostFrame { public key: string; public value: string; public percent: string; public color: Resource; constructor(key: string, value: string, percent: string, color: Resource) { this.key = key; this.value = value; this.percent = percent; this.color = color; } }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/data/DetailCommon.ets#L22-L34
570568bf673ae587b1a6adc170ed4767ab4e022d
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_bookmarks.ets
arkts
reconstruct_cached_plain_bookmarks
Reconstruct plain bookmarks and store in a cache array as a member variable of this bunch_of_bookmarks. @summary So that requests can be satisfied with this cached data in stead of another reconstruction which consumes another a lot of performance and time.
reconstruct_cached_plain_bookmarks() { let t0 = Date.now(); this.cached_plain_bookmarks = this.root.get_plain_bookmarks(); console.log(`[bunch_of_bookmarks][plain_bookmarks] Reconstructed plain bookmarks! length: ${this.cached_plain_bookmarks.length} (Used ${(Date.now() - t0)} ms)`); }
AST#method_declaration#Left reconstruct_cached_plain_bookmarks AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left t0 = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Lef...
reconstruct_cached_plain_bookmarks() { let t0 = Date.now(); this.cached_plain_bookmarks = this.root.get_plain_bookmarks(); console.log(`[bunch_of_bookmarks][plain_bookmarks] Reconstructed plain bookmarks! length: ${this.cached_plain_bookmarks.length} (Used ${(Date.now() - t0)} ms)`); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_bookmarks.ets#L28-L32
2802299a0d774cb0754e3cd27e6de92421a9cc32
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/navigation/UserGraph.ets
arkts
register
注册用户模块导航路由
register(): void { RouteBuild.register(UserRoutes.Profile, wrapBuilder(ProfileNav)); RouteBuild.register(UserRoutes.AddressList, wrapBuilder(AddressListNav)); RouteBuild.register(UserRoutes.AddressDetail, wrapBuilder(AddressDetailNav)); RouteBuild.register(UserRoutes.Footprint, wrapBuilder(FootprintNav)...
AST#method_declaration#Left register 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#Left...
register(): void { RouteBuild.register(UserRoutes.Profile, wrapBuilder(ProfileNav)); RouteBuild.register(UserRoutes.AddressList, wrapBuilder(AddressListNav)); RouteBuild.register(UserRoutes.AddressDetail, wrapBuilder(AddressDetailNav)); RouteBuild.register(UserRoutes.Footprint, wrapBuilder(FootprintNav)...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/navigation/UserGraph.ets#L16-L21
a5ec2ac3344b754e27a2f38fb5aa28846b1851db
github
devaige/HarmonyOSOfficialDemo.git
8b939116592cbc4e1c1b2e4f0b8fc4a57fde0f8c
RankingDemo/entry/src/main/ets/view/ListItemComponent.ets
arkts
build 函数以声明式的方式描述该组件的 UI 结构。
build() { // 下述代码中的 Row、Column、Text 等都是内置组件,由 SDK 自带提供。 Row() { Column() { if (this.isRenderCircleText()) { if (this.index !== undefined) { this.CircleText(this.index); } } else { Text(this.index?.toString()) .lineHeight(ItemStyle.TEXT_...
AST#build_method#Left build ( ) AST#build_body#Left { // 下述代码中的 Row、Column、Text 等都是内置组件,由 SDK 自带提供。 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 ( ) A...
build() { Row() { Column() { if (this.isRenderCircleText()) { if (this.index !== undefined) { this.CircleText(this.index); } } else { Text(this.index?.toString()) .lineHeight(ItemStyle.TEXT_LAYOUT_SIZE) .textAlign(TextAlign...
https://github.com/devaige/HarmonyOSOfficialDemo.git/blob/8b939116592cbc4e1c1b2e4f0b8fc4a57fde0f8c/RankingDemo/entry/src/main/ets/view/ListItemComponent.ets#L35-L72
1fd46acc0076cce9ce18710104bbedacf958217b
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/toolbox/src/main/ets/model/DragListener.ets
arkts
拖拽监听器
export interface DragListener { /** * 拖拽开始回调 * @param {GestureEvent} event - 手势事件 */ onActionStart: (event: GestureEvent) => void; /** * 拖拽过程回调 * @param {GestureEvent} event - 手势事件 */ onActionUpdate: (event: GestureEvent) => void; /** * 拖拽结束回调 * @param {GestureEvent} event - 手势事件 */...
AST#export_declaration#Left export AST#interface_declaration#Left interface DragListener AST#object_type#Left { /** * 拖拽开始回调 * @param {GestureEvent} event - 手势事件 */ AST#type_member#Left onActionStart : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left event : AST#type...
export interface DragListener { onActionStart: (event: GestureEvent) => void; onActionUpdate: (event: GestureEvent) => void; onActionEnd: (event: GestureEvent) => void; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/src/main/ets/model/DragListener.ets#L20-L36
94d6187f088bea9c83b289b322a37ddcf36548da
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/strings/StringCrypto.ets
arkts
md5
计算字符串的 MD5 哈希值 @param input 输入字符串 @returns 十六进制格式的哈希值
static async md5(input: string): Promise<string> { return StringCrypto._computeHash(input, 'MD5'); }
AST#method_declaration#Left static async md5 AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left P...
static async md5(input: string): Promise<string> { return StringCrypto._computeHash(input, 'MD5'); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringCrypto.ets#L36-L38
6e5e7d170965d5ee10477b27f3b352c6ba0bd846
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_core/src/main/ets/core/base/OutDTO.ets
arkts
create
创建空实例 @returns
static create(): OutDTO<string> { let outDTO = new OutDTO<string>(true, '', '', [], 200); return outDTO; }
AST#method_declaration#Left static create AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_argumen...
static create(): OutDTO<string> { let outDTO = new OutDTO<string>(true, '', '', [], 200); return outDTO; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/base/OutDTO.ets#L54-L57
085400a61f69a9a5709f48f4335666cb40447cff
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets
arkts
message
提示内容(可选) @description 支持字符串或Resource
message(message: ResourceStr) { this.builderOptions.message = message return this }
AST#method_declaration#Left message AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Lef...
message(message: ResourceStr) { this.builderOptions.message = message return this }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets#L19-L22
1ac221fff73fc6b1683601f3f866223bdfbd5277
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/services/settings/SettingsService.ets
arkts
migrateSettings
迁移设置 @param oldSettings 旧版本设置 @returns 迁移后的设置
private migrateSettings(oldSettings: AppSettings): AppSettings { // 创建默认设置作为基础 const defaultSettings = this.createDefaultSettings(); // 合并旧设置(保留现有配置) const migratedSettings: AppSettings = { version: BusinessConstants.SETTINGS_VERSION, language: oldSettings.language ?? defaultSettings.la...
AST#method_declaration#Left private migrateSettings AST#parameter_list#Left ( AST#parameter#Left oldSettings : AST#type_annotation#Left AST#primary_type#Left AppSettings AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AppSe...
private migrateSettings(oldSettings: AppSettings): AppSettings { const defaultSettings = this.createDefaultSettings(); const migratedSettings: AppSettings = { version: BusinessConstants.SETTINGS_VERSION, language: oldSettings.language ?? defaultSettings.language, theme: oldSetti...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/settings/SettingsService.ets#L831-L855
f30d5faed971bc552ea100e4b9c73170c49dc4b2
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/CryptoUtil.ets
arkts
generateSymKey
生成对称密钥SymKey,异步 @param algName 待生成对称密钥生成器的算法名称(AES128、AES192、AES256、3DES192、SM4_128、HMAC、HMAC|SHA1、HMAC|SHA256、HMAC|SHA512、HMAC|SM3、等) @returns
static async generateSymKey(algName: string): Promise<cryptoFramework.SymKey> { let symKeyGenerator = cryptoFramework.createSymKeyGenerator(algName); //创建对称密钥生成器 let symKey = await symKeyGenerator.generateSymKey(); //获取该对称密钥生成器随机生成的密钥 return symKey; }
AST#method_declaration#Left static async generateSymKey AST#parameter_list#Left ( AST#parameter#Left algName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generi...
static async generateSymKey(algName: string): Promise<cryptoFramework.SymKey> { let symKeyGenerator = cryptoFramework.createSymKeyGenerator(algName); let symKey = await symKeyGenerator.generateSymKey(); return symKey; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L100-L104
bc40f709bb69df3d063d11e0204036aa99af7ad8
gitee
huangwei021230/HarmonyFlow.git
427f918873b0c9efdc975ff4889726b1bfccc546
entry/src/main/ets/lib/io/FsFile.ets
arkts
subFile
Helper function to get a subfile of a directory. @param relPath The relative path of the subfile. @returns The subfile.
function subFile(dir: FsDir, relPath: string): FsFile { return fs.file(dir, relPath); }
AST#function_declaration#Left function subFile AST#parameter_list#Left ( AST#parameter#Left dir : AST#type_annotation#Left AST#primary_type#Left FsDir AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left relPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_typ...
function subFile(dir: FsDir, relPath: string): FsFile { return fs.file(dir, relPath); }
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/io/FsFile.ets#L27-L29
654fe552ea5e850ca9d7d2d03b4538e87150faf8
github
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets
arkts
Defines icon options. @interface IconOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface IconOptions { /** * Image resource. * * @type { ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ src: ResourceStr; /** * Image size option. * * @type { ?SizeOptions } * @sys...
AST#export_declaration#Left export AST#interface_declaration#Left interface IconOptions AST#object_type#Left { /** * Image resource. * * @type { ResourceStr } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#type_member#Left src : A...
export interface IconOptions { src: ResourceStr; size?: SizeOptions; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets#L30-L51
8446b936be641900d3b1e4794f85e16a48f4b3eb
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageEntertainment.ets
arkts
PageEntertainment
Tab content of entertainment.
@Component export struct PageEntertainment { build() { Column() { Text($r('app.string.entertainment')) .height(CommonConstants.FULL_HEIGHT) .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) } .width(CommonConstants.FULL_WIDTH) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct PageEntertainment AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_bod...
@Component export struct PageEntertainment { build() { Column() { Text($r('app.string.entertainment')) .height(CommonConstants.FULL_HEIGHT) .fontSize(CommonConstants.FONT_SIZE_PAGE_CONTENT) .fontWeight(CommonConstants.FONT_WEIGHT_LIGHT) } .width(CommonConstants.FULL_WIDTH) ...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SwiperArkTS/entry/src/main/ets/view/tabcontent/PageEntertainment.ets#L21-L33
e578eb76c82ac871740d6aa598fd58ca425a5d7e
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/entry/src/main/ets/pages/Index.ets
arkts
avPlay
(可选)当需要不显示字幕的时候,使用视频播放的AVPlayer实例注销字幕回调函数 async avTurnOffSubtitle() { this.avPlayer?.off('subtitleUpdate'); }
avPlay(): void { if (this.avPlayer) { try { this.avPlayer.play(); } catch (e) { console.error(`${this.tag}: avPlay = ${JSON.stringify(e)}`); } } }
AST#method_declaration#Left avPlay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expre...
avPlay(): void { if (this.avPlayer) { try { this.avPlayer.play(); } catch (e) { console.error(`${this.tag}: avPlay = ${JSON.stringify(e)}`); } } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Media/AVPlayer/AVPlayerArkTSSubtitle/entry/src/main/ets/pages/Index.ets#L139-L147
6e5d1f5e3a3e1581f2a578bb04a1e828959981ca
gitee
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
setting/src/main/ets/views/DotSheetBind.ets
arkts
darkModeChange
监听语言模式变化
@Monitor('appGeneralData.colorModeId') darkModeChange() { if (this.appGeneralData.colorModeId === 0) { application.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } else if (this.appGeneralData.colorModeId === 1) { application.getApplicationContext().setCo...
AST#method_declaration#Left AST#decorator#Left @ Monitor ( AST#expression#Left 'appGeneralData.colorModeId' AST#expression#Right ) AST#decorator#Right darkModeChange 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#expressio...
@Monitor('appGeneralData.colorModeId') darkModeChange() { if (this.appGeneralData.colorModeId === 0) { application.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } else if (this.appGeneralData.colorModeId === 1) { application.getApplicationContext().setCo...
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/setting/src/main/ets/views/DotSheetBind.ets#L132-L141
344bb205a87c77905f2c02d0ad64e152bb59b111
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Alarm/PermissionManager.ets
arkts
getAccessTokenIdSync
同步获取应用的访问令牌ID(类似Kotlin中的同步方法) @returns 应用的唯一令牌ID @throws 获取失败时抛出错误
private static getAccessTokenIdSync(): number { try { // 组合标志位获取完整包信息 const flags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA; // 同步获取当前应用包信息 const info = bundleManager.getBundleInfoForSelfSync(flags); retur...
AST#method_declaration#Left private static getAccessTokenIdSync 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#try_statement#Left try AST#block_statement#Left ...
private static getAccessTokenIdSync(): number { try { const flags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION | bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_METADATA; const info = bundleManager.getBundleInfoForSelfSync(flags); return info.appInfo.accessTokenId;...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Alarm/PermissionManager.ets#L56-L67
b8a84b3287092bff79b83318766e846004f4a53b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/ContactsPage.ets
arkts
buildFilterChip
构建筛选标签
@Builder buildFilterChip(label: string, value: string, count: number) { Button(`${label}(${count})`) .type(ButtonType.Capsule) .fontSize(14) .fontColor(this.selectedFilter === value ? '#ffffff' : '#666666') .backgroundColor(this.selectedFilter === value ? '#007AFF' : '#f0f0f0') .heig...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildFilterChip AST#parameter_list#Left ( AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Le...
@Builder buildFilterChip(label: string, value: string, count: number) { Button(`${label}(${count})`) .type(ButtonType.Capsule) .fontSize(14) .fontColor(this.selectedFilter === value ? '#ffffff' : '#666666') .backgroundColor(this.selectedFilter === value ? '#007AFF' : '#f0f0f0') .heig...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/ContactsPage.ets#L252-L263
19ec186bf7fbe73f36058028b03d064224662eea
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/tabcontentoverflow/src/main/ets/common/Utils.ets
arkts
通用功能类
export class Utils { // 点击未开发功能按钮弹出提示函数 showPromptAction() { promptAction.showToast({ message: $r('app.string.tabcontentoverflow_toast_message'), duration: CONFIGURATION.TABCONTENT_OVERFLOW_DURATION }); } }
AST#export_declaration#Left export AST#class_declaration#Left class Utils AST#class_body#Left { // 点击未开发功能按钮弹出提示函数 AST#method_declaration#Left showPromptAction AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left...
export class Utils { showPromptAction() { promptAction.showToast({ message: $r('app.string.tabcontentoverflow_toast_message'), duration: CONFIGURATION.TABCONTENT_OVERFLOW_DURATION }); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/tabcontentoverflow/src/main/ets/common/Utils.ets#L22-L30
ea668dc2218d1bd95f2d88d4cc00660347897683
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/user/src/main/ets/navigation/UserGraph.ets
arkts
@file 用户模块导航图 @author Joker.X
export class UserGraph implements RouteGraph { /** * 注册用户模块导航路由 * @returns {void} 无返回值 */ register(): void { RouteBuild.register(UserRoutes.Profile, wrapBuilder(ProfileNav)); } }
AST#export_declaration#Left export AST#class_declaration#Left class UserGraph AST#implements_clause#Left implements RouteGraph AST#implements_clause#Right AST#class_body#Left { /** * 注册用户模块导航路由 * @returns {void} 无返回值 */ AST#method_declaration#Left register AST#parameter_list#Left ( ) AST#parameter_list#Right :...
export class UserGraph implements RouteGraph { register(): void { RouteBuild.register(UserRoutes.Profile, wrapBuilder(ProfileNav)); } }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/user/src/main/ets/navigation/UserGraph.ets#L9-L17
cc6fcfb9724a58fc3a18bf23f63b3832377a0e1d
github
YueHua46/ArkTS_Learn.git
5c08d3016421c69c299f7cb757df686f277889ac
entry/src/main/ets/pages/RankPage.ets
arkts
aboutToAppear
生命周期 1.即将出现(在这里可以申请定时器资源等监听事件)
aboutToAppear() { console.log("${TAG} aboutToAppear"); }
AST#method_declaration#Left aboutToAppear 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 console AST#expression#Right . log AST#member_expr...
aboutToAppear() { console.log("${TAG} aboutToAppear"); }
https://github.com/YueHua46/ArkTS_Learn.git/blob/5c08d3016421c69c299f7cb757df686f277889ac/entry/src/main/ets/pages/RankPage.ets#L21-L23
ff70a3703a6453c78db194861cccba84268b1295
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/Main.ets
arkts
MenuItemWithAction
带点击事件的菜单项组件
@Builder MenuItemWithAction(title: string, icon: string, action: () => void) { Row() { Text(icon) .fontSize(24) .margin({ right: 12 }) Text(title) .fontSize(16) .fontColor('#333333') .layoutWeight(1) Text('›') .fontSize(24) .f...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right MenuItemWithAction AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left icon : AST#type_annotation#...
@Builder MenuItemWithAction(title: string, icon: string, action: () => void) { Row() { Text(icon) .fontSize(24) .margin({ right: 12 }) Text(title) .fontSize(16) .fontColor('#333333') .layoutWeight(1) Text('›') .fontSize(24) .f...
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/Main.ets#L1676-L1697
6dd3afb9737f096d2e1ca47a8a04278b8d8f26c1
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/radio/radioCheckedBackgroundColor.ets
arkts
RadioCheckedBackgroundColorBuilder
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Builder export function RadioCheckedBackgroundColorBuilder(name: string, param: Object) { RadioCheckedBackgroundColorExample() }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function RadioCheckedBackgroundColorBuilder 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#p...
@Builder export function RadioCheckedBackgroundColorBuilder(name: string, param: Object) { RadioCheckedBackgroundColorExample() }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/radio/radioCheckedBackgroundColor.ets#L16-L19
175ed64ecced6c3fc9a192da9e510e1d9f960558
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setAxisMinValue
Use setAxisMinimum(...) instead. @param min
public setAxisMinValue(min: number): void { this.setAxisMinimum(min); }
AST#method_declaration#Left public setAxisMinValue AST#parameter_list#Left ( AST#parameter#Left min : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_ty...
public setAxisMinValue(min: number): void { this.setAxisMinimum(min); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L744-L746
ee889de5f2e9d26371af368c75e8ba3228fdbd31
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ObjectPool.ets
arkts
create
Returns an ObjectPool instance, of a given starting capacity, that recycles instances of a given Poolable object. @param withCapacity A positive integer value. @param object An instance of the object that the pool should recycle. @return
public static create(withCapacity: number, object: Poolable) { let result = new ObjectPool<Poolable>(withCapacity, object); result.poolId = ObjectPool.ids; ObjectPool.ids++; return result; }
AST#method_declaration#Left public static create AST#parameter_list#Left ( AST#parameter#Left withCapacity : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left object : AST#type_annotation#Left AST#primary_type#Left Poolable AS...
public static create(withCapacity: number, object: Poolable) { let result = new ObjectPool<Poolable>(withCapacity, object); result.poolId = ObjectPool.ids; ObjectPool.ids++; return result; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ObjectPool.ets#L56-L62
8752983219df56ddfaec4dc91a9f1ea44cb25b18
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/util/DynamicSyncUtil.ets
arkts
hmac
消息认证码计算 @param str 计算字符串 @param symAlgName 秘钥规格 @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 @returns
static hmac(str: string, symAlgName: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { //创建消息认证码计算器 let mac = crypto.createMac(symAlgName); let messageData = new Uint8Array(buffer.from(str, 'utf-8').buffer); let updateLength = 200; // 默认以200字节为单位进行分段update let symKeyGener...
AST#method_declaration#Left static hmac AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symAlgName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#R...
static hmac(str: string, symAlgName: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { let mac = crypto.createMac(symAlgName); let messageData = new Uint8Array(buffer.from(str, 'utf-8').buffer); let updateLength = 200; let symKeyGenerator = crypto.createSymKeyGenerator(...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/DynamicSyncUtil.ets#L86-L105
cea127c80da69a8d7af82581a1afcebcac61d175
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/arkts/@arkts.collections.d.ets
arkts
getLastIndexOf
Locates the last occurrence of a certain bit value within a range of bits in a bit vector. @param { number } element - Element to be Located (0 means 0, else means 1). @param { number } fromIndex - The starting position of the index, containing the value at that index position. @param { number } toIndex - The end of t...
getLastIndexOf(element: number, fromIndex: number, toIndex: number): number;
AST#method_declaration#Left getLastIndexOf AST#parameter_list#Left ( AST#parameter#Left element : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fromIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_...
getLastIndexOf(element: number, fromIndex: number, toIndex: number): number;
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.collections.d.ets#L5615-L5615
3cc3fd80d13bff2a4c4d63242128ed9e885f63fa
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/DeviceUtil.ets
arkts
getODID
获取开发者匿名设备标识符,ODID。
static getODID(): string { return deviceInfo.ODID; }
AST#method_declaration#Left static getODID AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expressio...
static getODID(): string { return deviceInfo.ODID; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DeviceUtil.ets#L99-L101
e641e492d42080144e750954d0188bff6443faa6
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/ChatLog.ets
arkts
toRow
Convert to database row format
toRow(): ChatLogData { return { date: this.date, content: this.content, is_user: this.isUser ? 1 : 0, emotion: this.emotion, timestamp: this.timestamp }; }
AST#method_declaration#Left toRow AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ChatLogData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left ...
toRow(): ChatLogData { return { date: this.date, content: this.content, is_user: this.isUser ? 1 : 0, emotion: this.emotion, timestamp: this.timestamp }; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/ChatLog.ets#L70-L78
0c7c82f641ca8ae8003bac934344cebb91b34502
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
entry/src/main/ets/pages/example/debug/DebugPanelDialog.ets
arkts
@author open_9527 @date 2025/10/31 @desc DebugPanelDialog
export interface DebugPanelDialogParams extends PromptSettings { title?: string cancelClick?: () => void confirmClick?: () => void }
AST#export_declaration#Left export AST#interface_declaration#Left interface DebugPanelDialogParams AST#extends_clause#Left extends PromptSettings AST#extends_clause#Right AST#object_type#Left { AST#type_member#Left title ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotatio...
export interface DebugPanelDialogParams extends PromptSettings { title?: string cancelClick?: () => void confirmClick?: () => void }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/pages/example/debug/DebugPanelDialog.ets#L29-L33
b6561ae82e6689ab10456a5e339300d0eefea526
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/selecttextmenu/src/main/ets/view/SelectTextMenu.ets
arkts
selectMenuChange
监听到选中按钮发生改变时触发相应方法
selectMenuChange() { promptAction.showToast({ message: $r('app.string.select_text_menu_tips') }); }
AST#method_declaration#Left selectMenuChange AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left promptAction AST#expression#Right . showToast A...
selectMenuChange() { promptAction.showToast({ message: $r('app.string.select_text_menu_tips') }); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/selecttextmenu/src/main/ets/view/SelectTextMenu.ets#L124-L128
7973ff7c2494d60572f2a9d4709e328bd65c5411
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
isDirectory
判断文件是否是目录。 @param file string|number 文件应用沙箱路径path或已打开的文件描述符fd。 @returns
static isDirectory(file: string | number): boolean { return fs.statSync(file).isDirectory(); }
AST#method_declaration#Left static isDirectory AST#parameter_list#Left ( AST#parameter#Left file : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) A...
static isDirectory(file: string | number): boolean { return fs.statSync(file).isDirectory(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L285-L287
9b74bcecd955fbace9eb1f34785212a2303c5021
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets
arkts
send
采集到的音频流直接发送到socket服务端
private async send(buffer: ArrayBuffer): Promise<void> { Logger.info(TAG, `send buffer`); if (this.mSocketImpl) { await this.mSocketImpl.sendData(buffer); } }
AST#method_declaration#Left private async send AST#parameter_list#Left ( AST#parameter#Left buffer : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_typ...
private async send(buffer: ArrayBuffer): Promise<void> { Logger.info(TAG, `send buffer`); if (this.mSocketImpl) { await this.mSocketImpl.sendData(buffer); } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/BufferModel.ets#L260-L265
7adf4927d8bffbfb073197d64872f39f602901fd
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets
arkts
makeNode
Create nodes
makeNode(uiContext: UIContext): FrameNode | null { if (!this.node) { this.node = new BuilderNode(uiContext); this.node.build(this.builder, this.data); } else { this.update(this.data); } return this.node.getFrameNode(); }
AST#method_declaration#Left makeNode AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Fram...
makeNode(uiContext: UIContext): FrameNode | null { if (!this.node) { this.node = new BuilderNode(uiContext); this.node.build(this.builder, this.data); } else { this.update(this.data); } return this.node.getFrameNode(); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/GlobalCustomComponentReuse/ComponentPrebuild/customreusablepool/src/main/ets/utils/BuilderNodePool.ets#L42-L50
0ea007835e721e272bf5a5ca1a1f8c7984c7bbb4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/DeviceManagement/ScreenDetector/entry/src/main/ets/pages/Index.ets
arkts
In low-code mode, do not add anything to the build function, as it will be overwritten by the content generated by the .visual file in the build phase.
build() { Column() { Row() { Text($r('app.string.entry_MainAbility')) .fontSize(20) .fontColor(Color.White) .textAlign(TextAlign.Center) } .height('6%') .width('100%') .padding({ left: 15 }) .backgroundColor('#0D9FFB') .constraintSize({...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#arkts_ui_...
build() { Column() { Row() { Text($r('app.string.entry_MainAbility')) .fontSize(20) .fontColor(Color.White) .textAlign(TextAlign.Center) } .height('6%') .width('100%') .padding({ left: 15 }) .backgroundColor('#0D9FFB') .constraintSize({...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/DeviceManagement/ScreenDetector/entry/src/main/ets/pages/Index.ets#L24-L43
c5d84e9c99e256413b193456d359410a5d28a00c
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
arkts/@arkts.collections.d.ets
arkts
resize
Resize the bitVector's length. @param { number } size - The new size for bitVector. If count is greater than the current size of bitVector, the additional bit elements are set to 0. @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter type...
resize(size: number): void;
AST#method_declaration#Left resize AST#parameter_list#Left ( AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#ty...
resize(size: number): void;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.collections.d.ets#L12320-L12320
f140726258bb41446e4be84d6ea1e5e43587ef2c
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/listexchange/src/main/ets/model/AttributeModifier.ets
arkts
applyNormalAttribute
定义组件普通状态时的样式 @param instance: ListItem属性
applyNormalAttribute(instance: ListItemAttribute): void { if (this.hasShadow) { instance.shadow({ radius: $r('app.integer.list_exchange_shadow_radius'), color: $r('app.color.list_exchange_box_shadow') }); instance.zIndex(1); instance.opacity(0.5); } else { instance.opacity(this.opacity);...
AST#method_declaration#Left applyNormalAttribute AST#parameter_list#Left ( AST#parameter#Left instance : AST#type_annotation#Left AST#primary_type#Left ListItemAttribute AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void ...
applyNormalAttribute(instance: ListItemAttribute): void { if (this.hasShadow) { instance.shadow({ radius: $r('app.integer.list_exchange_shadow_radius'), color: $r('app.color.list_exchange_box_shadow') }); instance.zIndex(1); instance.opacity(0.5); } else { instance.opacity(this.opacity);...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/listexchange/src/main/ets/model/AttributeModifier.ets#L46-L56
456eba7eff3ae98c781384a833602f1000b51ae7
gitee
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/MinuteLineComponent.ets
arkts
MinuteLineComponent
分时线组件
@Component export struct MinuteLineComponent { private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private canvasDrawMargin: number = 20 //画布的边距 @Prop stockData: MinuteData = new MinuteData() pr...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MinuteLineComponent AST#component_body#Left { AST#property_declaration#Left private settings : AST#type_annotation#Left AST#primary_type#Left RenderingContextSettings AST#primary_type#Right AST#type_annotation#Right =...
@Component export struct MinuteLineComponent { private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private canvasDrawMargin: number = 20 @Prop stockData: MinuteData = new MinuteData() private c...
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/MinuteLineComponent.ets#L9-L343
8b7d4cf59ebb3b820c39923b961812fa74f8d1b3
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/marquee/src/main/ets/model/DataSource.ets
arkts
getData
获取指定数据项
public getData(index: number): TripDataType { return this.originDataArray[index]; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TripDataType AST#primary_...
public getData(index: number): TripDataType { return this.originDataArray[index]; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/marquee/src/main/ets/model/DataSource.ets#L32-L34
1aabd0267f705251bdce9a69bb15c508954775ac
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/utils/Tools.ets
arkts
openPreviewEasy
通过传入文件的uri,打开预览窗口。1秒内重复调用无效。 @param uri 文件的uri @returns
static async openPreviewEasy(uri: string): Promise<void> { const previewInfo = Tools.generatePreviewInfo(uri); return Tools.openPreview(previewInfo); }
AST#method_declaration#Left static async openPreviewEasy AST#parameter_list#Left ( AST#parameter#Left uri : 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_t...
static async openPreviewEasy(uri: string): Promise<void> { const previewInfo = Tools.generatePreviewInfo(uri); return Tools.openPreview(previewInfo); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/Tools.ets#L300-L303
97b4f7f9d3de3d28953804f403f2f530be5fdedb
gitee
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/ImageKnife.ets
arkts
putCacheImage
预加载缓存(用于外部已获取pixelmap,需要加入imageknife缓存的场景) @param url 图片地址url @param pixelMap 图片 @param cacheType 缓存策略 @param signature key自定义信息
putCacheImage(url: string, pixelMap: PixelMap, cacheType: CacheStrategy = CacheStrategy.Default, signature?: string) { let memoryKey = this.getEngineKeyImpl() .generateMemoryKey(url, ImageKnifeRequestSource.SRC, { loadSrc: url, signature: signature }); let fileKey = this.getEngineKeyImpl().generateFileKey...
AST#method_declaration#Left putCacheImage AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pixelMap : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type...
putCacheImage(url: string, pixelMap: PixelMap, cacheType: CacheStrategy = CacheStrategy.Default, signature?: string) { let memoryKey = this.getEngineKeyImpl() .generateMemoryKey(url, ImageKnifeRequestSource.SRC, { loadSrc: url, signature: signature }); let fileKey = this.getEngineKeyImpl().generateFileKey...
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/ImageKnife.ets#L262-L269
52bc4899cb28e0354cf1349d7e0f3a1e04a92ab4
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/community/PostDetailPage.ets
arkts
fetchComments
获取评论列表
async fetchComments(refresh: boolean = true): Promise<void> { try { if (refresh) { this.pageNumber = 0; this.commentLoading = true; } if (!this.hasMoreComments && !refresh) { return; } try { // 确保传递认证信息 console.info(`加载评论列表,当前用户登录状态...
AST#method_declaration#Left async fetchComments AST#parameter_list#Left ( AST#parameter#Left refresh : 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#...
async fetchComments(refresh: boolean = true): Promise<void> { try { if (refresh) { this.pageNumber = 0; this.commentLoading = true; } if (!this.hasMoreComments && !refresh) { return; } try { console.info(`加载评论列表,当前用户登录状态: ${this.us...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/community/PostDetailPage.ets#L125-L177
73145aa4e8c0ca0d1632fcb683af0edcf1ae0a83
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/ContactTypes.ets
arkts
联系人统计信息接口
export interface ContactStatistics { total: number; byRelation: RelationStats; byGender: GenderStats; byAge: AgeDistribution; upcomingBirthdays: UpcomingBirthdayStats; averageIntimacyLevel: number; favoriteCount: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ContactStatistics AST#object_type#Left { AST#type_member#Left total : 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 byRelation : AST#type_anno...
export interface ContactStatistics { total: number; byRelation: RelationStats; byGender: GenderStats; byAge: AgeDistribution; upcomingBirthdays: UpcomingBirthdayStats; averageIntimacyLevel: number; favoriteCount: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L233-L241
1eb855b95a67660e28547f7ec816e51cb6498f55
github