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
jiahaozheng406/huawei-travel-app-HarmonyOS
entry/src/main/ets/viewmodel/ScenicViewModel.ets
arkts
getLocations
获取路径规划 @param cur_idx 当前算法索引(时间最短|路径最短|最多人走) @returns
getLocations(cur_idx:number): Array<card_data> { switch (cur_idx) { case 0: return [ new card_data( $r("app.media.start"), "沙坡尾艺术西街" ), new card_data( $r("app.media.one"), "南普陀寺" ), new card_data( ...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLocations AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cur_idx AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#num...
getLocations(cur_idx:number): Array<card_data> { switch (cur_idx) { case 0: return [ new card_data( $r("app.media.start"), "沙坡尾艺术西街" ), new card_data( $r("app.media.one"), "南普陀寺" ), new card_data( ...
https://github.com/jiahaozheng406/huawei-travel-app-HarmonyOS
06c9d505f627ea0de6d738dc3b62b0ebeeaa7490
github
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/CloudStore.ets
arkts
loadAllRdpCredentials
==================== RDP Credential CRUD ====================
loadAllRdpCredentials(): RdpCredential[] { return this.loadAllRdpCredentialsInternal(true); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left loadAllRdpCredentials AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST...
loadAllRdpCredentials(): RdpCredential[] { return this.loadAllRdpCredentialsInternal(true); }
https://github.com/Mydstiny/RemoteDeskHarmonyOS
6028d693430b4bc47841db8de7afa30f34c241a6
github
terryma2024/happyword
harmonyos/entry/src/ohosTest/ets/test/HomeToolbarLocked.ui.test.ets
arkts
returnToHome
Navigate back to HomePage after a previous suite left the app mid-flow. Mirrors AdventureFlow.ui.test's returnToHome — press back up to 5 times until HomeStartButton resolves. Each `it` block in this suite must start on HomePage so HomeReviewButton is reachable; without this, the suite is order-dependent on whoever ran...
async function returnToHome(driver: Driver): Promise<void> { // See `launchApp` rationale for why the body is wrapped in try/catch. try { for (let i = 0; i < 5; i++) { const home: Component | null = await driver.findComponent(ON.id('HomeStartButton')); if (home !== null) { return; ...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left returnToHome AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left driver AST#identifier#Right AST#type...
async function returnToHome(driver: Driver): Promise<void> { // See `launchApp` rationale for why the body is wrapped in try/catch. try { for (let i = 0; i < 5; i++) { const home: Component | null = await driver.findComponent(ON.id('HomeStartButton')); if (home !== null) { return; ...
https://github.com/terryma2024/happyword
952a7eea7d69ddc8c3e03c1e5dd57892b3798c39
github
CsCesium/KantaiHomo
entry/src/main/ets/infra/net/wsClient/index.ets
arkts
bindEventsOnce
---------- internal ----------
private bindEventsOnce(): void { this.ws.on('open', (err: BusinessError): void => { if (err) { this.log('open error', this.errToStr(err as object)); return; } this.opened = true; this.reconnectDelay = this.opts.reconnectMs; this.startHeartbeat(); bus.emit('ws/op...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left bindEventsOnce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expr...
private bindEventsOnce(): void { this.ws.on('open', (err: BusinessError): void => { if (err) { this.log('open error', this.errToStr(err as object)); return; } this.opened = true; this.reconnectDelay = this.opts.reconnectMs; this.startHeartbeat(); bus.emit('ws/op...
https://github.com/CsCesium/KantaiHomo
0bcb35cd223b75015c9d26d9f876c5359bb2b295
github
harmonyos/codelabs
HarmonyOS_NEXT/OxHornCampus/entry/src/main/ets/view/TrainsTrack.ets
arkts
drawTrainPosition
Draw the next location of the train.
drawTrainPosition() { if (Math.abs(this.trainX - this.positionEnd.x) <= Const.AVERAGE_ERROR && Math.abs(this.trainY - this.positionEnd.y) <= Const.AVERAGE_ERROR) { this.trainX = this.positionEnd.x; this.trainY = this.positionEnd.y; if (this.currentIndex === this.trainsInfo.lineData.length ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left drawTrainPosition 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#...
drawTrainPosition() { if (Math.abs(this.trainX - this.positionEnd.x) <= Const.AVERAGE_ERROR && Math.abs(this.trainY - this.positionEnd.y) <= Const.AVERAGE_ERROR) { this.trainX = this.positionEnd.x; this.trainY = this.positionEnd.y; if (this.currentIndex === this.trainsInfo.lineData.length ...
https://gitee.com/harmonyos/codelabs.git
5327f60141f17d03571dc0642bdcac32694b7f42
gitee
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
setFloat64
Sets a double. @param byteOffset The byte offset. @param value The value. @param littleEndian If the value is little endian.
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void { this.dataView?.setFloat64(byteOffset, value, littleEndian) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setFloat64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#...
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void { this.dataView?.setFloat64(byteOffset, value, littleEndian) }
https://gitee.com/openharmony-sig/flutter_engine.git
c8a655c7e96453669ec751b25e5fd7065daffae0
gitee
pangpang20/antennaPodHM
entry/src/main/ets/service/SettingsService.ets
arkts
getAutoDeletePlayed
获取自动删除已播放设置
getAutoDeletePlayed(): boolean { return this.settings.autoDeletePlayed; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAutoDeletePlayed 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...
getAutoDeletePlayed(): boolean { return this.settings.autoDeletePlayed; }
https://github.com/pangpang20/antennaPodHM
57186385aacb10573e6ba2e3be15440655836283
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/StringBuilder.ets
arkts
toString
Returns the string that was formed as a result of all append operations @see append @returns String - builder's current buffer as string
public override toString(): String { let r = new char[this.count]; for (let i = 0; i < this.count; ++i) { r[i] = this.value[i]; } return new String(r); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le...
public override toString(): String { let r = new char[this.count]; for (let i = 0; i < this.count; ++i) { r[i] = this.value[i]; } return new String(r); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
02f9aaa477f43d6693e4c1e1351c6afa9515c3ee
gitee
silence17/harmonydemo
entry/src/main/ets/view/refresh/DialogUtils.ets
arkts
datePickerDialog
Date dialog dialog
static datePickerDialog(dateCallback: Function) { let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; let day = date.getDate(); const birthdate = this.getBirthDateValue(year, month, day); DatePickerDialog.show({ start: new Date('1900-1-1'), end: ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left datePickerDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dateCallback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Functio...
static datePickerDialog(dateCallback: Function) { let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + 1; let day = date.getDate(); const birthdate = this.getBirthDateValue(year, month, day); DatePickerDialog.show({ start: new Date('1900-1-1'), end: ...
https://github.com/silence17/harmonydemo
28c46e23b8172cd332d4cbcafffafec8f0d0b122
github
LJ666-ui/harmony-health-care
entry/src/main/ets/common/utils/TokenManager.ets
arkts
isFamilyLoggedIn
判断家属是否已登录
static isFamilyLoggedIn(): boolean { const isLoggedIn = SettingsUtil.get('isLoggedInAsFamily'); const token = SettingsUtil.get('familyToken'); return isLoggedIn === true && token !== null && token !== ''; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isFamilyLoggedIn 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 ...
static isFamilyLoggedIn(): boolean { const isLoggedIn = SettingsUtil.get('isLoggedInAsFamily'); const token = SettingsUtil.get('familyToken'); return isLoggedIn === true && token !== null && token !== ''; }
https://github.com/LJ666-ui/harmony-health-care
8cf98b6d9b3a40c126d588a4f4415f7b109910c6
github
openharmony/security_privacy_center
entry/src/main/ets/pages/Index.ets
arkts
getBundleInfo
Get all package information
getBundleInfo() { BundleInfoModel.getAllBundleInfoByFunctionAccess() .then(async (data: bundleManager.BundleInfo[]) => { // filter blank icon and text label resources let initAppInfoList: bundleManager.ApplicationInfo[] = []; for (let i = 0; i < data.length; i++) { let in...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getBundleInfo 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...
getBundleInfo() { BundleInfoModel.getAllBundleInfoByFunctionAccess() .then(async (data: bundleManager.BundleInfo[]) => { // filter blank icon and text label resources let initAppInfoList: bundleManager.ApplicationInfo[] = []; for (let i = 0; i < data.length; i++) { let in...
https://gitee.com/openharmony/security_privacy_center.git
36789838561b7a431eaa915a215efaeffc11f6bd
gitee
openharmony/applications_mms
entry/src/main/ets/service/SettingService.ets
arkts
restoreSwitchValue
Restore Page Defaults @param {Object} callback
restoreSwitchValue(callback) { mSettingModel.restoreSwitchValueToDefault(callback); },
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left restoreSwitchValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left callback AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right ...
restoreSwitchValue(callback) { mSettingModel.restoreSwitchValueToDefault(callback); },
https://gitee.com/openharmony/applications_mms.git
e52f2669f0a7fe380a98ba33ecd7530b63f86049
gitee
cpdd5201314/harmonyOS-music-app
products/phone/src/main/ets/pages/MusicApiClient.ets
arkts
handleTxResponse
处理腾讯API响应
private static handleTxResponse(response: MusicUrlResponse): string { if (!response || isNaN(Number(response.code))) { throw new Error('未知错误'); } switch (response.code) { case 200: if (!response.url) { throw new Error('返回数据为空'); } return response.url; d...
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 handleTxResponse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left response AST#identifier#Right AST#:...
private static handleTxResponse(response: MusicUrlResponse): string { if (!response || isNaN(Number(response.code))) { throw new Error('未知错误'); } switch (response.code) { case 200: if (!response.url) { throw new Error('返回数据为空'); } return response.url; d...
https://github.com/cpdd5201314/harmonyOS-music-app
e37c27aca5df7b58c3e382ecb370f4430993d3dd
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/FileUtils.ets
arkts
selectFiles
选择文件,并返回文件内容 @param context 上下文 @returns 文件内容信息
public static async selectFiles(size: number, fileSuffixFilters?: Array<string>): Promise<Array<FileContentInfo>> { try { const documentPicker = new picker.DocumentViewPicker(CommonUtils.getContext()); const options = new picker.DocumentSelectOptions(); options.fileSuffixFilters = fileSuffixFilt...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left selectFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left size A...
public static async selectFiles(size: number, fileSuffixFilters?: Array<string>): Promise<Array<FileContentInfo>> { try { const documentPicker = new picker.DocumentViewPicker(CommonUtils.getContext()); const options = new picker.DocumentSelectOptions(); options.fileSuffixFilters = fileSuffixFilt...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/FileUtils.ets#L125-L148
9193b63a8489960ab4fe88dbaeadac9255df2114
github
2763981847/Clock-Alarm
entry/src/main/ets/viewmodel/WorldClockViewModel.ets
arkts
batchRemoveCities
批量从城市列表中移除指定索引的城市。 @param indexesToRemove 要移除的城市索引数组
public batchRemoveCities(indexesToRemove: Array<number>) { indexesToRemove.forEach(index => this.cities.splice(index, 1)) this.setCitiesToDatabase() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left batchRemoveCities AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left indexesToRemove AST#identifier#Right AST#ERROR#Left AST#:#Left : A...
public batchRemoveCities(indexesToRemove: Array<number>) { indexesToRemove.forEach(index => this.cities.splice(index, 1)) this.setCitiesToDatabase() }
https://github.com/2763981847/Clock-Alarm
ee6d00602b4a46e591048d5daf8646b5812ce067
github
openharmony-tpc/VCard
library/src/main/ets/components/VCardBuilder.ets
arkts
splitPhoneNumbers
<p> Splits a given string expressing phone numbers into several strings, and remove unnecessary characters inside them. The size of a returned list becomes 1 when no split is needed. </p> <p> The given number "may" have several phone numbers when the contact entry is corrupted because of its original source. e.g. "111-...
private splitPhoneNumbers(phoneNumber: string): Array<string> { let phoneList = new Array<string>(); let builder = new StringBuilder(); let length = phoneNumber.length; for (let i = 0; i < length; i++) { let ch = phoneNumber.charAt(i); if (ch == '\n' && build...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left splitPhoneNumbers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left phoneNumber AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A...
private splitPhoneNumbers(phoneNumber: string): Array<string> { let phoneList = new Array<string>(); let builder = new StringBuilder(); let length = phoneNumber.length; for (let i = 0; i < length; i++) { let ch = phoneNumber.charAt(i); if (ch == '\n' && build...
https://gitee.com/openharmony-tpc/VCard.git
3d1b9a7922a05a7b77665c368a04980084fa4204
gitee
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
refresh
Refresh.
private refresh(): void { if (this.ctx !== undefined && this.input !== undefined && this.canvasReady) { this.drawImage(); this.drawCrop(); } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left refresh AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_...
private refresh(): void { if (this.ctx !== undefined && this.input !== undefined && this.canvasReady) { this.drawImage(); this.drawCrop(); } }
https://gitee.com/openharmony/codelabs.git
f6dcb4e65ba8f97904e7dfb8740adf3637577ef1
gitee
xiebyapps/ClipLink
entry/src/main/ets/services/SyncClipboardService.ets
arkts
uploadTextContent
Upload text clipboard content (text-focused)
async uploadTextContent(text: string): Promise<void> { const hash = await HashUtil.calculateTextHash(text); const profile: ProfileDto = { type: 'Text', text: text, hash: hash, hasData: false, size: text.length }; // Check if history record exists const profileId...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left uploadTextContent AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left text AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async uploadTextContent(text: string): Promise<void> { const hash = await HashUtil.calculateTextHash(text); const profile: ProfileDto = { type: 'Text', text: text, hash: hash, hasData: false, size: text.length }; // Check if history record exists const profileId...
https://github.com/xiebyapps/ClipLink
ac178d9caa11db4acb3e9c242de9120e28c45d14
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/JSONPathParser.ets
arkts
test
测试JSONPath表达式
static test(data: Record<string, Object>, path: string): boolean { try { const result: JSONPathResult = JSONPathParser.parse(data, path); return result !== null && result !== undefined; } catch { return false; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left test AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
static test(data: Record<string, Object>, path: string): boolean { try { const result: JSONPathResult = JSONPathParser.parse(data, path); return result !== null && result !== undefined; } catch { return false; } }
https://github.com/DaLongZhuaZi/manxia
818e640c4514592e4061f7aa80498bbf77621123
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/ui/SystemBarDemo.ets
arkts
exitFullScreen
退出全屏(非沉浸式效果) 非沉浸式效果就是顶部的系统状态栏和底部的系统导航栏与主界面都会独立显示
exitFullScreen() { this.windowClass.setWindowLayoutFullScreen(false).then(() => { this.message = '退出全屏成功'; }).catch((err: BusinessError) => { this.message =`退出全屏失败, errCode:${err.code}, errMessage:${err.message}`; }); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left exitFullScreen AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
exitFullScreen() { this.windowClass.setWindowLayoutFullScreen(false).then(() => { this.message = '退出全屏成功'; }).catch((err: BusinessError) => { this.message =`退出全屏失败, errCode:${err.code}, errMessage:${err.message}`; }); }
https://github.com/webabcd/HarmonyDemo
2a5aa50547c2c39ab24d33500cc2629d36a613a3
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/CommonUtils.ets
arkts
getContext
获取上下文 @returns
public static getContext(): common.UIAbilityContext { return CommonUtils.context as common.UIAbilityContext; }
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 getContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le...
public static getContext(): common.UIAbilityContext { return CommonUtils.context as common.UIAbilityContext; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/CommonUtils.ets#L26-L28
281830aaf0458f23cfe75e47686ee3da4e89a151
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
downloadFileWithHttp
使用HTTP直接下载文件(支持写入任意目录,包括公共Download目录)
private async downloadFileWithHttp( url: string, filePath: string, headers?: Record<string, string> ): Promise<void> { const httpRequest = http.createHttp(); try { const requestHeaders: Record<string, string> = this.buildDownloadHeaders(headers); const response: http.HttpResponse ...
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 downloadFileWithHttp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#L...
private async downloadFileWithHttp( url: string, filePath: string, headers?: Record<string, string> ): Promise<void> { const httpRequest = http.createHttp(); try { const requestHeaders: Record<string, string> = this.buildDownloadHeaders(headers); const response: http.HttpResponse ...
https://github.com/DaLongZhuaZi/manxia
d98c790980af3adededeff198ff8366c3d45335f
github
dingzhilin1990/zhilinclaw
src/security/CredentialVault.ets
arkts
cleanupExpired
清理过期凭证
public async cleanupExpired(): Promise<number> { const now = Date.now(); let count = 0; for (const [id, credential] of this.credentials.entries()) { if (credential.expiresAt && now > credential.expiresAt) { await this.delete(id); count++; } } console.log(`[CredentialV...
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 cleanupExpired AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:...
public async cleanupExpired(): Promise<number> { const now = Date.now(); let count = 0; for (const [id, credential] of this.credentials.entries()) { if (credential.expiresAt && now > credential.expiresAt) { await this.delete(id); count++; } } console.log(`[CredentialV...
https://github.com/dingzhilin1990/zhilinclaw
e4862c87dc819a4ff5ebb74bcf89aec5ea2fafb3
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/Legend.ets
arkts
getDirection
returns the text direction of the legend @return
public getDirection(): LegendDirection { return this.mDirection; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDirection 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 LegendDir...
public getDirection(): LegendDirection { return this.mDirection; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
ea1c8d39aa12de6c7216d6f61854fd1c5f03a52b
gitee
honjow/Next2V
shared/src/main/ets/utils/BreakpointSystem.ets
arkts
update
Tracks the active breakpoint purely for the change-guard below. The former AppStorage dual-write of a 'currentBreakpoint' key was removed: the State Management V2 migration retired its @StorageProp('currentBreakpoint') consumers, leaving the key with no reader anywhere in the repo, so the publish was dead. Layout consu...
private update(bp: Breakpoint): void { if (this.currentBreakpoint !== bp) { this.currentBreakpoint = bp } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left update AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bp AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR...
private update(bp: Breakpoint): void { if (this.currentBreakpoint !== bp) { this.currentBreakpoint = bp } }
https://github.com/honjow/Next2V
316ab081837625b9bbf92c0bb7b53fd2d8696184
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayAsListInt.ets
arkts
constructor
Constructs new ArrayAsList with required capacity @param capacity
constructor(capacity: int) { this.init(capacity, new Int()); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right ...
constructor(capacity: int) { this.init(capacity, new Int()); }
https://gitcode.com/iop123123/arkts-static-skills
438ad73e3e156703e171fd748cdec2ab366d7c9d
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentSet.ets
arkts
entries
@returns { IterableIterator<[T, T]> } an iterable of [v,v] pairs for every value `v` in the ConcurrentSet.
public override entries(): IterableIterator<[T, T]> { return this.elements.entries(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left entries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
public override entries(): IterableIterator<[T, T]> { return this.elements.entries(); }
https://gitcode.com/iop123123/arkts-static-skills
22e6557700665ee66aa5a5d3fd1dfda1ba9ceb27
gitcode
huaweicloud/huaweicloud-iot-device-sdk-arkts
huaweicloud_iot_device_library/src/main/ets/client/DeviceClient.ets
arkts
respondCommand
上报命令响应 @param requestId 请求id,响应的请求id必须和请求的一致 @param commandRsp 命令响应 @param qos
respondCommand(requestId: string, commandRsp: CommandRsp, qos: IoTMqttQos = 0): Promise<IoTMqttResponse> { if (!this.mqttClient) { return new Promise<IoTMqttResponse>((resolve, reject) => reject("mqtt client is null")); } const topic = `$oc/devices/${this.clientConf.deviceId}/sys/commands/response/r...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left respondCommand AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left requestId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
respondCommand(requestId: string, commandRsp: CommandRsp, qos: IoTMqttQos = 0): Promise<IoTMqttResponse> { if (!this.mqttClient) { return new Promise<IoTMqttResponse>((resolve, reject) => reject("mqtt client is null")); } const topic = `$oc/devices/${this.clientConf.deviceId}/sys/commands/response/r...
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts
d60fb466101151be37ab97bbc00840b240b5c21a
github
SMAT-Lab/PhantomRendering
example/entry/src/main/ets/common/DeviceUtils.ets
arkts
getDeviceType
获取设备类型
static getDeviceType(): 'phone' | 'tablet' | 'foldable' { if (DeviceUtils.isTablet()) { return 'tablet' } const aspectRatio = DeviceUtils.getScreenHeight() / DeviceUtils.getScreenWidth() if (aspectRatio > 2.1 || aspectRatio < 1.2) { return 'foldable' } return 'phone' }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getDeviceType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left A...
static getDeviceType(): 'phone' | 'tablet' | 'foldable' { if (DeviceUtils.isTablet()) { return 'tablet' } const aspectRatio = DeviceUtils.getScreenHeight() / DeviceUtils.getScreenWidth() if (aspectRatio > 2.1 || aspectRatio < 1.2) { return 'foldable' } return 'phone' }
https://github.com/SMAT-Lab/PhantomRendering
4da87323ed98ee6585ccf6660bc3e58a44aba3b7
github
aimilin6688/KeePassHO
entry/src/main/ets/services/template/TemplateBuilder.ets
arkts
reset
重置构建器,准备构建新条目
reset(): TemplateBuilder { this.entry = KdbxEntry.create(this.meta, this.parentGroup); this.options = { overwriteExisting: DEFAULT_APPLY_OPTIONS.overwriteExisting, copyTags: DEFAULT_APPLY_OPTIONS.copyTags, copyIcon: DEFAULT_APPLY_OPTIONS.copyIcon, copyExpiry: DEFAULT_APPLY_OPTIONS.copy...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reset 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 TemplateBuilder AST#identifier#Right AST#ERROR#Right AST...
reset(): TemplateBuilder { this.entry = KdbxEntry.create(this.meta, this.parentGroup); this.options = { overwriteExisting: DEFAULT_APPLY_OPTIONS.overwriteExisting, copyTags: DEFAULT_APPLY_OPTIONS.copyTags, copyIcon: DEFAULT_APPLY_OPTIONS.copyIcon, copyExpiry: DEFAULT_APPLY_OPTIONS.copy...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateBuilder.ets#L301-L310
d59d4c0df2c3ab768c130d80798ba8a13d6ce8b8
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/RDPInputHandler.ets
arkts
toggleRightClickMode
切换右键模式
toggleRightClickMode() { this.isRightClickMode = !this.isRightClickMode }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left toggleRightClickMode 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...
toggleRightClickMode() { this.isRightClickMode = !this.isRightClickMode }
https://github.com/AetheriumSimulator/qemu-hmos
1cb0d128ef5e57343a8bceb59d46e0b61bb42154
github
HarmonyOS_Samples/guide-snippets
ArkGraphics3D/entry/src/main/ets/arkgraphic/resource.ets
arkts
createEnvironmentPromise
[End create_image_promise] [Start create_environment_promise]
function createEnvironmentPromise() : Promise<Environment> { return new Promise((resolve, reject) => { // Ensure the scene is loaded before accessing sceneFactory if (globalScene) { let sceneFactory: SceneResourceFactory = globalScene.getResourceFactory(); // Manually load environment maps (.ktx/...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createEnvironmentPromise 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#ge...
function createEnvironmentPromise() : Promise<Environment> { return new Promise((resolve, reject) => { // Ensure the scene is loaded before accessing sceneFactory if (globalScene) { let sceneFactory: SceneResourceFactory = globalScene.getResourceFactory(); // Manually load environment maps (.ktx/...
https://gitcode.com/HarmonyOS_Samples/guide-snippets
af202576a84ac5bebf51d06eed80764bf6910a83
gitcode
openharmony-sig/ohos_easyui
easyui/src/main/ets/common/components/Contact.ets
arkts
build
@Link
build() { Column() { if(this.editable){ Column(){ Text("基础用法") .alignSelf(ItemAlign.Start) .margin(20) .fontColor("#ff5b5b5b") }.width("100%") }else{ Column(){ Text("不可编辑") .alignSelf(ItemAlign.Start) ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#ERROR#Left AST#method_definitio...
build() { Column() { if(this.editable){ Column(){ Text("基础用法") .alignSelf(ItemAlign.Start) .margin(20) .fontColor("#ff5b5b5b") }.width("100%") }else{ Column(){ Text("不可编辑") .alignSelf(ItemAlign.Start) ...
https://gitee.com/openharmony-sig/ohos_easyui.git
66aa4580ad3f515740c0a2338d5a5e2c978559cb
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/taskpool.ets
arkts
notifyNewTaskAvailable
@brief Notify waiting workers that new tasks are available
function notifyNewTaskAvailable(): void { ConcurrencyHelpers.lockGuard(globalTaskQueuesMutex, () => { ConcurrencyHelpers.condVarNotifyAll(globalTaskCondVar, globalTaskQueuesMutex); }); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left notifyNewTaskAvailable 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#pred...
function notifyNewTaskAvailable(): void { ConcurrencyHelpers.lockGuard(globalTaskQueuesMutex, () => { ConcurrencyHelpers.condVarNotifyAll(globalTaskCondVar, globalTaskQueuesMutex); }); }
https://gitcode.com/iop123123/arkts-static-skills
551d5d0540a751e7d0c1eb8790c7731eb5eaa80f
gitcode
CLMC2025/Vignette
entry/src/main/ets/vocabulary/VocabularyTracker.ets
arkts
getReviewWords
获取已掌握/复习阶段的词汇
getReviewWords(): VocabularyRecord[] { return this.getRecordsByStatus(WordStatus.REVIEW); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getReviewWords 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 VocabularyRecord AST#identifier#Right AST#[#Lef...
getReviewWords(): VocabularyRecord[] { return this.getRecordsByStatus(WordStatus.REVIEW); }
https://github.com/CLMC2025/Vignette
806e37dc6a6da4b224c46823cd9840c39725af70
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BarDataSet.ets
arkts
setFills
Sets the fills for the bars in this dataset. @param fills
public setFills(fills: JArrayList<Fill>): void { this.mFills = fills; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setFills AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left fills AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expressi...
public setFills(fills: JArrayList<Fill>): void { this.mFills = fills; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
6fe934c5e89642bd1b7f56516dca78400623b292
gitee
Yebingiscn/SweetVideo
entry/src/main/ets/utils/FileFolderUtil.ets
arkts
transferVideosToFileFolder
添加视频到文件夹,支持批量
static transferVideosToFileFolder(context: Context, videos: VideoMetadata[], fromFolderDate: string, targetFolderDate: string): FileFolder[] { const folders = Preferences.getFileFolder(context) || [] // 单次遍历查找两个文件夹 let fromFolder: FileFolder | undefined let targetFolder: FileFolder | undefined ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left transferVideosToFileFolder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id...
static transferVideosToFileFolder(context: Context, videos: VideoMetadata[], fromFolderDate: string, targetFolderDate: string): FileFolder[] { const folders = Preferences.getFileFolder(context) || [] // 单次遍历查找两个文件夹 let fromFolder: FileFolder | undefined let targetFolder: FileFolder | undefined ...
https://github.com/Yebingiscn/SweetVideo
e776eb30e6e542f344ac2a55459817931c92be56
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/InvisibleWebViewComponent.ets
arkts
getAllSourceIds
获取所有注册的源ID
getAllSourceIds(): string[] { return Array.from(this.webViewMap.keys()); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getAllSourceIds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Lef...
getAllSourceIds(): string[] { return Array.from(this.webViewMap.keys()); }
https://github.com/DaLongZhuaZi/manxia
bd282d467c9bbfe1bdb2093b2032f8078027fc17
github
offlinecat-dev/OCNetORM
src/main/ets/query/RelationLoadResult.ets
arkts
createSuccess
创建成功的关联加载结果 @param relationName 关联名称 @param loadedCount 加载的数据数量 @param duration 加载耗时(毫秒) @returns RelationLoadResult 实例
static createSuccess(relationName: string, loadedCount: number = 0, duration: number = 0): RelationLoadResult { const result = new RelationLoadResult(relationName) result.success = true result.loadedCount = loadedCount result.duration = duration return result }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createSuccess AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left relationName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
static createSuccess(relationName: string, loadedCount: number = 0, duration: number = 0): RelationLoadResult { const result = new RelationLoadResult(relationName) result.success = true result.loadedCount = loadedCount result.duration = duration return result }
https://github.com/offlinecat-dev/OCNetORM
5f3f279520fa50135977cf492aa416ba696392bd
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/messagelist/utils/AsrDisplayManager.ets
arkts
isExpanded
Check if ASR bubble should be considered expanded (i.e., not hidden) for a message. Note: actual rendering should still depend on whether asrText exists.
isExpanded(messageID: string | undefined): boolean { if (!messageID || messageID.length === 0) { return false; } return !this.hiddenMessageIDs.has(messageID); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isExpanded AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left messageID AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR...
isExpanded(messageID: string | undefined): boolean { if (!messageID || messageID.length === 0) { return false; } return !this.hiddenMessageIDs.has(messageID); }
https://github.com/Tencent-RTC/TUIKit_Harmony
23b35afcdc48b03bb13225fb330d98c155da81d8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets
arkts
toExponential
toExponential() returns std.core.String representing the underlying double in exponential notation @returns { String } the result of conversion @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toExponential(): String { return this.toExponentialWithNoDigit(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toExponential 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 String A...
public toExponential(): String { return this.toExponentialWithNoDigit(); }
https://gitcode.com/iop123123/arkts-static-skills
289baf4d0b5204deac033417de990675882f3944
gitcode
HarmonyOS_Samples/HarmonyOSComponentUXExamples
products/pc/src/main/ets/components/presentation/progress/components/CircleProgress.ets
arkts
handleIconClick
Handles icon click event
handleIconClick() { switch (this.currentState) { case DownloadState.IDLE: case DownloadState.PAUSED: // If idle or paused -> start/resume download this.startOrResumeDownload(); break; case DownloadState.DOWNLOADING: // If currently downloading -> pause thi...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleIconClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le...
handleIconClick() { switch (this.currentState) { case DownloadState.IDLE: case DownloadState.PAUSED: // If idle or paused -> start/resume download this.startOrResumeDownload(); break; case DownloadState.DOWNLOADING: // If currently downloading -> pause thi...
https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples
0d4a874f8f90e7188df94bcee1425a9571dd4512
gitcode
Yebingiscn/SweetVideo
entry/src/main/ets/database/Preferences.ets
arkts
getVideoMetaData
首页视频数据
static getVideoMetaData(context: Context) { return Preferences.getFileFolder(context)[0]?.video_list ?? [] as VideoMetadata[] }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getVideoMetaData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static getVideoMetaData(context: Context) { return Preferences.getFileFolder(context)[0]?.video_list ?? [] as VideoMetadata[] }
https://github.com/Yebingiscn/SweetVideo
0c9cd3b91ec299bbc06144f3f92aa183d0700487
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/BasePopup.ets
arkts
setPopupConfig
设置弹窗配置 @param popupConfig
setPopupConfig(popupConfig: PopupConfig) { this.popupConfig = popupConfig }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setPopupConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left popupConfig AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PopupConfig AST#ide...
setPopupConfig(popupConfig: PopupConfig) { this.popupConfig = popupConfig }
https://github.com/wuba/omni-ui
d2b000f5c46695478cc14f94a09711b4eb2bfe97
github
openharmony/applications_photos
common/src/main/ets/default/model/common/WorkerThreadPool.ets
arkts
startWorker
启动一个worker @param worker worker对象 @param buffer 传入worker的buffer @param excFunc 主线程回调函数 @param name worker名称
public static startWorker(worker: worker.ThreadWorker, buffer: ArrayBuffer, callback: Function, name: string): void { if (!worker) { Log.error(TAG, 'worker' + name + 'is null'); } worker.postMessage(buffer); worker.onmessage = function (e: MessageEvents) { callback(e, name); Log.info...
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 startWorker AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left worker AST#identifier#Right AST#:#Left : AS...
public static startWorker(worker: worker.ThreadWorker, buffer: ArrayBuffer, callback: Function, name: string): void { if (!worker) { Log.error(TAG, 'worker' + name + 'is null'); } worker.postMessage(buffer); worker.onmessage = function (e: MessageEvents) { callback(e, name); Log.info...
https://gitee.com/openharmony/applications_photos.git
30629f898504346758e615b754c9dcc0138b39a0
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/ImageCacheManager.ets
arkts
removeFromDiskCache
从磁盘缓存移除
private async removeFromDiskCache(cacheKey: string): Promise<void> { try { const cacheInfo = this.diskCacheIndex.get(cacheKey); if (cacheInfo) { if (await this.sandboxManager.exists(cacheInfo.filePath)) { await this.sandboxManager.deleteFile(cacheInfo.filePath); } thi...
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 removeFromDiskCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cacheKey AST#identifier#Right AST#ERROR#Left AST...
private async removeFromDiskCache(cacheKey: string): Promise<void> { try { const cacheInfo = this.diskCacheIndex.get(cacheKey); if (cacheInfo) { if (await this.sandboxManager.exists(cacheInfo.filePath)) { await this.sandboxManager.deleteFile(cacheInfo.filePath); } thi...
https://github.com/DaLongZhuaZi/manxia
69ef21816718fadadd9d97646245b0a19d4f0368
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncArrayConcurrentQueue.ets
arkts
remainingCapacity
Returns the number of additional elements that this queue can ideally accept without blocking. @returns { int } the remaining capacity of the ConcurrentQueue. @syscap SystemCapability.Utils.Lang
public override remainingCapacity(): int { return this.capacitySize - this.size; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left remainingCapacity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right...
public override remainingCapacity(): int { return this.capacitySize - this.size; }
https://gitcode.com/iop123123/arkts-static-skills
a2df2e942a3edd8c1bce72d95dfbb8418e9f81cb
gitcode
openharmony/applications_mms
entry/src/main/ets/pages/conversation/conversationController.ets
arkts
setDraft
Set Draft Content
setDraft() { // If the content is a draft, the draft content needs to be displayed. if (this.isDraft) { this.textValue = this.draftContent; this.canSendMessage = MmsPreferences.getInstance().haveSimCardReady(); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setDraft 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 { AST#{#Right AST#comment#Left // If the conte...
setDraft() { // If the content is a draft, the draft content needs to be displayed. if (this.isDraft) { this.textValue = this.draftContent; this.canSendMessage = MmsPreferences.getInstance().haveSimCardReady(); } }
https://gitee.com/openharmony/applications_mms.git
2ed4c59b2e11810ca29f977505d52b9d075f5f19
gitee
751496032/ZRouter
RouterApi/src/main/ets/model/ConfigInitializer.ets
arkts
isRoutePreloadThreadEnabled
路由预加载是否启用多线程,默认为true @param value
public set isRoutePreloadThreadEnabled(value: boolean) { this._isRoutePreloadThreadEnabled = value }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left set AST#identifier#Right AST#call_expression#Left AST#identifier#Left isRoutePreloadThreadEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST...
public set isRoutePreloadThreadEnabled(value: boolean) { this._isRoutePreloadThreadEnabled = value }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/model/ConfigInitializer.ets#L83-L85
1e6dd046cb54eda57c26f6098801787f9942f6a8
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ArrayList.ets
arkts
convertToArray
Converts the ArrayList to a standard JavaScript Array. @returns A new Array containing all elements of the ArrayList.
public convertToArray(): Array<T> { return Array.from(this.buffer); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left convertToArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#express...
public convertToArray(): Array<T> { return Array.from(this.buffer); }
https://gitcode.com/iop123123/arkts-static-skills
1e60bdbda2140ce541b84d15cd8d6678984ef0ea
gitcode
LongLiveY96/chatcube
entry/src/main/ets/utils/LunarCalendarUtils.ets
arkts
getGanZhiYear
获取干支年
function getGanZhiYear(year: number): string { const ganIndex = (year - 4) % 10 const zhiIndex = (year - 4) % 12 return TIAN_GAN[ganIndex] + DI_ZHI[zhiIndex] }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getGanZhiYear 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#:#Ri...
function getGanZhiYear(year: number): string { const ganIndex = (year - 4) % 10 const zhiIndex = (year - 4) % 12 return TIAN_GAN[ganIndex] + DI_ZHI[zhiIndex] }
https://github.com/LongLiveY96/chatcube
102802f28cccda8c9ab72b14b392a936889f5076
github
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/svggen/SVGRect.ets
arkts
setY
设置y坐标 @param newY y坐标值
public setY(newY: number): void{ this._y = newY; this._rectResultObj['y'] = newY; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left setY AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newY AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public setY(newY: number): void{ this._y = newY; this._rectResultObj['y'] = newY; }
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
acb8470bf20bc1e6219a3a1d59f625b279db2186
gitee
Vincent-Leon/zotero-harmony
entry/src/main/ets/data/ItemRepository.ets
arkts
itemToBucket
---------- bucket / row converters ----------
function itemToBucket(item: ZoteroItem, cachedAt: number): relationalStore.ValuesBucket { const data = item.data; return { 'key': item.key, 'version': item.version, 'parent_item': data.parentItem !== undefined ? data.parentItem : null, 'item_type': data.itemType, 'title': data.title !== undefine...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left itemToBucket AST#identifier#Right 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#:#Rig...
function itemToBucket(item: ZoteroItem, cachedAt: number): relationalStore.ValuesBucket { const data = item.data; return { 'key': item.key, 'version': item.version, 'parent_item': data.parentItem !== undefined ? data.parentItem : null, 'item_type': data.itemType, 'title': data.title !== undefine...
https://github.com/Vincent-Leon/zotero-harmony
631464a47e3bbfa63dfbf55c9884f2b5dce2b8cc
github
HarmonyOS_Samples/BestPracticeSnippets
ArkUI/orientationDevelopment/entry/src/main/ets/pages/Index.ets
arkts
build
[StartExclude enable_nfc]
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container_...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container_...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
c76970df6c71eade523478c713976ebe9a7dc8be
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Services/CacheStatusService.ets
arkts
createEmptyStats
创建空的统计信息
private createEmptyStats( contentId: string, contentType: CacheContentType, sourceId: number, title?: string ): ContentCacheStats { return { contentId: contentId, contentType: contentType, title: title || contentId, sourceId: sourceId, cachedChapterCount: 0, t...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left createEmptyStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left contentId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
private createEmptyStats( contentId: string, contentType: CacheContentType, sourceId: number, title?: string ): ContentCacheStats { return { contentId: contentId, contentType: contentType, title: title || contentId, sourceId: sourceId, cachedChapterCount: 0, t...
https://github.com/DaLongZhuaZi/manxia
1928efdecf4281f03659ad6cc930c1eb34ae24ab
github
HarmonyOS_Samples/BestPracticeSnippets
PerformanceAnalysis/BptaDelayAnalysis/entry/src/main/ets/components/AudioPlayerService.ets
arkts
initAudioPlayer
[StartExclude audio_player_service1]
private initAudioPlayer(): void { }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initAudioPlayer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#exp...
private initAudioPlayer(): void { }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
54d9dab7d26aaa7a021f5d247b33c1ed08f54905
gitcode
tdcare/tdwebrtc
src/main/ets/WebRTCManager.ets
arkts
answer
接听呼叫 关键流程: 1. 发送 doing 信令通知呼叫方 2. 加入房间(触发服务器发送 client_joined) 3. 设置 peerRoomMap 以便接收 ICE 候选 4. 等待呼叫方发送 Offer(标准 WebRTC 流程:呼叫方创建 Offer) 注意:被叫方不主动创建 Offer,而是等待呼叫方的 Offer 后创建 Answer
public answer(allMacList: string[], roomId: string): void { LogUtil.info(`[WebRTC] answer: allMacList=${JSON.stringify(allMacList)}, roomId=${roomId}`); // 1. 设置对端映射(用于接收 ICE 候选) for (let i = 0; i < allMacList.length; i++) { this.setPeerRoom(allMacList[i], roomId); } // 2. 发送 doing...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left answer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left allMacList AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right...
public answer(allMacList: string[], roomId: string): void { LogUtil.info(`[WebRTC] answer: allMacList=${JSON.stringify(allMacList)}, roomId=${roomId}`); // 1. 设置对端映射(用于接收 ICE 候选) for (let i = 0; i < allMacList.length; i++) { this.setPeerRoom(allMacList[i], roomId); } // 2. 发送 doing...
https://github.com/tdcare/tdwebrtc
f1275a8e6710f1a084d76ffd8e4c0b14ee7ef381
github
CPF-ApplicationTPC/imageknifepro
library/src/main/ets/ImageKnife.ets
arkts
fileCacheEnableExtension
默认的文件缓存启用文件拓展名 调用后,则写文件缓存时会添加文件拓展名 @param cacheName 需要操作的文件缓存名称,默认名称为空即操作大端文件缓存, 不为空则匹配小端文件缓存
fileCacheEnableExtension(cacheName?:string) { nativeNode.fileCacheEnableExtension(cacheName) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fileCacheEnableExtension AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cacheName AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#string#Left string...
fileCacheEnableExtension(cacheName?:string) { nativeNode.fileCacheEnableExtension(cacheName) }
https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/library/src/main/ets/ImageKnife.ets#L176-L178
5cc1bf229ce69c73982af2acb45c4682a6a76c21
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets
arkts
format
Formats a number according to the locale and formatting options of this Intl.NumberFormat object. @param value A number to format. @returns string representing the given number formatted according to the locale and formatting options of this Intl.NumberFormat object.
public format(value: number): string { return this.formatDouble(value); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left format 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 number A...
public format(value: number): string { return this.formatDouble(value); }
https://gitcode.com/iop123123/arkts-static-skills
db848f79a89b64b8ba2cc64fae88f782f145f3e9
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
getStringSingleInternal
内部方法:获取单个规则的字符串结果
private getStringSingleInternal(ruleStr: string): string { const regexGroupValue = this.getStringFromRegexGroupPayload(ruleStr); if (regexGroupValue !== null) { return regexGroupValue; } const parsedRule = this.parseRule(ruleStr); // 处理put变量 if (parsedRule.putMap) { Object.ke...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getStringSingleInternal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ruleStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string...
private getStringSingleInternal(ruleStr: string): string { const regexGroupValue = this.getStringFromRegexGroupPayload(ruleStr); if (regexGroupValue !== null) { return regexGroupValue; } const parsedRule = this.parseRule(ruleStr); // 处理put变量 if (parsedRule.putMap) { Object.ke...
https://github.com/DaLongZhuaZi/manxia
05acc99afbeb84e6117f26c02896c92a6020ca96
github
openharmony-sig/ohos_video_trimmer
entry/src/main/ets/pages/FileUtils.ets
arkts
writeStream
stream式写入
writeStream(path: string, tempArray: ArrayBuffer) { try { console.error("FileUtils - writeStream =1 ") this.createFile(path) console.error("FileUtils - writeStream 2 ") let ss = fs.createStreamSync(path, "r+"); console.error("FileUtils - writeStream 3 " + tempArray.byteLength) ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left writeStream AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
writeStream(path: string, tempArray: ArrayBuffer) { try { console.error("FileUtils - writeStream =1 ") this.createFile(path) console.error("FileUtils - writeStream 2 ") let ss = fs.createStreamSync(path, "r+"); console.error("FileUtils - writeStream 3 " + tempArray.byteLength) ...
https://gitee.com/openharmony-sig/ohos_video_trimmer.git
cec99fffac9387ce3b32b402ad7918d91d9df32b
gitee
the-wwyang/kids-learning-app
src/main/ets/services/QuestionCacheService.ets
arkts
isDuplicate
检查题目是否重复
private isDuplicate(question: MathQuestion): boolean { const hash = this.generateQuestionHash(question); return this.questionHistory.has(hash); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isDuplicate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left question AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
private isDuplicate(question: MathQuestion): boolean { const hash = this.generateQuestionHash(question); return this.questionHistory.has(hash); }
https://github.com/the-wwyang/kids-learning-app
d91d8bb049dc4e14bb9d96fdbe3fe41bd9de3736
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/Builder.ets
arkts
setAttachMargin
设置依附组件、气泡组件距离原始点击组件的距离 @param attachMargin @returns
setAttachMargin(attachMargin: number): Builder { this.popupConfig.attachMargin = attachMargin return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setAttachMargin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left attachMargin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left )...
setAttachMargin(attachMargin: number): Builder { this.popupConfig.attachMargin = attachMargin return this }
https://github.com/wuba/omni-ui
c20ff90024ad3e2c48daa89bc07fea0833bfc248
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/HtmlEntities.ets
arkts
encode
编码 HTML 特殊字符 将 <, >, &, ", ' 转换为对应的 HTML 实体
static encode(text: string): string { if (!text) { return text; } return text .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&#39;'); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left encode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AS...
static encode(text: string): string { if (!text) { return text; } return text .replace(/&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&#39;'); }
https://github.com/DaLongZhuaZi/manxia
457e422cb5dd1363d94891090b07c796a431dd73
github
codelably/HCompass
core/di/src/main/ets/ServiceContainer.ets
arkts
unregister
注销服务 @param key 服务标识符 @returns 是否注销成功
unregister(key: ServiceKey): boolean { return this.services.delete(key); }
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 key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ServiceKey AST#identifier#Right AST#)#Left ) A...
unregister(key: ServiceKey): boolean { return this.services.delete(key); }
https://github.com/codelably/HCompass
84dedf67a4c411ce9f7851482eaffbcc48af99ad
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/NvHttp.ets
arkts
getServerInfo
获取服务器信息 优先使用 HTTPS(如果已配对),失败后尝试 HTTP
async getServerInfo(likelyOnline: boolean = true): Promise<ServerInfo> { let response: string; const connectTimeout = likelyOnline ? NvHttp.LONG_CONNECTION_TIMEOUT : NvHttp.CONNECTION_TIMEOUT; try { // 如果有服务器证书且客户端证书文件存在(已配对),尝试 HTTPS 并使用客户端证书 if (this.serverCert && this.hasCertificateFiles()...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getServerInfo AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left likelyOnline AST#identifier#Right AST#type_annotation#Le...
async getServerInfo(likelyOnline: boolean = true): Promise<ServerInfo> { let response: string; const connectTimeout = likelyOnline ? NvHttp.LONG_CONNECTION_TIMEOUT : NvHttp.CONNECTION_TIMEOUT; try { // 如果有服务器证书且客户端证书文件存在(已配对),尝试 HTTPS 并使用客户端证书 if (this.serverCert && this.hasCertificateFiles()...
https://github.com/AlkaidLab/moonlight-harmony
52ff3baf6827d5a80f41c6686e38dad2a204085f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
entries
Returns an array of key, value pairs for every entry in the Int8Array @returns { IterableIterator<[int, Number]> } - key, value pairs for every entry in the array @syscap SystemCapability.Utils.Lang @FaAndStageModel
public entries(): IterableIterator<[int, Number]> { return new Int8ArrayIteratorEntries(this) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left entries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_sta...
public entries(): IterableIterator<[int, Number]> { return new Int8ArrayIteratorEntries(this) }
https://gitcode.com/iop123123/arkts-static-skills
708dcffd38e8c7e2a809f067b294f0be72cc2103
gitcode
webabcd/HarmonyDemo
entry/src/main/ets/pages/component/selection/RadioDemo.ets
arkts
applyContent
返回指定的自定义 Radio
applyContent() : WrappedBuilder<[RadioConfiguration]> { return wrapBuilder(buildRadio) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left applyContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#instantiation_expre...
applyContent() : WrappedBuilder<[RadioConfiguration]> { return wrapBuilder(buildRadio) }
https://github.com/webabcd/HarmonyDemo
e17eb57993e6bb8ac8c63429627de2000825aac8
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnProgressViewModel.ets
arkts
increaseDynamic
增加动态进度值 @param step 步进值
increaseDynamic(step: number): void { this.dynamicPercent = Math.min(100, this.dynamicPercent + step); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left increaseDynamic AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left step AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left )...
increaseDynamic(step: number): void { this.dynamicPercent = Math.min(100, this.dynamicPercent + step); }
https://github.com/codelably/tuniao-ui
06b02d555fd8ae6971b65459e7a3fad05f307360
github
honjow/Next2V
shared/src/main/ets/parser/V2exWriteFormParser.ets
arkts
extractSelectedSyntaxValue
The syntax <select>'s currently-selected option value (which syntax the topic was posted with).
private static extractSelectedSyntaxValue(formHtml: string): string { const select = V2exWriteFormParser.extractSyntaxSelect(formHtml) if (!select) { return '' } const re = /<option\b([^>]*)>([\s\S]*?)<\/option>/gi let m: RegExpExecArray | null = re.exec(select) while (m) { if (/\b...
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 extractSelectedSyntaxValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left formHtml AST#identifier#Right AST#ERROR#...
private static extractSelectedSyntaxValue(formHtml: string): string { const select = V2exWriteFormParser.extractSyntaxSelect(formHtml) if (!select) { return '' } const re = /<option\b([^>]*)>([\s\S]*?)<\/option>/gi let m: RegExpExecArray | null = re.exec(select) while (m) { if (/\b...
https://github.com/honjow/Next2V
ad88dabbca9f91f1f16d2ad9e145d68a635bc61e
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Boolean.ets
arkts
or
Does logical `or` on this instance and provided instance @param other provided instance @returns value as a result of logical `or`
public or(other: Boolean): Boolean { return Boolean.valueOf(this.value || other.unboxed()) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left or AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR...
public or(other: Boolean): Boolean { return Boolean.valueOf(this.value || other.unboxed()) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
435f33462b47a3ea4eeb473dd0ef466dcbd04655
gitee
openharmony/applications_call
entry/src/main/ets/common/configs/BtnGroupConfig.ets
arkts
addIconUrl
Process the image text of the button group @param {Array} arr - Pass in an array
function addIconUrl(arr) { const regExp = /^icon.*.*Url$/; arr.forEach((item) => { for (let key in item) { if (Object.prototype.hasOwnProperty.call(item, key) && regExp.test(key)) { item[key] = `${ImagePathConst.BASE_URL}${item[key]}.svg`; } } }); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left addIconUrl AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#required_parameter#Right AST#)#Left ) AST#)#Ri...
function addIconUrl(arr) { const regExp = /^icon.*.*Url$/; arr.forEach((item) => { for (let key in item) { if (Object.prototype.hasOwnProperty.call(item, key) && regExp.test(key)) { item[key] = `${ImagePathConst.BASE_URL}${item[key]}.svg`; } } }); }
https://gitee.com/openharmony/applications_call.git
b5178cf318099cfb0f5bdf43ace8b15d0a8376da
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/AniListScraper.ets
arkts
search
搜索媒体 @param keyword 搜索关键词 @param type 媒体类型 @param page 页码 @param perPage 每页数量
public async search( keyword: string, type: AniListMediaType = AniListMediaType.MANGA, page: number = 1, perPage: number = 25 ): Promise<ScraperSearchResult> { try { logger.info(TAG, `搜索AniList: keyword=${keyword}, type=${type}`); const query = ` query ($search: String, $typ...
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 search AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R...
public async search( keyword: string, type: AniListMediaType = AniListMediaType.MANGA, page: number = 1, perPage: number = 25 ): Promise<ScraperSearchResult> { try { logger.info(TAG, `搜索AniList: keyword=${keyword}, type=${type}`); const query = ` query ($search: String, $typ...
https://github.com/DaLongZhuaZi/manxia
564ba90d24019a4546da5873344598ef8ba9fb7e
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/LibFreeRDP.ets
arkts
getLastErrorString
Get the last error string
static getLastErrorString(inst: number): string { if (!LibFreeRDP.ensureNativeReady()) { return 'native library not loaded'; } return freerdpNative!.freerdpGetLastErrorString(inst); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getLastErrorString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inst AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
static getLastErrorString(inst: number): string { if (!LibFreeRDP.ensureNativeReady()) { return 'native library not loaded'; } return freerdpNative!.freerdpGetLastErrorString(inst); }
https://github.com/tangwengang-del/freerdp-harmonyos
e380dc935e7a87a4c0ed71007fe90ff8931ca648
github
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/database/RecurringBillDatabase.ets
arkts
deleteRecordsByConfigId
删除配置的所有生成记录
async deleteRecordsByConfigId(configId: number): Promise<number> { if (!this.rdbStore) { throw new Error('数据库未初始化'); } const predicates = new relationalStore.RdbPredicates(this.RECORD_TABLE); predicates.equalTo('recurringConfigId', configId); try { const rows = await this.rdbStore.de...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left deleteRecordsByConfigId AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left configId AST#identifi...
async deleteRecordsByConfigId(configId: number): Promise<number> { if (!this.rdbStore) { throw new Error('数据库未初始化'); } const predicates = new relationalStore.RdbPredicates(this.RECORD_TABLE); predicates.equalTo('recurringConfigId', configId); try { const rows = await this.rdbStore.de...
https://github.com/qiuhaotc/HarmonyOSPlayground
1c3351f61a8d9ce689de9a648964f9a722d7b39a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Editor/FileEditorService.ets
arkts
auditCapabilities
对编辑器功能完整性进行检查
public auditCapabilities(sessionId: string, language: string, readOnly: boolean, saveTarget: FileEditorSaveTarget, hasFilePath: boolean, tabCount: number): FileEditorFeatureAudit { const items: FileEditorFeatureCheck[] = []; items.push(this.createFeatureCheck('isolatedSession', '独立编辑会话', sessionId.l...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left auditCapabilities AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sessionId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
public auditCapabilities(sessionId: string, language: string, readOnly: boolean, saveTarget: FileEditorSaveTarget, hasFilePath: boolean, tabCount: number): FileEditorFeatureAudit { const items: FileEditorFeatureCheck[] = []; items.push(this.createFeatureCheck('isolatedSession', '独立编辑会话', sessionId.l...
https://github.com/DaLongZhuaZi/manxia
30fd3f2706805e9e440bf7cc9fa453f4253d027e
github
iichen-bycode/ArkTsWanandroid
entry/src/main/ets/http/request.ets
arkts
request
类型参数的作用,T决定AxiosResponse实例中data的类型
request<T = any>(config: HttpRequestConfig): Promise<T> { return new Promise<T>((resolve, reject) => { this.instance .request<any, T>(config) .then(res => { resolve(res); }) .catch((err) => { errorHandler(err) if (err) { reject(err); ...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#identifier#Left request AST#identifier#Right AST#<#Left < AST#<#Right AST#assignment_expression#Left AST#identifier#Left T AST#identifier#Right AST#=#Left = AST#=#Right AST#binary_expression#Left AST#identifier#Left any AST#identifier#Right A...
request<T = any>(config: HttpRequestConfig): Promise<T> { return new Promise<T>((resolve, reject) => { this.instance .request<any, T>(config) .then(res => { resolve(res); }) .catch((err) => { errorHandler(err) if (err) { reject(err); ...
https://github.com/iichen-bycode/ArkTsWanandroid
b7af1eed389c6e72a228f7402bbd4ea5bfae9037
github
CsCesium/KantaiHomo
entry/src/main/ets/app/pages/components/info/EquipInfoPage.ets
arkts
groupForIcon
==================== Helpers ====================
function groupForIcon(iconType: number): EquipTypeGroup { return iconType > 0 ? `i-${iconType}` : 'other'; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left groupForIcon AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left iconType AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:...
function groupForIcon(iconType: number): EquipTypeGroup { return iconType > 0 ? `i-${iconType}` : 'other'; }
https://github.com/CsCesium/KantaiHomo
0aca90ecf89577c3fda38b32f1f008ab09263915
github
erosTeam/NextE
feature/gallery/src/main/ets/viewmodel/GalleryDetailViewModel.ets
arkts
enrichFromApi
Best-effort gdata metadata enrich for a sparse seed (eros_fe getMoreGalleryInfoOne). Non-fatal: the detail fetch below provides canonical data, so a gdata failure must not block the page.
private async enrichFromApi(gid: string, token: string): Promise<void> { try { const base: string = EhConstants.baseUrl(connectSiteMode().isEx) const seed: EhGallery = new EhGallery(gid, token) const list: EhGallery[] = await EhApiPhpService.galleryData(base, [seed]) if (list.length > 0) {...
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 enrichFromApi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left gid AST#identifier#Right AST#:#Left : A...
private async enrichFromApi(gid: string, token: string): Promise<void> { try { const base: string = EhConstants.baseUrl(connectSiteMode().isEx) const seed: EhGallery = new EhGallery(gid, token) const list: EhGallery[] = await EhApiPhpService.galleryData(base, [seed]) if (list.length > 0) {...
https://github.com/erosTeam/NextE
3ee2357de978c180ec2c1e975a8142f223c51b00
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/OneDriveManager.ets
arkts
scanCacheDirectory
=== 私有方法 === 扫描缓存目录
private async scanCacheDirectory(): Promise<void> { try { this.cachedFiles.clear(); const files = await this.driveManager.listOneDriveCacheFiles(); for (const fileName of files) { const filePath = `${this.config.cachePath}/${fileName}`; try { const stat = fs.stat...
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 scanCacheDirectory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ...
private async scanCacheDirectory(): Promise<void> { try { this.cachedFiles.clear(); const files = await this.driveManager.listOneDriveCacheFiles(); for (const fileName of files) { const filePath = `${this.config.cachePath}/${fileName}`; try { const stat = fs.stat...
https://github.com/AetheriumSimulator/qemu-hmos
52024b6f34bb1a1d5cec3ce05d6ddd512ef5a6ba
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Parsers/EBookParser.ets
arkts
parseEpubGeneratedNavigationItems
当 EPUB/MOBI 没有可靠 nav/ncx 时,从正文标题生成可跳转目录。
public static parseEpubGeneratedNavigationItems( extractedRoot: string, spineItems: EBookChapter[] ): EpubNavigationItem[] { if (!extractedRoot || extractedRoot.trim().length === 0 || spineItems.length <= 0) { return []; } const parser = new ReaderKitEBookParser('', EBookFormat.EPUB); ...
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 parseEpubGeneratedNavigationItems AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left extractedRoot AST#identifier#Right A...
public static parseEpubGeneratedNavigationItems( extractedRoot: string, spineItems: EBookChapter[] ): EpubNavigationItem[] { if (!extractedRoot || extractedRoot.trim().length === 0 || spineItems.length <= 0) { return []; } const parser = new ReaderKitEBookParser('', EBookFormat.EPUB); ...
https://github.com/DaLongZhuaZi/manxia
a9b3b6f3150332b3f82281e7e6edd54a4555ec33
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/EntityData.ets
arkts
getPropertyNames
获取所有属性名 @returns 属性名数组
getPropertyNames(): Array<string> { const names: Array<string> = [] this.propertyMap.forEach((_, key) => { names.push(key) }) return names }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getPropertyNames AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#...
getPropertyNames(): Array<string> { const names: Array<string> = [] this.propertyMap.forEach((_, key) => { names.push(key) }) return names }
https://github.com/offlinecat-dev/OCNetORM
8f2e66bb4186ea0bd992cbc9f5dab01536b8b34b
github
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/Point.ets
arkts
set
Set value. @param x @param y
set(x: number, y: number): void { this.x = x; this.y = y; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left set AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST#,#Right AS...
set(x: number, y: number): void { this.x = x; this.y = y; }
https://gitee.com/openharmony/codelabs.git
720ceef9fcf301f6161939e45097109fc2c06470
gitee
arkui-x/samples
CodeLab/Cases/feature/floatwindow/src/main/ets/pages/FloatWindowMainPage.ets
arkts
onTouchEvent
触摸回调,悬浮窗跟手和贴边动画
onTouchEvent(event: TouchEvent): void { switch (event.type) { case TouchType.Down: { // 获取拖拽开始时悬浮窗在窗口中的坐标 this.windowStartX = event.touches[0].windowX; this.windowStartY = event.touches[0].windowY; break; } case TouchType.Move: { const windowX: number = ev...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onTouchEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TouchEvent AST#identifier#Right AST#)#Left...
onTouchEvent(event: TouchEvent): void { switch (event.type) { case TouchType.Down: { // 获取拖拽开始时悬浮窗在窗口中的坐标 this.windowStartX = event.touches[0].windowX; this.windowStartY = event.touches[0].windowY; break; } case TouchType.Move: { const windowX: number = ev...
https://gitcode.com/arkui-x/samples
a1d3044a75adcc83d8f4183ed104c03bce351ed5
gitcode
openharmony/applications_contacts
entry/src/main/ets/presenter/favorite/EditFavoriteListPresenter.ets
arkts
deleteFavoriteInfo
Remove selected data @param selectFavoriteIdList
deleteFavoriteInfo(selectFavoriteIdList: string[]) { HiLog.i(TAG, 'deleteFavoriteInfo start.'); let usuallyLength = this.usuallySelectList.length; if (usuallyLength > 0) { sharedPreferencesUtils.saveToPreferences('usuallySelectDisplayNameList', JSON.stringify(this.usuallySelectList)); } let ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left deleteFavoriteInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left selectFavoriteIdList AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AS...
deleteFavoriteInfo(selectFavoriteIdList: string[]) { HiLog.i(TAG, 'deleteFavoriteInfo start.'); let usuallyLength = this.usuallySelectList.length; if (usuallyLength > 0) { sharedPreferencesUtils.saveToPreferences('usuallySelectDisplayNameList', JSON.stringify(this.usuallySelectList)); } let ...
https://gitee.com/openharmony/applications_contacts.git
cd8d59b4dbea20bfeb2e7a53b957a809a3e99e9f
gitee
ZHCOOL520/HarmonyOS-AUTOcall
entry/src/main/ets/utils/AutoCallUtils.ets
arkts
isValidPhoneNumber
验证手机号码
static isValidPhoneNumber(phone: string): boolean { const phoneRegex = /^1[3-9]\d{9}$/; return phoneRegex.test(phone); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isValidPhoneNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left phone AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static isValidPhoneNumber(phone: string): boolean { const phoneRegex = /^1[3-9]\d{9}$/; return phoneRegex.test(phone); }
https://github.com/ZHCOOL520/HarmonyOS-AUTOcall
ca00760e6a2e089c794b77f4515f75fe1f8fd9cb
github
YDYm233/EasyRandom_HarmonyNextApp
common/VitalUI/src/main/ets/Demo/DemoRoseChart.ets
arkts
build
是否绘制文本
build() { Column() { GridRow({ columns: { sm: 4, md: 8, lg: 12 }, gutter: 12 }) { GridCol({ span: { sm: 4, md: 4, lg: 6 } }) { Row() { //RoseChart({data:R...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#object#Left AST#{#Left { AST#{#Right AST#method_def...
build() { Column() { GridRow({ columns: { sm: 4, md: 8, lg: 12 }, gutter: 12 }) { GridCol({ span: { sm: 4, md: 4, lg: 6 } }) { Row() { //RoseChart({data:R...
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
85d0da50974b4ba967861f653f303c8713e43232
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/SettingsManager.ets
arkts
getThemeModeDisplayText
获取主题模式显示文本
getThemeModeDisplayText(mode: ThemeMode): Resource { if (mode === ThemeMode.LIGHT) { return $r('app.string.theme_light') } else if (mode === ThemeMode.DARK) { return $r('app.string.theme_dark') } else { return $r('app.string.theme_system') } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getThemeModeDisplayText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ThemeMode AST#identifier#Right A...
getThemeModeDisplayText(mode: ThemeMode): Resource { if (mode === ThemeMode.LIGHT) { return $r('app.string.theme_light') } else if (mode === ThemeMode.DARK) { return $r('app.string.theme_dark') } else { return $r('app.string.theme_system') } }
https://github.com/LongLiveY96/chatcube
9269b33e15a3061d7204e6aca3d86629cbf39cb4
github
CLMC2025/Vignette
entry/src/main/ets/vocabulary/SnowballSystem.ets
arkts
getSnowballProgress
获取滚雪球进度
getSnowballProgress(): SnowballProgress { const stats = this.analyzeLearningNetwork(); const connectedWords = stats.networkSize - stats.isolatedWords.length; const progress = stats.networkSize > 0 ? (connectedWords / stats.networkSize) * 100 : 0; return { totalWords: stats.network...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSnowballProgress 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 SnowballProgress AST#identifier#Right AST#...
getSnowballProgress(): SnowballProgress { const stats = this.analyzeLearningNetwork(); const connectedWords = stats.networkSize - stats.isolatedWords.length; const progress = stats.networkSize > 0 ? (connectedWords / stats.networkSize) * 100 : 0; return { totalWords: stats.network...
https://github.com/CLMC2025/Vignette
c7b4213d5240453299eb3c24c709f99d10ab870e
github
openharmony/codelabs
ETSUI/HarmonyPhotoAlbum/entry/src/main/ets/service/PhotoService.ets
arkts
insert
插入一张图片数据 @param photo 图片对象 (id可传0,因为是自增的) @returns Promise<number> 返回插入行的 rowId
insert(photo: PhotoModel): Promise<number> { if (!this.rdbStore) { console.error('[PhotoService] 数据库未初始化'); return Promise.reject('DB not initialized'); } const valueBucket: relationalStore.ValuesBucket = {}; valueBucket[Constants.COL_NAME] = photo.name; valueBucket[Constants.COL_PAT...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left photo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right...
insert(photo: PhotoModel): Promise<number> { if (!this.rdbStore) { console.error('[PhotoService] 数据库未初始化'); return Promise.reject('DB not initialized'); } const valueBucket: relationalStore.ValuesBucket = {}; valueBucket[Constants.COL_NAME] = photo.name; valueBucket[Constants.COL_PAT...
https://gitcode.com/openharmony/codelabs
34bb91584dc8602d550d8a71b4f9593767e6038d
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
extractChapterListFromScriptResult
从脚本结果中提取章节列表
private extractChapterListFromScriptResult(scriptResult: string | Object): ChapterInfo[] { let parsedResult: string | Object | undefined = scriptResult; if (typeof scriptResult === 'string') { parsedResult = this.parseStructuredScriptResult(scriptResult); } if (!parsedResult || typeof parsedRes...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractChapterListFromScriptResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left scriptResult AST#identifier#Right AST#ERROR#Left AST#...
private extractChapterListFromScriptResult(scriptResult: string | Object): ChapterInfo[] { let parsedResult: string | Object | undefined = scriptResult; if (typeof scriptResult === 'string') { parsedResult = this.parseStructuredScriptResult(scriptResult); } if (!parsedResult || typeof parsedRes...
https://github.com/DaLongZhuaZi/manxia
9e878511a255e481201f3f86589d1f0142cb9400
github
openharmony/applications_calendar_data
datamanager/src/main/ets/processor/events/EventsProcessor.ets
arkts
isCalendarContainSameCreator
检查待插入的 event 与 calendar 表中相同 calendar_id 的元组是否拥有相同的 creator @param rdbStore rdb数据库 @param values 插入操作的数据 @return true 相同 false 不相同
async function isCalendarContainSameCreator(rdbStore: data_rdb.RdbStore, values: data_rdb.ValuesBucket): Promise<boolean> { Log.debug(TAG, 'isCalendarContainSameCreator start'); const eventCreator = values[EventColumns.CREATOR]; let resultSet = await queryCalendarIdAndC...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left isCalendarContainSameCreator AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rdbStore AST#identif...
async function isCalendarContainSameCreator(rdbStore: data_rdb.RdbStore, values: data_rdb.ValuesBucket): Promise<boolean> { Log.debug(TAG, 'isCalendarContainSameCreator start'); const eventCreator = values[EventColumns.CREATOR]; let resultSet = await queryCalendarIdAndC...
https://gitee.com/openharmony/applications_calendar_data.git
d3977b95640651a263cb2836ea0b32431597c00e
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/MedicalAgent.ets
arkts
retrieveKnowledge
RAG知识检索 @param query 检索查询 @returns 知识上下文
protected async retrieveKnowledge(query: string): Promise<KnowledgeContext> { try { const context = await this.ragRetriever.retrieve(query); return context; } catch (error) { // 检索失败时返回空上下文 return { content: '', references: [], totalFound: 0, filteredCou...
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left retrieveKnowledge AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AS...
protected async retrieveKnowledge(query: string): Promise<KnowledgeContext> { try { const context = await this.ragRetriever.retrieve(query); return context; } catch (error) { // 检索失败时返回空上下文 return { content: '', references: [], totalFound: 0, filteredCou...
https://github.com/LJ666-ui/harmony-health-care
4201fd01d639652363c1d58d7fb3aa646b62d542
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/LRU.ets
arkts
remove
Removes the entry for the given key, if present. @param { K } - the key to remove @returns { true } if an entry was removed, false otherwise @syscap SystemCapability.Utils.Lang @FaAndStageModel
public remove(key: K): boolean { ConcurrencyHelpers.mutexLock(this.mutex); try { const node = this.map.get(key); if (node === undefined) { return false; } this.removeNode(node); this.map.delete(key); this.size--;...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#Right AST...
public remove(key: K): boolean { ConcurrencyHelpers.mutexLock(this.mutex); try { const node = this.map.get(key); if (node === undefined) { return false; } this.removeNode(node); this.map.delete(key); this.size--;...
https://gitcode.com/iop123123/arkts-static-skills
b2b1aa09bd6875a69aa0f145204cb2aae93609ce
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Array.ets
arkts
sort
Sorts the elements of an array in place and returns the reference to the same array, now sorted. @param { function } [comparator] Optional. A function that defines the sort order. If omitted, the array is sorted according to each character's Unicode code point value, according to the string conversion of each element. ...
public sort(comparator?: (a: T, b: T) => int): this { if (this.actualLength <= 1) return this if (comparator == undefined) { this.wrap_default_sort() return this } const compareTo: int = this.move_undefined_end() let cmp: (l: Any, r: Any)...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left comparator AST#identif...
public sort(comparator?: (a: T, b: T) => int): this { if (this.actualLength <= 1) return this if (comparator == undefined) { this.wrap_default_sort() return this } const compareTo: int = this.move_undefined_end() let cmp: (l: Any, r: Any)...
https://gitcode.com/iop123123/arkts-static-skills
7559ed4e8d50395f9277fdc7a53573481ab03ca1
gitcode
Joker-x-dev/CoolMallArkTS
core/designsystem/src/main/ets/component/Scroll.ets
arkts
build
构建带大内边距的垂直滚动布局 @returns {void} 无返回值
build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_large"), ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { VerticalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_large"), ...
https://github.com/Joker-x-dev/CoolMallArkTS
9fd1545871c8a817cd5a3d7cfab81801c933ccd6
github
JackJiang2011/harmonychat
entry/src/main/ets/pages/model/MessagesProvider.ets
arkts
getMessages
获得消息数据缓存集合。 @returns 消息数据缓存集合
getMessages(): Array<Message> { return this.messages; }
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getMessages AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left ...
getMessages(): Array<Message> { return this.messages; }
https://github.com/JackJiang2011/harmonychat
3be9566eaa2669d4f200fe5f8cc00318e856f3c0
github
dingzhilin1990/zhilinclaw
src/agents/HanwudiWorkflow.ets
arkts
step5_QualityCheck
步骤 5: 质量检查
private async step5_QualityCheck(executionResult: any): Promise<QualityReport> { this.addLog(5, 'Inspector', '开始质量检查', 'started'); const input = JSON.stringify(executionResult.documents); const result = await this.inspector.process(input); const qualityReport = result.documents?.qualityRepor...
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 step5_QualityCheck AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left executionResult AST#identifier#Right AST#ERROR#Le...
private async step5_QualityCheck(executionResult: any): Promise<QualityReport> { this.addLog(5, 'Inspector', '开始质量检查', 'started'); const input = JSON.stringify(executionResult.documents); const result = await this.inspector.process(input); const qualityReport = result.documents?.qualityRepor...
https://github.com/dingzhilin1990/zhilinclaw
2b766f2906d5e5ea41d9f55b2db6f96974348c2a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelInitializer.ets
arkts
getContext
获取上下文
getContext(): common.UIAbilityContext | null { return this.context; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left :...
getContext(): common.UIAbilityContext | null { return this.context; }
https://github.com/DaLongZhuaZi/manxia
fc61e47397648946ed1342962b5270e8166f9961
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Array.ets
arkts
keys
Returns an iterator over all indices
public keys(): ValuesIterator<Int> { let ret: Int[] = new Int[this.data.length]; for (let i: int = 0; i < this.data.length; i++) { ret[i] = i; } return new ValuesIterator<Int>(ret); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left keys 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 keys(): ValuesIterator<Int> { let ret: Int[] = new Int[this.data.length]; for (let i: int = 0; i < this.data.length; i++) { ret[i] = i; } return new ValuesIterator<Int>(ret); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
7a8fe534204a78ed1248569d1cf226ef0422b1b5
gitee