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
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RejectedHandler.ets
arkts
unregister
Unregisters a previously registered rejection handler. @param cb The callback to be removed from the handler set.
public unregister(cb: RejectedObjectListener): void { this.handlers.delete(cb); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unregister AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cb AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Rejecte...
public unregister(cb: RejectedObjectListener): void { this.handlers.delete(cb); }
https://gitcode.com/iop123123/arkts-static-skills
933fbfcdf992c68859d5e99e85a4ddf37584d508
gitcode
HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts
entry/src/main/ets/common/CommonEventUtil.ets
arkts
subscribeCallBack
Callback for common event subscription. @param error Error information. @param data Event that is listened to.
private subscribeCallBack(error: BusinessError, data: commonEventManager.CommonEventData) { if (error) { hilog.error(domainId, logTag, `Failed to subscribe. errCode: ${error.code}, message: ${error.message}`); return; } if (canIUse("SystemCapability.Notification.CommonEvent")) { hilog.in...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left subscribeCallBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left error AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
private subscribeCallBack(error: BusinessError, data: commonEventManager.CommonEventData) { if (error) { hilog.error(domainId, logTag, `Failed to subscribe. errCode: ${error.code}, message: ${error.message}`); return; } if (canIUse("SystemCapability.Notification.CommonEvent")) { hilog.in...
https://gitcode.com/HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts
30f414b0a4ff78319f58da26fa27ade9eccece79
gitcode
HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
products/phone/src/main/ets/pages/customScan/model/ScanLayout.ets
arkts
setWidthBreakpoint
Width breakpoints: 600 and 840. BREAKPOINT_SM, BREAKPOINT_MD, BREAKPOINT_LG
public setWidthBreakpoint(width: number): void { if (width < BreakpointConstants.MIDDLE_DEVICE_WIDTH) { this.widthBreakpoint = BreakpointConstants.BREAKPOINT_SM; } else if (width < BreakpointConstants.LARGE_DEVICE_WIDTH) { this.widthBreakpoint = BreakpointConstants.BREAKPOINT_MD; } else { ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setWidthBreakpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
public setWidthBreakpoint(width: number): void { if (width < BreakpointConstants.MIDDLE_DEVICE_WIDTH) { this.widthBreakpoint = BreakpointConstants.BREAKPOINT_SM; } else if (width < BreakpointConstants.LARGE_DEVICE_WIDTH) { this.widthBreakpoint = BreakpointConstants.BREAKPOINT_MD; } else { ...
https://gitcode.com/HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
4d441ff7cb9b9f632fce7b2a76a478199de2f0c6
gitcode
openharmony/applications_call
mobiledatasettings/src/main/ets/pages/index.ets
arkts
getSimCardOnePhoneNumber
Get mobile phone number
getSimCardOnePhoneNumber() { getSimCardOnePhoneNumber().then((res) => { LogUtils.i(TAG, 'getSimTelephoneNumber card1 other success' + JSON.stringify(res)); this.mTelephoneNumber = res; }).catch((err) => { LogUtils.i(TAG, 'getSimTelephoneNumber card1 other catch' + JSON.stringify(err)); }...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getSimCardOnePhoneNumber 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...
getSimCardOnePhoneNumber() { getSimCardOnePhoneNumber().then((res) => { LogUtils.i(TAG, 'getSimTelephoneNumber card1 other success' + JSON.stringify(res)); this.mTelephoneNumber = res; }).catch((err) => { LogUtils.i(TAG, 'getSimTelephoneNumber card1 other catch' + JSON.stringify(err)); }...
https://gitee.com/openharmony/applications_call.git
9c028ed1e86bcdc6dcb8e98a817696dff996d1e5
gitee
midori52000/ArkPilot
Agent/entry/src/main/ets/apim/ApiManagementService.ets
arkts
discoverModels
========== 模型发现 ==========
async discoverModels(baseUrl: string, apiKey: string): Promise<string[]> { const trimmedUrl = cleanBaseUrl(baseUrl); const modelsUrl = `${trimmedUrl}/models`; try { const httpRequest = http.createHttp(); const response = await httpRequest.request(modelsUrl, { method: http.RequestMetho...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left discoverModels AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left baseUrl AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async discoverModels(baseUrl: string, apiKey: string): Promise<string[]> { const trimmedUrl = cleanBaseUrl(baseUrl); const modelsUrl = `${trimmedUrl}/models`; try { const httpRequest = http.createHttp(); const response = await httpRequest.request(modelsUrl, { method: http.RequestMetho...
https://github.com/midori52000/ArkPilot
230a7c53047dccc6d98d37a1e1ea574c3cb92abe
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
of
Returns a new array from a set of elements. @param { FixedArray<int> } items - a set of elements to include in the new array object. @returns { Uint32Array } - a new Uint32Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(...items: FixedArray<int>): Uint32Array { let res = new Uint32Array(items.length.toInt()) res.ofInt(stub.toValueArray(items)) return res }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR...
public static of(...items: FixedArray<int>): Uint32Array { let res = new Uint32Array(items.length.toInt()) res.ofInt(stub.toValueArray(items)) return res }
https://gitcode.com/iop123123/arkts-static-skills
bae06ed4a8cc0e0e14b6975b6e9a52ce145fd0eb
gitcode
codelably/HCompass
core/navigation/src/main/ets/GuardManager.ets
arkts
unregister
注销路由守卫 @param guard 守卫实例 @returns 是否注销成功
unregister(guard: RouteGuard): boolean { const index = this.guards.indexOf(guard); if (index !== -1) { this.guards.splice(index, 1); this.log(`Guard unregistered: ${guard.name ?? 'unnamed'}`); return true; } return false; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left unregister AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left guard AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left RouteGuard AST#identifier#Right AST#)#Left )...
unregister(guard: RouteGuard): boolean { const index = this.guards.indexOf(guard); if (index !== -1) { this.guards.splice(index, 1); this.log(`Guard unregistered: ${guard.name ?? 'unnamed'}`); return true; } return false; }
https://github.com/codelably/HCompass
4f0c06e3fc5d13e86c5edc84aa3078d06fced197
github
HarmonyOS_Samples/HarmonyOSComponentUXExamples
commons/componentuxexamplesbase/src/main/ets/components/select/slider/components/BaseSlider.ets
arkts
baseCardStyle
Extract file-level global common card styles
@Styles function baseCardStyle() { .width(SizeToken.SIZE_PERCENT_100) .borderRadius(CornerRadiusToken.CORNER_RADIUS_16) .backgroundColor($r('sys.color.comp_background_list_card')) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Styles AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left baseCardStyle AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Le...
@Styles function baseCardStyle() { .width(SizeToken.SIZE_PERCENT_100) .borderRadius(CornerRadiusToken.CORNER_RADIUS_16) .backgroundColor($r('sys.color.comp_background_list_card')) }
https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples
a1f228d4d294058968dde2b6528123a4abfcb88e
gitcode
openharmony/codelabs
ETSUI/MediaReview/entry/src/main/ets/pages/PostDetail.ets
arkts
onPageShow
页面回到前台时刷新用户信息
onPageShow() { this.loadUser() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow 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 AS...
onPageShow() { this.loadUser() }
https://gitcode.com/openharmony/codelabs
f5d9a335ea383ed2d379a428435a5efc1e92ce31
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets
arkts
buildFilterActions
构建筛选漫画操作序列
buildFilterActions(config: MangaSourceConfig): Action[] { const workflow = this.getWorkflow(config, 'filter'); if (!workflow) { throw new MangaSourceError( MangaSourceErrorCode.INVALID_CONFIG, '缺少筛选工作流配置' ); } return this.processActions(workflow, {}); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left buildFilterActions 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 AS...
buildFilterActions(config: MangaSourceConfig): Action[] { const workflow = this.getWorkflow(config, 'filter'); if (!workflow) { throw new MangaSourceError( MangaSourceErrorCode.INVALID_CONFIG, '缺少筛选工作流配置' ); } return this.processActions(workflow, {}); }
https://github.com/DaLongZhuaZi/manxia
bbf5fbca4c8ba474acb1e89421c3eae38b5550ce
github
openharmony/codelabs
ETSUI/LifeBalance/entry/src/main/ets/common/database/DietRecordDao.ets
arkts
deleteRecord
2. 根据 ID 删除记录
async deleteRecord(id: string): Promise<boolean> { const store = RdbManager.getInstance().getRdbStore(); if (!store) { return false; } let predicates = new relationalStore.RdbPredicates(this.tableName); predicates.equalTo('id', id); try { await store.delete(predicates); ret...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteRecord AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
async deleteRecord(id: string): Promise<boolean> { const store = RdbManager.getInstance().getRdbStore(); if (!store) { return false; } let predicates = new relationalStore.RdbPredicates(this.tableName); predicates.equalTo('id', id); try { await store.delete(predicates); ret...
https://gitcode.com/openharmony/codelabs
c7056030a51e425c0e3e0173c123e299a39ef369
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/ScraperManager.ets
arkts
setGoogleBooksApiKey
设置Google Books API Key
public setGoogleBooksApiKey(apiKey: string): void { this.googleBooksScraper.setApiKey(apiKey); logger.info(TAG, 'Google Books API Key已设置'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setGoogleBooksApiKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left apiKey AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
public setGoogleBooksApiKey(apiKey: string): void { this.googleBooksScraper.setApiKey(apiKey); logger.info(TAG, 'Google Books API Key已设置'); }
https://github.com/DaLongZhuaZi/manxia
b8d3a075d35f04639f06542cdf1dce08ee654bde
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BarEntry.ets
arkts
getPositiveSum
Reuturns the sum of all positive values this entry (if stacked) contains. @return
public getPositiveSum(): number { return this.mPositiveSum; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPositiveSum 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#...
public getPositiveSum(): number { return this.mPositiveSum; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1863dcab45e959a8c178ea754e7cab7ada8c5d20
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/store/AppStore.ets
arkts
updateSettings
Action: 更新设置
public updateSettings(settings: Partial<AppState['settings']>): void { const updatedSettings = { darkMode: settings.darkMode !== undefined ? settings.darkMode : this.state.settings.darkMode, fontSize: settings.fontSize !== undefined ? settings.fontSize : this.state.settings.fontSize, language: s...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left settings AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation...
public updateSettings(settings: Partial<AppState['settings']>): void { const updatedSettings = { darkMode: settings.darkMode !== undefined ? settings.darkMode : this.state.settings.darkMode, fontSize: settings.fontSize !== undefined ? settings.fontSize : this.state.settings.fontSize, language: s...
https://github.com/LJ666-ui/harmony-health-care
6797747e7fbf90478f130428d962ed547b482825
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/WindowManager.ets
arkts
hideNavigationBar
只隐藏导航栏,保留状态栏 @param uiContext 可选的UIContext,推荐在组件中传入
static hideNavigationBar(uiContext?: UIContext): void { try { const mainWindow = uiContext ? WindowManager.getMainWindowFromUIContext(uiContext) : WindowManager.getMainWindow(); if (!mainWindow) { logger.error(WindowManager.TAG, '❌ 无法获取主窗口,隐藏导航栏失败'); return; ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left hideNavigationBar AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#...
static hideNavigationBar(uiContext?: UIContext): void { try { const mainWindow = uiContext ? WindowManager.getMainWindowFromUIContext(uiContext) : WindowManager.getMainWindow(); if (!mainWindow) { logger.error(WindowManager.TAG, '❌ 无法获取主窗口,隐藏导航栏失败'); return; ...
https://github.com/DaLongZhuaZi/manxia
cf27f60685b593fa86742eaa44a4b9dd85119ce1
github
aimilin6688/KeePassHO
entry/src/main/ets/services/store/SyncSettingsService.ets
arkts
enableSync
开启同步并执行全量同步 封装权限请求 + 设置保存 + 全量同步的完整流程 @param context UIAbilityContext(用于请求权限) @param onGranted 权限授予后的回调(UI 状态更新) @param onDenied 权限拒绝后的回调(UI 状态回滚) @param onComplete 全量同步完成后的回调 @param onError 全量同步失败的回调
public static async enableSync(context: common.UIAbilityContext, onGranted: () => void, onDenied: () => void, onComplete: () => void, onError: (error: Error) => void): Promise<void> { const granted = await SyncSettingsService.requestSyncPermission(context); if (granted) { onGranted(); ...
AST#ERROR#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#ERROR#Right AST#identifier#Left enableSync AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Le...
public static async enableSync(context: common.UIAbilityContext, onGranted: () => void, onDenied: () => void, onComplete: () => void, onError: (error: Error) => void): Promise<void> { const granted = await SyncSettingsService.requestSyncPermission(context); if (granted) { onGranted(); ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/SyncSettingsService.ets#L191-L208
1285a569a83cd4e658c8d38b91e7f00d7db47e5b
github
LongLiveY96/chatcube
entry/src/main/ets/state/AppSettingsState.ets
arkts
resolveAppSettingsStatePath
path 解析器:入参支持字段名(providers / providersVersion / providersInitialized) 未命中则原样返回,让 UIUtils.addMonitor 自己决定要不要监听
function resolveAppSettingsStatePath(path: string): string { switch (path) { case 'providers': return 'providers' case 'providersInitialized': return 'providersInitialized' case 'providersVersion': return 'providersVersion' case 'assistants': return 'assistants' case 'assis...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left resolveAppSettingsStatePath AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annotation#Left AST#:#L...
function resolveAppSettingsStatePath(path: string): string { switch (path) { case 'providers': return 'providers' case 'providersInitialized': return 'providersInitialized' case 'providersVersion': return 'providersVersion' case 'assistants': return 'assistants' case 'assis...
https://github.com/LongLiveY96/chatcube
d26594f885210cdddcc2d5a9107343c1ce637329
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
getFirstDayInMonth
Returns first day with respect to year and month @param year @param month @returns first day
function getFirstDayInMonth(year: int, month: int): int { if (year == 0) { return firstDayInMonthNormal[month]; } else { return firstDayInMonthLeap[month]; } }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getFirstDayInMonth AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left year AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
function getFirstDayInMonth(year: int, month: int): int { if (year == 0) { return firstDayInMonthNormal[month]; } else { return firstDayInMonthLeap[month]; } }
https://gitcode.com/iop123123/arkts-static-skills
caa5795426a1a03b1458561ceab532677a9f32ca
gitcode
the-wwyang/kids-learning-app
src/main/ets/storage/UserSettingsStorageService.ets
arkts
updateAudioSettings
更新音频设置 @param audioSettings 音频设置
static async updateAudioSettings(audioSettings: AudioSettings): Promise<void> { try { const settings = await UserSettingsStorageService.loadSettings(); settings.audio = audioSettings; await UserSettingsStorageService.saveSettings(settings); console.log('[UserSettingsStorage] Audio settings...
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 updateAudioSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left audioSettings AST#identifier#Right A...
static async updateAudioSettings(audioSettings: AudioSettings): Promise<void> { try { const settings = await UserSettingsStorageService.loadSettings(); settings.audio = audioSettings; await UserSettingsStorageService.saveSettings(settings); console.log('[UserSettingsStorage] Audio settings...
https://github.com/the-wwyang/kids-learning-app
bb0fb1ac1eb580e695697e4244f92dfa52109659
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
of
Returns a new array from a set of elements. @returns { BigInt64Array } - a new BigInt64Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(): BigInt64Array { return new BigInt64Array(0) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression...
public static of(): BigInt64Array { return new BigInt64Array(0) }
https://gitcode.com/iop123123/arkts-static-skills
e462104a67090d5e8b66edd8e0eec75328f1d073
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
getAxis
Returns the y-axis object to the corresponding AxisDependency. In the horizontal bar-chart, LEFT == top, RIGHT == BOTTOM @param axis @return
public getAxis(axis: AxisDependency): YAxis | null { if (axis == AxisDependency.LEFT) return this.mAxisLeft; else return this.mAxisRight; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAxis AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left axis AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AxisDepe...
public getAxis(axis: AxisDependency): YAxis | null { if (axis == AxisDependency.LEFT) return this.mAxisLeft; else return this.mAxisRight; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
87cedb1e8723282f9d482787eb51d9ce09f2114b
gitee
openharmony-sig/applications_calculator
common/src/main/ets/util/CommonUtil.ets
arkts
checkIfDeviceIsTablet
Check whether the current device is a tablet. @return {boolean} Whether the current device is a tablet.
static checkIfDeviceIsTablet(): boolean { return deviceInfo.deviceType === DEVICE_TYPE_TABLET; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkIfDeviceIsTablet 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 boo...
static checkIfDeviceIsTablet(): boolean { return deviceInfo.deviceType === DEVICE_TYPE_TABLET; }
https://gitee.com/openharmony-sig/applications_calculator.git
578183964c15bb87a699ce39bf3f334350526854
gitee
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/IMService.ets
arkts
leaveGroup
退出群聊 @param conversationId 会话ID
async leaveGroup(conversationId: string): Promise<ApiResponse<any>> { return this.client.post<any>(`/api/v1/im/conversations/${conversationId}/leave`, {}) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left leaveGroup 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#:#L...
async leaveGroup(conversationId: string): Promise<ApiResponse<any>> { return this.client.post<any>(`/api/v1/im/conversations/${conversationId}/leave`, {}) }
https://github.com/David8Idira/AI-OA
4b281e35a38aa541c93b4befa33982a6bfca37f4
github
openharmony-sig/FastBle
library/src/main/ets/BleManager.ets
arkts
readRssi
read Rssi @param bleDevice @param callback
public readRssi(bleDevice: BleDevice, callback: BleRssiCallback) { if (callback == null) { throw new Error("BleRssiCallback can not be Null!"); } if (this.multipleBluetoothController !== null) { let bleBluetooth: BleBluetooth | null = this.multipleBluetoothController.getBleBluetooth(bleDevice...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left readRssi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bleDevice AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Bl...
public readRssi(bleDevice: BleDevice, callback: BleRssiCallback) { if (callback == null) { throw new Error("BleRssiCallback can not be Null!"); } if (this.multipleBluetoothController !== null) { let bleBluetooth: BleBluetooth | null = this.multipleBluetoothController.getBleBluetooth(bleDevice...
https://gitee.com/openharmony-sig/FastBle.git
ec386fe688dbc9e7224f193a224689c03b7e0862
gitee
Octo-o-o-o/harmonyos-ai-workspace
samples/templates/web-bridge-h5-shell/BridgeJavaScriptProxy.ets
arkts
handleSync
─── 同步入口 ─────────────────────────────────────────────
handleSync(raw: string): string { const env = parseEnvelope(raw) if (env === null) { return JSON.stringify(this.buildError('INVALID_PAYLOAD', 'envelope decode failed', null)) } // Demo dispatch:按 type 路由。生产代码这里会进 SSE / Storage / Upload 等子模块 if (env.type === 'capability.query') { // Ar...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left handleSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left raw AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)...
handleSync(raw: string): string { const env = parseEnvelope(raw) if (env === null) { return JSON.stringify(this.buildError('INVALID_PAYLOAD', 'envelope decode failed', null)) } // Demo dispatch:按 type 路由。生产代码这里会进 SSE / Storage / Upload 等子模块 if (env.type === 'capability.query') { // Ar...
https://github.com/Octo-o-o-o/harmonyos-ai-workspace
a5620d09e7f8daad84eecf7fd4a653991210a816
github
Tencent-RTC/TUIKit_Harmony
call/src/main/ets/common/utils/Permission.ets
arkts
hasPermission
audio → mic; video → mic + camera. Returns true when all required perms are granted.
static async hasPermission( context: common.UIAbilityContext, mediaType: CallMediaType, ): Promise<boolean> { const required: Permissions[] = mediaType === CallMediaType.video ? [MIC_PERM, CAMERA_PERM] : [MIC_PERM]; const atManager = abilityAccessCtrl.createAtManager(); let tokenId:...
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 hasPermission AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : ...
static async hasPermission( context: common.UIAbilityContext, mediaType: CallMediaType, ): Promise<boolean> { const required: Permissions[] = mediaType === CallMediaType.video ? [MIC_PERM, CAMERA_PERM] : [MIC_PERM]; const atManager = abilityAccessCtrl.createAtManager(); let tokenId:...
https://github.com/Tencent-RTC/TUIKit_Harmony
f551ee14b8256689496d50ac1aba7aea2ff0d713
github
openharmony/arkui_ace_engine
advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.GridObjectSortComponent.ets
arkts
getAdaptiveSymbolFontSize
get adaptive for symbol font size
getAdaptiveSymbolFontSize(): string { let fontScale: number | undefined = this.fontSizeScale as number | undefined; if (!this.isFollowingSystemFontScale || fontScale === undefined) { fontScale = MIN_FONT_SCALE; } fontScale = Math.min(MIN_SYMBOL_FONT_SCALE, fontScale); fontScale = Math.max(fo...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAdaptiveSymbolFontSize 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#string#Left string AST#string#Right AST#ERROR#Right ...
getAdaptiveSymbolFontSize(): string { let fontScale: number | undefined = this.fontSizeScale as number | undefined; if (!this.isFollowingSystemFontScale || fontScale === undefined) { fontScale = MIN_FONT_SCALE; } fontScale = Math.min(MIN_SYMBOL_FONT_SCALE, fontScale); fontScale = Math.max(fo...
https://gitcode.com/openharmony/arkui_ace_engine
b3edca0dd248f2e923e323b23b1f2e6773ae71da
gitcode
krmao/arcview
library/src/main/ets/components/ArcView.ets
arkts
aboutToAppear
region lifecycle
aboutToAppear(): void { Logger.info(this.TAG, 'aboutToAppear'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear 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_bloc...
aboutToAppear(): void { Logger.info(this.TAG, 'aboutToAppear'); }
https://github.com/krmao/arcview/blob/ad2c9b6ddc84a100efc72355c628d7bc9f039870/library/src/main/ets/components/ArcView.ets#L129-L131
f261644c539ae8d749412c73e0da76f70d817b84
github
LJ666-ui/harmony-health-care
entry/src/main/ets/smartward/core/checkers/TimeChecker.ets
arkts
checkTimeRules
检查时间规则
private checkTimeRules(): void { const now = new Date(); const currentMinute = now.getHours() * 60 + now.getMinutes(); // 避免同一分钟重复检查 if (currentMinute === this.lastCheckedMinute) { return; } this.lastCheckedMinute = currentMinute; const currentTimeStr = `${String(now.getHours()).p...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left checkTimeRules 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#v...
private checkTimeRules(): void { const now = new Date(); const currentMinute = now.getHours() * 60 + now.getMinutes(); // 避免同一分钟重复检查 if (currentMinute === this.lastCheckedMinute) { return; } this.lastCheckedMinute = currentMinute; const currentTimeStr = `${String(now.getHours()).p...
https://github.com/LJ666-ui/harmony-health-care
0d05670d61bdb16e6a10cec0d4b6ee43c0ae2bc8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
findLast
Finds the last element in the Int32Array that satisfies the condition @param { function } fn - condition @returns { int } - the last element that satisfies fn @throws { Error } - If the element cannot be found, throw an exception @syscap SystemCapability.Utils.Lang @FaAndStageModel
public findLast(fn: (val: number, index: int, array: Int32Array) => boolean): int { for (let i = this.lengthInt - 1; i >= 0; --i) { let val = this.getUnsafe(i) if (fn((val).toDouble(), i, this)) { return val } } throw new Error("Int32Array....
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: number, index: int, array: Int32Array) => boolean): int { for (let i = this.lengthInt - 1; i >= 0; --i) { let val = this.getUnsafe(i) if (fn((val).toDouble(), i, this)) { return val } } throw new Error("Int32Array....
https://gitcode.com/iop123123/arkts-static-skills
b3f6a171b991355215886f4e15ce40d0dc891476
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/viewmodel/PcListActions.ets
arkts
getAddressLabel
根据地址匹配返回易读标签
private getAddressLabel(address: string, computerInfo: ComputerInfo): string { if (address === computerInfo.manualAddress) return `手动 (${address})`; if (address === computerInfo.localAddress) return `局域网 (${address})`; if (address === computerInfo.remoteAddress) return `远程 (${address})`; if (address =...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getAddressLabel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left address AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
private getAddressLabel(address: string, computerInfo: ComputerInfo): string { if (address === computerInfo.manualAddress) return `手动 (${address})`; if (address === computerInfo.localAddress) return `局域网 (${address})`; if (address === computerInfo.remoteAddress) return `远程 (${address})`; if (address =...
https://github.com/AlkaidLab/moonlight-harmony
c389479e16962883ff2fda41d25a310eae61ed25
github
cheinlu/HarmonyOS-groundhog-charging-system
TbsChargeHarmonyOs/entry/src/main/ets/entryability/EntryAbility.ets
arkts
setMainWindowImmersive
设置沉浸式状态栏 默认情况:状态栏、导航栏透明,状态栏字体颜色黑色 @param windowStage
setMainWindowImmersive(windowStage: window.WindowStage) { WindowModel.getInstance().setWindowStage(windowStage) WindowModel.getInstance().setMainWindowImmersive(true) let type = window.AvoidAreaType.TYPE_SYSTEM; try { let mainWindow = windowStage.getMainWindowSync() let avoidArea = mainWin...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setMainWindowImmersive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left ...
setMainWindowImmersive(windowStage: window.WindowStage) { WindowModel.getInstance().setWindowStage(windowStage) WindowModel.getInstance().setMainWindowImmersive(true) let type = window.AvoidAreaType.TYPE_SYSTEM; try { let mainWindow = windowStage.getMainWindowSync() let avoidArea = mainWin...
https://github.com/cheinlu/HarmonyOS-groundhog-charging-system
5b75b9ad7311df98b60d39c96f920c6944398abf
github
Tencent-RTC/TUIKit_Harmony
call/src/main/ets/feature/IncomingNotificationFeature.ets
arkts
tryLoadAvatarPixelMap
Returns undefined on any failure; the notification will fall back to the bundle's default icon.
private async tryLoadAvatarPixelMap(url: string | undefined): Promise<image.PixelMap | undefined> { if (!url || url.length === 0 || !url.startsWith('http')) { return undefined; } try { const req = http.createHttp(); const resp = await req.request(url, { method: http.RequestMethod.GET });...
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 tryLoadAvatarPixelMap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#...
private async tryLoadAvatarPixelMap(url: string | undefined): Promise<image.PixelMap | undefined> { if (!url || url.length === 0 || !url.startsWith('http')) { return undefined; } try { const req = http.createHttp(); const resp = await req.request(url, { method: http.RequestMethod.GET });...
https://github.com/Tencent-RTC/TUIKit_Harmony
61d5cb78b9708006c657c63a10426305248c38c1
github
LongLiveY96/chatcube
entry/src/main/ets/services/ToolRegistry.ets
arkts
getToolExecutor
获取工具执行器
getToolExecutor(toolId: string): ToolExecutor | undefined { const tool = this.tools.get(toolId) if (tool !== undefined) { return tool.executor } return undefined }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getToolExecutor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left toolId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
getToolExecutor(toolId: string): ToolExecutor | undefined { const tool = this.tools.get(toolId) if (tool !== undefined) { return tool.executor } return undefined }
https://github.com/LongLiveY96/chatcube
445551a81c039678d512224e8a2beef3ea7fc77a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/SyncPrimitives.ets
arkts
lock
/ Acquires lock and allows to get exclusive access to the critical seciton
public lock(): void { WriteLock.lock(this.rwLock); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left lock 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#:#Righ...
public lock(): void { WriteLock.lock(this.rwLock); }
https://gitcode.com/iop123123/arkts-static-skills
526fd5c0ea2628ac91eadfe6d053231dec06c1b9
gitcode
chendi126/harmonyOS-TCP
entry/src/main/ets/common/GlassStyles.ets
arkts
getButtonGradientStart
获取按钮渐变起始色
static getButtonGradientStart(type: 'primary' | 'secondary' | 'success' | 'warning' = 'primary'): string { switch (type) { case 'primary': return GlassColors.BUTTON_PRIMARY_START; case 'secondary': return GlassColors.BUTTON_SECONDARY_START; case 'success': return GlassCol...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getButtonGradientStart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignmen...
static getButtonGradientStart(type: 'primary' | 'secondary' | 'success' | 'warning' = 'primary'): string { switch (type) { case 'primary': return GlassColors.BUTTON_PRIMARY_START; case 'secondary': return GlassColors.BUTTON_SECONDARY_START; case 'success': return GlassCol...
https://github.com/chendi126/harmonyOS-TCP
195f478d665dcc3f2ac944cf3a7f201946bca04f
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/OCRRecognition.ets
arkts
getDefaultPreprocessingOptions
获取默认预处理选项
static getDefaultPreprocessingOptions(): PreprocessingOptions { const result: PreprocessingOptions = { autoRotate: true, deskew: true, denoise: true, enhanceContrast: true, binarize: false, resize: true, maxWidth: 1920, maxHeight: 1920 }; return result; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getDefaultPreprocessingOptions 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#identif...
static getDefaultPreprocessingOptions(): PreprocessingOptions { const result: PreprocessingOptions = { autoRotate: true, deskew: true, denoise: true, enhanceContrast: true, binarize: false, resize: true, maxWidth: 1920, maxHeight: 1920 }; return result; }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
ca4fc60b6b9294cc2313d4aec56843b0b19d3ffb
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/ProviderViewModel.ets
arkts
providerToApiConfig
============================================================================ 业务 helpers ============================================================================ 把运行时 Provider 转成一次请求所需的最小 AIApiConfig
private providerToApiConfig(provider: ModelProvider): AIApiConfig { return { providerId: provider.id, providerType: provider.type, apiStyle: provider.apiStyle, apiKey: getEffectiveApiKey(provider.id, provider.apiKey), baseUrl: provider.baseUrl, apiPath: provider.apiPath || unde...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left providerToApiConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left provider AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident...
private providerToApiConfig(provider: ModelProvider): AIApiConfig { return { providerId: provider.id, providerType: provider.type, apiStyle: provider.apiStyle, apiKey: getEffectiveApiKey(provider.id, provider.apiKey), baseUrl: provider.baseUrl, apiPath: provider.apiPath || unde...
https://github.com/LongLiveY96/chatcube
df8ad7c3dfed10ca4221b64f7e835a7c79a0d188
github
Countly/countly-sdk-hos
library/src/main/ets/internal/modules/ModuleViews.ets
arkts
updateOrientation
Record an orientation change. Auto-driven by `LifecycleObserver` via `applicationContext.on('environment', ...)` when `trackOrientationChanges` is on (default true), see `CountlyInstance.handleConfigurationUpdated`. Integrators can also call this directly for manual control or in test harnesses. Accepts `'portrait'` or...
public async updateOrientation(mode: string, forceSend: boolean = false): Promise<void> { if (this.rejectIfHalted('ModuleViews', 'updateOrientation')) return; if (!this.config.trackOrientationChanges) { this.config.logger.v('[ModuleViews] updateOrientation, trackOrientationChanges disabled, ignored'); ...
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 updateOrientation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left :...
public async updateOrientation(mode: string, forceSend: boolean = false): Promise<void> { if (this.rejectIfHalted('ModuleViews', 'updateOrientation')) return; if (!this.config.trackOrientationChanges) { this.config.logger.v('[ModuleViews] updateOrientation, trackOrientationChanges disabled, ignored'); ...
https://github.com/Countly/countly-sdk-hos
5c3af7adf1280d323f22127df81bf85925a546ad
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/background/ContinuousTaskDemo.ets
arkts
stopBackgroundRunning
停止长时任务
stopBackgroundRunning() { /* * backgroundTaskManager.stopBackgroundRunning() - 停止长时任务 * context - 上下文 */ backgroundTaskManager.stopBackgroundRunning(getContext(this)).then(() => { this.message += "stopBackgroundRunning 成功\n" }).catch((err: BusinessError) => { this.message += `...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left stopBackgroundRunning 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_bl...
stopBackgroundRunning() { /* * backgroundTaskManager.stopBackgroundRunning() - 停止长时任务 * context - 上下文 */ backgroundTaskManager.stopBackgroundRunning(getContext(this)).then(() => { this.message += "stopBackgroundRunning 成功\n" }).catch((err: BusinessError) => { this.message += `...
https://github.com/webabcd/HarmonyDemo
ec924a2d16223df54dfe259b5b40a6c267ac155c
github
mybricks/comlib-harmony-normal
packages/rt-arkts/comlib/src/main/ets/AiMusic/model/AppMusicMediaPlayer.ets
arkts
stopVinylRotation
结束唱片动画
static stopVinylRotation() { animateTo({ duration: 500, curve: Curve.EaseInOut }, () => { MediaPlayer.needleRotation = 0 MediaPlayer.eventListener.get("needleRotation")?.forEach((listener) => { listener(MediaPlayer.needleRotation) }) }) clearInterval(MediaPlayer....
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left stopVinylRotation 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#{#Le...
static stopVinylRotation() { animateTo({ duration: 500, curve: Curve.EaseInOut }, () => { MediaPlayer.needleRotation = 0 MediaPlayer.eventListener.get("needleRotation")?.forEach((listener) => { listener(MediaPlayer.needleRotation) }) }) clearInterval(MediaPlayer....
https://github.com/mybricks/comlib-harmony-normal
f89c30604ee7a0b1ce442b054a9b0f704a2b0f40
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
constructor
Private constructor for VoidType @param {RuntimeTypeDescriptor} td Type descriptor @param {boolean} value Whether this is a value type @syscap SystemCapability.Utils.Lang @FaAndStageModel
private constructor(td: RuntimeTypeDescriptor, value: boolean) { super(td, getBootRuntimeLinker()) this.value = value }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left td AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Run...
private constructor(td: RuntimeTypeDescriptor, value: boolean) { super(td, getBootRuntimeLinker()) this.value = value }
https://gitcode.com/iop123123/arkts-static-skills
9b9fffb291eaf91c2770b4d293627d5710ecb2de
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/NSFWHelper.ets
arkts
isNSFWByText
从标题或描述判断是否为NSFW内容
public static isNSFWByText(text: string): boolean { if (!text) { return false; } const textLower = text.toLowerCase(); return NSFW_KEYWORDS.some(keyword => textLower.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 isNSFWByText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST...
public static isNSFWByText(text: string): boolean { if (!text) { return false; } const textLower = text.toLowerCase(); return NSFW_KEYWORDS.some(keyword => textLower.includes(keyword)); }
https://github.com/DaLongZhuaZi/manxia
afa725f074c24b4aa7b3b09d6993084cb4b2b983
github
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/AccountKitService.ets
arkts
getUnionID
获取 UnionID
getUnionID(): string { return this.credential?.unionID || ''; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUnionID 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#string#Left string AST#string#Right AST#ERROR#Right AST#statement_b...
getUnionID(): string { return this.credential?.unionID || ''; }
https://github.com/Mydstiny/RemoteDeskHarmonyOS
02b96bd8791ca5b6bf1ae17ed0a3b5bdbfdf5157
github
wuba/omni-ui
omni_component/src/main/ets/utils/ImmersionBar.ets
arkts
immersion
如果 transparentStatusBar @param value
immersion(value: ImmersionBarSettings) { let isLayoutFullScreen: boolean = value.transparentStatusBar ?? false this.windowClass?.setImmersiveModeEnabledState(isLayoutFullScreen) let statusBarColor = value.statusBarColor if (value.transparentStatusBar) { statusBarColor = Color.Transparent.toStrin...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left immersion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ImmersionBarSettings AST#ident...
immersion(value: ImmersionBarSettings) { let isLayoutFullScreen: boolean = value.transparentStatusBar ?? false this.windowClass?.setImmersiveModeEnabledState(isLayoutFullScreen) let statusBarColor = value.statusBarColor if (value.transparentStatusBar) { statusBarColor = Color.Transparent.toStrin...
https://github.com/wuba/omni-ui
b865262f4055bec981c81a6ca1b1372731362db3
github
HarmonyOS_Samples/hmosworld
HMOSWorld/Application/commons/audioplayer/src/main/ets/service/AudioRenderService.ets
arkts
startAudioRender
Start playing the audio and monitor the audio status.
public startAudioRender() { if (this.renderer) { const stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED]; // Rendering starts if and only if the state is one of prepared, paused, and stopped. if (stateGroup.indexOf(this.renderer...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startAudioRender 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#{#Lef...
public startAudioRender() { if (this.renderer) { const stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED]; // Rendering starts if and only if the state is one of prepared, paused, and stopped. if (stateGroup.indexOf(this.renderer...
https://gitcode.com/HarmonyOS_Samples/hmosworld
95db55c409f9c8e1892b421aaadbc8706b864799
gitcode
webabcd/HarmonyDemo
entry/src/main/ets/pages/security/CryptoDemo.ets
arkts
hmac
计算指定数据的 hmac 哈希值 hmac 是一种基于密钥的哈希算法,其通过结合哈希函数和密钥对数据进行哈希处理
public static hmac(data: Uint8Array, keyData: Uint8Array): Uint8Array { let symKey = CryptoHelper.getHmacSymKey(keyData); let mac = cryptoFramework.createMac('SHA256'); mac.initSync(symKey); mac.updateSync({ data: data }); let macResult = mac.doFinalSync(); return macResult.data }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left hmac AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#id...
public static hmac(data: Uint8Array, keyData: Uint8Array): Uint8Array { let symKey = CryptoHelper.getHmacSymKey(keyData); let mac = cryptoFramework.createMac('SHA256'); mac.initSync(symKey); mac.updateSync({ data: data }); let macResult = mac.doFinalSync(); return macResult.data }
https://github.com/webabcd/HarmonyDemo
b0f99a21eeaca5449fdd7bfd590d61ce21de3a05
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
getUserAgent
获取WebView的UserAgent
private async getUserAgent(): Promise<string> { return new Promise<string>((resolve, reject) => { try { // [修复] 添加超时机制,防止WebView未就绪时无限等待 const timeout = setTimeout(() => { reject(new Error('WebView UserAgent获取超时')); }, 3000); // 3秒超时 this.engineConfig.webVi...
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 getUserAgent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
private async getUserAgent(): Promise<string> { return new Promise<string>((resolve, reject) => { try { // [修复] 添加超时机制,防止WebView未就绪时无限等待 const timeout = setTimeout(() => { reject(new Error('WebView UserAgent获取超时')); }, 3000); // 3秒超时 this.engineConfig.webVi...
https://github.com/DaLongZhuaZi/manxia
14fa1d2775098952790ef3d16486f32a5abc598b
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
internal
Fills the Uint16Array with specified value @param value new valuy @returns modified Uint16Array public
/* public */ internal fill(value: number, start: int, end: int): Uint16Array { throw new Error("not implemented") }
AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#call_expression#Left AST#identifier#Left internal 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...
/* public */ internal fill(value: number, start: int, end: int): Uint16Array { throw new Error("not implemented") }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
7a10ce9ad59111082d0781f7a23be7bcb2bdd4c1
gitee
GrassyUnknown/Health-Life-HarmonyOS-Next
entry/src/main/ets/view/home/WeekCalendarComponent.ets
arkts
getProgressImg
获取该天进度
getProgressImg(item: WeekDateModel): Resource { let finNum = item.dayInfo?.finTaskNum || 0; // 0 if (finNum === 0) { return $r('app.media.ic_home_undone'); } // 完成 if (finNum === (item.dayInfo?.targetTaskNum || 0)) { return $r('app.media.ic_home_all_done'); } // other r...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getProgressImg AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left WeekDateModel AST#identifier#Right AST#)#...
getProgressImg(item: WeekDateModel): Resource { let finNum = item.dayInfo?.finTaskNum || 0; // 0 if (finNum === 0) { return $r('app.media.ic_home_undone'); } // 完成 if (finNum === (item.dayInfo?.targetTaskNum || 0)) { return $r('app.media.ic_home_all_done'); } // other r...
https://github.com/GrassyUnknown/Health-Life-HarmonyOS-Next
b640fab68f304578bb73d0aa30d7f1c31820f07d
github
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
addApiPathColumnIfNeeded
添加 api_path 字段(用于自定义 API 路径)
private async addApiPathColumnIfNeeded(): Promise<void> { if (this.rdbStore === null) { return } try { await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.PROVIDERS} ADD COLUMN api_path TEXT DEFAULT ''`) } catch (error) { console.info('DatabaseService', 'api_path column may alre...
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 addApiPathColumnIfNeeded AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressio...
private async addApiPathColumnIfNeeded(): Promise<void> { if (this.rdbStore === null) { return } try { await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.PROVIDERS} ADD COLUMN api_path TEXT DEFAULT ''`) } catch (error) { console.info('DatabaseService', 'api_path column may alre...
https://github.com/LongLiveY96/chatcube
fb84832d307bf44d7ff92d41bc5fd0aba5b92cf7
github
Strive700/AdvisoryCore
AdvisoryCore-Harmony/entry/src/main/ets/pages/BasicFund.ets
arkts
onReset
重置筛选条件
private onReset() { this.filters = new Filters(); this.onSearch(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left onReset 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 { AS...
private onReset() { this.filters = new Filters(); this.onSearch(); }
https://github.com/Strive700/AdvisoryCore
d4e6125d39ebff23c9a005043e98d3ab7d2ccddf
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/less_than/less_than_ubyte.ets
arkts
main
--- desc: check less than operation for unsigned byte ---
function main(): void { const a: ubyte = {{v.left}} const b: ubyte = {{v.right}} assert (a < b) == {{v.result}}
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { const a: ubyte = {{v.left}} const b: ubyte = {{v.right}} assert (a < b) == {{v.result}}
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
825610cd8827371037ccc037c98b45c83edcb8c1
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/AccountService.ets
arkts
updateProfile
仅在登录成功后 profile 授权拿到新头像/昵称时调用,补齐展示数据。 不改变 loggedIn 状态。
async updateProfile(nickName: string, avatarUri: string): Promise<void> { if (!this.cachedAccount.loggedIn) { return } const preferences: PreferencesService = getPreferencesService() try { await preferences.setString(PreferenceKeys.HW_ACCOUNT_NICK_NAME, nickName) await preferences.se...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left updateProfile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left nickName AST#identifier#Right A...
async updateProfile(nickName: string, avatarUri: string): Promise<void> { if (!this.cachedAccount.loggedIn) { return } const preferences: PreferencesService = getPreferencesService() try { await preferences.setString(PreferenceKeys.HW_ACCOUNT_NICK_NAME, nickName) await preferences.se...
https://github.com/LongLiveY96/chatcube
8b99754e4910eee53e6eb7a82f3becda53920f66
github
arkui-x/samples
CodeLab/Cases/feature/customtabbar/src/main/ets/util/CustomTabBar.ets
arkts
checkParam
检查输入参数
checkParam() { if (!this.tabsInfo || this.tabsInfo.length === 0) { this.tabsInfo = [ new TabBarInfo(0, CommonConstants.DEFAULT_TITLE1_TAB, CommonConstants.DEFAULT_ICON, CommonConstants.DEFAULT_ICON, CommonConstants.SELECTED_TITLE_FONT_COLOR, CommonConstants.DEFAULT_ICON), new TabBa...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left checkParam 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 AS...
checkParam() { if (!this.tabsInfo || this.tabsInfo.length === 0) { this.tabsInfo = [ new TabBarInfo(0, CommonConstants.DEFAULT_TITLE1_TAB, CommonConstants.DEFAULT_ICON, CommonConstants.DEFAULT_ICON, CommonConstants.SELECTED_TITLE_FONT_COLOR, CommonConstants.DEFAULT_ICON), new TabBa...
https://gitcode.com/arkui-x/samples
ea81db67e1ec79af4e62e69df899edb51785e28e
gitcode
openharmony/update_update_app
feature/ota/src/main/ets/notify/NotificationHelper.ets
arkts
showDownloading
下载进度通知 @param version 版本号 @param progress 进度 @param context 上下文
async showDownloading(version, progress, context): Promise<void> { let templateName: string = 'downloadTemplate'; if (!globalThis.isSupportTemplate) { globalThis.isSupportTemplate = await notification.isSupportTemplate(templateName).catch(err => { this.logError('showDownloading isSupportTemplate...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left showDownloading AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left version AST#identifier#Right AST#required_parameter#Ri...
async showDownloading(version, progress, context): Promise<void> { let templateName: string = 'downloadTemplate'; if (!globalThis.isSupportTemplate) { globalThis.isSupportTemplate = await notification.isSupportTemplate(templateName).catch(err => { this.logError('showDownloading isSupportTemplate...
https://gitee.com/openharmony/update_update_app.git
9e52d7a4498a765bbe899368d6c17611e22ef254
gitee
arkui-x/samples
CodeLab/Cases/feature/customanimationtab/src/main/ets/utils/CustomAnimationTab.ets
arkts
indicatorBar
默认背景条样式 @param {BaseInterface} $$ - 返回的基本信息
@Builder function indicatorBar($$: BaseInterface) { Column() .height(CommonConstants.FULL_PERCENT) .width(CommonConstants.FULL_PERCENT) .backgroundColor(Color.Red) .borderRadius(CommonConstants.DEFAULT_INDICATOR_BORDER_RADIUS) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left indicatorBar AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#requ...
@Builder function indicatorBar($$: BaseInterface) { Column() .height(CommonConstants.FULL_PERCENT) .width(CommonConstants.FULL_PERCENT) .backgroundColor(Color.Red) .borderRadius(CommonConstants.DEFAULT_INDICATOR_BORDER_RADIUS) }
https://gitcode.com/arkui-x/samples
ac9ac9dfd452cbb733f338e1ce76a9e4f08faabe
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/ConsolePanel.ets
arkts
getSystemStatus
获取系统状态
getSystemStatus(): string { const errorCount = this.logs.filter(log => log.level === LogLevel.ERROR).length; const warnCount = this.logs.filter(log => log.level === LogLevel.WARN).length; const infoCount = this.logs.filter(log => log.level === LogLevel.INFO).length; const debugCount = this.logs.filter...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSystemStatus 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#string#Left string AST#string#Right AST#ERROR#Right AST#statem...
getSystemStatus(): string { const errorCount = this.logs.filter(log => log.level === LogLevel.ERROR).length; const warnCount = this.logs.filter(log => log.level === LogLevel.WARN).length; const infoCount = this.logs.filter(log => log.level === LogLevel.INFO).length; const debugCount = this.logs.filter...
https://github.com/DaLongZhuaZi/manxia
6c80fead42eabf4dce529f214ac9bc42b54965a8
github
openharmony/applications_settings
product/phone/src/main/ets/pages/passwordInput.ets
arkts
updateView
Update view
updateView() { this.pageTitle = this.getPageTitle(); this.inputMessage = this.getInputMessage(); this.unlockMethodList = this.getUnlockMethodList(); this.buttonVisibility = this.getButtonVisibility(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateView 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 AS...
updateView() { this.pageTitle = this.getPageTitle(); this.inputMessage = this.getInputMessage(); this.unlockMethodList = this.getUnlockMethodList(); this.buttonVisibility = this.getButtonVisibility(); }
https://gitee.com/openharmony/applications_settings.git
96d1b8626a6901da28bc71aa661c28b8f0acb946
gitee
ycj3/streaming-markdown
packages/streaming-markdown/src/main/ets/ui/BlockView.ets
arkts
openLink
Open link URL in system browser
openLink(url: string) { const context = this.getUIContext().getHostContext() as common.UIAbilityContext; context.openLink(url) .then(() => {}) .catch((error: BusinessError) => { console.error('open link failed: ' + JSON.stringify(error)); }); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openLink AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)...
openLink(url: string) { const context = this.getUIContext().getHostContext() as common.UIAbilityContext; context.openLink(url) .then(() => {}) .catch((error: BusinessError) => { console.error('open link failed: ' + JSON.stringify(error)); }); }
https://github.com/ycj3/streaming-markdown
6e5e4d58b9f7c39f18975556322f035ebacaac23
github
richshaw2015/nds
ohos/entry/src/main/ets/types/MelonDSNative.ets
arkts
setSettingsConfig
============================================================================ 设置同步接口 (Settings Menu Port) Requirements: 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7 ============================================================================ 设置配置值 (扩展版本,支持更多类型) @param key 配置键 @param value 配置值 (boolean, number, string, 或 str...
static setSettingsConfig(key: string, value: SettingsConfigValue): boolean { return MelonDSNative.native.setSettingsConfig(key, value); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setSettingsConfig 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...
static setSettingsConfig(key: string, value: SettingsConfigValue): boolean { return MelonDSNative.native.setSettingsConfig(key, value); }
https://github.com/richshaw2015/nds
fa556483ecdab6652f0de1bbb0f6530985bbca00
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/RcpSessionPool.ets
arkts
acquire
取/建一个 Session(按 cacheKey 缓存)
static acquire(cacheKey: string, options: SessionAcquireOptions): rcp.Session { const cached = RcpSessionPool.entries.get(cacheKey); if (cached) { cached.lastUsedAt = Date.now(); // 重新插入维护 LRU 顺序(Map 保留插入顺序) RcpSessionPool.entries.delete(cacheKey); RcpSessionPool.entries.set(cacheKey, ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left acquire AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cacheKey AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right ...
static acquire(cacheKey: string, options: SessionAcquireOptions): rcp.Session { const cached = RcpSessionPool.entries.get(cacheKey); if (cached) { cached.lastUsedAt = Date.now(); // 重新插入维护 LRU 顺序(Map 保留插入顺序) RcpSessionPool.entries.delete(cacheKey); RcpSessionPool.entries.set(cacheKey, ...
https://github.com/AlkaidLab/moonlight-harmony
ebc18107560a73bdb745df43806e527e402d3f1a
github
FinalScave/SweetEditor
platform/OHOS/sweeteditor/src/main/ets/core/EditorCore.ets
arkts
setIndentGuides
==================== Guide (Code Structure Lines) ====================
setIndentGuides(guidesOrData: IndentGuide[] | ArrayBuffer, _size?: number): EditorActionResult { if (guidesOrData instanceof ArrayBuffer) { return CoreProtocol.decodeEditorActionResult( native.editorSetIndentGuides(this.handle, guidesOrData, guidesOrData.byteLength)); } const data = CoreProt...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setIndentGuides AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left guidesOrData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#subscript_expression#...
setIndentGuides(guidesOrData: IndentGuide[] | ArrayBuffer, _size?: number): EditorActionResult { if (guidesOrData instanceof ArrayBuffer) { return CoreProtocol.decodeEditorActionResult( native.editorSetIndentGuides(this.handle, guidesOrData, guidesOrData.byteLength)); } const data = CoreProt...
https://github.com/FinalScave/SweetEditor
c099f3c9702cdfb11dcea1afeccc376f917cabc0
github
terryma2024/happyword
harmonyos/entry/src/test/LearningReportBuilder.test.ets
arkts
makeLibrary
Standard 3-pack fixture used by most cases: - fruit-forest (builtin, 5 words) - school-castle (builtin, 4 words) - space-station (global, 3 words) activeIds defaults to the 2 builtins (ACTIVE_BUILTINS); tests that need inactive-but-seen behavior pass space-station's words into the recorder while leaving it out of activ...
function makeLibrary(): PackLibrary { const lib: PackLibrary = new PackLibrary(); lib.setBuiltins([ makePack('fruit-forest', 'Fruit Forest', 'builtin', ['f-apple', 'f-banana', 'f-orange', 'f-grape', 'f-pear'], 'fruit'), makePack('school-castle', 'School Castle', 'builtin', ['s-school', 's-park',...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left makeLibrary AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier...
function makeLibrary(): PackLibrary { const lib: PackLibrary = new PackLibrary(); lib.setBuiltins([ makePack('fruit-forest', 'Fruit Forest', 'builtin', ['f-apple', 'f-banana', 'f-orange', 'f-grape', 'f-pear'], 'fruit'), makePack('school-castle', 'School Castle', 'builtin', ['s-school', 's-park',...
https://github.com/terryma2024/happyword
b0b4dd343210f9582f496bac2e2702a80b38f048
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
getOnlineComicInfoById
获取在线漫画(强类型)
public async getOnlineComicInfoById(comicId: string): Promise<OnlineComicInfo | null> { try { const sql = 'SELECT * FROM online_comic_info WHERE id = ?'; const result = await this.databaseManager.querySql(sql, [comicId]); if (result && result.length > 0) { return this.convertRecordToOnli...
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 getOnlineComicInfoById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left AST#...
public async getOnlineComicInfoById(comicId: string): Promise<OnlineComicInfo | null> { try { const sql = 'SELECT * FROM online_comic_info WHERE id = ?'; const result = await this.databaseManager.querySql(sql, [comicId]); if (result && result.length > 0) { return this.convertRecordToOnli...
https://github.com/DaLongZhuaZi/manxia
47934023ca780ea1f1704e9b157ae528e2ade594
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test37_original_index.ets
arkts
setUnion
--- Set algebra: union, intersection, difference ---
function setUnion(a: Set<number>, b: Set<number>): Set<number> { let result: Set<number> = new Set(a); let arr: number[] = Array.from(b); for (let i: number = 0; i < arr.length; i++) { result.add(arr[i]); } return result; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left setUnion AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left a AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#...
function setUnion(a: Set<number>, b: Set<number>): Set<number> { let result: Set<number> = new Set(a); let arr: number[] = Array.from(b); for (let i: number = 0; i < arr.length; i++) { result.add(arr[i]); } return result; }
https://github.com/miaochiahao/ark-ghidra
401c1db23ceb00ecd3089bc09ecb1c2741998176
github
arkui-x/samples
CodeLab/Cases/feature/cardswiperanimation/src/main/ets/model/CardModel.ets
arkts
totalCount
Total data count @returns: length
totalCount(): number { return this.list.length; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left totalCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_b...
totalCount(): number { return this.list.length; }
https://gitcode.com/arkui-x/samples
0e359001357c335b89f931154eb8bc5b55094062
gitcode
XJTUWYD/ArkDiff
entry/src/main/ets/services/AnalyticsService.ets
arkts
track
记录一次事件(按名称聚合计数)
static track(event: string): void { AnalyticsService.init(); const cur = AnalyticsService.counts[event] ?? 0; AnalyticsService.counts[event] = cur + 1; try { AppStorage.setOrCreate(COUNTS_KEY, JSON.stringify(AnalyticsService.counts)); } catch (_e) { hilog.error(DOMAIN, 'analytics', 'tr...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left track AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ER...
static track(event: string): void { AnalyticsService.init(); const cur = AnalyticsService.counts[event] ?? 0; AnalyticsService.counts[event] = cur + 1; try { AppStorage.setOrCreate(COUNTS_KEY, JSON.stringify(AnalyticsService.counts)); } catch (_e) { hilog.error(DOMAIN, 'analytics', 'tr...
https://github.com/XJTUWYD/ArkDiff
b25ed15e01232433de1a0b5dfbef0e722a23f117
github
LZZLHY/hlib
entry/src/main/ets/viewmodel/DownloadVM.ets
arkts
restoreTasks
应用启动时清理残留:之前进程跑到一半的下载任务无法跨进程恢复(http stream 是进程内对象), 把任务列表清空,让用户重新触发。
static async restoreTasks(_ctx?: common.UIAbilityContext): Promise<void> { AppStorage.setOrCreate<DownloadTask[]>(AppStorageKeys.DOWNLOAD_TASKS, []); }
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 restoreTasks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left _ctx AST#identifier#Right AST#?#Left ? AST#...
static async restoreTasks(_ctx?: common.UIAbilityContext): Promise<void> { AppStorage.setOrCreate<DownloadTask[]>(AppStorageKeys.DOWNLOAD_TASKS, []); }
https://github.com/LZZLHY/hlib
1e370efa35cd66900bc562febf19079e20239f9d
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/OCRRecognition.ets
arkts
createEmptyNumberField
创建空的数值字段
static createEmptyNumberField(): NumberField { const result: NumberField = { value: 0, rawText: '', confidence: 0, hasBoundingBox: false, boundingBoxJson: '' }; return result; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createEmptyNumberField 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...
static createEmptyNumberField(): NumberField { const result: NumberField = { value: 0, rawText: '', confidence: 0, hasBoundingBox: false, boundingBoxJson: '' }; return result; }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
9a92962fa80833c3dbfbe25b1fcd47eb3ae24d6a
github
LongLiveY96/chatcube
entry/src/main/ets/models/ChatModels.ets
arkts
hasAttachments
检查是否有附件
hasAttachments(): boolean { return this.attachments.length > 0 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasAttachments 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#stat...
hasAttachments(): boolean { return this.attachments.length > 0 }
https://github.com/LongLiveY96/chatcube
00770e0e879b5aabdc207cb1a16522749bc8a525
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/EBookDataManager.ets
arkts
getEBookById
根据ID获取电子书
public async getEBookById(id: string): Promise<EBook | null> { try { const sql = `SELECT * FROM ebook_info WHERE id = ?`; const records = await this.dbManager.querySql(sql, [id]); if (records && records.length > 0) { return await this.buildEBookFromRecord(records[0]); } ...
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 getEBookById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#...
public async getEBookById(id: string): Promise<EBook | null> { try { const sql = `SELECT * FROM ebook_info WHERE id = ?`; const records = await this.dbManager.querySql(sql, [id]); if (records && records.length > 0) { return await this.buildEBookFromRecord(records[0]); } ...
https://github.com/DaLongZhuaZi/manxia
ead1894407f7d70fbddf4eb0767963f079713286
github
HarmonyOS_Samples/BestPracticeSnippets
ImageEditTaskPool/entry/src/main/ets/view/AdjustContentView.ets
arkts
getStartEditPixelMap
[EndExclude postProcess_start] [End postProcess_start]
getStartEditPixelMap() { return this.clonePixelMap(this.startEditPixelMap as image.PixelMap); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getStartEditPixelMap 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_blo...
getStartEditPixelMap() { return this.clonePixelMap(this.startEditPixelMap as image.PixelMap); }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
9bf9a36a8bef7ee40636b0b9e4204a7e27e4adc6
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
findLast
Finds the last element in the Uint32Array that satisfies the condition @param fn condition @returns the last element that satisfies fn
public findLast(fn: (val: number, index: int, array: Uint32Array) => boolean): number { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Uint32Array.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: number, index: int, array: Uint32Array) => boolean): number { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Uint32Array.findLast: not impl...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
cf567778ecadc22bdfa4bdbd8715dacc299a42d3
gitee
openharmony/applications_mms
entry/src/main/ets/utils/MmsPreferences.ets
arkts
getValueOfRecallMessageSwitch
Obtains the value of the send cancel switch.
public getValueOfRecallMessageSwitch(): string { return <string> this.getValueFromMap(common.string.KEY_OF_RECALL_MESSAGE_SWITCH, common.bool.FALSE); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValueOfRecallMessageSwitch 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#string#L...
public getValueOfRecallMessageSwitch(): string { return <string> this.getValueFromMap(common.string.KEY_OF_RECALL_MESSAGE_SWITCH, common.bool.FALSE); }
https://gitee.com/openharmony/applications_mms.git
f7887b8eaf54f272052e50df62ecb8607b2d0e70
gitee
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/PreferencesUtil.ets
arkts
ensureInit
确保初始化完成
private static async ensureInit(): Promise<void> { // 这里可以添加一些初始化逻辑 console.log('PreferencesUtil初始化中...'); }
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 ensureInit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#...
private static async ensureInit(): Promise<void> { // 这里可以添加一些初始化逻辑 console.log('PreferencesUtil初始化中...'); }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
8798e0e200bae961a2c1d953a78958b35042149e
github
Joker-x-dev/CoolMallArkTS
core/model/src/main/ets/entity/SelectedGoods.ets
arkts
constructor
@param {Partial<SelectedGoods>} init - 初始化数据
constructor(init?: Partial<SelectedGoods>) { if (!init) { return; } this.goodsId = init.goodsId ?? this.goodsId; this.goodsInfo = init.goodsInfo ?? this.goodsInfo; this.spec = init.spec ?? this.spec; this.count = init.count ?? this.count; }
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 init AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expres...
constructor(init?: Partial<SelectedGoods>) { if (!init) { return; } this.goodsId = init.goodsId ?? this.goodsId; this.goodsInfo = init.goodsInfo ?? this.goodsInfo; this.spec = init.spec ?? this.spec; this.count = init.count ?? this.count; }
https://github.com/Joker-x-dev/CoolMallArkTS
1d2e3c5e70154323a6661fb39bcbdedeb466ac8c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncLockManager.ets
arkts
setElem
Set element and create a WeakRef in locks.and register WeakRef in FinalizationRegistry @param { AsyncLock } asyncLock - name of the lock.
public setElem(asyncLock: AsyncLock) { let w = new WeakRef<AsyncLock>(asyncLock) this.locks.set(asyncLock.name, w) this.finreg.register(asyncLock, asyncLock.name, asyncLock); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setElem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left asyncLock AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Asy...
public setElem(asyncLock: AsyncLock) { let w = new WeakRef<AsyncLock>(asyncLock) this.locks.set(asyncLock.name, w) this.finreg.register(asyncLock, asyncLock.name, asyncLock); }
https://gitcode.com/iop123123/arkts-static-skills
feed8707e92b903ac2b1f5353a3c1658a8347ef7
gitcode
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/deviceAwareness/facades/AccessibilityFacade.ets
arkts
isAccessibilityEnabled
查询无障碍功能是否启用
isAccessibilityEnabled(): NGFAccessibilityState { try { const isEnabled: boolean = accessibility.isOpenAccessibilitySync(); logger.info(TAG, '无障碍状态: ' + isEnabled); return isEnabled ? NGFAccessibilityState.ENABLED : NGFAccessibilityState.DISABLED; } catch (e) { logger.warn(TAG, '无障碍状态查...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAccessibilityEnabled 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 NGFAccessibilityState AST#identifier#Ri...
isAccessibilityEnabled(): NGFAccessibilityState { try { const isEnabled: boolean = accessibility.isOpenAccessibilitySync(); logger.info(TAG, '无障碍状态: ' + isEnabled); return isEnabled ? NGFAccessibilityState.ENABLED : NGFAccessibilityState.DISABLED; } catch (e) { logger.warn(TAG, '无障碍状态查...
https://github.com/DaLongZhuaZi/NGF
3b7ec48c093c7b84b53f9766c8abd53f36781838
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnFormViewModel.ets
arkts
submitCustomRuleForm
提交自定义校验表单
submitCustomRuleForm(): void { this.customRuleController.validate().then((res): void => { if (res.valid) { this.validateResultMsg = "自定义校验全部通过"; } else { const labels: Array<string> = res.fields.map((item): string => item.message); this.validateResultMsg = labels.join("; "); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left submitCustomRuleForm 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#stateme...
submitCustomRuleForm(): void { this.customRuleController.validate().then((res): void => { if (res.valid) { this.validateResultMsg = "自定义校验全部通过"; } else { const labels: Array<string> = res.fields.map((item): string => item.message); this.validateResultMsg = labels.join("; "); ...
https://github.com/codelably/tuniao-ui
e05c2eb0f56eb907583dded59ac3cea8dc104fa8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets
arkts
waitEmptyQueue
Waits asynchronously until the queue is no longer empty. Resumes when at least one element becomes available to remove. @returns { Promise<void> } A promise that resolves after an element becomes available, and after the waiting coroutine is resumed. @syscap SystemCapability.Utils.Lang @FaAndStageModel
private async waitEmptyQueue(): Promise<void> { while (this.atomicsGetSize() == 0) { await this.popCondVar.wait(this.popMutex); } }
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 waitEmptyQueue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
private async waitEmptyQueue(): Promise<void> { while (this.atomicsGetSize() == 0) { await this.popCondVar.wait(this.popMutex); } }
https://gitcode.com/iop123123/arkts-static-skills
48aa22b153b5c7c3ff767f11ee56138fbc210479
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets
arkts
setRetentionDaysByIndex
根据索引设置保留天数
public async setRetentionDaysByIndex(index: number): Promise<void> { if (index >= 0 && index < RETENTION_DAYS_OPTIONS.length) { await this.setRetentionDays(RETENTION_DAYS_OPTIONS[index]); } }
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 setRetentionDaysByIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:...
public async setRetentionDaysByIndex(index: number): Promise<void> { if (index >= 0 && index < RETENTION_DAYS_OPTIONS.length) { await this.setRetentionDays(RETENTION_DAYS_OPTIONS[index]); } }
https://github.com/DaLongZhuaZi/manxia
50706358005c60370ccb1cabadf7874e4210bbb5
github
CLMC2025/Vignette
entry/src/main/ets/database/repositories/WordRepository.ets
arkts
pruneAllHistory
Prune history for all words Returns the total number of history entries removed
async pruneAllHistory(): Promise<number> { this.ensureInitialized(); const words = await this.getAllWords(); let totalRemoved = 0; const wordsToUpdate: WordItem[] = []; for (const word of words) { const removed = word.history.pruneOldEntries(); if (removed > 0) { totalRemoved...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left pruneAllHistory AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Rig...
async pruneAllHistory(): Promise<number> { this.ensureInitialized(); const words = await this.getAllWords(); let totalRemoved = 0; const wordsToUpdate: WordItem[] = []; for (const word of words) { const removed = word.history.pruneOldEntries(); if (removed > 0) { totalRemoved...
https://github.com/CLMC2025/Vignette
bb42066805f024749c3106aaec7fd80fedcb3bc0
github
openharmony/applications_call
entry/src/main/ets/common/components/FuncBtnGroup.ets
arkts
keepHandle
Call hold interface @param {string} type - Click the hold button
keepHandle(type) { const awaitIsActive = this.btnList.find((v) => v.type === type).isActive; LogUtils.i(TAG, 'keep handle awaitIsActive : ' + !awaitIsActive); !awaitIsActive ? this.mCallServiceProxy.holdCall(this.callData.callId) : this.mCallServiceProxy.unHoldCall(this.callData.callId); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left keepHandle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left type AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expressi...
keepHandle(type) { const awaitIsActive = this.btnList.find((v) => v.type === type).isActive; LogUtils.i(TAG, 'keep handle awaitIsActive : ' + !awaitIsActive); !awaitIsActive ? this.mCallServiceProxy.holdCall(this.callData.callId) : this.mCallServiceProxy.unHoldCall(this.callData.callId); }
https://gitee.com/openharmony/applications_call.git
f0a193f0151c880c189d55f0ff694af4265d2322
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/TagDAO.ets
arkts
getBillIdsByTagId
获取标签关联的所有账单ID @param tagId 标签ID @returns 账单ID数组
static async getBillIdsByTagId(tagId: number): Promise<number[]> { const store = DatabaseManager.getDatabase(); const sql = `SELECT bill_id FROM bill_tags WHERE tag_id = ?`; let resultSet: relationalStore.ResultSet | null = null; try { resultSet = await store.querySql(sql, [tagId]); const ...
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 getBillIdsByTagId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tagId AST#identifier#Right AST#:#Left ...
static async getBillIdsByTagId(tagId: number): Promise<number[]> { const store = DatabaseManager.getDatabase(); const sql = `SELECT bill_id FROM bill_tags WHERE tag_id = ?`; let resultSet: relationalStore.ResultSet | null = null; try { resultSet = await store.querySql(sql, [tagId]); const ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
42bdda3a36bd2f29179ae123faa8f980ab402e2b
github
openharmony-sig/ohos_danmaku_flame_master
library/src/main/ets/components/common/master/flame/danmaku/ui/widget/DanmakuView.ets
arkts
setOnDanmakuClickListener
------------- Click Listener -------------------
setOnDanmakuClickListener(listener: OnDanmakuClickListener|ESObject, xOff?: number, yOff?: number): void { this.delegate.setOnDanmakuClickListener(listener, xOff, yOff); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setOnDanmakuClickListener 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#binary_expression#Left AST#identifier#Left...
setOnDanmakuClickListener(listener: OnDanmakuClickListener|ESObject, xOff?: number, yOff?: number): void { this.delegate.setOnDanmakuClickListener(listener, xOff, yOff); }
https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git
d8ab7d48ee4c972869984135d2e959246feb169c
gitee
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/AccountStoreRepository.ets
arkts
loadAccount
读取账号 @returns {Promise<string>} 用户账号,默认空字符串
loadAccount(): Promise<string> { return this.dataSource.getAccount(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left loadAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right ...
loadAccount(): Promise<string> { return this.dataSource.getAccount(); }
https://github.com/Joker-x-dev/CoolMallArkTS
3068c656074a9f97e38b2eed32e5cffa22a7d356
github
LJ666-ui/harmony-health-care
5-skill离线包/星云智联–分布式AI全周期智慧健康管理平台_skills/skills/MedicalRiskAssessSkill.ets
arkts
evaluateBloodGlucose
评估血糖风险
private static evaluateBloodGlucose(value: number): RiskFactor { let score = 0; let level: 'low' | 'medium' | 'high' | 'very_high' = 'low'; if (value >= 16.7) { score = 100; level = 'very_high'; } else if (value >= 11.1) { score = 80; level = 'high'; } else if (value >= 7.0) { score = 55; lev...
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 evaluateBloodGlucose AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#...
private static evaluateBloodGlucose(value: number): RiskFactor { let score = 0; let level: 'low' | 'medium' | 'high' | 'very_high' = 'low'; if (value >= 16.7) { score = 100; level = 'very_high'; } else if (value >= 11.1) { score = 80; level = 'high'; } else if (value >= 7.0) { score = 55; lev...
https://github.com/LJ666-ui/harmony-health-care
1f014cd8c7b010b25db63a89555aca17dcfcc861
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/07.expressions/15.unary_expressions/08.logical_complement_operator/logical_complement.ets
arkts
main
--- desc: Logical complement operator params: {{lc.origin}} => {{lc.dest}} ---
function main(): void { let a = {{lc.origin}};
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { let a = {{lc.origin}};
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
c68540f2a49b0b983dd713277f39ca78280f12d5
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/ResponsiveLayout.ets
arkts
getXSLayoutParams
XS断点布局参数(手机竖屏)
private static getXSLayoutParams(): ResponsiveLayoutParams { return new ResponsiveLayoutParams(3, 12, 16, 600, false, 0, 1.0); }
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 getXSLayoutParams AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ...
private static getXSLayoutParams(): ResponsiveLayoutParams { return new ResponsiveLayoutParams(3, 12, 16, 600, false, 0, 1.0); }
https://github.com/DaLongZhuaZi/manxia
397bbeba87be4a307c35619e61504f11791d8011
github
Delsin-Yu/JustPDF
entry/src/main/ets/pages/pdfview/PDFTunerController.ets
arkts
getReferenceTonePitchLoudnessCompensation
等响与听感折中:低于锚点略提、高于锚点略压,均用当前平滑后的频率,避免改调时突变。
private getReferenceTonePitchLoudnessCompensation(frequencyHz: number): number { const anchor: number = TunerReferenceToneLoudnessAnchorHz; if (frequencyHz < anchor) { const safeHz: number = Math.max(TunerReferenceToneMinHz, frequencyHz); const ratio: number = anchor / safeHz; const boosted:...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getReferenceTonePitchLoudnessCompensation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left frequencyHz AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right ...
private getReferenceTonePitchLoudnessCompensation(frequencyHz: number): number { const anchor: number = TunerReferenceToneLoudnessAnchorHz; if (frequencyHz < anchor) { const safeHz: number = Math.max(TunerReferenceToneMinHz, frequencyHz); const ratio: number = anchor / safeHz; const boosted:...
https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFTunerController.ets#L404-L417
8185d30e3a7fee11779a094146a65fd0ec4f96a6
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/userdata/history/classes/meowHistoryIndexFileBundle.ets
arkts
getEntriesForKey
Checks if a key exists in the index file. @param key The SINGLE token key to check. @returns The array of timestamps indexed, undefined if ran into an error.
async getEntriesForKey(key: string) { if (!this.ready) { meow(`Index file ${this.indexFilePath} is not ready yet.`, 'meowHistoryIndexFileBundle', meowLevel.ERROR); return undefined; } const startTime = Date.now(); try { // Get the key header of the key. // The header remember...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getEntriesForKey AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left key AST#identifier#Right AST#type_annotation#Left AST#:#Left :...
async getEntriesForKey(key: string) { if (!this.ready) { meow(`Index file ${this.indexFilePath} is not ready yet.`, 'meowHistoryIndexFileBundle', meowLevel.ERROR); return undefined; } const startTime = Date.now(); try { // Get the key header of the key. // The header remember...
https://github.com/awaLiny2333/LinysBrowser_NEXT
bf57028730729d6f711b13bc7c75fb3de8c702c7
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/SettingsService.ets
arkts
getHostSettings
获取主机设置
async getHostSettings(): Promise<HostSettings> { return { enableSops: await this.getBoolean(SettingsKeys.ENABLE_SOPS, true), screenCombinationMode: await this.getString(SettingsKeys.SCREEN_COMBINATION_MODE, '主机默认'), lockScreenAfterDisconnect: await this.getBoolean(SettingsKeys.LOCK_SCREEN_AFTER_...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getHostSettings 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#gene...
async getHostSettings(): Promise<HostSettings> { return { enableSops: await this.getBoolean(SettingsKeys.ENABLE_SOPS, true), screenCombinationMode: await this.getString(SettingsKeys.SCREEN_COMBINATION_MODE, '主机默认'), lockScreenAfterDisconnect: await this.getBoolean(SettingsKeys.LOCK_SCREEN_AFTER_...
https://github.com/AlkaidLab/moonlight-harmony
24c337d6409f033a3384b72385799ac6182768f6
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.buffer.ets
arkts
writeDoubleLE
Writes a 64-bit double to the buffer at the specified offset using little-endian format @param {double} value - Value to write @param {int} [offset=0] - Number of bytes to skip before writing @returns {int} Offset plus the number of bytes written
public writeDoubleLE(value: double, offset: int = 0): int { this.checkOffset(offset, 8); this.getDataView().setFloat64(offset, value, true); return offset + 8; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left writeDoubleLE AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left d...
public writeDoubleLE(value: double, offset: int = 0): int { this.checkOffset(offset, 8); this.getDataView().setFloat64(offset, value, true); return offset + 8; }
https://gitcode.com/iop123123/arkts-static-skills
ba909f62a4027adc02352e2a1985085b39d5ceac
gitcode
terryma2024/happyword
harmonyos/entry/src/main/ets/services/BattleAnswerRecorder.ets
arkts
recordEncounter
Moved from BattlePage.recordEncounterForCurrentMonster (incl. the once-per-catalog-index dedup that lived in the page field).
recordEncounter(catalogIndex: number): void { if (catalogIndex <= 0 || catalogIndex === this.lastEncounterRecordedCatalogIndex) { return; } this.lastEncounterRecordedCatalogIndex = catalogIndex; this.monsterProgress.recordEncounter(catalogIndex); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left recordEncounter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left catalogIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left )...
recordEncounter(catalogIndex: number): void { if (catalogIndex <= 0 || catalogIndex === this.lastEncounterRecordedCatalogIndex) { return; } this.lastEncounterRecordedCatalogIndex = catalogIndex; this.monsterProgress.recordEncounter(catalogIndex); }
https://github.com/terryma2024/happyword
73eb4565eadfa8c87c14dd014eb535deaa3ab8a7
github
aimilin6688/KeePassHO
entry/src/main/ets/storage/local/LocalFileStorage.ets
arkts
doRead
读取文件内容 @param path 文件路径 @returns 结果
public async doRead(path: string): Promise<ArrayBuffer> { try { // 打开文件 const file = await fs.open(path, fs.OpenMode.READ_ONLY); // 获取文件信息 const fileInfo = await fs.stat(file.fd); // 创建缓冲区 const buffer = new ArrayBuffer(fileInfo.size); // 读取文件内容 await fs.read(file.f...
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 doRead AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Righ...
public async doRead(path: string): Promise<ArrayBuffer> { try { // 打开文件 const file = await fs.open(path, fs.OpenMode.READ_ONLY); // 获取文件信息 const fileInfo = await fs.stat(file.fd); // 创建缓冲区 const buffer = new ArrayBuffer(fileInfo.size); // 读取文件内容 await fs.read(file.f...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/local/LocalFileStorage.ets#L76-L93
9c6a8e2145d4b1d5f5aa574de09d0b78d4f8b4ef
github
darcycui/DarcyHarmonyNext
entry/src/main/ets/pages/entry/render_control/ForEachPage.ets
arkts
<arrow>
生成子组件
(item: string) => { ChildItem({ item: item }) },
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 item AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left AST#string#Left string AST#string#Right AST#predefined_type#Rig...
(item: string) => { ChildItem({ item: item }) },
https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/render_control/ForEachPage.ets#L14-L16
03ba8e0a12e6283952ad6674e72496f88d51cc99
github
Countly/countly-sdk-hos
library/src/main/ets/internal/modules/ModuleContent.ets
arkts
enterContentZone
-- Public API --
public async enterContentZone(): Promise<void> { if (!this.core.consentModule.hasConsent(CountlyFeature.CONTENT)) { this.config.logger.v('[ModuleContent] enterContentZone, no content consent, skipped'); return; } if (this.core.deviceIdModule.isTemporary()) { this.config.logger.d('[Module...
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 enterContentZone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
public async enterContentZone(): Promise<void> { if (!this.core.consentModule.hasConsent(CountlyFeature.CONTENT)) { this.config.logger.v('[ModuleContent] enterContentZone, no content consent, skipped'); return; } if (this.core.deviceIdModule.isTemporary()) { this.config.logger.d('[Module...
https://github.com/Countly/countly-sdk-hos
ede4787e48bbae4b2e4ec7b81fa2f83b972bd687
github
banggx/account_app_harmonyos
entry/src/main/ets/service/account.ets
arkts
getAccountByMonth
按月份获取记账记录
getAccountByMonth(time: string | number) { const startMonth = dayjs(time).startOf('month').toDate().getTime(); const endMonth = dayjs(time).endOf('month').toDate().getTime(); return AccountModel.queryByDateRange(startMonth, endMonth); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAccountByMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left time AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#L...
getAccountByMonth(time: string | number) { const startMonth = dayjs(time).startOf('month').toDate().getTime(); const endMonth = dayjs(time).endOf('month').toDate().getTime(); return AccountModel.queryByDateRange(startMonth, endMonth); }
https://github.com/banggx/account_app_harmonyos
c9157fc6e45c00edb91624b02a995021acf9e849
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.PlainArray.ets
arkts
forEach
Callback function is used to iterate over the elements on the instance object and their corresponding subscripts. @param callbackFn to apply @param callbackFn.value the value of the element @param callbackFn.key the key of the element @param callbackFn.PlainArray the instance of this object
public forEach(callbackFn: PlainArrayForEachCb<T>): void { this.buckets.forEach((value: T, key: int) => { callbackFn(value, key, this); }); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left forEach AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callbackFn AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expr...
public forEach(callbackFn: PlainArrayForEachCb<T>): void { this.buckets.forEach((value: T, key: int) => { callbackFn(value, key, this); }); }
https://gitcode.com/iop123123/arkts-static-skills
5fdaaabf92521e240e55957b0963e852ddc3ee65
gitcode