nwo
stringclasses
449 values
path
stringlengths
9
173
language
stringclasses
1 value
identifier
stringlengths
1
53
docstring
stringlengths
5
4.13k
function
stringlengths
10
87.2k
ast_function
stringlengths
351
354k
obf_function
stringlengths
10
87.2k
url
stringlengths
30
175
function_sha
stringlengths
40
40
source
stringclasses
3 values
openharmony/arkui_ace_engine
advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.EditableTitleBar.ets
arkts
getNumberByResource
get resource size @param resourceId resource id @return resource size
function getNumberByResource(resourceId: number, defaultNumber: number): number { return defaultNumber }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getNumberByResource AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left resourceId AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
function getNumberByResource(resourceId: number, defaultNumber: number): number { return defaultNumber }
https://gitcode.com/openharmony/arkui_ace_engine
0fb5feeec844da09269d812bfd5484635ec2a7e6
gitcode
openharmony/developtools_profiler
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets
arkts
constructor
default constructor for initialization in code
constructor() { this.init(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
constructor() { this.init(); }
https://gitee.com/openharmony/developtools_profiler.git
d799fc07b95c2e8ea87b9e289d1f745a7fb50557
gitee
Goway-Hui/harmonyos-next-dev
harmonyos-next-dev/assets/network-request-template.ets
arkts
delete
==================== DELETE 请求 ====================
async delete<T>(path: string): Promise<ApiResponse<T>> { let url = this.buildUrl(path); return this.request<T>(url, http.RequestMethod.DELETE); }
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left delete AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type_identifier#Right AST#type_parameter#Right AST#>#Left ...
async delete<T>(path: string): Promise<ApiResponse<T>> { let url = this.buildUrl(path); return this.request<T>(url, http.RequestMethod.DELETE); }
https://github.com/Goway-Hui/harmonyos-next-dev
07d21a822252decd91063d082ab76788d7a413fc
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/constants/ApiConstants.ets
arkts
postReplies
获取帖子回复列表
static postReplies(postId: number): string { return `/posts/${postId}/replies`; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left postReplies AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left postId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu...
static postReplies(postId: number): string { return `/posts/${postId}/replies`; }
https://github.com/Amaz1ny/HarmonyDO-public
37fe5a8d3d1e1afa6ae400816084848a02d63536
github
arkui-x/samples
CodeLab/Cases/feature/calendarswitch/src/main/ets/customcalendar/utils/TimeUtils.ets
arkts
getNextMonth
获取下个月的月份 @param year 年 @param month 月 @returns 返回下个月的月份
static getNextMonth(year: number, month: number): number { return (month + 1 > 12) ? 1 : month + 1; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getNextMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left num...
static getNextMonth(year: number, month: number): number { return (month + 1 > 12) ? 1 : month + 1; }
https://gitcode.com/arkui-x/samples
d18bb183e887b6dd4f87272646dcd389b84f01e4
gitcode
terryma2024/happyword
harmonyos/entry/src/main/ets/services/BattleQuestionScheduler.ets
arkts
activePhasePool
Pool used for degradation on the current phase.
activePhasePool(): string[] { if (this.mode === BattleScheduleMode.SingleType) { return [this.singleType]; } if (this.mode === BattleScheduleMode.ChallengeOnly) { return this.effectiveChallengePool.slice(); } if (this.isIntroPassActive() || this.mode === BattleScheduleMode.IntroOnly) {...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left activePhasePool AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Rig...
activePhasePool(): string[] { if (this.mode === BattleScheduleMode.SingleType) { return [this.singleType]; } if (this.mode === BattleScheduleMode.ChallengeOnly) { return this.effectiveChallengePool.slice(); } if (this.isIntroPassActive() || this.mode === BattleScheduleMode.IntroOnly) {...
https://github.com/terryma2024/happyword
4da8cdbe538501bee508d88b591a50dfd1be756b
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/AbstractController.ets
arkts
notifyDeviceAdded
通知设备已添加并将状态标记为 Ready(幂等:重复调用不会重复通知)
protected notifyDeviceAdded(): void { if (this.controllerState === ControllerState.Ready || this.controllerState === ControllerState.Stopped) return; this.controllerState = ControllerState.Ready; if (this.listener) { this.listener.deviceAdded(this); } }
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left notifyDeviceAdded AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left v...
protected notifyDeviceAdded(): void { if (this.controllerState === ControllerState.Ready || this.controllerState === ControllerState.Stopped) return; this.controllerState = ControllerState.Ready; if (this.listener) { this.listener.deviceAdded(this); } }
https://github.com/AlkaidLab/moonlight-harmony
3a032006ac41daecadab6a1b4d4c8b053ab27e2f
github
Countly/countly-sdk-hos
entry/src/main/ets/model/DemoState.ets
arkts
safe
Run `fn` (sync or async), auto-logging a tagged OK/ERR line. Any rejection is caught so a fire-and-forget onClick handler does not produce an unhandled promise warning.
public static async safe(tag: string, fn: () => Promise<void> | void): Promise<void> { try { const r: Promise<void> | void = fn(); if (r instanceof Promise) await r; DemoLog.append(`${tag} OK`); } catch (e) { DemoLog.append(`${tag} ERR: ${e}`); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#identifier#Left safe AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR...
public static async safe(tag: string, fn: () => Promise<void> | void): Promise<void> { try { const r: Promise<void> | void = fn(); if (r instanceof Promise) await r; DemoLog.append(`${tag} OK`); } catch (e) { DemoLog.append(`${tag} ERR: ${e}`); } }
https://github.com/Countly/countly-sdk-hos
ff7b565708eed59a27dec2db0f056b35cc8be2d3
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets
arkts
getRetentionDaysIndex
获取当前保留天数在选项中的索引
public getRetentionDaysIndex(): number { const index = RETENTION_DAYS_OPTIONS.indexOf(this.settings.retentionDays); return index >= 0 ? index : 2; // 默认返回30天的索引 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getRetentionDaysIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left numb...
public getRetentionDaysIndex(): number { const index = RETENTION_DAYS_OPTIONS.indexOf(this.settings.retentionDays); return index >= 0 ? index : 2; // 默认返回30天的索引 }
https://github.com/DaLongZhuaZi/manxia
e0d1d80d03a15f272b7c4c8897f82608b9cb70a8
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceAPIEngine.ets
arkts
convertMethod
转换HTTP方法
private convertMethod(method: string): http.RequestMethod { if (method === 'GET') { return http.RequestMethod.GET; } else if (method === 'POST') { return http.RequestMethod.POST; } else if (method === 'PUT') { return http.RequestMethod.PUT; } else if (method === 'DELETE') { ret...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertMethod AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left method AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
private convertMethod(method: string): http.RequestMethod { if (method === 'GET') { return http.RequestMethod.GET; } else if (method === 'POST') { return http.RequestMethod.POST; } else if (method === 'PUT') { return http.RequestMethod.PUT; } else if (method === 'DELETE') { ret...
https://github.com/DaLongZhuaZi/manxia
1c129b57bf993db795e8f9e6cea0a5cdd77e2559
github
LZZLHY/hlib
entry/src/main/ets/api/ZLibraryClient.ets
arkts
pingDomain
─── 探针 ─────────────────────────────────────────── 探测某域名是否可达;不污染 cookie jar,不抛异常。
async pingDomain(domain: string, timeoutMs: number = 8000): Promise<number> { return await this.http.ping(domain, timeoutMs); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left pingDomain AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left domain AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS...
async pingDomain(domain: string, timeoutMs: number = 8000): Promise<number> { return await this.http.ping(domain, timeoutMs); }
https://github.com/LZZLHY/hlib
2edf2ca3730079b2702963be452496a7393b76ae
github
Kira-Yagami-Light/Kira-Projects
TodoTask/entry/src/main/ets/model/TaskModel.ets
arkts
setCategoryName
Set the category name and color
setCategoryName(categoryList: TaskCategoryData[]) { for (let i = 0; i < categoryList.length; ++i) { if (categoryList[i].id === this.category) { this.categoryName = categoryList[i].name; this.categoryColor = categoryList[i].color; break; } } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setCategoryName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left categoryList AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#ide...
setCategoryName(categoryList: TaskCategoryData[]) { for (let i = 0; i < categoryList.length; ++i) { if (categoryList[i].id === this.category) { this.categoryName = categoryList[i].name; this.categoryColor = categoryList[i].color; break; } } }
https://github.com/Kira-Yagami-Light/Kira-Projects
8e4e6719dd6d20c7e7ebeb225d739c192b1788b2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SettingsManager.ets
arkts
loadAllSettings
加载所有设置到缓存
private async loadAllSettings(): Promise<void> { try { if (!this.dataManager) { throw new Error('DataManager未初始化'); } const settings = await this.dataManager.getAllSettings(); this.settingsCache.clear(); settings.forEach((setting: UserSettingsDatabaseRecord) => { ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left loadAllSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
private async loadAllSettings(): Promise<void> { try { if (!this.dataManager) { throw new Error('DataManager未初始化'); } const settings = await this.dataManager.getAllSettings(); this.settingsCache.clear(); settings.forEach((setting: UserSettingsDatabaseRecord) => { ...
https://github.com/DaLongZhuaZi/manxia
4158ccb67929b3675af001d2e1de1d72aac9738a
github
offlinecat-dev/OCNetORM
src/main/ets/query/DataTransformTask.ets
arkts
create
创建参数实例 @param entityName 实体名称 @param columnNames 列名数组 @param columnTypes 列类型数组 @param propertyNames 属性名数组 @returns TransformTaskParams 实例
static create( entityName: string, columnNames: Array<string>, columnTypes: Array<string>, propertyNames: Array<string> ): TransformTaskParams { const params = new TransformTaskParams() params.entityName = entityName params.columnNames = columnNames params.columnTypes = columnTypes ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left create AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right...
static create( entityName: string, columnNames: Array<string>, columnTypes: Array<string>, propertyNames: Array<string> ): TransformTaskParams { const params = new TransformTaskParams() params.entityName = entityName params.columnNames = columnNames params.columnTypes = columnTypes ...
https://github.com/offlinecat-dev/OCNetORM
701b8d1db09bdfe3a79ea0eb97ba33875aa19f09
github
openharmony-sig/applications_calculator
feature/calculation/src/main/ets/calculator/Evaluator.ets
arkts
setGlobalExpression
@param exp
setGlobalExpression(exp: string): void { LogUtil.info(TAG, 'GlobalExpression:', exp); AppStorage.setOrCreate('globalExpression', exp); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setGlobalExpression AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left exp AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Lef...
setGlobalExpression(exp: string): void { LogUtil.info(TAG, 'GlobalExpression:', exp); AppStorage.setOrCreate('globalExpression', exp); }
https://gitee.com/openharmony-sig/applications_calculator.git
943557bd161400eef3b9d35c280331b9be513339
gitee
openharmony/codelabs
GraphicImage/GestureScreenshot/entry/src/main/ets/model/OffsetModel.ets
arkts
resetOffsetXY
Reset offset to the input value. @param offsetX @param offsetY
public resetOffsetXY(offsetX: number, offsetY: number) { if (this.xLocationType === XLocationEnum.XLeft) { this.offsetXLeft = this.offsetXRight - offsetX < CommonConstant.OFFSET_RANGE * 2 ? this.offsetXLeft : offsetX; } if (this.xLocationType === XLocationEnum.XRight) { this.offsetXRig...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetOffsetXY AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left offsetX AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#R...
public resetOffsetXY(offsetX: number, offsetY: number) { if (this.xLocationType === XLocationEnum.XLeft) { this.offsetXLeft = this.offsetXRight - offsetX < CommonConstant.OFFSET_RANGE * 2 ? this.offsetXLeft : offsetX; } if (this.xLocationType === XLocationEnum.XRight) { this.offsetXRig...
https://gitee.com/openharmony/codelabs.git
86e49c0c18acce2c9581e08c9a885a3994f7c58f
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/ReminderService.ets
arkts
getReminderStatistics
获取提醒统计
static async getReminderStatistics(userId: number): Promise<ReminderStatistics> { try { const allReminders: Reminder[] = await ReminderDAO.getByUserId(userId); const activeReminders: Reminder[] = allReminders.filter(r => r.isActive === 1); const today: string = new Date().toISOString().split('T'...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getReminderStatistics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#...
static async getReminderStatistics(userId: number): Promise<ReminderStatistics> { try { const allReminders: Reminder[] = await ReminderDAO.getByUserId(userId); const activeReminders: Reminder[] = allReminders.filter(r => r.isActive === 1); const today: string = new Date().toISOString().split('T'...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f8902efdde552c6bee607c0e49276398201c712d
github
openharmony/update_update_app
feature/ota/src/main/ets/dialog/DialogHelper.ets
arkts
logInfo
info级别日志打印 @param message 日志内容
function logInfo(message: string): void { LogUtils.info('DialogHelper', message); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left logInfo AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left message AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function logInfo(message: string): void { LogUtils.info('DialogHelper', message); }
https://gitee.com/openharmony/update_update_app.git
603c3a628d8d64ca0c08f7ebc9b5ae09bd9f42d7
gitee
openharmony/applications_notes
features/src/main/ets/components/FolderListComp.ets
arkts
onDeleteConfirm
Folder Delete Callback
onDeleteConfirm() { let currentFolder = FolderUtil.getFolderData(this.AllFolderArray, this.folderItem.uuid) let index = this.AllFolderArray.indexOf(currentFolder) let currentNoteDataArray = NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray')!, this.folderItem.uuid); let deleteNoteDataArray = Note...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onDeleteConfirm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le...
onDeleteConfirm() { let currentFolder = FolderUtil.getFolderData(this.AllFolderArray, this.folderItem.uuid) let index = this.AllFolderArray.indexOf(currentFolder) let currentNoteDataArray = NoteUtil.getNoteDataArray(AppStorage.Get('AllNoteArray')!, this.folderItem.uuid); let deleteNoteDataArray = Note...
https://gitee.com/openharmony/applications_notes.git
92bbfa3148dcc5dd3eda0447dde60d9f21763a56
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/FontManager.ets
arkts
initialize
初始化字体管理器
async initialize(context: common.UIAbilityContext): Promise<void> { if (this.isInitialized) { logger.info(TAG, '字体管理器已初始化'); return; } try { this.context = context; // 创建字体存储目录 this.fontsDirPath = `${context.filesDir}/${FONTS_DIR}`; await this.ensureFontsDir(); ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left initialize AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#t...
async initialize(context: common.UIAbilityContext): Promise<void> { if (this.isInitialized) { logger.info(TAG, '字体管理器已初始化'); return; } try { this.context = context; // 创建字体存储目录 this.fontsDirPath = `${context.filesDir}/${FONTS_DIR}`; await this.ensureFontsDir(); ...
https://github.com/DaLongZhuaZi/manxia
e926a2a10c73b13527f38f85aea2274d644dae54
github
arkui-x/samples
CodeLab/Cases/feature/bluetooth/src/main/ets/pages/HeartRate.ets
arkts
onHeartRate
心率变动事件
onHeartRate(): void { Log.showInfo(TAG, `onHeartRate: heartRate = ${this.heartRate}`); this.heartRateTop = this.heartRateTop < this.heartRate ? this.heartRate : this.heartRateTop; this.heartRateBottom = (this.heartRateBottom === 0) ? this.heartRate : (this.heartRateBottom > this.heartRate) ? this.he...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onHeartRate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#...
onHeartRate(): void { Log.showInfo(TAG, `onHeartRate: heartRate = ${this.heartRate}`); this.heartRateTop = this.heartRateTop < this.heartRate ? this.heartRate : this.heartRateTop; this.heartRateBottom = (this.heartRateBottom === 0) ? this.heartRate : (this.heartRateBottom > this.heartRate) ? this.he...
https://gitcode.com/arkui-x/samples
bae5fe9da901e768c3fbb10a73835cab597255c7
gitcode
arkui-x/samples
CodeLab/Cases/feature/applicationexception/src/main/ets/model/DataSource.ets
arkts
totalCount
获取数据的长度
public totalCount(): number { return 0; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left totalCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#numb...
public totalCount(): number { return 0; }
https://gitcode.com/arkui-x/samples
a9147d32f8dac83b0a5520753f86227e5d36535f
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
of
Returns a new array from a set of elements. @returns { Uint16Array } - a new Uint16Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(): Uint16Array { return new Uint16Array(0) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression...
public static of(): Uint16Array { return new Uint16Array(0) }
https://gitcode.com/iop123123/arkts-static-skills
f8cbb1e195db563918aeb4e26eb02422eac49e5b
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/CloudSyncService.ets
arkts
getSyncStatistics
获取同步统计
static async getSyncStatistics(userId: number): Promise<SyncStatistics> { try { const stats = await CloudSyncRecordDAO.getStatistics(userId); const result: SyncStatistics = new SyncStatisticsResult( stats.total, stats.completed, stats.failed, stats.lastSyncTime );...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getSyncStatistics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left...
static async getSyncStatistics(userId: number): Promise<SyncStatistics> { try { const stats = await CloudSyncRecordDAO.getStatistics(userId); const result: SyncStatistics = new SyncStatisticsResult( stats.total, stats.completed, stats.failed, stats.lastSyncTime );...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
7aec055c337869f8b09581e21390a64776be2e04
github
XHXYT/Pixark
entry/src/main/ets/common/utils/ComponentAttrUtils.ets
arkts
getRectInfoById
根据组件的ID获取其位置信息
public static getRectInfoById(context: UIContext, id: string): RectInfoInPx { if (!context || !id) { throw CustomExceptions.EMPTY_OBJECT_EXCEPTION; } let componentInfo: componentUtils.ComponentInfo | undefined = undefined; try { componentInfo = context.getComponentUtils().getRectangleById(...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getRectInfoById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left...
public static getRectInfoById(context: UIContext, id: string): RectInfoInPx { if (!context || !id) { throw CustomExceptions.EMPTY_OBJECT_EXCEPTION; } let componentInfo: componentUtils.ComponentInfo | undefined = undefined; try { componentInfo = context.getComponentUtils().getRectangleById(...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/ComponentAttrUtils.ets#L24-L61
dcbef22122e3529012d403ae8336a05253eaf36a
github
openharmony-sig/ohos_danmaku_flame_master
library/src/main/ets/components/common/master/flame/danmaku/danmaku/util/DanmakuUtils.ets
arkts
willHitInDuration
检测两个弹幕是否会碰撞 允许不同类型弹幕的碰撞 @param d1 @param d2 @return
public static willHitInDuration(disp: IDisplayer, d1: BaseDanmaku, d2: BaseDanmaku, duration: number, currTime: number): boolean { let type1: number = d1.getType(); let type2: number = d2.getType(); // allow hit if different type if (type1 != type2) return false; ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left willHitInDuration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left disp AST#identifier#Right AST#:#Left ...
public static willHitInDuration(disp: IDisplayer, d1: BaseDanmaku, d2: BaseDanmaku, duration: number, currTime: number): boolean { let type1: number = d1.getType(); let type2: number = d2.getType(); // allow hit if different type if (type1 != type2) return false; ...
https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git
71e1d532ca165aeae3ee7d437d0463a0e136392e
gitee
terryma2024/happyword
harmonyos/entry/src/ohosTest/ets/test/PackManagerFlow.ui.test.ets
arkts
mockHttp
Issue a fire-and-forget HTTP call against the mock server. We thread everything through @ohos.net.http directly because the test process has no network MCP client and the mock is reached over the loopback (`hdc rport tcp:8123`). Bodies are intentionally optional so callers can do redeem (POST + JSON body) and unbind (P...
async function mockHttp( method: http.RequestMethod, path: string, body: string, bearer: string, ): Promise<string> { try { const req: http.HttpRequest = http.createHttp(); try { const headers: Record<string, string> = { 'Content-Type': 'application/json' }; if (bearer.length > 0) { ...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left mockHttp AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left method AST#identifier#Right AST#type_ann...
async function mockHttp( method: http.RequestMethod, path: string, body: string, bearer: string, ): Promise<string> { try { const req: http.HttpRequest = http.createHttp(); try { const headers: Record<string, string> = { 'Content-Type': 'application/json' }; if (bearer.length > 0) { ...
https://github.com/terryma2024/happyword
cbf3de9f360ab3db2405918eedb3940671111561
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
forEach
Performs the specified action for each element in Uint32Array @param { function } callbackfn - A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public forEach(callbackfn: (value: number, index: int, array: Uint32Array) => void): void { for (let i = 0; i < this.lengthInt; i++) { callbackfn(this.getUnsafe(i).toDouble(), i, this) } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#identifier#Left forEach AST#identifier#Right AST#ERROR#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri...
public forEach(callbackfn: (value: number, index: int, array: Uint32Array) => void): void { for (let i = 0; i < this.lengthInt; i++) { callbackfn(this.getUnsafe(i).toDouble(), i, this) } }
https://gitcode.com/iop123123/arkts-static-skills
b6c735e1e952788e48fcb044f60e967b883d55ad
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/AnomalyDetectionDAO.ets
arkts
getAllByUser
获取用户所有基线数据
static async getAllByUser(userId: number): Promise<UserSpendingBaseline[]> { let resultSet: relationalStore.ResultSet | null = null; try { const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(UserSpendingBaseline.tableName); predicates.equalTo('us...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getAllByUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AS...
static async getAllByUser(userId: number): Promise<UserSpendingBaseline[]> { let resultSet: relationalStore.ResultSet | null = null; try { const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(UserSpendingBaseline.tableName); predicates.equalTo('us...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
0fc2fea2b62560be7b7ed747bfe38e123a3b49e4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Preload/ChapterPreloadManager.ets
arkts
buildPreloadOptions
构建预加载选项(包含headers)
private buildPreloadOptions(): LoadOptions | undefined { if (!this.hasConfiguredSourceHeaders(this.currentSourceHeaders)) { return undefined; } const headers: RequestHeaders = {} as RequestHeaders; this.copyConfiguredSourceHeaders(headers, this.currentSourceHeaders); const options...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildPreloadOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expressi...
private buildPreloadOptions(): LoadOptions | undefined { if (!this.hasConfiguredSourceHeaders(this.currentSourceHeaders)) { return undefined; } const headers: RequestHeaders = {} as RequestHeaders; this.copyConfiguredSourceHeaders(headers, this.currentSourceHeaders); const options...
https://github.com/DaLongZhuaZi/manxia
5baa3dcad0f53ff1a9936e42e945375794bb979d
github
LongLiveY96/chatcube
entry/src/main/ets/services/WebSearchService.ets
arkts
search
统一搜索接口
async search(query: string, options?: WebSearchExecutionOptions): Promise<SearchResult> { const runtime = options?.runtimeConfig !== undefined ? options.runtimeConfig : await this.getRuntimeConfigSnapshot() const requestId = options?.requestId !== undefined ? options.requestId : '' const cancelCheck = opt...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left search AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left query AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R...
async search(query: string, options?: WebSearchExecutionOptions): Promise<SearchResult> { const runtime = options?.runtimeConfig !== undefined ? options.runtimeConfig : await this.getRuntimeConfigSnapshot() const requestId = options?.requestId !== undefined ? options.requestId : '' const cancelCheck = opt...
https://github.com/LongLiveY96/chatcube
d112e3df3bdeead68fe5ef5bcd08b2da322ccd9c
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/NativeHidController.ets
arkts
mayBeSilentlyDisconnected
检查控制器是否可能已静默断开 @param inactivityThresholdMs 不活动阈值(毫秒) @returns true 表示可能已断开
mayBeSilentlyDisconnected(inactivityThresholdMs: number = 30000): boolean { if (!this.running) { return true; } const now = Date.now(); return (now - this.lastActivityTime) > inactivityThresholdMs; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left mayBeSilentlyDisconnected AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inactivityThresholdMs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AS...
mayBeSilentlyDisconnected(inactivityThresholdMs: number = 30000): boolean { if (!this.running) { return true; } const now = Date.now(); return (now - this.lastActivityTime) > inactivityThresholdMs; }
https://github.com/AlkaidLab/moonlight-harmony
aafb909c9753942ae632dd7c73819bf73dbcb5c8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets
arkts
values
Returns elements from the Map as an values Iterator @returns iterator with map values
override values(): IterableIterator<V> { return this.mappedIterator<V>((k: K, v: V): V => v) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left values AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#...
override values(): IterableIterator<V> { return this.mappedIterator<V>((k: K, v: V): V => v) }
https://gitcode.com/iop123123/arkts-static-skills
05f0965c8855251eea51a4a86d06e19f0607200f
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Storage/StorageAnalyzer.ets
arkts
constructor
缓存30秒
private constructor() { this.sandboxManager = SandboxManager.getInstance(); this.imageCacheManager = ImageCacheManager.getInstance(); this.databaseManager = DatabaseManager.getInstance(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left ...
private constructor() { this.sandboxManager = SandboxManager.getInstance(); this.imageCacheManager = ImageCacheManager.getInstance(); this.databaseManager = DatabaseManager.getInstance(); }
https://github.com/DaLongZhuaZi/manxia
8550c07951ce3f2fd235071f09e4cc8a1ec44a05
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
setEnabledGroups
设置启用的分组列表
async setEnabledGroups(groups: string[]): Promise<void> { this.searchSettings.enabledGroups = groups; await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.SEARCH_SETTINGS, this.searchSettings); }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setEnabledGroups AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_par...
async setEnabledGroups(groups: string[]): Promise<void> { this.searchSettings.enabledGroups = groups; await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.SEARCH_SETTINGS, this.searchSettings); }
https://github.com/DaLongZhuaZi/manxia
a5f93b61862b779393713f5c1ae066df37a74edd
github
FinalScave/SweetLine
platform/OHOS/sweetline/src/main/ets/Index.ets
arkts
compileSyntaxFromJson
Compile syntax rule from JSON @param syntaxJson JSON content of the syntax rule @throws SyntaxCompileError on compilation error
public compileSyntaxFromJson(syntaxJson: string): SyntaxRule | null { if (this.nativeHandle == 0) { return null; } return withSyntaxCompileError(() => { let handle: number = lib.HighlightEngine_CompileSyntaxFromJson(this.nativeHandle, syntaxJson); if (handle == 0) { ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left compileSyntaxFromJson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left syntaxJson AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A...
public compileSyntaxFromJson(syntaxJson: string): SyntaxRule | null { if (this.nativeHandle == 0) { return null; } return withSyntaxCompileError(() => { let handle: number = lib.HighlightEngine_CompileSyntaxFromJson(this.nativeHandle, syntaxJson); if (handle == 0) { ...
https://github.com/FinalScave/SweetLine
d38201b2f757f48fd7061522aed4580a88b05280
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets
arkts
getSegment
Gets the decoded path segments. @returns { string[] } Return decoded path segments, each without a leading or trailing "/".
getSegment(): string[] { return this.uriEntry.getSegments(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getSegment AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
getSegment(): string[] { return this.uriEntry.getSegments(); }
https://gitcode.com/iop123123/arkts-static-skills
ff57bce6a9bcb428d8657a2cff0ece20504e7e20
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/AnomalyDetectionService.ets
arkts
acknowledgeBatch
批量确认异常
static async acknowledgeBatch(anomalyIds: number[]): Promise<number> { try { let count = 0; for (let i = 0; i < anomalyIds.length; i++) { const success = await AnomalyRecordDAO.acknowledge(anomalyIds[i]); if (success) { count++; } } return count; } cat...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left acknowledgeBatch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left anomalyIds AST#identifier#Right AST#ERROR#Left AST#:#L...
static async acknowledgeBatch(anomalyIds: number[]): Promise<number> { try { let count = 0; for (let i = 0; i < anomalyIds.length; i++) { const success = await AnomalyRecordDAO.acknowledge(anomalyIds[i]); if (success) { count++; } } return count; } cat...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
bc0e5bc29537bb49a3199451d85f42b5c62dbb58
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
from
Creates an Uint8ClampedArray from array-like argument @param o array-like object to initialize Uint8ClampedArray @param mapFn function to apply for each @returns new Uint8ClampedArray
public from(o: Object, mapFn: (e: Object) => number): Uint8ClampedArray { let newF: (e: Object, index: int) => number = (e: Object, index: int): number => { return mapFn(e) } return this.from(o, newF) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R...
public from(o: Object, mapFn: (e: Object) => number): Uint8ClampedArray { let newF: (e: Object, index: int) => number = (e: Object, index: int): number => { return mapFn(e) } return this.from(o, newF) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
04b457decdf9f7100e8261f63f2d6903d3d2c7a3
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceSelectorEngine.ets
arkts
executeTextSelector
执行文本选择器
private async executeTextSelector( selector: Selector, context: SelectorContext, executeJS: (script: string) => Promise<Object> ): Promise<SelectorResult> { // 类型安全的属性访问 const textSelector = selector as TextSelector; const matchType = textSelector.textMatch || TextMatchType.CONTAINS; con...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left executeTextSelector AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left selector AST#identifier#Right AST...
private async executeTextSelector( selector: Selector, context: SelectorContext, executeJS: (script: string) => Promise<Object> ): Promise<SelectorResult> { // 类型安全的属性访问 const textSelector = selector as TextSelector; const matchType = textSelector.textMatch || TextMatchType.CONTAINS; con...
https://github.com/DaLongZhuaZi/manxia
ce634a43b680870bcb7f07b4a5edeba1786e5e18
github
openharmony/applications_app_samples
code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/customcomponents/CustomShareDlg.ets
arkts
onPlatClick
点击分享平台事件
onPlatClick() { promptAction.showToast({ message: $r('app.string.video_trimmer_toast_tips') }); };
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPlatClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
onPlatClick() { promptAction.showToast({ message: $r('app.string.video_trimmer_toast_tips') }); };
https://github.com/openharmony/applications_app_samples
122f17f34aea6a62ce32e05017542440781e086e
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/OrderCacheStoreRepository.ets
arkts
saveCarts
保存选中的购物车项(仅购物车页面使用) @param {Cart[]} carts 购物车列表 @returns {Promise<void>} Promise<void>
saveCarts(carts: Cart[]): Promise<void> { return this.dataSource.setCarts(carts); }
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left saveCarts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left carts AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_ex...
saveCarts(carts: Cart[]): Promise<void> { return this.dataSource.setCarts(carts); }
https://github.com/Joker-x-dev/CoolMallArkTS
8d53caebb29387418e2547a9b03d26805d660b41
github
Delsin-Yu/JustPDF
entry/src/main/ets/components/PageInfo.ets
arkts
evictViewerCache
@deprecated 语义同 evictAllViewerCaches,保留名称以兼容既有调用。
public evictViewerCache(): void { this.evictAllViewerCaches(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left evictViewerCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expre...
public evictViewerCache(): void { this.evictAllViewerCaches(); }
https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/components/PageInfo.ets#L551-L553
7bea010189903d1dc46063ba00dc55afdf45c735
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/08.function_declarations/05.shadowing_parameters/scope1.ets
arkts
getQ
top-level scope
function getQ(): int { return q; // returns top-level q }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getQ AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier#Left i...
function getQ(): int { return q; // returns top-level q }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
1380be4e35682d267963f30af486dee24ba2346e
gitee
HarmonyOS_Samples/MusicHome
features/player/src/main/ets/view/LrcView.ets
arkts
onLyricUpdated
Watch handler: lyric list changed; resets active line and redraws.
onLyricUpdated() { this.mCurrentLine = NONE_LINE; this.onTimeUpdated(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onLyricUpdated AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
onLyricUpdated() { this.mCurrentLine = NONE_LINE; this.onTimeUpdated(); }
https://gitcode.com/HarmonyOS_Samples/MusicHome
01ec27368a8f2a7e5b10ef0bf75c2603741856d2
gitcode
LYM15/FireflyCompanion
entry/src/main/ets/utils/httpCore/http.ets
arkts
post
封装post方法 直接将参数添加到headers上 post<T>(url: string, data?: object,extraRequestOptions?: ExtraRequestOptions): Promise<ApiResponse<T>> { Logger.info(TAG,'requestOptions',JSON.stringify(extraRequestOptions)) const headers: Record<string, string> = {}; if (extraRequestOptions?.xServerlessSign) { headers['x-serverless-sign'] = ...
post<T>(url: string, data?: object, extraRequestOptions?: ExtraRequestOptions): Promise<ApiResponse<T>> { return instance.post<null, ApiResponse<T>>(url, data, { extraRequestOptions } as ExtendedAxiosRequestConfig); }
AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left post AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#ERROR#Left AST#form...
post<T>(url: string, data?: object, extraRequestOptions?: ExtraRequestOptions): Promise<ApiResponse<T>> { return instance.post<null, ApiResponse<T>>(url, data, { extraRequestOptions } as ExtendedAxiosRequestConfig); }
https://github.com/LYM15/FireflyCompanion
059e7a8bc51ae5ade34d951db9d1904ca9aa50f4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Services/DataService.ets
arkts
addToFavorites
==================== 收藏服务 ==================== 添加收藏
public async addToFavorites(comicId: string, tags: string[] = []): Promise<void> { try { const favoriteData: FavoriteInfoInput = { comicId, userId: this.currentUserId, lastReadChapterId: undefined, lastReadTime: undefined, tags }; await this.dataMan...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left addToFavorites AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left AST#:#Left :...
public async addToFavorites(comicId: string, tags: string[] = []): Promise<void> { try { const favoriteData: FavoriteInfoInput = { comicId, userId: this.currentUserId, lastReadChapterId: undefined, lastReadTime: undefined, tags }; await this.dataMan...
https://github.com/DaLongZhuaZi/manxia
a76597e8ebcc265686e26b8691060c0e0b86aa09
github
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/MedicalAgent.ets
arkts
getSpecialty
获取专科领域
getSpecialty(): MedicalSpecialty { return this.specialty; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSpecialty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left MedicalSpecialty AST#identifier#Right AST#ERROR#R...
getSpecialty(): MedicalSpecialty { return this.specialty; }
https://github.com/LJ666-ui/harmony-health-care
df55bed334f96c3c8394faa955cb6d19216690a7
github
yang-kun-long/HarmonyAccounting
entry/src/main/ets/pages/MainPage.ets
arkts
slectMonthData
参数:字符串时间,"2024-09-11 10:18:19" 返回值,返回周几,以及今年第几周 获取一个月内的数据,并按照账户类型进行分组,并计算每个分组的总金额
slectMonthData(date:string,y:string,m:string): number{ date=date.split(' ')[0]; let year = date.split('-')[0]; let month = date.split('-')[1]; if(year==y&&month==m) return 0; else if(year==y) return 1; else return 2; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left slectMonthData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , ...
slectMonthData(date:string,y:string,m:string): number{ date=date.split(' ')[0]; let year = date.split('-')[0]; let month = date.split('-')[1]; if(year==y&&month==m) return 0; else if(year==y) return 1; else return 2; }
https://github.com/yang-kun-long/HarmonyAccounting
0040d8f35e13dd3e71ce8a021369e71514085ebd
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/ScraperManager.ets
arkts
setAniListToken
设置AniList访问令牌
public setAniListToken(token: string): void { this.anilistScraper.setAccessToken(token); logger.info(TAG, 'AniList访问令牌已设置'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setAniListToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left...
public setAniListToken(token: string): void { this.anilistScraper.setAccessToken(token); logger.info(TAG, 'AniList访问令牌已设置'); }
https://github.com/DaLongZhuaZi/manxia
b7d2bfb1987e45363ec50c738947e22b108689fc
github
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/SVGManager.ets
arkts
_convertArrayToXML
转换数组为XML格式 @param arrayObj 要被转换为XML格式的数组对象 @return xml格式数据
private _convertArrayToXML(arrayObj: object): string { let arrayXml = ''; if (typeof arrayObj === SVGAttrConstants.TYPEOF_OBJECT && isArray(arrayObj)) { arrayObj.forEach((element: Record<string, string>) => { if (this._convertObjToXML(element)) { arrayXml += this._convertObjToXML(eleme...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left _convertArrayToXML AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left arrayObj AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#object#Left object AST...
private _convertArrayToXML(arrayObj: object): string { let arrayXml = ''; if (typeof arrayObj === SVGAttrConstants.TYPEOF_OBJECT && isArray(arrayObj)) { arrayObj.forEach((element: Record<string, string>) => { if (this._convertObjToXML(element)) { arrayXml += this._convertObjToXML(eleme...
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
375e7ec89f35604dea10a5d7bfaa07216ec7d86d
gitee
Joker-x-dev/CoolMallArkTS
core/util/src/main/ets/permission/PermissionUtils.ets
arkts
requestCameraPermission
申请相机权限 用法示例:PermissionUtils.requestCameraPermission() { granted => ... } @param callback 权限申请结果回调
public async requestCameraPermission(callback: (granted: boolean) => void): Promise<void> { const permissions: Permissions[] = ["ohos.permission.CAMERA"]; await this.handlePermissionResult('相机权限', callback, permissions); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#identifier#Left requestCameraPermission AST#identifier#Right AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR...
public async requestCameraPermission(callback: (granted: boolean) => void): Promise<void> { const permissions: Permissions[] = ["ohos.permission.CAMERA"]; await this.handlePermissionResult('相机权限', callback, permissions); }
https://github.com/Joker-x-dev/CoolMallArkTS
02c10a74b784149e8d328a047c8760261b5872b5
github
Joker-x-dev/CoolMallArkTS
core/ui/src/main/ets/component/bottombar/AppBottomButton.ets
arkts
build
构建底部操作按钮 @returns {void} 无返回值
build(): void { Column() { IBestButton({ text: this.text, type: "primary", round: true, loading: this.loading, disabled: this.loading, btnWidth: P100, onBtnClick: (): void => { this.onTap(); } }); if (this.safeAreaEnabled ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { Column() { IBestButton({ text: this.text, type: "primary", round: true, loading: this.loading, disabled: this.loading, btnWidth: P100, onBtnClick: (): void => { this.onTap(); } }); if (this.safeAreaEnabled ...
https://github.com/Joker-x-dev/CoolMallArkTS
bf56eb852a78d5c34329be12e85be6497e6e9717
github
xiaofenger_705/protobuf-arkts-generator
runtime/arkpb/BinaryEncodingVisitor.ets
arkts
visitMapStringMessage
访问 map<string, message> 字段 Value 是嵌套消息,需要递归处理
visitMapStringMessage(value: Map<string, Message>, fieldNumber: number): void { value.forEach((v, k) => { const entryWriter = this.writer.fork() entryWriter.tag(1, 2).string(k) // Value 是消息,递归处理 const nestedVisitor = new BinaryEncodingVisitor() nestedVisitor.recursionDepth = this.re...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitMapStringMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Map AST#identif...
visitMapStringMessage(value: Map<string, Message>, fieldNumber: number): void { value.forEach((v, k) => { const entryWriter = this.writer.fork() entryWriter.tag(1, 2).string(k) // Value 是消息,递归处理 const nestedVisitor = new BinaryEncodingVisitor() nestedVisitor.recursionDepth = this.re...
https://gitcode.com/xiaofenger_705/protobuf-arkts-generator
9dbda4d3a1e24f1fa72e1a63cd298bb4ff56a0d9
gitcode
azhu0001/localsend-harmony
entry/src/main/ets/pages/transfer/TransferPage.ets
arkts
onTransferInfoDisplayClick
显示/关闭 文件传输信息
onTransferInfoDisplayClick() { if (this.isTransferInfoChanging) { return } this.isTransferInfoChanging = true this.isTransferInfoDisplay = !this.isTransferInfoDisplay if (this.isTransferInfoDisplay) { this.mTransferInfoHeight = 'auto' } else { this.mTransferInfoHeight = 0 ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onTransferInfoDisplayClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#stateme...
onTransferInfoDisplayClick() { if (this.isTransferInfoChanging) { return } this.isTransferInfoChanging = true this.isTransferInfoDisplay = !this.isTransferInfoDisplay if (this.isTransferInfoDisplay) { this.mTransferInfoHeight = 'auto' } else { this.mTransferInfoHeight = 0 ...
https://gitcode.com/azhu0001/localsend-harmony
a2f9ead83988f45835fbd00561a9a7ddf539b3e6
gitcode
openharmony-tpc/VCard
library/src/main/ets/components/VCardParserImpl_V21.ets
arkts
getQuotedPrintablePart
<p> Parses and returns Quoted-Printable. </p> @param firstString The string following a parameter name and attributes. Example: "string" in "ADR:ENCODING=QUOTED-PRINTABLE:string\n\r". @return whole Quoted-Printable string, including a given argument and following lines. Excludes the last empty line following to Quoted ...
private getQuotedPrintablePart(firstString: string): string { // Specifically, there may be some padding between = and CRLF. // See the following: // // qp-line := *(qp-segment transport-padding CRLF) // qp-part transport-padding // qp-segment := qp-section *(SPACE / ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getQuotedPrintablePart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left firstString AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left str...
private getQuotedPrintablePart(firstString: string): string { // Specifically, there may be some padding between = and CRLF. // See the following: // // qp-line := *(qp-segment transport-padding CRLF) // qp-part transport-padding // qp-segment := qp-section *(SPACE / ...
https://gitee.com/openharmony-tpc/VCard.git
6b5ea203ff459a65f7c21ddadcfcb1d51264a389
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Class.ets
arkts
getStaticField
Look up a static field by name among the fields declared in this class. @param { string } name The field name to search for. @returns { reflect.StaticField | undefined } the found static field, or undefined if not found. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getStaticField(name: string): reflect.StaticField | undefined { return this.getStaticFieldByNameInternal(name, true) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStaticField AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
public getStaticField(name: string): reflect.StaticField | undefined { return this.getStaticFieldByNameInternal(name, true) }
https://gitcode.com/iop123123/arkts-static-skills
0e92888ce7792de848db8508ade7ea89703939af
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SmartCategoryDAO.ets
arkts
getActiveRules
查询激活的规则(按优先级排序)
static async getActiveRules(userId: number): Promise<SmartCategoryRule[]> { try { await SmartCategoryRuleDAO.ensureSchema(); const store = DatabaseManager.getDatabase(); const sql = ` SELECT * FROM ${SmartCategoryRule.tableName} WHERE user_id = ? AND is_active = 1 AND is_...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getActiveRules AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : ...
static async getActiveRules(userId: number): Promise<SmartCategoryRule[]> { try { await SmartCategoryRuleDAO.ensureSchema(); const store = DatabaseManager.getDatabase(); const sql = ` SELECT * FROM ${SmartCategoryRule.tableName} WHERE user_id = ? AND is_active = 1 AND is_...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f7625542bc09becbcc3361d93a7b6ef8a457f092
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/BaseEventUtil.ets
arkts
getEventNames
获取所有事件名称 @returns 事件名称数组
getEventNames(): string[] { const dataEventNames = Array.from(this.dataEvents.keys()) return dataEventNames }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getEventNames AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Rig...
getEventNames(): string[] { const dataEventNames = Array.from(this.dataEvents.keys()) return dataEventNames }
https://github.com/Yebingiscn/SweetVideo
b08f4524e7cd7175e0f6cd08f72650cce3e89f52
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
find
Finds the first element in the Float32Array that satisfies the condition @param fn the condition to apply for each element @returns the first element that satisfies fn TODO: return float | undefined as in JS
public find(fn: (val: float, index: int, array: Float32Array) => boolean): float { for (let i = 0; i < this.length; ++i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Float32Array.find: not implemented if el...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left find AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ...
public find(fn: (val: float, index: int, array: Float32Array) => boolean): float { for (let i = 0; i < this.length; ++i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Float32Array.find: not implemented if el...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
c5fd6ecf69814f90f7c9e045eb47f8c277b89c11
gitee
youyeyejie/ZhiXing_ActHub
entry/src/main/ets/core/services/FocusTimerEngine.ets
arkts
resetState
重置内部状态至默认空闲值
private resetState(): void { this.state = FocusState.IDLE; this.remainingSeconds = this.currentWorkDuration; this.totalSeconds = this.currentWorkDuration; this.todoId = 0; this.todoTitle = ''; this.startTimestamp = 0; this.expectedEndTime = 0; this.segmentStartRemainingSeconds = 0; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left resetState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressi...
private resetState(): void { this.state = FocusState.IDLE; this.remainingSeconds = this.currentWorkDuration; this.totalSeconds = this.currentWorkDuration; this.todoId = 0; this.todoTitle = ''; this.startTimestamp = 0; this.expectedEndTime = 0; this.segmentStartRemainingSeconds = 0; ...
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/services/FocusTimerEngine.ets#L260-L270
eb8ebee7e7612b988c6ccc224b01e47d06f9394c
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/ThemeManager.ets
arkts
isDarkMode
获取当前是否为深色模式
public isDarkMode(): boolean { switch (this.currentThemeMode) { case ThemeMode.SYSTEM: return this.systemDarkMode; case ThemeMode.DARK: return true; case ThemeMode.LIGHT: return false; default: return false; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDarkMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#bo...
public isDarkMode(): boolean { switch (this.currentThemeMode) { case ThemeMode.SYSTEM: return this.systemDarkMode; case ThemeMode.DARK: return true; case ThemeMode.LIGHT: return false; default: return false; } }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ThemeManager.ets#L79-L90
5224c473e36a3ace81c37e7274ff7e5798a041fd
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/Message.ets
arkts
sendToTarget
Send the message to the target
public sendToTarget(): void { const previousStatus = this.status.compareAndSwap(MessageInnerStatus.PENDING.valueOf(), MessageInnerStatus.SENT.valueOf()); if (previousStatus != MessageInnerStatus.PENDING.valueOf()) { throw new Error('Message:: Message already sent'); ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left sendToTarget AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#R...
public sendToTarget(): void { const previousStatus = this.status.compareAndSwap(MessageInnerStatus.PENDING.valueOf(), MessageInnerStatus.SENT.valueOf()); if (previousStatus != MessageInnerStatus.PENDING.valueOf()) { throw new Error('Message:: Message already sent'); ...
https://gitcode.com/iop123123/arkts-static-skills
33c0c6e6fe20ad5e7d5dfc6f97d02e723252baf1
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Types/NamingConventions.ets
arkts
validateInterfaceName
验证接口名称是否符合规范 @param name - 接口名称 @returns 是否符合规范
static validateInterfaceName(name: string): boolean { // PascalCase 规则:首字母大写,后续单词首字母大写 const pascalCaseRegex = /^[A-Z][a-zA-Z0-9]*$/; return pascalCaseRegex.test(name); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left validateInterfaceName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
static validateInterfaceName(name: string): boolean { // PascalCase 规则:首字母大写,后续单词首字母大写 const pascalCaseRegex = /^[A-Z][a-zA-Z0-9]*$/; return pascalCaseRegex.test(name); }
https://github.com/DaLongZhuaZi/manxia
3acae9ed0f921638644004bbc528b458a4a9fb1f
github
arkui-x/samples
CodeLab/Cases/feature/limitedheightbottomdialog/src/main/ets/view/ActionSectionView.ets
arkts
build
操作项点击处理
build() { Column() { ForEach(this.actionItems, (actionItem: ActionItem, index: number) => { this.createActionItem(actionItem, this.onClickItem) if (index < this.actionItems.length - 1) { this.createDivider() } }) }.sectionStyle() }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Column() { ForEach(this.actionItems, (actionItem: ActionItem, index: number) => { this.createActionItem(actionItem, this.onClickItem) if (index < this.actionItems.length - 1) { this.createDivider() } }) }.sectionStyle() }
https://gitcode.com/arkui-x/samples
2e005a91e47a8826bb327af833ebb3f19fec0149
gitcode
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/SearchHistoryRepository.ets
arkts
addSearchHistory
添加搜索历史记录 @param {string} keyword 搜索关键词 @returns {Promise<void>} Promise<void> @example const repo: SearchHistoryRepository = new SearchHistoryRepository(); await repo.addSearchHistory("手机");
async addSearchHistory(keyword: string): Promise<void> { const trimmed: string = keyword.trim(); if (!trimmed) { return; } const history: SearchHistory = new SearchHistory(); history.keyword = trimmed; history.searchTime = Date.now(); return this.dataSource.addSearchHistory(history);...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addSearchHistory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyword AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async addSearchHistory(keyword: string): Promise<void> { const trimmed: string = keyword.trim(); if (!trimmed) { return; } const history: SearchHistory = new SearchHistory(); history.keyword = trimmed; history.searchTime = Date.now(); return this.dataSource.addSearchHistory(history);...
https://github.com/Joker-x-dev/CoolMallArkTS
69eb03af0a2394c740df450e920bf38e598cfe53
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Char.ets
arkts
isValidCodePoint
isValidCodePoint() checks if the code point is correctly encoded. See UTF-16 for more details. @returns true if the code point is not malformed.
public static isValidCodePoint(value: UTF_16_CodePoint): boolean { return (Char.isInBasicMultilingualPlane(value)) || ((value & Char.HIGH_SURROGATE_BITS) == Char.HIGH_SURROGATE_BITS) && ((value & Char.LOW_SURROGATE_BITS) == Char.LOW_SURROGATE_BITS); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left isValidCodePoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left ...
public static isValidCodePoint(value: UTF_16_CodePoint): boolean { return (Char.isInBasicMultilingualPlane(value)) || ((value & Char.HIGH_SURROGATE_BITS) == Char.HIGH_SURROGATE_BITS) && ((value & Char.LOW_SURROGATE_BITS) == Char.LOW_SURROGATE_BITS); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
fdcc1677bb651a1fba3c7f8d063481316b7811a7
gitee
arkui-x/samples
CodeLab/Cases/feature/digitalscrollanimation/src/main/ets/pages/DigitalScrollDetail.ets
arkts
onDataRefresh
是否刷新 监听到刷新状态变化,执行回调
onDataRefresh() { if (this.isRefresh === false) { this.refreshData(); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onDataRefresh AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left...
onDataRefresh() { if (this.isRefresh === false) { this.refreshData(); } }
https://gitcode.com/arkui-x/samples
7421d18d611bbd933eb9abaf944ca82ebd13ac6c
gitcode
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/util/WindowUtil.ets
arkts
updateWindowInfo
Binds the main window, registers one-shot listeners, and loads initial size, breakpoints, and avoid areas.
updateWindowInfo(): void { try { this.mainWindowInfo.windowStatusType = this.mainWindow!.getWindowStatus(); this.mainWindow!.on('windowStatusChange', this.onStatusTypeChange); let width: number = this.mainWindow!.getWindowProperties().windowRect.width; let height: number = this.mainWindow...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateWindowInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b...
updateWindowInfo(): void { try { this.mainWindowInfo.windowStatusType = this.mainWindow!.getWindowStatus(); this.mainWindow!.on('windowStatusChange', this.onStatusTypeChange); let width: number = this.mainWindow!.getWindowProperties().windowRect.width; let height: number = this.mainWindow...
https://gitcode.com/HarmonyOS_Samples/MusicHome
df4c464c9021f625b6589c50fda7a0cbbf37ff0c
gitcode
arkui-x/samples
CodeLab/Cases/common/utils/src/main/ets/utils/NWebUtils.ets
arkts
getNWeb
获取NodeController
function getNWeb(url: string): NWebNodeController | null { if (currentNode.url != url || !currentNode.lastNetAvailable) { loadUrl(url); } connection.hasDefaultNet().then((data: boolean) => { currentNode.lastNetAvailable = data; }); return currentNode.nWebController; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getNWeb AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
function getNWeb(url: string): NWebNodeController | null { if (currentNode.url != url || !currentNode.lastNetAvailable) { loadUrl(url); } connection.hasDefaultNet().then((data: boolean) => { currentNode.lastNetAvailable = data; }); return currentNode.nWebController; }
https://gitcode.com/arkui-x/samples
e0d335512f928246d23deb4aaed98b6286857757
gitcode
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/utils/RouterManager.ets
arkts
pushWebView
打开应用内 WebView
static pushWebView(url: string, title: string = ''): void { RouterManager.pushPath( RouteConstants.PAGE_WEB_VIEW, new WebViewRouteParam(url, title) as Object ); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left pushWebView AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin...
static pushWebView(url: string, title: string = ''): void { RouterManager.pushPath( RouteConstants.PAGE_WEB_VIEW, new WebViewRouteParam(url, title) as Object ); }
https://github.com/Amaz1ny/HarmonyDO-public
1d544dbee957bb92e4fcdfb0354b59c1326d2b8a
github
HarmonyOS_Samples/BestPracticeSnippets
DealStrideSolution/entry/src/main/ets/utils/CameraServiceOne.ets
arkts
getCameraManagerFn
Get the Camera Manager instance
getCameraManagerFn(uiContext: UIContext): camera.CameraManager | undefined { if (this.cameraManager) { return this.cameraManager; } let cameraManager: camera.CameraManager | undefined = undefined; try { cameraManager = camera.getCameraManager(uiContext.getHostContext()); Logger.info(...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getCameraManagerFn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#:#Left : AST#:#Right...
getCameraManagerFn(uiContext: UIContext): camera.CameraManager | undefined { if (this.cameraManager) { return this.cameraManager; } let cameraManager: camera.CameraManager | undefined = undefined; try { cameraManager = camera.getCameraManager(uiContext.getHostContext()); Logger.info(...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
8005b6da8fb41dbaff37224ea2c493e82e13e341
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/YAxis.ets
arkts
setMaxWidth
Sets the maximum width that the axis can take (in vp). @param maxWidth
public setMaxWidth(maxWidth: number): void { this.mMaxWidth = maxWidth; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMaxWidth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left maxWidth AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Ri...
public setMaxWidth(maxWidth: number): void { this.mMaxWidth = maxWidth; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
3bfc3ac9144d08d1bd9c6d86e0b3bbfa878dfae0
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
constructor
Creates an Float64Array with respect to buf and byteOffset. @param buf data initializer @param byteOffset byte offset from begin of the buf
public constructor(buf: Buffer, byteOffset: int) { this(buf, byteOffset, buf.getByteLength() / Float64Array.BYTES_PER_ELEMENT) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Buffe...
public constructor(buf: Buffer, byteOffset: int) { this(buf, byteOffset, buf.getByteLength() / Float64Array.BYTES_PER_ELEMENT) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
9d1ca154a6e632926b862e0104c1afba40a1fcdd
gitee
openharmony/codelabs
ETSUI/HarmonyPhotoAlbum/entry/src/main/ets/service/PhotoService.ets
arkts
initDB
初始化数据库 @param context 应用上下文
initDB(context: common.UIAbilityContext): Promise<void> { const config: relationalStore.StoreConfig = { name: Constants.RDB_NAME, securityLevel: relationalStore.SecurityLevel.S1 }; return new Promise((resolve, reject) => { relationalStore.getRdbStore(context, config, (err, store) => { ...
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left initDB AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expres...
initDB(context: common.UIAbilityContext): Promise<void> { const config: relationalStore.StoreConfig = { name: Constants.RDB_NAME, securityLevel: relationalStore.SecurityLevel.S1 }; return new Promise((resolve, reject) => { relationalStore.getRdbStore(context, config, (err, store) => { ...
https://gitcode.com/openharmony/codelabs
350efa69ae6fdd21ec1d662cc1f606fa7d3cbea6
gitcode
youyeyejie/ZhiXing_ActHub
entry/src/test/TodoTestDataHelper.ets
arkts
insertTestTodos
生成并插入测试待办数据 @param count 生成数量(默认5个) @returns Promise<number> 成功插入的数量
async insertTestTodos(count: number = 5): Promise<number> { try { console.log(`开始生成${count}个测试待办数据...`); const todos = this.generateTestTodos(count); let insertedCount = 0; for (const todo of todos) { try { await this.repository.save(todo); inserte...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left insertTestTodos AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left count AST#identifier#Right AST#type_annotation#Left AS...
async insertTestTodos(count: number = 5): Promise<number> { try { console.log(`开始生成${count}个测试待办数据...`); const todos = this.generateTestTodos(count); let insertedCount = 0; for (const todo of todos) { try { await this.repository.save(todo); inserte...
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/test/TodoTestDataHelper.ets#L29-L53
6063cc880c4b0213d678b7148b707d7f23fb5627
github
openharmony-sig/qr-code-generator
library/src/main/ets/components/MainPage/qrcodegen.ets
arkts
addEccAndInterleave
-- Private helper methods for constructor: Codewords and masking -- Returns a new byte string representing the given data with the appropriate error correction codewords appended to it, based on this object's version and error correction level.
private addEccAndInterleave(data: Array<byte>): Array<byte> { const ver: int = this.version; const ecl: QrCode.Ecc = this.errorCorrectionLevel; if (data.length != QrCode.getNumDataCodewords(ver, ecl)) throw new Error("Invalid argument"); // Calculate parameter numbers const numB...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left addEccAndInterleave AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantia...
private addEccAndInterleave(data: Array<byte>): Array<byte> { const ver: int = this.version; const ecl: QrCode.Ecc = this.errorCorrectionLevel; if (data.length != QrCode.getNumDataCodewords(ver, ecl)) throw new Error("Invalid argument"); // Calculate parameter numbers const numB...
https://gitee.com/openharmony-sig/qr-code-generator.git
f6eb8f2a58955b861025bc1dce22ec9f4c3c1061
gitee
openharmony/codelabs
ETSUI/Habit/entry/src/main/ets/pages/StatsPage.ets
arkts
calculateStreak
计算连续天数 (逻辑保留,虽然界面不显示了)
calculateStreak(dates: string[]): number { if (dates.length === 0) { return 0; } let uniqueDates = Array.from(new Set(dates)).sort().reverse(); let now = new Date(); let todayStr = DateUtil.formatDate(now.getTime()); let yesterday = new Date(); yesterday.setDate(now.getDate() - 1); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateStreak AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dates AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left string AS...
calculateStreak(dates: string[]): number { if (dates.length === 0) { return 0; } let uniqueDates = Array.from(new Set(dates)).sort().reverse(); let now = new Date(); let todayStr = DateUtil.formatDate(now.getTime()); let yesterday = new Date(); yesterday.setDate(now.getDate() - 1); ...
https://gitcode.com/openharmony/codelabs
937c176f06bc639861567449d472d449b2309b39
gitcode
openharmony/codelabs
Media/VideoPlayer/entry/src/main/ets/viewmodel/HomeDialogModel.ets
arkts
checkUrlValidity
Verifying Network Connections.
checkUrlValidity() { this.isLoading = false; this.homeTabModel.linkCheck = $r('app.string.link_check'); this.homeTabModel.loadColor = $r('app.color.index_tab_selected_font_color'); if (this.avPlayer !== null) { this.avPlayer.release(); } if (this.duration === HomeConstants.DURATION_TWO) ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left checkUrlValidity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L...
checkUrlValidity() { this.isLoading = false; this.homeTabModel.linkCheck = $r('app.string.link_check'); this.homeTabModel.loadColor = $r('app.color.index_tab_selected_font_color'); if (this.avPlayer !== null) { this.avPlayer.release(); } if (this.duration === HomeConstants.DURATION_TWO) ...
https://gitee.com/openharmony/codelabs.git
2fc98a22570f3410bccaf3ce49670edda09ff9cf
gitee
chendi126/harmonyOS-TCP
entry/src/main/ets/common/GlassStyles.ets
arkts
getSlideAnimationDuration
获取滑入动画持续时间
static getSlideAnimationDuration(): number { return 400; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getSlideAnimationDuration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left ...
static getSlideAnimationDuration(): number { return 400; }
https://github.com/chendi126/harmonyOS-TCP
67a0e51cb69d52d8d7547ec5606c690ace36e52b
github
openharmony-sig/earth
hpauditor/tests/issues/expected/issue48.ets.audit.ets
arkts
printDelay
HPAudit: Explicitly declare return types of functions and methods : hp-specs-explicit-return-types : 1 : 13 : issue48.ets
printDelay(): void { /* HPAudit: Do not assign this to a variable : hp-specs-no-this-to-vars : 1 : 14 : issue48.ets */ const self = this; setTimeout(function() { self.sayHi(); }, 2000) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left printDelay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L...
printDelay(): void { /* HPAudit: Do not assign this to a variable : hp-specs-no-this-to-vars : 1 : 14 : issue48.ets */ const self = this; setTimeout(function() { self.sayHi(); }, 2000) }
https://gitee.com/openharmony-sig/earth.git
41cc710c95e2c28a768a2bc12d12c1ad50b4f703
gitee
offlinecat-dev/OCNetORM
src/main/ets/query/WhereCondition.ets
arkts
notEqual
创建不等于条件 @param column 列名 @param value 值 @returns WhereCondition 实例
static notEqual(column: string, value: ValueType): WhereCondition { const condition = new WhereCondition() condition.column = column condition.operator = ConditionOperator.NOT_EQUAL condition.value = value return condition }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left notEqual AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin...
static notEqual(column: string, value: ValueType): WhereCondition { const condition = new WhereCondition() condition.column = column condition.operator = ConditionOperator.NOT_EQUAL condition.value = value return condition }
https://github.com/offlinecat-dev/OCNetORM
a26d5130bc8be4ac27ddc51b2f8eadefdf41b64c
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/Bill.ets
arkts
constructor
0 = 正常, 1 = 已删除
constructor( billId: number = 0, userId: number = 0, accountId: number = 0, categoryId: number = 0, amount: number = 0.0, note: string = '', transactionDate: string = '', type: 'income' | 'expense' = 'expense', createdAt: string = '', updatedAt: string = '', isDeleted: numb...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left billId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#L...
constructor( billId: number = 0, userId: number = 0, accountId: number = 0, categoryId: number = 0, amount: number = 0.0, note: string = '', transactionDate: string = '', type: 'income' | 'expense' = 'expense', createdAt: string = '', updatedAt: string = '', isDeleted: numb...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
a5ad5f9f0faf5f2440a5a0b5ce3cfe3874cebd1c
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets
arkts
closed
Readable completes destroyfile and returns true, otherwise returns false.
get closed(): boolean { return this.closedInner === undefined ? false : this.closedInner!; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left closed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right A...
get closed(): boolean { return this.closedInner === undefined ? false : this.closedInner!; }
https://gitcode.com/iop123123/arkts-static-skills
a0a58081175f2c2ad6d847518e27398c0ce4eaba
gitcode
openharmony-sig/ohos_danmaku_flame_master
library/src/main/ets/components/common/master/flame/danmaku/danmaku/model/ohos/DanmakuContext.ets
arkts
preventOverlapping
���÷���Ļ�ص� @param pairs map<K,V> ����null�ָ�Ĭ������,Ĭ��Ϊ�����ص� K = (BaseDanmaku.TYPE_SCROLL_RL|BaseDanmaku.TYPE_SCROLL_LR|BaseDanmaku.TYPE_FIX_TOP|BaseDanmaku.TYPE_FIX_BOTTOM) V = true|false �Ƿ��ص� @return
public preventOverlapping(pairs: Map<number, boolean>): DanmakuContext { this.mIsPreventOverlappingEnabled = (pairs != null); if (pairs == null) { this.mDanmakuFilters.unregisterFilter({ tag: DanmakuFilters.TAG_OVERLAPPING_FILTER, primary: false }); } else { this.setFilterData(DanmakuFilters.T...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left preventOverlapping AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left pairs AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Righ...
public preventOverlapping(pairs: Map<number, boolean>): DanmakuContext { this.mIsPreventOverlappingEnabled = (pairs != null); if (pairs == null) { this.mDanmakuFilters.unregisterFilter({ tag: DanmakuFilters.TAG_OVERLAPPING_FILTER, primary: false }); } else { this.setFilterData(DanmakuFilters.T...
https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git
a647bb27e5be226c4498958ddd86ada29c0c3331
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/components/charts/base/BaseChart.ets
arkts
constructor
构造函数 @param config 初始配置 @param data 初始数据
constructor(config: BaseChartConfig, data: ChartData<T>) { this.config = config; this.data = data; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BaseChartConfig AST#identif...
constructor(config: BaseChartConfig, data: ChartData<T>) { this.config = config; this.data = data; }
https://github.com/LJ666-ui/harmony-health-care
c420d2f2f2d9353455e1e85e96c644515946b9b9
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MainMenuPage.ets
arkts
addDynamicCustomKeyword
添加动态书架自定义关键词
private addDynamicCustomKeyword(): void { const keyword = this.dynamicFilterCustomInput.trim(); if (keyword.length === 0) return; if (this.dynamicFilterCustomKeywords.includes(keyword)) { this.showToast('该关键词已存在'); return; } this.dynamicFilterCustomKeywords = this.dynamicFilterCustomKe...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left addDynamicCustomKeyword AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left v...
private addDynamicCustomKeyword(): void { const keyword = this.dynamicFilterCustomInput.trim(); if (keyword.length === 0) return; if (this.dynamicFilterCustomKeywords.includes(keyword)) { this.showToast('该关键词已存在'); return; } this.dynamicFilterCustomKeywords = this.dynamicFilterCustomKe...
https://github.com/DaLongZhuaZi/manxia
bbdb7fee0f072147e3467413405a5c85dd4682da
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
from
Creates an array from a set of type std.core.Set<int>. @param { Set<int> } set - A set object to convert to an array. @returns { Uint8ClampedArray } - A new Uint8ClampedArray @throws { RangeError } - Input parameter error. @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(set: Set<int>): Uint8ClampedArray { const length = set.size; const result = new Uint8ClampedArray(length) let iter = set.$_iterator() for (let i:int = 0; i < length; ++i) { const x = iter.next() if (x.done) { throw new RangeE...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Righ...
public static from(set: Set<int>): Uint8ClampedArray { const length = set.size; const result = new Uint8ClampedArray(length) let iter = set.$_iterator() for (let i:int = 0; i < length; ++i) { const x = iter.next() if (x.done) { throw new RangeE...
https://gitcode.com/iop123123/arkts-static-skills
3767bb03329ab9a08fc42cdcdad90bd87316a258
gitcode
tdcare/tdwebrtc
src/main/ets/WebRTCManager.ets
arkts
stopVideoEncoder
停止 Rust 层内部视频编码器
public stopVideoEncoder(): boolean { if (!this.client) return false; return this.client.stopVideoEncoder(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left stopVideoEncoder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean ...
public stopVideoEncoder(): boolean { if (!this.client) return false; return this.client.stopVideoEncoder(); }
https://github.com/tdcare/tdwebrtc
28ff135cfd424532a4435fdfe67d8787d0cff419
github
genjishare/snake-game
entry/src/main/ets/common/model/GameData.ets
arkts
constructor
入口边界信息
constructor(gameState?: GameState) { if (gameState) { this.snake = gameState.snake || []; this.food = gameState.food || { x: 0, y: 0 }; this.direction = gameState.direction || 'right'; this.nextDirection = gameState.nextDirection || 'right'; this.score = gameState.score || 0; ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left gameState AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left...
constructor(gameState?: GameState) { if (gameState) { this.snake = gameState.snake || []; this.food = gameState.food || { x: 0, y: 0 }; this.direction = gameState.direction || 'right'; this.nextDirection = gameState.nextDirection || 'right'; this.score = gameState.score || 0; ...
https://github.com/genjishare/snake-game
6ad9f1d62a9f2268080cb40055bee76bf3d0ffdd
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncArrayConcurrentQueue.ets
arkts
constructor
Constructs a ArrayConcurrentQueue with provided capacity. @param { int } capacity the capacity of the ArrayConcurrentQueue @syscap SystemCapability.Utils.Lang
constructor(capacity: int) { if (capacity <= 0) { // NOTE(ypigunova): #33368 Add typed error throw new RangeError("Invalid capacity for ArrayConcurrentQueue's constructor."); } this.capacitySize = capacity; this.array = Array.create...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right ...
constructor(capacity: int) { if (capacity <= 0) { // NOTE(ypigunova): #33368 Add typed error throw new RangeError("Invalid capacity for ArrayConcurrentQueue's constructor."); } this.capacitySize = capacity; this.array = Array.create...
https://gitcode.com/iop123123/arkts-static-skills
bdadd37d03f79af8c7d153e9973f8096d93c0900
gitcode
Joker-x-dev/CoolMallArkTS
core/util/src/main/ets/context/ContextUtil.ets
arkts
init
在 UIAbility 的 onCreate 方法中获取 UIAbilityContext
static init(context: common.UIAbilityContext) { ContextUtil.context = context; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AS...
static init(context: common.UIAbilityContext) { ContextUtil.context = context; }
https://github.com/Joker-x-dev/CoolMallArkTS
cde53272da33494fca7541516243eac14e0dd5a4
github
arkui-x/samples
CodeLab/Cases/feature/databaseupgrade/src/main/ets/utils/DBUtils.ets
arkts
queryData
通用查询 @param tableName 表名 @param limit 最大查询数量 @param lastId 上一次查询id @param callback 业务逻辑
async queryData(tableName: string, limit: number, lastId: number, callback: (result: relationalStore.ResultSet) => Promise<void>): Promise<void> { if (store === undefined) { return; } const querySql: string = util.format(Constants.QUERY_TABLE_SQL_TEMPLATE, tableName, lastId, limit); try { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left queryData AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left tableName AST#identifier#Right AST#...
async queryData(tableName: string, limit: number, lastId: number, callback: (result: relationalStore.ResultSet) => Promise<void>): Promise<void> { if (store === undefined) { return; } const querySql: string = util.format(Constants.QUERY_TABLE_SQL_TEMPLATE, tableName, lastId, limit); try { ...
https://gitcode.com/arkui-x/samples
a939f2fcaf836e8eb0a8ecb688f5c42cb6646605
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Char.ets
arkts
equals
equals(Object) compares two Chars by their underlying primitive chars. @param other a reference to object to be compared with. @returns comparison result of underlying primitive chars. Returns false if the argument is not an instance of Char.
public override equals(other: Object|null): boolean { if (other instanceof Char) { return this.value == (other as Char).unboxed(); } return false; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left equals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#...
public override equals(other: Object|null): boolean { if (other instanceof Char) { return this.value == (other as Char).unboxed(); } return false; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
adcaa048a61bef773c666eff2bb978dad519302d
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/services/AuthService.ets
arkts
sendVerificationCode
发送验证码 @param phone 手机号 @returns 发送结果
static async sendVerificationCode(phone: string): Promise<BaseResponse<void>> { return await HttpUtil.post<void>(`${this.BASE_URL}/send-code`, { phone }, { skipAuth: true }); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left sendVerificationCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left phone AST#identifier#Right AST#:#Le...
static async sendVerificationCode(phone: string): Promise<BaseResponse<void>> { return await HttpUtil.post<void>(`${this.BASE_URL}/send-code`, { phone }, { skipAuth: true }); }
https://github.com/LJ666-ui/harmony-health-care
7483e63b4db72fba232d2431fea69e23b14db288
github
arkui-x/samples
CodeLab/Cases/feature/customscan/src/main/ets/viewmodel/CustomScanViewModel.ets
arkts
closeScanResult
关闭扫码结果 @returns {void}
closeScanResult(): void { logger.info('closeScanResult'); if (this.scanResultDialogId) { promptAction.closeCustomDialog(this.scanResultDialogId); this.scanResultDialogId = undefined; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left closeScanResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bl...
closeScanResult(): void { logger.info('closeScanResult'); if (this.scanResultDialogId) { promptAction.closeCustomDialog(this.scanResultDialogId); this.scanResultDialogId = undefined; } }
https://gitcode.com/arkui-x/samples
442d5a18fbd1a48980ab3e925c9d0879a6d4e59f
gitcode
OMGCA/sakipay
sakipay_hmos/main/src/main/ets/models/HolidayCalendar.ets
arkts
isHoliday
Returns true if the given month/day is a public holiday (day off).
public isHoliday(month: number, day: number): boolean { const key: string = `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}` return this.holidays.has(key) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isHoliday AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left month AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numbe...
public isHoliday(month: number, day: number): boolean { const key: string = `${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}` return this.holidays.has(key) }
https://github.com/OMGCA/sakipay
be6832befa84689634ba51ef647fc6581a7eb57f
github
openharmony/codelabs
Data/PersonalAssistantPro/entry/src/main/ets/services/BiometricService.ets
arkts
checkAvailability
检查当前设备是否支持生物认证
checkAvailability(): boolean { try { userAuth.getAvailableStatus(userAuth.UserAuthType.FINGERPRINT, userAuth.AuthTrustLevel.ATL1); this.logger.info('Biometric check passed (Supported).'); return true; } catch (error) { this.logger.error(`Biometric check failed: ${JSON.stringify(error)}...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left checkAvailability AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#s...
checkAvailability(): boolean { try { userAuth.getAvailableStatus(userAuth.UserAuthType.FINGERPRINT, userAuth.AuthTrustLevel.ATL1); this.logger.info('Biometric check passed (Supported).'); return true; } catch (error) { this.logger.error(`Biometric check failed: ${JSON.stringify(error)}...
https://gitcode.com/openharmony/codelabs
75661700564e6cfd6366800475ff93363f38ed55
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SharedLedgerDAO.ets
arkts
getByInvitationCode
根据邀请码获取邀请
static async getByInvitationCode(code: string): Promise<LedgerInvitation | null> { let resultSet: relationalStore.ResultSet | null = null; try { const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(LedgerInvitation.tableName); predicates.equalTo('...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getByInvitationCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left...
static async getByInvitationCode(code: string): Promise<LedgerInvitation | null> { let resultSet: relationalStore.ResultSet | null = null; try { const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(LedgerInvitation.tableName); predicates.equalTo('...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
960c406a03762bde0a27c2950e35b203031f75d7
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/MouseEmulationService.ets
arkts
setCallback
==================== 公开 API ==================== 设置鼠标模拟回调(由 StreamPage 调用)
setCallback(callback: MouseEmulationCallback | null): void { this.callback = callback; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left MouseEmulatio...
setCallback(callback: MouseEmulationCallback | null): void { this.callback = callback; }
https://github.com/AlkaidLab/moonlight-harmony
06af24b1993344f60f5808b38bf2d374bd29a801
github