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
richshaw2015/nds
ohos/entry/src/main/ets/utils/NdsRomCache.ets
arkts
clearCache
清除所有缓存 Requirements: 2.7 @returns 是否成功
clearCache(): boolean { const cacheDir = this.getCacheDir(); if (!cacheDir) { return false; } try { const result = this.deleteDirectoryRecursively(cacheDir); this.notifyCacheChanged(); hilog.info(DOMAIN, TAG, 'Cache cleared, result: %{public}s', result.toString()); retur...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearCache 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#statemen...
clearCache(): boolean { const cacheDir = this.getCacheDir(); if (!cacheDir) { return false; } try { const result = this.deleteDirectoryRecursively(cacheDir); this.notifyCacheChanged(); hilog.info(DOMAIN, TAG, 'Cache cleared, result: %{public}s', result.toString()); retur...
https://github.com/richshaw2015/nds
95b4795887d9131220f77565027071822124ffe2
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/utils/WatchHistoryManager.ets
arkts
getRecentWatchHistory
获取最近观看的N条记录
getRecentWatchHistory(limit: number = 20): WatchHistoryModel[] { const allHistory = this.getAllWatchHistory() return allHistory.slice(0, limit) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getRecentWatchHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left limit AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#Left nu...
getRecentWatchHistory(limit: number = 20): WatchHistoryModel[] { const allHistory = this.getAllWatchHistory() return allHistory.slice(0, limit) }
https://github.com/SMAT-Lab/PhantomRendering
c77b5b3ababe2b8bdf646323e8881eb4778cc9fb
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/FavoriteViewModel.ets
arkts
resetAndLoad
强制重置并重新加载 (用于切换账号)
public resetAndLoad() { this.trendList = []; this.collectionList = []; this.followList = []; this.trendNovels = []; this.collectionNovels = []; // 重置小说 this.nextTrendUrlPublic = ''; this.nextTrendUrlPrivate = ''; this.nextCollectionUrlPublic = ''; this.nextCollectionUrlPrivate = ''; this.nextTren...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetAndLoad 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 { ...
public resetAndLoad() { this.trendList = []; this.collectionList = []; this.followList = []; this.trendNovels = []; this.collectionNovels = []; // 重置小说 this.nextTrendUrlPublic = ''; this.nextTrendUrlPrivate = ''; this.nextCollectionUrlPublic = ''; this.nextCollectionUrlPrivate = ''; this.nextTren...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/FavoriteViewModel.ets#L89-L105
a2dfb793e42343aa339a03d5172a05e944e68324
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/EBookDataManager.ets
arkts
ensureSettingsColumns
确保 ebook_reading_settings 表有所有需要的列 注意:暂时移除缓存检查,确保每次都执行列检查
private async ensureSettingsColumns(): Promise<void> { // 暂时禁用缓存,确保每次都检查 // if (this.settingsColumnsChecked) { // return; // } try { logger.info(TAG, '检查 ebook_reading_settings 表列...'); const result = await this.dbManager.querySql("PRAGMA table_info('ebook_reading_settings')", [...
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 ensureSettingsColumns AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
private async ensureSettingsColumns(): Promise<void> { // 暂时禁用缓存,确保每次都检查 // if (this.settingsColumnsChecked) { // return; // } try { logger.info(TAG, '检查 ebook_reading_settings 表列...'); const result = await this.dbManager.querySql("PRAGMA table_info('ebook_reading_settings')", [...
https://github.com/DaLongZhuaZi/manxia
f3dd8a2af41eae9d21fffe20ef18534d2fe65da4
github
LJ666-ui/harmony-health-care
entry/src/main/ets/smartward/core/checkers/TimeChecker.ets
arkts
startTimeCheck
启动时间检查
public startTimeCheck(): void { if (this.timerId !== null) { console.log('TimeChecker: Already running'); return; } this.timerId = setInterval(() => { this.checkTimeRules(); }, this.checkInterval); console.log(`TimeChecker: Started with interval ${this.checkInterval}ms`); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startTimeCheck 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#express...
public startTimeCheck(): void { if (this.timerId !== null) { console.log('TimeChecker: Already running'); return; } this.timerId = setInterval(() => { this.checkTimeRules(); }, this.checkInterval); console.log(`TimeChecker: Started with interval ${this.checkInterval}ms`); }
https://github.com/LJ666-ui/harmony-health-care
a61710c7e01212ea4c5c8a56055d8048b3ea05a1
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncCondVar.ets
arkts
notifyAll
Unblocks ALL suspended coroutine associated with this CondVar. This method is thread-safe in relation to other methods of the CondVar. @param { AsyncMutex } mutex - The mutex associated with the condition, must be locked when calling to ensure correct synchronization @syscap SystemCapability.Utils.Lang pre-condition: m...
public notifyAll(mutex: AsyncMutex): void { while (this.waiters_ != 0) { this.waitersList_.resume(); this.waiters_--; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left notifyAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mutex AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Async...
public notifyAll(mutex: AsyncMutex): void { while (this.waiters_ != 0) { this.waitersList_.resume(); this.waiters_--; } }
https://gitcode.com/iop123123/arkts-static-skills
82dd576a0c4ca6256f1d2e1c26bb2b9c7d05ab6f
gitcode
CPF-ApplicationTPC/openharmony_tpc_samples
SwipeMenuListView/library/src/main/ets/utils/SwipeMenuListUtils.ets
arkts
getDrawable
获取drawable资源路径 @param context 上下文对象 @param resId drawable资源ID @returns Promise<string> 资源路径
public static async getDrawable(context: common.UIAbilityContext, resId: number): Promise<string> { try { return await context.resourceManager.getStringValue(resId); } catch (error) { logger.warn(`Failed to get drawable resource ${resId}:`, error); return ''; } }
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#call_expression#Left AST#identifier#Left getDrawable AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left contex...
public static async getDrawable(context: common.UIAbilityContext, resId: number): Promise<string> { try { return await context.resourceManager.getStringValue(resId); } catch (error) { logger.warn(`Failed to get drawable resource ${resId}:`, error); return ''; } }
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
698085f717d09f44edee335416043add0118202e
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/EventSourcingService.ets
arkts
getCurrentVersion
获取当前聚合版本
private static async getCurrentVersion(aggregateType: string, aggregateId: number): Promise<number> { try { const events = await DomainEventDAO.getByAggregate(aggregateType, aggregateId, 0); if (events.length === 0) { return 0; } return events[events.length - 1].version; } catc...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left getCurrentVersion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left aggregateTyp...
private static async getCurrentVersion(aggregateType: string, aggregateId: number): Promise<number> { try { const events = await DomainEventDAO.getByAggregate(aggregateType, aggregateId, 0); if (events.length === 0) { return 0; } return events[events.length - 1].version; } catc...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
56b5f10a7476a9f0fd219e15a169f95d851b80d3
github
offlinecat-dev/OCNetORM
src/main/ets/core/HooksProcessor.ets
arkts
hasAnyHook
检查实体是否有任何钩子 @param entityName 实体名称 @returns 是否有任何钩子
hasAnyHook(entityName: string): boolean { return this.hasHook(entityName, 'beforeSave') || this.hasHook(entityName, 'afterLoad') || this.hasHook(entityName, 'beforeDelete') || this.hasHook(entityName, 'beforeInsert') || this.hasHook(entityName, 'afterInsert') || this.hasHook(entityNa...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasAnyHook 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 AST#ERROR#Right AST#)#Left ) AST#)#...
hasAnyHook(entityName: string): boolean { return this.hasHook(entityName, 'beforeSave') || this.hasHook(entityName, 'afterLoad') || this.hasHook(entityName, 'beforeDelete') || this.hasHook(entityName, 'beforeInsert') || this.hasHook(entityName, 'afterInsert') || this.hasHook(entityNa...
https://github.com/offlinecat-dev/OCNetORM
a9facf139e9de7cb61fe572e4a1af03af8ca1400
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
fill
Fills the Float32Array with specified value @param { float } value - new value @param { int } [start] - start index to begin fill from @param { int } [end] - last index to end fill from, excluded @returns { this } - modified Float32Array @syscap SystemCapability.Utils.Lang @FaAndStageModel
public fill(value: float, start?: int, end?: int): this { const k = normalizeIndex(start ?? 0, this.lengthInt) const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt) this.fillInternal(value, k, finalPos) return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left fill AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR...
public fill(value: float, start?: int, end?: int): this { const k = normalizeIndex(start ?? 0, this.lengthInt) const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt) this.fillInternal(value, k, finalPos) return this }
https://gitcode.com/iop123123/arkts-static-skills
1a35955b7049b9c692827ae6a8d77057cbee9af6
gitcode
ZestBox-18/kitebook-frontend
commons/data_core/src/main/ets/services/AccountManager.ets
arkts
deleteAccount
删除账户;仅在没有账单引用时允许删除。
static async deleteAccount(id: number): Promise<number> { const account: AccountBean | null = await AccountManager.getAccountById(id); if (account === null) { return -1; } const hasReferencedBills: boolean = await AccountManager.hasReferencedBills(account.name); if (hasReferencedBills) { ...
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 deleteAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:...
static async deleteAccount(id: number): Promise<number> { const account: AccountBean | null = await AccountManager.getAccountById(id); if (account === null) { return -1; } const hasReferencedBills: boolean = await AccountManager.hasReferencedBills(account.name); if (hasReferencedBills) { ...
https://github.com/ZestBox-18/kitebook-frontend
f2127431f5125f21dee32becaf53654a740f1f3d
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/ARRenderer.ets
arkts
updateArrowColor
更新箭头颜色 @param color 颜色
public updateArrowColor(color: string): void { this.arrowColor = color; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateArrowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
public updateArrowColor(color: string): void { this.arrowColor = color; }
https://github.com/LJ666-ui/harmony-health-care
5fc4aae420888e77650f2eaa3873fa634e84caff
github
richshaw2015/nds
ohos/entry/src/main/ets/utils/CheatManager.ets
arkts
clearAllOnlineCache
清除所有在线缓存
clearAllOnlineCache(): void { const dir = this.getCheatsDir(); if (!dir) return; try { const entries = fileIo.listFileSync(dir); for (const entry of entries) { // 只删除在线缓存文件(格式: XXXX.XXXXXXXX.xml,不是 cheats.xml 也不是 _enabled.json) if (entry.endsWith('.xml') && entry !== 'cheats.xm...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearAllOnlineCache 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#statemen...
clearAllOnlineCache(): void { const dir = this.getCheatsDir(); if (!dir) return; try { const entries = fileIo.listFileSync(dir); for (const entry of entries) { // 只删除在线缓存文件(格式: XXXX.XXXXXXXX.xml,不是 cheats.xml 也不是 _enabled.json) if (entry.endsWith('.xml') && entry !== 'cheats.xm...
https://github.com/richshaw2015/nds
333e26c2f8f53cfa9b6fa0c6ef3acaec84c4b4f2
github
Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie
StackGameWithUnityDevEcoExport/tuanjieLib/src/main/ets/utils/TuanjieNative.ets
arkts
nativeOnLocationChange
Notifies engine location changed. @param location - location data.
public static nativeOnLocationChange(location: ESObject): void { tuanjie.nativeOnLocationChange(location); }
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 nativeOnLocationChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left location AST#identifier#Right AS...
public static nativeOnLocationChange(location: ESObject): void { tuanjie.nativeOnLocationChange(location); }
https://github.com/Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie
18f82933a98663665b203e859adc87872e90908d
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/HTMLElement.ets
arkts
lastChild
获取最后一个子元素
get lastChild(): Node | null { return this.childNodes.length > 0 ? this.childNodes[this.childNodes.length - 1] : null; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left lastChild 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_expression#Left AST#identifier...
get lastChild(): Node | null { return this.childNodes.length > 0 ? this.childNodes[this.childNodes.length - 1] : null; }
https://github.com/DaLongZhuaZi/manxia
eb43bb580f0432566274ccbbd6c4974aafddca4c
github
heeh02/superconnect
harmony/entry/src/main/ets/input/GestureController.ets
arkts
abortForPen
Pen took over mid finger-gesture (Index calls this when sourceTool===Pen).
abortForPen(): void { if (this.st === GState.OneFinger || this.movedOnce) { this.fire(InputType.TouchUp, 0, this.last); // release any held left button } this.reset(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left abortForPen 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#Lef...
abortForPen(): void { if (this.st === GState.OneFinger || this.movedOnce) { this.fire(InputType.TouchUp, 0, this.last); // release any held left button } this.reset(); }
https://github.com/heeh02/superconnect
a3f138c549484187d7dcd08e95437fb578004cda
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/AdviceFeedbackDAO.ets
arkts
parseResultSet
解析查询结果
private static parseResultSet(resultSet: relationalStore.ResultSet): AdviceFeedback { const feedback = new AdviceFeedback(); feedback.feedbackId = resultSet.getLong(resultSet.getColumnIndex('feedback_id')); feedback.userId = resultSet.getLong(resultSet.getColumnIndex('user_id')); feedback.adviceId = r...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left parseResultSet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#...
private static parseResultSet(resultSet: relationalStore.ResultSet): AdviceFeedback { const feedback = new AdviceFeedback(); feedback.feedbackId = resultSet.getLong(resultSet.getColumnIndex('feedback_id')); feedback.userId = resultSet.getLong(resultSet.getColumnIndex('user_id')); feedback.adviceId = r...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e566aff42ad77b7b1c9c3acc22ff876d7c7d040d
github
HarmonyOS_Samples/BestPracticeSnippets
WaterFlowSample/entry/src/main/ets/model/StickyWaterFlowDataSource.ets
arkts
unregisterDataChangeListener
Register a controller that changes data. @param {DataChangeListener} listener Data change listener
unregisterDataChangeListener(listener: DataChangeListener): void { let pos: number = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left unregisterDataChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DataChangeListener AST#...
unregisterDataChangeListener(listener: DataChangeListener): void { let pos: number = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
47b4afd2499a1d6bb89fc83e6c2b88c147a73e1a
gitcode
Dabing-0x19d/berverage_HarmonyOS6.0
entry/src/main/ets/common/utils/PreferencesUtil.ets
arkts
removeWeekFormId
删除周数据卡片的 formId
removeWeekFormId(preferences: preferences.Preferences, formId: string): void { try { let formIds = this.getWeekFormIds(preferences); const index = formIds.indexOf(formId); if (index !== -1) { formIds.splice(index, 1); this.preferencesPut(preferences, 'weekFormIdList', formIds); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeWeekFormId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left preferences AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left prefe...
removeWeekFormId(preferences: preferences.Preferences, formId: string): void { try { let formIds = this.getWeekFormIds(preferences); const index = formIds.indexOf(formId); if (index !== -1) { formIds.splice(index, 1); this.preferencesPut(preferences, 'weekFormIdList', formIds); ...
https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0
0fc59197fb5d575297bf1f7a08af722401ba1532
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/IMService.ets
arkts
getDepartmentContacts
获取部门联系人列表 @param departmentId 部门ID
async getDepartmentContacts(departmentId?: string): Promise<ApiResponse<{ contacts: Contact[] }>> { return this.client.get<{ contacts: Contact[] }>('/api/v1/im/contacts/department', departmentId ? { departmentId } : undefined) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getDepartmentContacts AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left departmentId AST#identifier#Right AST#?#Left ? AST#?#Righ...
async getDepartmentContacts(departmentId?: string): Promise<ApiResponse<{ contacts: Contact[] }>> { return this.client.get<{ contacts: Contact[] }>('/api/v1/im/contacts/department', departmentId ? { departmentId } : undefined) }
https://github.com/David8Idira/AI-OA
95470b1b9d214b690b4078ad7e9ce6341051ea84
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/IMService.ets
arkts
markRead
标记会话已读 @param conversationId 会话ID @param messageId 消息ID(传入则标记到该消息)
async markRead(conversationId: string, messageId?: string): Promise<ApiResponse<any>> { return this.client.post<any>(`/api/v1/im/conversations/${conversationId}/read`, messageId ? { messageId } : {}) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left markRead AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left conversationId AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async markRead(conversationId: string, messageId?: string): Promise<ApiResponse<any>> { return this.client.post<any>(`/api/v1/im/conversations/${conversationId}/read`, messageId ? { messageId } : {}) }
https://github.com/David8Idira/AI-OA
dd578fdcf1eb806726ff2b1656760d4aa86c123d
github
jjjjjjava/ffmpeg_tools
src/main/ets/ffmpeg/FFmpegFactory.ets
arkts
imageConvert
图片格式转换 @param input 输入图片路径 @param output 输出图片路径 @param quality 质量 1-31(数字越小质量越高),默认 2
public static imageConvert(input: string, output: string, quality: number = 2): string[] { return [ 'ffmpeg', '-i', input, '-q:v', quality.toString(), '-y', output ]; }
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 imageConvert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AS...
public static imageConvert(input: string, output: string, quality: number = 2): string[] { return [ 'ffmpeg', '-i', input, '-q:v', quality.toString(), '-y', output ]; }
https://github.com/jjjjjjava/ffmpeg_tools
3a4de41a4639247d3df608d2d2e47be3259627da
github
openharmony/applications_app_samples
code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/VideoTrimmerView.ets
arkts
releaseAvPlayer
释放播放器
releaseAvPlayer(): Promise<void> { return new Promise((resolve, reject) => { if (this && this.avPlayer) { this.setOffCallback(); this.avPlayer?.stop().then(() => { this.avPlayer?.release().then(() => { resolve(); }) .catch((err: BusinessError) => {...
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left releaseAvPlayer 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 AS...
releaseAvPlayer(): Promise<void> { return new Promise((resolve, reject) => { if (this && this.avPlayer) { this.setOffCallback(); this.avPlayer?.stop().then(() => { this.avPlayer?.release().then(() => { resolve(); }) .catch((err: BusinessError) => {...
https://github.com/openharmony/applications_app_samples
f4bdd9fb92e00addbd18215a5ce70975b2a25fa4
github
openharmony/applications_app_samples
code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets
arkts
createDecodingOptions
创造解码参数
createDecodingOptions(): string | number | image.DecodingOptionsForPicture { let message = ndkTest.createDecodingOptions(); return this.logger.check_result(`createDecodingOptions`, message); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left createDecodingOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left A...
createDecodingOptions(): string | number | image.DecodingOptionsForPicture { let message = ndkTest.createDecodingOptions(); return this.logger.check_result(`createDecodingOptions`, message); }
https://github.com/openharmony/applications_app_samples
8587c8e0ab34fe0e7d187c1e0916c0b602679374
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets
arkts
constructor
Create EAWorker instance with specified task @param { Task } task The task function to execute @param { boolean } [needInterop=false] true if need to create JS runtime
constructor(task: Task, needInterop: boolean = false) { this("EAWorker", task, needInterop); }
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 task AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Task AST#identifier#Right AST...
constructor(task: Task, needInterop: boolean = false) { this("EAWorker", task, needInterop); }
https://gitcode.com/iop123123/arkts-static-skills
9da9c2709c43fb4baba0b433d235547de035de20
gitcode
openharmony-sig/ohos_checksum
library/src/main/ets/sha1.ets
arkts
rol
Bitwise rotate a 32-bit number to the left. 32位二进制数循环左移
rol(num: number, cnt: number) { return (num << cnt) | (num >>> (32 - cnt)); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left rol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left num AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left...
rol(num: number, cnt: number) { return (num << cnt) | (num >>> (32 - cnt)); }
https://gitee.com/openharmony-sig/ohos_checksum.git
25ce7091f8a0b619b03657702d28504a15528eec
gitee
openharmony/arkui_ace_engine
examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets
arkts
makeEci
Returns a segment representing an Extended Channel Interpretation (ECI) designator with the given assignment value.
public static makeEci(assignVal: int): QrSegment { let bb: Array<bit> = [] if (assignVal < 0) { throw new RangeError("ECI assignment value out of range"); } else if (assignVal < (1 << 7)) { appendBits(assignVal, 8, bb); } else if (assignVal < (1 << 14)) { appendBits(0...
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 makeEci AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left assignVal AST#identifier#Right AST#ERROR#Left AST#:#Left : AST...
public static makeEci(assignVal: int): QrSegment { let bb: Array<bit> = [] if (assignVal < 0) { throw new RangeError("ECI assignment value out of range"); } else if (assignVal < (1 << 7)) { appendBits(assignVal, 8, bb); } else if (assignVal < (1 << 14)) { appendBits(0...
https://gitee.com/openharmony/arkui_ace_engine.git
f9a2edf9e57eeab3aa735dcd3db867abb6d28f91
gitee
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
onPinchStart
Pinch start. @param x @param y @param scale
onPinchStart(x: number, y: number, scale: number): void { Logger.debug(TAG, `onPinchStart: event[x: ${x}, y: ${y}]`); this.splitLineShow = true; this.state = CropTouchState.IMAGE_SCALE; this.pinchPoint.set(x, y); this.scale = scale; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onPinchStart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST#,...
onPinchStart(x: number, y: number, scale: number): void { Logger.debug(TAG, `onPinchStart: event[x: ${x}, y: ${y}]`); this.splitLineShow = true; this.state = CropTouchState.IMAGE_SCALE; this.pinchPoint.set(x, y); this.scale = scale; }
https://gitee.com/openharmony/codelabs.git
2fe16103a381b3e7230a90e0007fdd89065dbe7d
gitee
openharmony/applications_photos
common/src/main/ets/default/model/common/HistogramManager.ets
arkts
startDraw
直方图绘制
public startDraw(): void { Log.info(TAG, 'data prepare finished, start draw histogram'); TraceControllerUtils.startTrace('startDraw'); this.initializePixelArray(); const startIndex = 0; this.drawSingleHistogram(this.pixelArray.slice(startIndex, Constants.HISTOGRAM_CONSTANT_256), Constants.HI...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startDraw 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_s...
public startDraw(): void { Log.info(TAG, 'data prepare finished, start draw histogram'); TraceControllerUtils.startTrace('startDraw'); this.initializePixelArray(); const startIndex = 0; this.drawSingleHistogram(this.pixelArray.slice(startIndex, Constants.HISTOGRAM_CONSTANT_256), Constants.HI...
https://gitee.com/openharmony/applications_photos.git
68f629679edc8b6efe0a66848435a3ef3c790c50
gitee
iHongRen/harmony-study-demo
entry/src/main/ets/pages/transcoder/Transcoder.ets
arkts
pauseTranscoderingProcess
暂停转码对应的流程。
async pauseTranscoderingProcess() { if (Transcoder.canIUse()) { if (this.avTranscoder != undefined) { // 仅在调用start返回后调用pause为合理调用。 await this.avTranscoder.pause(); } } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left pauseTranscoderingProcess AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#L...
async pauseTranscoderingProcess() { if (Transcoder.canIUse()) { if (this.avTranscoder != undefined) { // 仅在调用start返回后调用pause为合理调用。 await this.avTranscoder.pause(); } } }
https://github.com/iHongRen/harmony-study-demo
246cd1c51093d74500e677b82d996da9e006214a
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/data/api/ApiClient.ets
arkts
setContext
设置上下文
static setContext(context: any): void { if (ApiClient.instance) { ApiClient.instance.context = context } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left context AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#any#Left any AST#any#Right AST#ERR...
static setContext(context: any): void { if (ApiClient.instance) { ApiClient.instance.context = context } }
https://github.com/David8Idira/AI-OA
ecaa257d8f60a133486737164cb66363987d095b
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
loadConfig
加载配置文件 @param jsonContent JSON配置内容 @param skipInitialize 是否跳过初始化工作流(默认false)
async loadConfig(jsonContent: string, skipInitialize: boolean = false): Promise<ParseResult> { logger.info(TAG, `加载漫画图源配置, skipInitialize=${skipInitialize}`); logger.debug(TAG, `接收到的JSON长度: ${jsonContent.length}`); // 保存原始JSON用于提取API配置 this.rawConfigJson = jsonContent; // [优化] 配置变更时清除缓存 t...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadConfig AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left jsonContent AST#identifier#Right AST#type_annotation#Left A...
async loadConfig(jsonContent: string, skipInitialize: boolean = false): Promise<ParseResult> { logger.info(TAG, `加载漫画图源配置, skipInitialize=${skipInitialize}`); logger.debug(TAG, `接收到的JSON长度: ${jsonContent.length}`); // 保存原始JSON用于提取API配置 this.rawConfigJson = jsonContent; // [优化] 配置变更时清除缓存 t...
https://github.com/DaLongZhuaZi/manxia
1df251a99068c7749e6bf00f330305201b917be8
github
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/VibratorManager.ets
arkts
stop
═══════════════════════════════════════════════════════════════ 停止控制 ═══════════════════════════════════════════════════════════════ 停止指定模式的振动 @param stopMode 停止模式:VIBRATOR_STOP_MODE_TIME / VIBRATOR_STOP_MODE_PRESET
static stop(stopMode?: string): void { try { if (stopMode) { vibrator.stopVibration(stopMode as vibrator.VibratorStopMode, VibratorManager.createCallback('stop')); } else { vibrator.stopVibration(VibratorManager.createCallback('stop')); } } catch (err) { VibratorManager...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left stop AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left stopMode AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#...
static stop(stopMode?: string): void { try { if (stopMode) { vibrator.stopVibration(stopMode as vibrator.VibratorStopMode, VibratorManager.createCallback('stop')); } else { vibrator.stopVibration(VibratorManager.createCallback('stop')); } } catch (err) { VibratorManager...
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
6fde044984015fe24ff688e2c9f1a8e325c96d5d
github
chenchl/GMLogger-HarmonyOS
gmlogger/src/main/ets/components/security/logger/Logger.ets
arkts
console
控制台日志输出函数(只支持输出到控制台不支持加密存储) @param message - 需要输出的消息内容,支持字符串或对象类型 @param [tag] - 可选标签参数,用于标识日志来源。当未提供时默认使用类实例的mTag属性值
console(message: string | object, tag?: string | undefined) { // 组合标签和消息内容后输出日志 console.log(this.getMessage(tag == undefined ? this.mTag : tag, message)) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left console AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left str...
console(message: string | object, tag?: string | undefined) { // 组合标签和消息内容后输出日志 console.log(this.getMessage(tag == undefined ? this.mTag : tag, message)) }
https://github.com/chenchl/GMLogger-HarmonyOS
a655f20598811b932c45b1eae9ced627cd0e443d
github
terryma2024/happyword
harmonyos/entry/src/main/ets/services/CocosEngineHost.ets
arkts
ensureBooted
Idempotent engine boot. Replicates the scaffold's order: appLifecycle.onCreate -> resourceManagerInit -> writablePathInit -> worker creation + UI<->worker port wiring. The XComponent's onLoad later posts 'onXCLoad', upon which the worker runs nativeEngineInit/Start. All fallible work runs inside the try block; instance...
ensureBooted(ctx: common.UIAbilityContext): void { if (this.booted) { return; } try { const engineUtils: context = cocos.getContext(ContextType.ENGINE_UTILS); const lifecycle: context = cocos.getContext(ContextType.APP_LIFECYCLE); engineUtils.registerFunction('executeMethodAsync', ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left ensureBooted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ctx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left common AST#identi...
ensureBooted(ctx: common.UIAbilityContext): void { if (this.booted) { return; } try { const engineUtils: context = cocos.getContext(ContextType.ENGINE_UTILS); const lifecycle: context = cocos.getContext(ContextType.APP_LIFECYCLE); engineUtils.registerFunction('executeMethodAsync', ...
https://github.com/terryma2024/happyword
5defe405a307d64b43ecc219152945e7dd2423ac
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets
arkts
negative
Returns whether the BigInt is negative. @returns { boolean } True if negative, false otherwise. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public negative(): boolean { return this.sign < 0 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left negative 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#bool...
public negative(): boolean { return this.sign < 0 }
https://gitcode.com/iop123123/arkts-static-skills
f7c483d4bded1135f9d85e72189a8d1827f9f791
gitcode
offlinecat-dev/OCNetORM
src/main/ets/core/ColumnMetadata.ets
arkts
setLength
设置 TEXT 类型最大长度 @param len 最大长度 @returns 当前实例,支持链式调用
setLength(len: number): ColumnMetadata { this.length = len return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setLength AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left len AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#...
setLength(len: number): ColumnMetadata { this.length = len return this }
https://github.com/offlinecat-dev/OCNetORM
0dc9527f1ab9529eada8337c6050c111526c573f
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
getChapterById
根据ID获取单个章节
public async getChapterById(chapterId: string): Promise<ChapterInfo | null> { try { const records = await this.databaseManager.querySql( `SELECT id, comicId, externalId, title, chapterNumber AS chapterIndex, chapterNumber, pageCount, isDownloaded, downloadPath, publishTime, addTime, ...
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 getChapterById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chapterId AST#identifier#Right AST#ERROR#Left AST#:#Left...
public async getChapterById(chapterId: string): Promise<ChapterInfo | null> { try { const records = await this.databaseManager.querySql( `SELECT id, comicId, externalId, title, chapterNumber AS chapterIndex, chapterNumber, pageCount, isDownloaded, downloadPath, publishTime, addTime, ...
https://github.com/DaLongZhuaZi/manxia
5ab694bef9cb86a5e377413b52be9173c3cd3d32
github
Joker-x-dev/CoolMallArkTS
feature/auth/src/main/ets/component/BottomNavigationRow.ets
arkts
build
构建底部导航行 @returns {void} 无返回值
build(): void { ColumnStart({ widthValue: P100 }) { SpaceVerticalXXLarge(); RowCenter({ widthValue: P100 }) { if (!this.divider) { Text(this.messageText) .fontSize($r("app.float.body_medium")) .fontColor($r("app.color.text_tertiary")); } else { ...
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 { ColumnStart({ widthValue: P100 }) { SpaceVerticalXXLarge(); RowCenter({ widthValue: P100 }) { if (!this.divider) { Text(this.messageText) .fontSize($r("app.float.body_medium")) .fontColor($r("app.color.text_tertiary")); } else { ...
https://github.com/Joker-x-dev/CoolMallArkTS
bf4006e8a6b88a436928dc1fbd5f479ddeaa0096
github
openharmony/codelabs
ETSUI/ItemManagerAPP/entry/src/main/ets/data/UserRdb.ets
arkts
getInstance
单例模式(保留)
static getInstance(): UserInfoRdb { if (!UserInfoRdb.instance) { UserInfoRdb.instance = new UserInfoRdb(); } return UserInfoRdb.instance; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getInstance 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 UserInfoRd...
static getInstance(): UserInfoRdb { if (!UserInfoRdb.instance) { UserInfoRdb.instance = new UserInfoRdb(); } return UserInfoRdb.instance; }
https://gitcode.com/openharmony/codelabs
e817f60110c730770f59567dd53a0b80fa9a6027
gitcode
Nekofox-POT/LinMusic
entry/src/main/ets/package/audio_player/class_audio_player.ets
arkts
send_play_list_index
7x5 列表指针广播 //
private send_play_list_index() { emitter.emit({ eventId: 715 }, { data: { index: (this.play_list.length == 0) ? 0 : this.play_list_index } }) emitter.emit({ eventId: 725 }, { data: { index: (this.play_list.length == 0) ? 0 : this.play_list_index } }) }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left send_play_list_index 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 AS...
private send_play_list_index() { emitter.emit({ eventId: 715 }, { data: { index: (this.play_list.length == 0) ? 0 : this.play_list_index } }) emitter.emit({ eventId: 725 }, { data: { index: (this.play_list.length == 0) ? 0 : this.play_list_index } }) }
https://github.com/Nekofox-POT/LinMusic
69fd087966787477ec75f0e530ccce1acdb3badf
github
yongoe1024/RdbPlus
rdbplus/src/main/ets/core/Wrapper.ets
arkts
orderByDesc
对某字段排序-降序。可以调用多次,按顺序拼接SQL @param field 字段 @returns Wrapper
orderByDesc(field: string, condition: boolean = true): Wrapper { if (condition) { this.orderList.push(`${field} desc`) } return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left orderByDesc AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left field AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AS...
orderByDesc(field: string, condition: boolean = true): Wrapper { if (condition) { this.orderList.push(`${field} desc`) } return this }
https://github.com/yongoe1024/RdbPlus/blob/83f7347b7ac692941729d3464923155948e876bb/rdbplus/src/main/ets/core/Wrapper.ets#L251-L256
33664448a9dd25aeb93252d9ce81cc8712609452
github
OnceWeWere/Weather_HarmonyOS
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onBackground
4. 应用进入后台
onBackground(): void { // 应用切到后台 // Ability has back to background hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackground 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...
onBackground(): void { // 应用切到后台 // Ability has back to background hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onBackground'); }
https://github.com/OnceWeWere/Weather_HarmonyOS
59b7ecb40194935e4e5faeea1250f52a3c013195
github
NissonCX/CQU-HarmonyOS-APP-Dev-Final
entry/src/main/ets/utils/ExportManager.ets
arkts
getExportedFiles
获取导出文件列表(应用缓存目录下的导出文件)
async getExportedFiles(context: Context): Promise<string[]> { try { const files: string[] = []; const dirPath = context.cacheDir; // 列出目录中的文件 const listResult = fileIo.listFileSync(dirPath); // 筛选导出文件 for (const fileName of listResult) { if (fileName.startsWith('Healt...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getExportedFiles AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async getExportedFiles(context: Context): Promise<string[]> { try { const files: string[] = []; const dirPath = context.cacheDir; // 列出目录中的文件 const listResult = fileIo.listFileSync(dirPath); // 筛选导出文件 for (const fileName of listResult) { if (fileName.startsWith('Healt...
https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final
50fdf51ea796934c9f85c9e2114096ff62db13d6
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/EntityData.ets
arkts
loadRelated
触发延迟加载关联数据 @param propertyName 关联属性名
async loadRelated(propertyName: string): Promise<RelatedDataValue | null> { const existing = this.relatedData.get(propertyName) if (existing) { return existing } const loader = this.lazyRelationLoaders.get(propertyName) if (!loader) { return null } const value = await loader() ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadRelated AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left propertyName AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async loadRelated(propertyName: string): Promise<RelatedDataValue | null> { const existing = this.relatedData.get(propertyName) if (existing) { return existing } const loader = this.lazyRelationLoaders.get(propertyName) if (!loader) { return null } const value = await loader() ...
https://github.com/offlinecat-dev/OCNetORM
fe30b31e765203324ee5ce25d55c82b65ab128e5
github
openharmony/applications_mms
entry/src/main/ets/pages/infomsg/InfoMsgController.ets
arkts
searchCoverageClick
Slide your finger to exit the search mode.
searchCoverageClick() { this.backSearch(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left searchCoverageClick 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_bloc...
searchCoverageClick() { this.backSearch(); }
https://gitee.com/openharmony/applications_mms.git
c986b7e0a30978887a838cf5d20a8d9a3512262a
gitee
openharmony/codelabs
ETSUI/PositioningDemo/entry/src/main/ets/service/PlanService.ets
arkts
getPlanStatistics
获取计划统计信息
async getPlanStatistics(): Promise<PlanStatistics> { const plans = await this.getAllPlans(); const activePlans = plans.filter(p => p.status === PlanStatus.ACTIVE); const completedPlans = plans.filter(p => p.status === PlanStatus.COMPLETED); const totalCompletionRate = plans.reduce((sum, p) => sum + p...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getPlanStatistics AST#identifier#Right AST#ERROR#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#ge...
async getPlanStatistics(): Promise<PlanStatistics> { const plans = await this.getAllPlans(); const activePlans = plans.filter(p => p.status === PlanStatus.ACTIVE); const completedPlans = plans.filter(p => p.status === PlanStatus.COMPLETED); const totalCompletionRate = plans.reduce((sum, p) => sum + p...
https://gitcode.com/openharmony/codelabs
5c32ed4ba5ac27177b58a6bc913970ef864701f7
gitcode
OHPG/FinSdk
jellyfin/src/main/ets/api/SessionApi.ets
arkts
reportViewing
reportViewing @summary Reports that a session is viewing an item. @param {SessionApiReportViewingRequest} requestParameters Request parameters. @throws {RequiredError} @memberof SessionApi
public async reportViewing(requestParameters: SessionApiReportViewingRequest): Promise<void> { return this.apiClient.post({path: "/Sessions/Viewing", parameters: requestParameters}) }
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 reportViewing AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST...
public async reportViewing(requestParameters: SessionApiReportViewingRequest): Promise<void> { return this.apiClient.post({path: "/Sessions/Viewing", parameters: requestParameters}) }
https://github.com/OHPG/FinSdk
490957a521ab78ee856d6dea1c5392c2b488c1be
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
getEntryByTouchPoint
returns the Entry object displayed at the touched position of the chart @param x @param y @return
public getEntryByTouchPoint(x: number, y: number): EntryOhos | null { let h: Highlight | null = this.getHighlightByTouchPoint(x, y); if (h != null && this.mData) { return this.mData.getEntryForHighlight(h); } return null; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getEntryByTouchPoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
public getEntryByTouchPoint(x: number, y: number): EntryOhos | null { let h: Highlight | null = this.getHighlightByTouchPoint(x, y); if (h != null && this.mData) { return this.mData.getEntryForHighlight(h); } return null; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
c96b1b20939dcf37ab2c08cb6925998a0e57d537
gitee
OHPG/FinSdk
jellyfin/src/main/ets/api/LibraryApi.ets
arkts
getLibraryOptionsInfo
@summary Gets the library options info. @param {LibraryApiGetLibraryOptionsInfoRequest} requestParameters Request parameters. @param {*} [options] Override http request option. @throws {RequiredError} @memberof LibraryApi
public getLibraryOptionsInfo(requestParameters: LibraryApiGetLibraryOptionsInfoRequest = {}): Promise<LibraryOptionsResultDto> { return this.apiClient.get({path: `/Libraries/AvailableOptions`, parameters: requestParameters}) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLibraryOptionsInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right A...
public getLibraryOptionsInfo(requestParameters: LibraryApiGetLibraryOptionsInfoRequest = {}): Promise<LibraryOptionsResultDto> { return this.apiClient.get({path: `/Libraries/AvailableOptions`, parameters: requestParameters}) }
https://github.com/OHPG/FinSdk
72d30cb3486d23dd90ec9150691f8939c5ad2c22
github
openharmony/applications_filepicker
audiopicker/src/main/ets/basemvvm/AbsBaseViewData.ets
arkts
clear
clear livedata
public clear(): void { this.liveData.splice(0, this.liveData?.length) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left clear 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#:#Rig...
public clear(): void { this.liveData.splice(0, this.liveData?.length) }
https://gitee.com/openharmony/applications_filepicker.git
f58df79349b65caa234a632f2c78814d84d569fa
gitee
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/Ratio.ets
arkts
getH
Get height. @returns
getH(): number { return this.h; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getH 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#number#Right AST#ERROR#Right AST#statement_block#L...
getH(): number { return this.h; }
https://gitee.com/openharmony/codelabs.git
33ac384b63683b453101c5ffebd2f351c02be613
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/UndefinableStringArray.ets
arkts
toFixedArray
Converts UndefinableStringArray to a FixedArray of String @returns { FixedArray<String> } A new FixedArray containing all elements @throws { TypeError } If an element is undefined, a type error may be thrown when assigning to FixedArray @syscap SystemCapability.Utils.Lang
public toFixedArray(): FixedArray<String> { let newData: FixedArray<String> = new FixedArray<String>(this.curSize) for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i]! } return newData }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toFixedArray 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#expressio...
public toFixedArray(): FixedArray<String> { let newData: FixedArray<String> = new FixedArray<String>(this.curSize) for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i]! } return newData }
https://gitcode.com/iop123123/arkts-static-skills
0d562156361dc2a91bb123ded1258be5b5d0dae6
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets
arkts
constructor
Creates a RegExpMatchArray instance that contains matching results. @param { int } index The starting index of the matching result. @param { String } input The original string used for matching. @param { Array<String | undefined> } result The string array that matches. @param { Array<Array<int>> } indices The starting ...
constructor(index: int, input: String, result: Array<String | undefined>, indices: Array<Array<int>>) { super(index, input, result, indices) }
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 index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right AST...
constructor(index: int, input: String, result: Array<String | undefined>, indices: Array<Array<int>>) { super(index, input, result, indices) }
https://gitcode.com/iop123123/arkts-static-skills
e400894c93d8b3add67b25b05836c1ed2d026d68
gitcode
LambdaYH/ScrcpyForHarmonyOS
app/src/main/ets/helper/Logger.ets
arkts
debug
Debug 级别日志
debug(msg: string, ...args: (string | number | boolean | object | undefined | null)[]): void { const formattedMsg = this.formatMessage(msg, args); hilog.debug(DOMAIN, this.tag, '%{public}s', formattedMsg); this.writeToFile(LogLevel.DEBUG, 'DEBUG', formattedMsg); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left debug AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left msg AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Righ...
debug(msg: string, ...args: (string | number | boolean | object | undefined | null)[]): void { const formattedMsg = this.formatMessage(msg, args); hilog.debug(DOMAIN, this.tag, '%{public}s', formattedMsg); this.writeToFile(LogLevel.DEBUG, 'DEBUG', formattedMsg); }
https://github.com/LambdaYH/ScrcpyForHarmonyOS
d2af6bc82267cd0225bcda2596b27f1660203a84
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
findLast
Finds the last element in the BigInt64Array that satisfies the condition @param fn condition @returns the last element that satisfies fn
public findLast(fn: (val: long, index: int, array: BigInt64Array) => boolean): long { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("BigInt64Array.findLast: not impl...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left findLast AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:...
public findLast(fn: (val: long, index: int, array: BigInt64Array) => boolean): long { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("BigInt64Array.findLast: not impl...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
47f3d9c929605589137c62cc973cc3632de15e82
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Source/SourceManager.ets
arkts
generateTestReport
生成测试报告
generateTestReport(result: TestResult): string { return this.tester.generateReport(result); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left generateTestReport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left result AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TestResult AST#identifier#Right AST...
generateTestReport(result: TestResult): string { return this.tester.generateReport(result); }
https://github.com/DaLongZhuaZi/manxia
c2c3ea1389649a8755d27ac20ab0448428ae1b69
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
constructor
Creates an Uint8Array with respect to buf. @param { ArrayLike<Number> | ArrayBuffer } buf - data initializer @throws { RangeError } - Input parameter error. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLengthInt = (buf as ArrayBuffer).getByteLength() if (this.byteLengthInt % Uint8Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength sho...
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#binary_expression#Lef...
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLengthInt = (buf as ArrayBuffer).getByteLength() if (this.byteLengthInt % Uint8Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength sho...
https://gitcode.com/iop123123/arkts-static-skills
ba023dbe18d3d7bba5c075e22e83cee0818e93be
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/WebSearchService.ets
arkts
extractUrl
从文本中提取 URL
extractUrl(text: string): string | null { const trimmed = text.trim() const httpPattern = /^https?:\/\/[^\s]+/ const httpMatch = trimmed.match(httpPattern) if (httpMatch) { return httpMatch[0] } const domainPattern = /^[\w\-]+\.[\w\-]+(:\d+)?(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?/ cons...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left extractUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left str...
extractUrl(text: string): string | null { const trimmed = text.trim() const httpPattern = /^https?:\/\/[^\s]+/ const httpMatch = trimmed.match(httpPattern) if (httpMatch) { return httpMatch[0] } const domainPattern = /^[\w\-]+\.[\w\-]+(:\d+)?(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?/ cons...
https://github.com/LongLiveY96/chatcube
bac08b896858f50afd836d01b7a269207f618c27
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
slice
Creates a slice of current BigUint64Array using range [begin, end] {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice} @param { int } [begin] start - index to be taken into slice @param { int } [end] - last index to be taken into slice @returns { BigUint64Array } - ...
public slice(begin?: int, end?: int): BigUint64Array { return this.sliceFromTo(begin ?? 0, end ?? this.lengthInt) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#...
public slice(begin?: int, end?: int): BigUint64Array { return this.sliceFromTo(begin ?? 0, end ?? this.lengthInt) }
https://gitcode.com/iop123123/arkts-static-skills
f9f5b416450485b225c8f5c6279d6c6adc2454e7
gitcode
openharmony-tpc/openharmony_tpc_samples
OhosVideoCache/library/src/main/ets/MimeUtils.ets
arkts
getMimeTypeFromExtension
根据文件后缀名获得对应的MIME类型。 @param file
public static getMimeTypeFromExtension(extension: string): string { let fileType = "*/*"; if (extension == "") return fileType; // 在MIME和文件类型的匹配表中找到对应的MIME类型。 for (let i = 0; i < MimeUtils.MIME_MapTable.length; i++) { if (extension === MimeUtils.MIME_MapTable[i][0]) fileType = MimeUtils...
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 getMimeTypeFromExtension AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left extension AST#identifier#Right AST#ERROR#Left...
public static getMimeTypeFromExtension(extension: string): string { let fileType = "*/*"; if (extension == "") return fileType; // 在MIME和文件类型的匹配表中找到对应的MIME类型。 for (let i = 0; i < MimeUtils.MIME_MapTable.length; i++) { if (extension === MimeUtils.MIME_MapTable[i][0]) fileType = MimeUtils...
https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git
89cf9ca665d04261702bde2677bdaf124fc36367
gitee
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/services/StepCounterService.ets
arkts
saveCurrentSteps
保存当前步数到数据库
private async saveCurrentSteps(): Promise<void> { try { const today = this.formatDate(new Date()); // 获取今天已有的步数记录 const existingRecord = await this.stepManager.getStepRecordByDate(today); if (existingRecord.success && existingRecord.data) { // 如果今天已有记录,更新它 const existingD...
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 saveCurrentSteps AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ...
private async saveCurrentSteps(): Promise<void> { try { const today = this.formatDate(new Date()); // 获取今天已有的步数记录 const existingRecord = await this.stepManager.getStepRecordByDate(today); if (existingRecord.success && existingRecord.data) { // 如果今天已有记录,更新它 const existingD...
https://gitcode.com/openharmony/codelabs
c48775155c637cd264677e41ec64ae12de4d63a5
gitcode
openharmony-sig/knowledge_demo_entainment
FA/BombGame/entry/src/main/ets/MainAbility/pages/game.ets
arkts
setRandomBomb
随机生成炸弹
setRandomBomb() { this.bombIndex = Math.floor(Math.random() * 9) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setRandomBomb 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...
setRandomBomb() { this.bombIndex = Math.floor(Math.random() * 9) }
https://gitee.com/openharmony-sig/knowledge_demo_entainment.git
31a5f4737e038fb11d2e53ae3a591c8a2897f8f1
gitee
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets
arkts
currentTabSearchSubmit
Submits the search on current tab.
currentTabSearchSubmit() { if (!this.currentTab) { meow(`No current tab found!`, 'meowTabBunch][submitCurrentTabSearchKey', meowLevel.WARN); return; } this.currentTab.searchInPage(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left currentTabSearchSubmit 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_b...
currentTabSearchSubmit() { if (!this.currentTab) { meow(`No current tab found!`, 'meowTabBunch][submitCurrentTabSearchKey', meowLevel.WARN); return; } this.currentTab.searchInPage(); }
https://github.com/awaLiny2333/LinysBrowser_NEXT
0090be3d62ac7cee833bb0c3d93c4609904cd6b4
github
PollenWang6/HiXD
entry/src/main/ets/services/CasLoginService.ets
arkts
getLibraryAuth
获取图书馆 userId 和 token(参考 Flutter: 先走 CAS 再跟重定向链)
async getLibraryAuth(): Promise<LibraryAuthResult | null> { const libTarget: string = 'https://hyytsgxzs.xidian.edu.cn/api/index/casLoginDo.html?libraryId=5&openId=o2b1a5Fg6r8hKcL0FXopEkfmiQGc&source=xdbb'; // 先请求 CAS,带上已有 CAS Cookie,已登录则返回 302 const casUrl: string = 'https://ids.xidian.edu.cn/authserver/...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getLibraryAuth AST#identifier#Right AST#ERROR#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#gener...
async getLibraryAuth(): Promise<LibraryAuthResult | null> { const libTarget: string = 'https://hyytsgxzs.xidian.edu.cn/api/index/casLoginDo.html?libraryId=5&openId=o2b1a5Fg6r8hKcL0FXopEkfmiQGc&source=xdbb'; // 先请求 CAS,带上已有 CAS Cookie,已登录则返回 302 const casUrl: string = 'https://ids.xidian.edu.cn/authserver/...
https://github.com/PollenWang6/HiXD
805289c94d888f993dd2a20b164867fe97cfa429
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Set.ets
arkts
forEach
Executes the provided callback function once for each element in the Set in insertion order. @param { function } callbackfn - The callback function to execute for each element. @syscap SystemCapability.Utils.Lang @FaAndStageModel
override forEach(callbackfn: (k: K, v: K, set: Set<K>) => void): void { let it = this.keys(); while (true) { const v = it.next() if (v.done) { return } callbackfn(v.value as K, v.value as K, this) } }
AST#program#Left AST#expression_statement#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left forEach AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right A...
override forEach(callbackfn: (k: K, v: K, set: Set<K>) => void): void { let it = this.keys(); while (true) { const v = it.next() if (v.done) { return } callbackfn(v.value as K, v.value as K, this) } }
https://gitcode.com/iop123123/arkts-static-skills
a2fb374d6e141b04cc5f47f72b3e9bcd69505d64
gitcode
HarmonyOS_Samples/guide-snippets
Ability/UIAbilityLifecycle/entry/src/main/ets/entryability/EntryAbility.ets
arkts
onNewWant
[EndExclude onNewWant] [StartExclude onBackground]
onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam) { // 更新资源、数据 }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onNewWant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#,...
onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam) { // 更新资源、数据 }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
df29af93892e48df89303d1d59faeb1cd028713d
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/Transformer.ets
arkts
rectValueToPixelHorizontal
Transform a rectangle with all matrices with potential animation phases. @param r
public rectValueToPixelHorizontal(r: MyRect, phaseY?: number) { if (phaseY != null && phaseY != undefined) { r.left *= phaseY; r.right *= phaseY; } this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left rectValueToPixelHorizontal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left r AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi...
public rectValueToPixelHorizontal(r: MyRect, phaseY?: number) { if (phaseY != null && phaseY != undefined) { r.left *= phaseY; r.right *= phaseY; } this.mMatrixValueToPx.mapRect(r); this.mViewPortHandler.getMatrixTouch().mapRect(r); this.mMatrixOffset.mapRect(r); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
9de0c1663125a55f05e5c826e1c48d1f2b939445
gitee
robotzzh/AgricultureApp
entry/src/main/ets/models/MainViewModel.ets
arkts
refresh_data
public farmBean: FarmBean[] = []; 192.168.1.151
public refresh_data(Index: number){ //TODO:将本地IP改成wifi解码 console.info("localIP change1 to "+this.localIP) let tcp =new TCP(this.localIP,12345,this.farmBean[Index].sensor_IP, this.farmBean[Index].sensor_port); tcp.connect(this.localIP); tcp.subscribe(); connection.getAppNet(function(error, data) {...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left refresh_data AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left Index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu...
public refresh_data(Index: number){ //TODO:将本地IP改成wifi解码 console.info("localIP change1 to "+this.localIP) let tcp =new TCP(this.localIP,12345,this.farmBean[Index].sensor_IP, this.farmBean[Index].sensor_port); tcp.connect(this.localIP); tcp.subscribe(); connection.getAppNet(function(error, data) {...
https://github.com/robotzzh/AgricultureApp
cb04abc971dbdb67bd8a7c6f481f3f65b91913cf
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrCodeGenerator.ets
arkts
reserveVersionAreas
Reserve version info areas (v7+)
reserveVersionAreas(version: number): void { if (version < 7) return; for (let i = 0; i < 6; i++) { for (let j = 0; j < 3; j++) { this.reserved[i][this.size - 11 + j] = true; this.reserved[this.size - 11 + j][i] = true; } } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reserveVersionAreas AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left version AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) ...
reserveVersionAreas(version: number): void { if (version < 7) return; for (let i = 0; i < 6; i++) { for (let j = 0; j < 3; j++) { this.reserved[i][this.size - 11 + j] = true; this.reserved[this.size - 11 + j][i] = true; } } }
https://github.com/AlkaidLab/moonlight-harmony
091958eab73bef9acbf0880111cf931a7eb7f1b0
github
aintnece/TuiEditorHarmonyOS
entry/src/main/ets/components/Toolbar.ets
arkts
build
═══════════════════════════════════════════════════════════ build() ═══════════════════════════════════════════════════════════
build() { Row() { // ── 粗体 ── this.iconBtn($r('app.media.tui_bold'), '加粗', () => { if (editorContext.editor) { editorContext.editor.exec('Bold'); } }) // ── 斜体 ── this.iconBtn($r('app.media.tui_italic'), '斜体', () => { if (editorContext.editor) { editorContext.editor.exec('Italic'); } }) ...
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() { Row() { // ── 粗体 ── this.iconBtn($r('app.media.tui_bold'), '加粗', () => { if (editorContext.editor) { editorContext.editor.exec('Bold'); } }) // ── 斜体 ── this.iconBtn($r('app.media.tui_italic'), '斜体', () => { if (editorContext.editor) { editorContext.editor.exec('Italic'); } }) ...
https://github.com/aintnece/TuiEditorHarmonyOS
43ec6c8716a265491344fd300715215647bee7f2
github
Coke0807/NewsAPP-HarmonyOS
NewsApp/entry/src/main/ets/utils/SettingsUtil.ets
arkts
init
初始化Preferences
static async init(context: Context): Promise<void> { try { SettingsUtil.prefs = await preferences.getPreferences(context, PREFERENCES_NAME); // 加载设置到AppStorage await SettingsUtil.loadSettings(); } catch (e) { console.error('SettingsUtil: 初始化失败', e); } }
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 init AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Rig...
static async init(context: Context): Promise<void> { try { SettingsUtil.prefs = await preferences.getPreferences(context, PREFERENCES_NAME); // 加载设置到AppStorage await SettingsUtil.loadSettings(); } catch (e) { console.error('SettingsUtil: 初始化失败', e); } }
https://github.com/Coke0807/NewsAPP-HarmonyOS
97c74d00e024b3242040242dc05237f504a576eb
github
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/GlobalDataManager.ets
arkts
clearToken
清除token
async clearToken(): Promise<void> { this.token = null; await StorageUtil.removeToken(); }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left clearToken AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Ri...
async clearToken(): Promise<void> { this.token = null; await StorageUtil.removeToken(); }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
702fa5153cc5db33da8862cff426e5a3861ebff0
github
heeh02/superconnect
harmony/entry/src/main/ets/services/connection/role/ReceiverConnection.ets
arkts
<arrow>
video_config → set codec + HDR mode + resolution on native, which starts decode.
(width: number, height: number, codec: string, hdr: string): void => { sc.setCodec(codec); sc.setHdr(hdr); sc.setVideoSize(width, height); this.onStreamInfo?.({ width: width, height: height, codec: codec, hdr: hdr }); this.onLog?.('decoder armed ' + width + '×' + height + '...
AST#program#Left AST#ERROR#Left AST#arrow_function#Left AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left width AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left AST#number#Left number AST#number#Right AST#predefined_type#Ri...
(width: number, height: number, codec: string, hdr: string): void => { sc.setCodec(codec); sc.setHdr(hdr); sc.setVideoSize(width, height); this.onStreamInfo?.({ width: width, height: height, codec: codec, hdr: hdr }); this.onLog?.('decoder armed ' + width + '×' + height + '...
https://github.com/heeh02/superconnect
f17c84deed537a2ec02481f4976298f8ebc554aa
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Float.ets
arkts
compareTo
Compares this instance to other Float object The result is less than 0 if this instance lesser than provided object 0 if they are equal and greater than 0 otherwise. @param other Float object to compare with @returns result of the comparison, -1 if this instance is less than provided object, 0 if equal, 1 if greater
public override compareTo(other: Float): int { if ((this.isNaN() && other.isNaN()) || (Math.abs(this.value - other) < Float.EPSILON)) { return 0; } if (this.isNaN() || this.value > other) { return 1; } return -1; }
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 compareTo 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 compareTo(other: Float): int { if ((this.isNaN() && other.isNaN()) || (Math.abs(this.value - other) < Float.EPSILON)) { return 0; } if (this.isNaN() || this.value > other) { return 1; } return -1; }
https://gitcode.com/iop123123/arkts-static-skills
4a4c7e8a54f011ec603b1c57aa1704e253042564
gitcode
openharmony/codelabs
Distributed/DistributeDraw/entry/src/main/ets/entryability/EntryAbility.ets
arkts
checkPermissions
Check the permission status.
async function checkPermissions(context: common.UIAbilityContext) { let grantStatus: abilityAccessCtrl.GrantStatus = await checkAccessToken(); if (grantStatus !== abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { // Applying for the distributed data synchronization permission. let atManager: abilityAccess...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left checkPermissions AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST...
async function checkPermissions(context: common.UIAbilityContext) { let grantStatus: abilityAccessCtrl.GrantStatus = await checkAccessToken(); if (grantStatus !== abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { // Applying for the distributed data synchronization permission. let atManager: abilityAccess...
https://gitee.com/openharmony/codelabs.git
10c6d5dd5924f486c4f4e8f57167ef439ebd60a4
gitee
richshaw2015/nds
ohos/entry/src/test/DependencyRelations.test.ets
arkts
setSettingValue
设置设置项的值 @param key 设置键名 @param value 设置值
setSettingValue(key: string, value: boolean | string | number): void { const state = this.settingStates.get(key) || { key, value, enabled: true }; state.value = value; this.settingStates.set(key, state); // 更新依赖的子设置状态 this.updateDependentSettings(key, value); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setSettingValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , ...
setSettingValue(key: string, value: boolean | string | number): void { const state = this.settingStates.get(key) || { key, value, enabled: true }; state.value = value; this.settingStates.set(key, state); // 更新依赖的子设置状态 this.updateDependentSettings(key, value); }
https://github.com/richshaw2015/nds
0ecf54ab6965689b163b1092c061afe1f8dccf77
github
ibestservices/ibest-ui
library/src/main/ets/components/guide/index.type.ets
arkts
getWidth
获取宽度 @returns 矩形区域的宽
public getWidth(): number { return this.right - this.left }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getWidth 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#number...
public getWidth(): number { return this.right - this.left }
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/guide/index.type.ets#L43-L45
715f0afeaec8821a518b5e3ac33f60c85257d34b
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/SettingsManager.ets
arkts
getLanguageDisplayText
获取语言显示文本
getLanguageDisplayText(language: AppLanguage): Resource { if (language === AppLanguage.ZH_CN) { return $r('app.string.language_zh_cn') } else if (language === AppLanguage.EN_US) { return $r('app.string.language_en_us') } else { return $r('app.string.language_system') } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLanguageDisplayText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left language AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AppLanguage AST#identifier#Ri...
getLanguageDisplayText(language: AppLanguage): Resource { if (language === AppLanguage.ZH_CN) { return $r('app.string.language_zh_cn') } else if (language === AppLanguage.EN_US) { return $r('app.string.language_en_us') } else { return $r('app.string.language_system') } }
https://github.com/LongLiveY96/chatcube
c6d4121b2440f07189008668926d5c15983bebdb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
copyWithin
Makes a copy of internal elements to targetPos from startPos to endPos. See rules of parameters normalization on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin | MDN} @param { int } target - insert index to place copied elements @param { int } start - start inde...
public copyWithin(target: int, start: int, end?: int): Int16Array { let arrayLength: int = this.lengthInt; target = normalizeIndex(target, arrayLength); start = normalizeIndex(start, arrayLength); end = normalizeIndex(asIntOrDefault(end, arrayLength), arrayLength); let count:...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left copyWithin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#...
public copyWithin(target: int, start: int, end?: int): Int16Array { let arrayLength: int = this.lengthInt; target = normalizeIndex(target, arrayLength); start = normalizeIndex(start, arrayLength); end = normalizeIndex(asIntOrDefault(end, arrayLength), arrayLength); let count:...
https://gitcode.com/iop123123/arkts-static-skills
1b7555628a7517dd35a4381ed7026a7f74570352
gitcode
Cool_foolisher1/ArkTSRepository
MultiCalculator/features/calculator/src/main/ets/utils/CalculateUtil.ets
arkts
dealQueue
处理队列中的表达式
dealQueue(queue: Array<string>): string { if (checkEmptyUtil.isEmpty(queue)) { return 'NaN' } let outputStack: string[] = [] while (queue.length > 0) { let current: string | undefined = queue.shift() if (current !== undefined) { if (!this.isSymbol(current)) { output...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left dealQueue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left queue AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left Array AST#i...
dealQueue(queue: Array<string>): string { if (checkEmptyUtil.isEmpty(queue)) { return 'NaN' } let outputStack: string[] = [] while (queue.length > 0) { let current: string | undefined = queue.shift() if (current !== undefined) { if (!this.isSymbol(current)) { output...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
2d150ce988660aa9222cac62bfcf86aeff59093e
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets
arkts
buildImageUrlActions
构建图片URL获取操作序列
buildImageUrlActions(config: MangaSourceConfig, pageIndex: number): Action[] { const workflow = this.getWorkflow(config, 'getImageUrl'); if (!workflow) { throw new MangaSourceError( MangaSourceErrorCode.INVALID_CONFIG, '缺少图片URL工作流配置' ); } return this.processActions(workflo...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left buildImageUrlActions 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 MangaSourceConfig ...
buildImageUrlActions(config: MangaSourceConfig, pageIndex: number): Action[] { const workflow = this.getWorkflow(config, 'getImageUrl'); if (!workflow) { throw new MangaSourceError( MangaSourceErrorCode.INVALID_CONFIG, '缺少图片URL工作流配置' ); } return this.processActions(workflo...
https://github.com/DaLongZhuaZi/manxia
e056c0497673dbf803a797677696b259422770f2
github
SMAT-Lab/Homecheck-Sec2026
test/unittest/sample/CacheAvplayer/ets/CacheAvplayerNoReport.ets
arkts
resetCurrentPlayer
使用reset方法重置AVPlayer实例
resetCurrentPlayer(): void { this.currentPlayer?.pause(() => { this.currentPlayer?.reset(); }) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resetCurrentPlayer 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...
resetCurrentPlayer(): void { this.currentPlayer?.pause(() => { this.currentPlayer?.reset(); }) }
https://github.com/SMAT-Lab/Homecheck-Sec2026
e88d6e6891cc73914d5c0c11b0b108f76661949e
github
wuba/omni-ui
omni_component/src/main/ets/components/filterbar/converter/OmniFilterConverter.ets
arkts
convertSelectedData
将选中的数据转换为 Map<string, string>
convertSelectedData(selectedResults: OmniFilterItemBean[]): Map<string, string> { return getFilterParams(selectedResults); }
AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left convertSelectedData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left selectedResults AST#identifier#Right AST#:#Left : AS...
convertSelectedData(selectedResults: OmniFilterItemBean[]): Map<string, string> { return getFilterParams(selectedResults); }
https://github.com/wuba/omni-ui
70895f313baa74fd7a9307820b989eb0f1ee9be7
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/MetadataXmlGenerator.ets
arkts
escapeXml
XML特殊字符转义
private static escapeXml(text: string): string { if (!text) return ''; return text .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&apos;'); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left escapeXml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST...
private static escapeXml(text: string): string { if (!text) return ''; return text .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&apos;'); }
https://github.com/DaLongZhuaZi/manxia
dd2b2718f9fed34eeb6576613b4ae01a4fcc8938
github
Joker-x-dev/CoolMallArkTS
core/designsystem/src/main/ets/component/Row.ets
arkts
build
渲染布局 @returns {void} 无返回值 @example RowEndBottom() { Text("Hi"); }
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.End, alignItems: VerticalAlign.Bottom, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginValue, ...
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 { RowBase({ options: this.options, justifyContent: FlexAlign.End, alignItems: VerticalAlign.Bottom, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginValue, ...
https://github.com/Joker-x-dev/CoolMallArkTS
c28363a24a8c735a17f6145089ed4a5a39d53b46
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Storage/DownloadDirManager.ets
arkts
restorePersistedDirInfo
从Download同步流程已持久化的目录恢复缓存管理访问状态
public restorePersistedDirInfo(): boolean { if (this.isInitialized && this.downloadDirPath !== '') { return true; } let savedPath = AppStorage.get<string>(DOWNLOAD_SYNC_DIR_PATH_KEY); let savedUri = AppStorage.get<string>(DOWNLOAD_SYNC_DIR_URI_KEY); if (!savedPath || savedPath.length === 0)...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left restorePersistedDirInfo 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 b...
public restorePersistedDirInfo(): boolean { if (this.isInitialized && this.downloadDirPath !== '') { return true; } let savedPath = AppStorage.get<string>(DOWNLOAD_SYNC_DIR_PATH_KEY); let savedUri = AppStorage.get<string>(DOWNLOAD_SYNC_DIR_URI_KEY); if (!savedPath || savedPath.length === 0)...
https://github.com/DaLongZhuaZi/manxia
9a62fc13a24bcb50a3df4abcfb08d80272974b7d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
setUTCMinutes
Sets the minutes for a specified date according to universal time. @param { int } value new minutes @param { int } sec @param { int } ms @returns { long } get new date value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public setUTCMinutes(value: int, sec: int, ms: int): long { this.setUTCMinutes(value); this.setUTCSeconds(sec); this.setUTCMilliseconds(ms); return this.ms; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setUTCMinutes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifie...
public setUTCMinutes(value: int, sec: int, ms: int): long { this.setUTCMinutes(value); this.setUTCSeconds(sec); this.setUTCMilliseconds(ms); return this.ms; }
https://gitcode.com/iop123123/arkts-static-skills
cfcaf2998542e78c9b5dc5c55d282b01d17f4c6f
gitcode
wuba/omni-ui
omni_component/src/main/ets/components/popup/Builder.ets
arkts
setTransition
打开/关闭自定义对话框的动画参数 @param transition @returns
setTransition(transition?: TransitionEffect): Builder { this.dialogOptions.transition = transition return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setTransition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left transition AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TransitionE...
setTransition(transition?: TransitionEffect): Builder { this.dialogOptions.transition = transition return this }
https://github.com/wuba/omni-ui
16dba23b4e4c5c2b6a2806964c49c54355abc748
github
the-wwyang/kids-learning-app
src/main/ets/services/DataBackupService.ets
arkts
exportData
导出学习数据到文件
public async exportData(): Promise<BackupResult> { try { // 收集所有数据 const backupData = await this.collectBackupData(); // 生成文件名 const fileName = this.generateBackupFileName(); // 转换为JSON字符串 const jsonData = JSON.stringify(backupData, null, 2); // 保存到文件 const fileP...
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 exportData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
public async exportData(): Promise<BackupResult> { try { // 收集所有数据 const backupData = await this.collectBackupData(); // 生成文件名 const fileName = this.generateBackupFileName(); // 转换为JSON字符串 const jsonData = JSON.stringify(backupData, null, 2); // 保存到文件 const fileP...
https://github.com/the-wwyang/kids-learning-app
b6cb444c115d0b4f0a07573ae00faea0ef29f5fc
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/service/ReimburseService.ets
arkts
createReimburse
创建报销单
createReimburse(params: ReimburseCreateParams): Promise<string> { return new Promise((resolve) => { setTimeout(() => { resolve('reimburse-' + Date.now()); }, 1000); }); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left createReimburse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left params AST#identifier#Right AST#:#Left : AST#:#Right AST#E...
createReimburse(params: ReimburseCreateParams): Promise<string> { return new Promise((resolve) => { setTimeout(() => { resolve('reimburse-' + Date.now()); }, 1000); }); }
https://github.com/David8Idira/AI-OA
6cb849b82f1aec30cb716c8f52140f9067655b23
github
Nekofox-POT/LinMusic
entry/src/main/ets/package/audio_player/class_audio_player.ets
arkts
set_audio
点歌 //
async set_audio(index: number = this.play_list_index): Promise<boolean> { // 修正指针 // this.play_list_index = index this.send_play_list_index() let tmp_path: string = '' let tmp_ino: string = '' // 获取路径(防溢出检测) // try { tmp_path = this.play_list[index] tmp_ino = `${fs.statSync(t...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left set_audio AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
async set_audio(index: number = this.play_list_index): Promise<boolean> { // 修正指针 // this.play_list_index = index this.send_play_list_index() let tmp_path: string = '' let tmp_ino: string = '' // 获取路径(防溢出检测) // try { tmp_path = this.play_list[index] tmp_ino = `${fs.statSync(t...
https://github.com/Nekofox-POT/LinMusic
ec68ee801658cb642d6ba0d48f2e314a07437507
github
Tianpei-Shi/MusicDash
src/pages/music/ProfilePage.ets
arkts
gotoUserProfile
跳转到用户中心
gotoUserProfile(): void { if (!this.isLoggedIn) { // 未登录,跳转到登录页面 router.pushUrl({ url: 'pages/LoginPage' }); } else { // 已登录,跳转到用户详情页 router.pushUrl({ url: 'pages/user/UserDetailPage', params: { userId: this.userInfo.id } }); } ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left gotoUserProfile 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...
gotoUserProfile(): void { if (!this.isLoggedIn) { // 未登录,跳转到登录页面 router.pushUrl({ url: 'pages/LoginPage' }); } else { // 已登录,跳转到用户详情页 router.pushUrl({ url: 'pages/user/UserDetailPage', params: { userId: this.userInfo.id } }); } ...
https://github.com/Tianpei-Shi/MusicDash
461bda6e8e12fb456e4ab80baa012c81caf7484c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
copyWithin
Makes a copy of internal elements to targetPos from begin to end of Uint8ClampedArray. See rules of parameters normalization on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin} @param { int } target - insert index to place copied elements @returns { Uint8ClampedA...
public copyWithin(target: int): Uint8ClampedArray { this.copyWithinImpl(target, 0, this.lengthInt) return this }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left copyWithin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#...
public copyWithin(target: int): Uint8ClampedArray { this.copyWithinImpl(target, 0, this.lengthInt) return this }
https://gitcode.com/iop123123/arkts-static-skills
5688d778910065688f8b32e70aa7075e233d4751
gitcode
encorexin/WordPressCMS
harmonyos/entry/src/main/ets/services/http/AIStreamClient.ets
arkts
generateSlug
生成 SEO slug
static async generateSlug( title: string, endpoint: string, apiKey: string, model: string ): Promise<string> { const prompt = `请将以下中文标题转换为SEO友好的英文URL别名(slug)。 要求: 1. 全部小写 2. 单词之间用短横线(-)连接 3. 只包含英文字母、数字和短横线 4. 简洁明了,长度控制在3-8个单词 5. 移除无意义的词 6. 直接输出slug结果,不要任何解释 标题:${title}` const messages: Cha...
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 generateSlug AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left title AST#identifier#Right AST#:#Left : AST...
static async generateSlug( title: string, endpoint: string, apiKey: string, model: string ): Promise<string> { const prompt = `请将以下中文标题转换为SEO友好的英文URL别名(slug)。 要求: 1. 全部小写 2. 单词之间用短横线(-)连接 3. 只包含英文字母、数字和短横线 4. 简洁明了,长度控制在3-8个单词 5. 移除无意义的词 6. 直接输出slug结果,不要任何解释 标题:${title}` const messages: Cha...
https://github.com/encorexin/WordPressCMS
dbdab068d2fee522b640baf552c90292a0c666b7
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/NSFWHelper.ets
arkts
isNSFWByTags
从标签判断是否为NSFW内容
public static isNSFWByTags(tags: string[]): boolean { if (!tags || tags.length === 0) { return false; } const tagsLower = tags.map(t => t.toLowerCase()).join(','); return NSFW_KEYWORDS.some(keyword => tagsLower.includes(keyword)); }
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 isNSFWByTags AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tags AST#identifier#Right AST#:#Left : AST...
public static isNSFWByTags(tags: string[]): boolean { if (!tags || tags.length === 0) { return false; } const tagsLower = tags.map(t => t.toLowerCase()).join(','); return NSFW_KEYWORDS.some(keyword => tagsLower.includes(keyword)); }
https://github.com/DaLongZhuaZi/manxia
4670acad28bc71b62f7fa1120c897bcd3a02dcb9
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/CouponRepository.ets
arkts
constructor
构造函数 @param networkDataSource 可选的数据源实例,便于注入测试替身
constructor(networkDataSource?: CouponNetworkDataSource) { this.networkDataSource = networkDataSource ?? new CouponNetworkDataSourceImpl(); }
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 networkDataSource AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
constructor(networkDataSource?: CouponNetworkDataSource) { this.networkDataSource = networkDataSource ?? new CouponNetworkDataSourceImpl(); }
https://github.com/Joker-x-dev/CoolMallArkTS
0ab165a5586140c3ef0e5b943afbaad60b132dc0
github
HarmonyOS_Samples/BestPracticeSnippets
AppDataSecurity/entry/src/main/ets/pages/Index.ets
arkts
writeFile
[Start write_file]
function writeFile(filePath: string, data: string): void { try { let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); let writeLen = fileIo.writeSync(file.fd, data); hilog.info(0x0000, 'AppDataSecurity', 'The length of str is: ' + writeLen); fileIo.closeSync(file)...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left writeFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left filePath AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function writeFile(filePath: string, data: string): void { try { let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); let writeLen = fileIo.writeSync(file.fd, data); hilog.info(0x0000, 'AppDataSecurity', 'The length of str is: ' + writeLen); fileIo.closeSync(file)...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
f2bc321ce76d883ed44aae1e3cdeaf625f1466fb
gitcode
Joker-x-dev/CoolMallArkTS
core/ui/src/main/ets/component/image/MediumAvatar.ets
arkts
build
构建中等尺寸头像 @returns {void} 无返回值
build(): void { Avatar({ src: this.src, avatarSize: 48, onTap: this.onTap }); }
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 { Avatar({ src: this.src, avatarSize: 48, onTap: this.onTap }); }
https://github.com/Joker-x-dev/CoolMallArkTS
f89394ccd94840d99d0d82eb21ec0a8a85d0e9e9
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets
arkts
supportedLocalesOf
Returns an array of supported locales for text segmentation @param locales An array of BCP 47 language tags to check @param options Optional configuration for locale matching @returns An array of supported locales from the input @remarks - Validates which of the provided locales are supported by the Segmenter - Uses th...
public static supportedLocalesOf( locales: BCP47LanguageTag | BCP47LanguageTag[], options?: PickLocaleMatchSegmenterOptions, ): BCP47LanguageTag[] { const matchingStrategy = options?.localeMatcher ?? 'best fit'; try { return matchin...
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 supportedLocalesOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left locales AST#identifier#Right AST#:#L...
public static supportedLocalesOf( locales: BCP47LanguageTag | BCP47LanguageTag[], options?: PickLocaleMatchSegmenterOptions, ): BCP47LanguageTag[] { const matchingStrategy = options?.localeMatcher ?? 'best fit'; try { return matchin...
https://gitcode.com/iop123123/arkts-static-skills
8cdad10d45d945f2f828b6b0afe34c2dc40615ab
gitcode