nwo
stringclasses
449 values
path
stringlengths
9
173
language
stringclasses
1 value
identifier
stringlengths
1
53
docstring
stringlengths
5
4.13k
function
stringlengths
10
87.2k
ast_function
stringlengths
351
354k
obf_function
stringlengths
10
87.2k
url
stringlengths
30
175
function_sha
stringlengths
40
40
source
stringclasses
3 values
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets
arkts
doRead
The specific implementation of data production. It must not be actively called. After data production, Readable.push should be called to push the produced data into the buffer. If push is not called, doRead will not be called again. @param { int } size - Expected length of the data to be read. @throws { BusinessError }...
doRead(size: int): void { throw ERR_DOREAD_NOT_IMPLEMENTED; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left doRead AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left size AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right AST#)#Left ) AST#)#Right...
doRead(size: int): void { throw ERR_DOREAD_NOT_IMPLEMENTED; }
https://gitcode.com/iop123123/arkts-static-skills
0861b56a879a232353d95ff6979ebcfb290b21c3
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/LimitLine.ets
arkts
getLineColor
Returns the color that is used for this LimitLine @return
public getLineColor(): number | string { return this.mLineColor; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLineColor 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 AS...
public getLineColor(): number | string { return this.mLineColor; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1aca618aa49917c66008097547ecb5f6089ee3c2
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Services/GlobalSearchService.ets
arkts
getAvailableMangaSources
==================== 获取可用源 ==================== 获取可用的漫画图源列表(按置顶排序)
async getAvailableMangaSources(): Promise<SourceInfo[]> { try { return await this.sourceManager.getEnabledSourcesSortedByPinned(); } catch (error) { logger.error(TAG, `获取漫画图源失败: ${error}`); return []; } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAvailableMangaSources AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
async getAvailableMangaSources(): Promise<SourceInfo[]> { try { return await this.sourceManager.getEnabledSourcesSortedByPinned(); } catch (error) { logger.error(TAG, `获取漫画图源失败: ${error}`); return []; } }
https://github.com/DaLongZhuaZi/manxia
c11817c9a8b5a78192d56e3db422cbd8382ea84c
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/utils/TikTokChatStore.ets
arkts
addOneTiktokVideoComment
给单个视频写入评论 @param {String} videoId 视频的id @param {MessageInfo} message 评论的信息
async addOneTiktokVideoComment(videoId: string, message: commentDataModel) { const store = this.getVideoStore(videoId) const list = this.getOneTiktokVideoAllComment(videoId) list.unshift(message) store.putSync(videoId, JSON.stringify(list)) await store.flush() }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addOneTiktokVideoComment AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left videoId AST#identifier#Right AST#type_annotation#Left ...
async addOneTiktokVideoComment(videoId: string, message: commentDataModel) { const store = this.getVideoStore(videoId) const list = this.getOneTiktokVideoAllComment(videoId) list.unshift(message) store.putSync(videoId, JSON.stringify(list)) await store.flush() }
https://github.com/SMAT-Lab/PhantomRendering
25552913eefc7d8c10afe19001d1f176af0804c6
github
XJTUWYD/ArkDiff
entry/src/main/ets/utils/PatchExporter.ets
arkts
generateFromRawDiff
从原始文本和差异结果生成 Unified Diff 将连续的非未变更行(含前后 context)归并为 hunk,确保 header 计数与 body 一致。
static generateFromRawDiff( oldText: string, newText: string, diffLines: DiffLine[], options?: ExportOptions ): string { const opt = { ...DEFAULT_EXPORT_OPTIONS, ...options }; const headerA = opt.headerA || 'original'; const headerB = opt.headerB || 'modified'; const lines: string[] ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateFromRawDiff AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left oldText AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
static generateFromRawDiff( oldText: string, newText: string, diffLines: DiffLine[], options?: ExportOptions ): string { const opt = { ...DEFAULT_EXPORT_OPTIONS, ...options }; const headerA = opt.headerA || 'original'; const headerB = opt.headerB || 'modified'; const lines: string[] ...
https://github.com/XJTUWYD/ArkDiff
801cd9defe175523a46f5d47734d775dd6670dad
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/RDPPerformanceManager.ets
arkts
compressRLE
RLE压缩(纯软件实现)
private async compressRLE(data: ArrayBuffer): Promise<ArrayBuffer> { const input = new Uint8Array(data) const output: number[] = [] let i = 0 while (i < input.length) { const currentByte = input[i] let count = 1 // 计算连续相同字节的数量 while (i + count < input.length && inpu...
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 compressRLE AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AS...
private async compressRLE(data: ArrayBuffer): Promise<ArrayBuffer> { const input = new Uint8Array(data) const output: number[] = [] let i = 0 while (i < input.length) { const currentByte = input[i] let count = 1 // 计算连续相同字节的数量 while (i + count < input.length && inpu...
https://github.com/AetheriumSimulator/qemu-hmos
ff99b52a143a72a2444890b617a2e297baa54e89
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/interop/js/ESError.ets
arkts
getValue
Retrieves the ESValue associated with this error.
getValue(): ESValue { return this.err_; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getValue 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 ESValue AST#identifier#Right AST#ERROR#Right AST#stat...
getValue(): ESValue { return this.err_; }
https://gitcode.com/iop123123/arkts-static-skills
9e8b7d6531cb466d2edaf480192d0b5b7dcb710d
gitcode
HarmonyOS_Samples/HMRouter
entry/src/main/ets/entryability/EntryAbility.ets
arkts
updateBreakpoint
根据当前窗口尺寸更新断点
private updateBreakpoint(windowWidth: number): void { // 将长度的单位由px换算为vp let windowWidthVp = windowWidth / display.getDefaultDisplaySync().densityPixels; let newBp: string = ''; if(windowWidthVp < 600) { newBp = BreakpointConstants.BREAKPOINT_SM; } else if(windowWidthVp < 840) { newBp =...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateBreakpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left windowWidth AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AS...
private updateBreakpoint(windowWidth: number): void { // 将长度的单位由px换算为vp let windowWidthVp = windowWidth / display.getDefaultDisplaySync().densityPixels; let newBp: string = ''; if(windowWidthVp < 600) { newBp = BreakpointConstants.BREAKPOINT_SM; } else if(windowWidthVp < 840) { newBp =...
https://gitcode.com/HarmonyOS_Samples/HMRouter
c9230084b95c93beee7cc630509eb952b2ba020e
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
clamp
Return a new Decimal whose value is the value of this Decimal clamped to the range delineated by `min` and `max`. @param { Value } min {double | string | Decimal} @param { Value } max {double | string | Decimal} @returns { Decimal } the Decimal type @throws { BusinessError } 10200001 - The value of `min` is out of rang...
public clamp(min: Value, max: Value): Decimal { let minDecimal = new Decimal(min); let maxDecimal = new Decimal(max); if (!minDecimal.s || !maxDecimal.s) { return new Decimal(NaN); } if (minDecimal.greaterThan(maxDecimal)) { throw Utils.createBusinessE...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left clamp AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left min AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public clamp(min: Value, max: Value): Decimal { let minDecimal = new Decimal(min); let maxDecimal = new Decimal(max); if (!minDecimal.s || !maxDecimal.s) { return new Decimal(NaN); } if (minDecimal.greaterThan(maxDecimal)) { throw Utils.createBusinessE...
https://gitcode.com/iop123123/arkts-static-skills
96dc72dce6a0c108432047677b4d8692bb01ca9c
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/AnomalyDetectionDAO.ets
arkts
delete
删除基线数据
static async delete(baselineId: number): Promise<void> { try { await DAOHelper.softDelete(UserSpendingBaseline.tableName, 'baseline_id', baselineId); } catch (error) { throw DAOHelper.toError('[UserSpendingBaselineDAO] 删除基线失败', error); } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#delete#Left delete AST#delete#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left baselineId AST#identifier#Right AST#type_annotation#Left AST#...
static async delete(baselineId: number): Promise<void> { try { await DAOHelper.softDelete(UserSpendingBaseline.tableName, 'baseline_id', baselineId); } catch (error) { throw DAOHelper.toError('[UserSpendingBaselineDAO] 删除基线失败', error); } }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
fe05525d6e8946a1b44918067cd02c703a5d2fd9
github
ASweetBite/HarmonyPulse
entry/src/main/ets/type/GlobalMusic.ets
arkts
addSong
用户添加歌曲逻辑 @param song 新增的歌曲对象
addSong(song: SongItemType) { this.songList = [...this.songList, song]; // 如果是第一首歌,自动显示播放栏 if (this.songList.length === 1) { this.resetToMusic(0); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left addSong AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left song AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left SongItemType AST#identifier#Right...
addSong(song: SongItemType) { this.songList = [...this.songList, song]; // 如果是第一首歌,自动显示播放栏 if (this.songList.length === 1) { this.resetToMusic(0); } }
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/type/GlobalMusic.ets#L53-L59
168d8487c7badcff0d6e5cd863fa625f392fc03b
github
tdcare/tdwebrtc
src/main/ets/WebRTCManager.ets
arkts
getSendVideoCodec
v36: 获取发送端视频编解码器(用于编码器选择) 根据设备编码能力自动选择,不再硬编码 VP8 优先级: H265 > H264 > VP9 > VP8(取决于设备硬件能力 + 已实现的编解码器) VP8 软编码(libvpx)始终兜底
public getSendVideoCodec(): string { return this.codecCapabilities?.bestSendCodec ?? 'VP8'; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getSendVideoCodec AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string A...
public getSendVideoCodec(): string { return this.codecCapabilities?.bestSendCodec ?? 'VP8'; }
https://github.com/tdcare/tdwebrtc
0d86be80dfc96da089a1e735aa97dd3a4952b82a
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/Legend.ets
arkts
setWordWrapEnabled
Should the legend word wrap? / this is currently supported only for: BelowChartLeft, BelowChartRight, BelowChartCenter. / note that word wrapping a legend takes a toll on performance. / you may want to set maxSizePercent when word wrapping, to set the point where the text wraps. / default: false @param enabled
public setWordWrapEnabled(enabled: boolean): void { this.mWordWrapEnabled = enabled; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setWordWrapEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
public setWordWrapEnabled(enabled: boolean): void { this.mWordWrapEnabled = enabled; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
c8c940b6903d76cf7cf16dcbe1f2dc1fd5614e67
gitee
cpdd5201314/harmonyOS-music-app
common/mediaCommon/src/main/ets/utils/SongManager.ets
arkts
getAllSongs
获取所有歌曲
public getAllSongs(): Music[] { return this.songs; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAllSongs 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 Music AST#...
public getAllSongs(): Music[] { return this.songs; }
https://github.com/cpdd5201314/harmonyOS-music-app
ecc742310bd3c0ab054d50442ec28dd9e355ec6e
github
fuhhhhhhhh/openharmony
entry/src/main/ets/data/database/DBManager.ets
arkts
deleteDB
删除数据库(开发调试用)
public async deleteDB(): Promise<void> { if (!this.context) { throw new Error('需要先设置context'); } try { await relationalStore.deleteRdbStore(this.context, this.DB_NAME); this.rdbStore = null; console.log('数据库已删除'); } catch (error) { console.error('删除数据库失败'); throw n...
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 deleteDB AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left ...
public async deleteDB(): Promise<void> { if (!this.context) { throw new Error('需要先设置context'); } try { await relationalStore.deleteRdbStore(this.context, this.DB_NAME); this.rdbStore = null; console.log('数据库已删除'); } catch (error) { console.error('删除数据库失败'); throw n...
https://github.com/fuhhhhhhhh/openharmony
859540734bea008cb408eec6f06558e8fbfa748d
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/ComputerManager.ets
arkts
invalidateServerInfoCache
主动让某台电脑的 ServerInfo 缓存失效(例如配对/解配后状态可能改变时)
invalidateServerInfoCache(uuid: string): void { this.serverInfoCache.delete(uuid); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left invalidateServerInfoCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uuid AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AS...
invalidateServerInfoCache(uuid: string): void { this.serverInfoCache.delete(uuid); }
https://github.com/AlkaidLab/moonlight-harmony
200e6496657f865b7dff76008c8ad865c34bd5df
github
arkui-x/samples
CodeLab/Cases/feature/decompressfile/src/main/ets/view/MainPage.ets
arkts
getFileListData
获取解压后的文件列表
getFileListData(outFileDir: string) { // TODO:知识点:使用fs.listFile接口获取解压得到的沙箱目录下的所有文件名。 fs.listFile(outFileDir).then((fileNames: Array<string>) => { this.fileListData.clearData(); // 清空上一次获取的列表 for (let i = 0; i < fileNames.length; i++) { this.fileListData.pushData(new FileItem(fileNames[i], ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getFileListData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left outFileDir AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right...
getFileListData(outFileDir: string) { // TODO:知识点:使用fs.listFile接口获取解压得到的沙箱目录下的所有文件名。 fs.listFile(outFileDir).then((fileNames: Array<string>) => { this.fileListData.clearData(); // 清空上一次获取的列表 for (let i = 0; i < fileNames.length; i++) { this.fileListData.pushData(new FileItem(fileNames[i], ...
https://gitcode.com/arkui-x/samples
7d7c295b050ada1c1b236fa0682cdc39adca0d57
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrCodeGenerator.ets
arkts
placeTimingPatterns
Place timing patterns
placeTimingPatterns(): void { for (let i = 8; i < this.size - 8; i++) { if (!this.reserved[6][i]) { this.modules[6][i] = i % 2 === 0; this.reserved[6][i] = true; } if (!this.reserved[i][6]) { this.modules[i][6] = i % 2 === 0; this.reserved[i][6] = true; } ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left placeTimingPatterns AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen...
placeTimingPatterns(): void { for (let i = 8; i < this.size - 8; i++) { if (!this.reserved[6][i]) { this.modules[6][i] = i % 2 === 0; this.reserved[6][i] = true; } if (!this.reserved[i][6]) { this.modules[i][6] = i % 2 === 0; this.reserved[i][6] = true; } ...
https://github.com/AlkaidLab/moonlight-harmony
f8e4d1f4a98630cc858c9ed1e2dfaa0d24df5e59
github
XHXYT/Pixark
entry/src/main/ets/common/utils/ColorUtils.ets
arkts
getColorWithAlpha
获取指定透明度的颜色值 @returns number
public getColorWithAlpha(color: ResourceColor, alpha: number): number { const baseColor = this.getNormalColor(color); const clampedAlpha = Math.max(0, Math.min(255, alpha)); const rgb = baseColor & 0x00FFFFFF; return (clampedAlpha << 24) | rgb; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getColorWithAlpha AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public getColorWithAlpha(color: ResourceColor, alpha: number): number { const baseColor = this.getNormalColor(color); const clampedAlpha = Math.max(0, Math.min(255, alpha)); const rgb = baseColor & 0x00FFFFFF; return (clampedAlpha << 24) | rgb; }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/ColorUtils.ets#L22-L27
62ca576adae02d8537b16a4c1b97ab7d6c4ffaa5
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/MouseEmulationService.ets
arkts
convertStickToPixelMovement
摇杆值→像素移动量转换 对齐 Android: convertRawStickAxisToPixelMovement() normalize → ×4 → magnitude² 加速曲线
private convertStickToPixelMovement(stickX: number, stickY: number): StickMovement { // 归一化到 -1 ~ 1 let nx = stickX / 32766.0; let ny = stickY / 32766.0; // 基础倍率 nx *= 4; ny *= 4; const mag = Math.sqrt(nx * nx + ny * ny); if (mag > 0) { // 二次方加速:越推越快 const accel = mag * mag...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertStickToPixelMovement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stickX AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST...
private convertStickToPixelMovement(stickX: number, stickY: number): StickMovement { // 归一化到 -1 ~ 1 let nx = stickX / 32766.0; let ny = stickY / 32766.0; // 基础倍率 nx *= 4; ny *= 4; const mag = Math.sqrt(nx * nx + ny * ny); if (mag > 0) { // 二次方加速:越推越快 const accel = mag * mag...
https://github.com/AlkaidLab/moonlight-harmony
d2b7fcc4e654cde6d3cff6f5fee1445e0994997c
github
openharmony/applications_app_samples
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/pages/NewLogin.ets
arkts
receiveMessage
对接收的消息处理 @param data
receiveMessage(data: string): void { Logger.info(TAG, 'receiveMessage begin data ' + JSON.stringify(data)); if (data.split('&')[0] && data.split('&')[0] === 'invitationNumber') { AppStorage.setOrCreate('invitationNumber', data.split('&')[1]); return; } if (data == 'ok') { // router....
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left receiveMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) ...
receiveMessage(data: string): void { Logger.info(TAG, 'receiveMessage begin data ' + JSON.stringify(data)); if (data.split('&')[0] && data.split('&')[0] === 'invitationNumber') { AppStorage.setOrCreate('invitationNumber', data.split('&')[1]); return; } if (data == 'ok') { // router....
https://github.com/openharmony/applications_app_samples
5b6a34449d3b0d212dcb14c84c72e87d90a72f9d
github
HarmonyOS_Samples/MultiPictureBeautification
multipicturecommon/src/main/ets/utils/WindowUtil.ets
arkts
setWindowStage
Initialize window stage and get main window instance synchronously
setWindowStage(windowStage: window.WindowStage): void { this.windowStage = windowStage; try { this.mainWindow = this.windowStage.getMainWindowSync(); } catch (err) { Logger.error(LogConstants.LOG_TAG_WINDOW_UTIL, 'Failed to get main window. Cause: %{public}s', JSON.stringify(err)); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setWindowStage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left window AST#identifier#R...
setWindowStage(windowStage: window.WindowStage): void { this.windowStage = windowStage; try { this.mainWindow = this.windowStage.getMainWindowSync(); } catch (err) { Logger.error(LogConstants.LOG_TAG_WINDOW_UTIL, 'Failed to get main window. Cause: %{public}s', JSON.stringify(err)); ...
https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification
f26b0aad4e2757dc8a330fddcbdca03ee1676181
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/ModelCapabilityMatcher.ets
arkts
getCaseInsensitive
通过小写索引查找缓存条目(大小写不敏感回退)
private getCaseInsensitive(key: string): ModelsDevEntry | null { const originalId = this.lowerCaseIndex.get(key.toLowerCase()) if (originalId !== undefined) { const entry = this.cache.get(originalId) if (entry !== undefined) { return entry } } return null }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getCaseInsensitive 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#...
private getCaseInsensitive(key: string): ModelsDevEntry | null { const originalId = this.lowerCaseIndex.get(key.toLowerCase()) if (originalId !== undefined) { const entry = this.cache.get(originalId) if (entry !== undefined) { return entry } } return null }
https://github.com/LongLiveY96/chatcube
079d13b3fcede72145018d242dcf0c60b5210207
github
Countly/countly-sdk-hos
library/src/main/ets/internal/ServerConfig.ets
arkts
applyEventSegmentationFilter
Per-event segmentation filter. The config is a map of `eventName → set<segKey>`; an event with no entry in the map keeps all its segmentation.
public static applyEventSegmentationFilter(eventName: string, segmentation: SegmentationMap, sc: ServerConfig, logger: Logger): SegmentationMap { const fl: FilterList<Record<string, string[]>> = sc.eventSegmentationFilter; const keys: string[] = Object.keys(fl.filterList); if (keys.length === 0) return se...
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 applyEventSegmentationFilter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left eventName AST#identifier#Right AST#ERROR#...
public static applyEventSegmentationFilter(eventName: string, segmentation: SegmentationMap, sc: ServerConfig, logger: Logger): SegmentationMap { const fl: FilterList<Record<string, string[]>> = sc.eventSegmentationFilter; const keys: string[] = Object.keys(fl.filterList); if (keys.length === 0) return se...
https://github.com/Countly/countly-sdk-hos
e27191e925072904c9a41669a9187a35490275bf
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Byte.ets
arkts
shortValue
Returns value of this instance @returns value as short
public override shortValue(): short { return this.value as short; }
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 shortValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#...
public override shortValue(): short { return this.value as short; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
1b39ca2ec91697199170a6815f0f548df2be02a0
gitee
CPF-ApplicationTPC/imageknifepro
library/src/main/ets/ImageKnife.ets
arkts
setGlobalLoadEndCallback
设置全局的图片加载结束回调 回调在图片加载成功,失败,取消时执行 @param loadEnd 图片加载结束回调,入参提供各类图片加载的数据信息
setGlobalLoadEndCallback(loadEnd:( // 加载图片来源信息,包含网络图片url src:string, // 图片请求信息,区分主图,占位图,缩略图,错误图 requestType:string, // 图片加载是否成功 isSuccess:boolean, // 加载各阶段时间 timeInfo?:TimeInfo, // 失败错误码 errorCode?:string, // 错误信息 errorMessage?:string, // http 请求头信息 requestHeade...
AST#program#Left AST#ERROR#Left AST#identifier#Left setGlobalLoadEndCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left loadEnd AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#L...
setGlobalLoadEndCallback(loadEnd:( // 加载图片来源信息,包含网络图片url src:string, // 图片请求信息,区分主图,占位图,缩略图,错误图 requestType:string, // 图片加载是否成功 isSuccess:boolean, // 加载各阶段时间 timeInfo?:TimeInfo, // 失败错误码 errorCode?:string, // 错误信息 errorMessage?:string, // http 请求头信息 requestHeade...
https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/library/src/main/ets/ImageKnife.ets#L318-L336
77161dc2dbc06c9b57974677e97dae2adcb6b066
gitcode
openharmony/arkui_ace_engine
examples/BindSheet/entry/src/main/ets/pages/multiDeviceConversion/Index04.ets
arkts
calculateData
获取对应id的组件相对窗口左上角的属性
calculateData(id: string): AnimationInfo { let itemInfo: RectInfoInPx = ComponentAttrUtils.getRectInfoById(WindowUtils.window.getUIContext(), id); // 首先计算图片的宽高与窗口宽高的比例 let widthScaleRatio = itemInfo.width / WindowUtils.windowWidthPx; let heightScaleRatio = itemInfo.height / WindowUtils.windowHei...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST...
calculateData(id: string): AnimationInfo { let itemInfo: RectInfoInPx = ComponentAttrUtils.getRectInfoById(WindowUtils.window.getUIContext(), id); // 首先计算图片的宽高与窗口宽高的比例 let widthScaleRatio = itemInfo.width / WindowUtils.windowWidthPx; let heightScaleRatio = itemInfo.height / WindowUtils.windowHei...
https://gitee.com/openharmony/arkui_ace_engine.git
37bad39ca89e843403da07324db92ab115c7552a
gitee
aimilin6688/KeePassHO
entry/src/main/ets/storage/local/LocalFileStorage.ets
arkts
exists
检查文件是否存在 @param path 文件路径 @return Promise<boolean> 文件是否存在
public async exists(path: string): Promise<boolean> { try { // fixme 这里始终返回false ,不确定什么原因 let result = fs.accessSync(path, fs.AccessModeType.EXIST); hilog.info(DOMAIN, TAG, `Check file exist: ${result}, path: ${path}`); return true; } catch (error) { hilog.error(DOMAIN, TAG, `fil...
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 exists AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Righ...
public async exists(path: string): Promise<boolean> { try { // fixme 这里始终返回false ,不确定什么原因 let result = fs.accessSync(path, fs.AccessModeType.EXIST); hilog.info(DOMAIN, TAG, `Check file exist: ${result}, path: ${path}`); return true; } catch (error) { hilog.error(DOMAIN, TAG, `fil...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/local/LocalFileStorage.ets#L133-L143
64032851bbe9d4ca9763b9b3b33db2c4f67dde87
github
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/MedicalAgent.ets
arkts
buildPrompt
构建提示词 @param question 用户问题 @param knowledge 知识上下文 @param context 对话上下文 @returns 完整提示词
protected buildPrompt( question: string, knowledge: KnowledgeContext, context?: ConversationContext ): string { let prompt = this.getSystemPrompt(); // 添加知识参考 if (knowledge.content) { prompt += `\n\n【医学知识参考】\n${knowledge.content}`; } // 添加对话历史 if (context && context.messa...
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left buildPrompt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left question AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
protected buildPrompt( question: string, knowledge: KnowledgeContext, context?: ConversationContext ): string { let prompt = this.getSystemPrompt(); // 添加知识参考 if (knowledge.content) { prompt += `\n\n【医学知识参考】\n${knowledge.content}`; } // 添加对话历史 if (context && context.messa...
https://github.com/LJ666-ui/harmony-health-care
4554f2bb4cadea30aa07b09bf4bca7875d4ade32
github
arkui-x/samples
CodeLab/Cases/feature/customscan/src/main/ets/model/WindowModel.ets
arkts
getWindowRect
获取当前主窗口的尺寸 @returns
async getWindowRect(): Promise<window.Rect | undefined> { if (this.windowStage === undefined) { logger.error('windowStage is undefined.'); return; } if (!this.mainWindow) { this.mainWindow = await this.windowStage.getMainWindow(); } const mainWinProp = this.mainWindow.getWindow...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getWindowRect AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left A...
async getWindowRect(): Promise<window.Rect | undefined> { if (this.windowStage === undefined) { logger.error('windowStage is undefined.'); return; } if (!this.mainWindow) { this.mainWindow = await this.windowStage.getMainWindow(); } const mainWinProp = this.mainWindow.getWindow...
https://gitcode.com/arkui-x/samples
ef61bbe4f6709e675ebcd3649496509d42a4ba29
gitcode
apap6628114/nga_oh
entry/src/main/ets/store/NotificationStore.ets
arkts
refreshUnreadCount
============== Refresh ==============
async refreshUnreadCount(): Promise<void> { if (!this.auth.isAuthenticated) return const now: number = Date.now() if (now - this.lastNotiQueryTime < NotificationStore.NOTI_QUERY_DELAY) return this.lastNotiQueryTime = now try { const result = await getNotifications(this.auth.token) if (...
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left refreshUnreadCount AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#...
async refreshUnreadCount(): Promise<void> { if (!this.auth.isAuthenticated) return const now: number = Date.now() if (now - this.lastNotiQueryTime < NotificationStore.NOTI_QUERY_DELAY) return this.lastNotiQueryTime = now try { const result = await getNotifications(this.auth.token) if (...
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/NotificationStore.ets#L36-L56
24f1e366922471de7b438aec588f463a1c18a483
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
setOnChartGestureListener
Sets a gesture-listener for the chart for custom callbacks when executing gestures on the chart surface. @param l
public setOnChartGestureListener(l: OnChartGestureListener): void { this.mGestureListener = l; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setOnChartGestureListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left l AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
public setOnChartGestureListener(l: OnChartGestureListener): void { this.mGestureListener = l; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1a4826dae3cd94c2b3edd2b86798bf60bee8a1e3
gitee
openharmony/applications_mms
entry/src/main/ets/pages/conversationlist/conversationListController.ets
arkts
jumpToGroupDetail
Go to the multi-faceted portrait list page.
jumpToGroupDetail(threadId, contactsNum) { let actionData = { uri: 'pages/group_detail/group_detail', params: { threadId: threadId, contactsNum: contactsNum } }; this.isJumping = false; router.push(actionData); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left jumpToGroupDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left threadId AST#identifier#Right AST#,#Left , AST#,#Right AST#identifier#Left contactsNum AST#identifier#Right AST#)#Left ) AST#...
jumpToGroupDetail(threadId, contactsNum) { let actionData = { uri: 'pages/group_detail/group_detail', params: { threadId: threadId, contactsNum: contactsNum } }; this.isJumping = false; router.push(actionData); }
https://gitee.com/openharmony/applications_mms.git
7d854dc6bafdd0c53e6d8c5553c687b55da4801c
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
toReversed
Creates a reversed copy @returns { BigUint64Array } - a reversed copy @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toReversed(): BigUint64Array { let newArray = new BigUint64Array(this.lengthInt) if (this.lengthInt > 0) { BigUint64Array.reverseCopyBuffer(newArray.buffer, this.buffer, this.byteOffset, this.lengthInt); } return newArray }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toReversed 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 BigUint64Ar...
public toReversed(): BigUint64Array { let newArray = new BigUint64Array(this.lengthInt) if (this.lengthInt > 0) { BigUint64Array.reverseCopyBuffer(newArray.buffer, this.buffer, this.byteOffset, this.lengthInt); } return newArray }
https://gitcode.com/iop123123/arkts-static-skills
77299e82084b354780ef633111e2fa4c3cc87afc
gitcode
openharmony-sig/fluttertpc_flutter_qr_reader
ohos/src/main/ets/me/hetian/flutter_qr_reader/components/viewmodel/CustomScanViewModel.ets
arkts
setCameraTorch
设置相机闪关灯默认状态 @param torchEnabled @returns {void}
setCameraTorch(torchEnabled: boolean): void { this.torchEnabled = torchEnabled; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCameraTorch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left torchEnabled AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#)#Left...
setCameraTorch(torchEnabled: boolean): void { this.torchEnabled = torchEnabled; }
https://gitee.com/openharmony-sig/fluttertpc_flutter_qr_reader.git
0b8e452e3be5d752042c6944c1adc1eda11d2726
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/WebDAVService.ets
arkts
joinPath
拼接完整远端 URL
private joinPath(serverUrl: string, remoteDir: string, fileName: string): string { let server = serverUrl.trim() while (server.endsWith('/')) { server = server.substring(0, server.length - 1) } let dir = remoteDir.trim() while (dir.startsWith('/')) { dir = dir.substring(1) } wh...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left joinPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left serverUrl AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#R...
private joinPath(serverUrl: string, remoteDir: string, fileName: string): string { let server = serverUrl.trim() while (server.endsWith('/')) { server = server.substring(0, server.length - 1) } let dir = remoteDir.trim() while (dir.startsWith('/')) { dir = dir.substring(1) } wh...
https://github.com/LongLiveY96/chatcube
f3b7ac01f438a8308021963edfb04223e9e1adc7
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/DeviceSensorService.ets
arkts
isActive
检查是否有传感器正在活跃
isActive(): boolean { return this.gyroEnabled || this.accelEnabled; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isActive 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#statement_...
isActive(): boolean { return this.gyroEnabled || this.accelEnabled; }
https://github.com/AlkaidLab/moonlight-harmony
bca68764de99bd0f5fe6abcf6f7714b5d2272780
github
AGenUI/AGenUI
platforms/harmony/agenui/src/main/ets/agenui/AGenEngineUI.ets
arkts
setMinLogLevel
Set the minimum log level. Messages below this threshold are filtered out on both the ArkTS side and the C++ engine side (via IRuntimeLogger::getMinLevel(), which is checked by the LOG_LEVEL macro before any vsnprintf), so filtered levels skip variadic formatting entirely. @param level One of AGenUILogger.LEVEL_DEBUG(0...
static setMinLogLevel(level: number): void { AGenUILogger.getInstance().setMinLogLevel(level); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setMinLogLevel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
static setMinLogLevel(level: number): void { AGenUILogger.getInstance().setMinLogLevel(level); }
https://github.com/AGenUI/AGenUI
65bfe353c6e7967d497caef60ab63ad9b5a45319
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryCache.ets
arkts
getStatistics
获取缓存统计信息 @returns 缓存统计
getStatistics(): CacheStatistics { const total = this.hits + this.misses const hitRate = total > 0 ? this.hits / total : 0 return { hits: this.hits, misses: this.misses, size: this.cache.size, hitRate: hitRate } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStatistics 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 CacheStatistics AST#identifier#Right AST#ERROR#R...
getStatistics(): CacheStatistics { const total = this.hits + this.misses const hitRate = total > 0 ? this.hits / total : 0 return { hits: this.hits, misses: this.misses, size: this.cache.size, hitRate: hitRate } }
https://github.com/offlinecat-dev/OCNetORM
310365e6d21439ce7835023e40ecaa92873c3999
github
openharmony-sig/ohos_danmaku_flame_master
library/src/main/ets/components/common/master/flame/danmaku/danmaku/model/ohos/DanmakuContext.ets
arkts
getL2RDanmakuVisibility
@return �Ƿ���ʾ���ҹ�����Ļ
public getL2RDanmakuVisibility(): boolean { return this.L2RDanmakuVisibility; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getL2RDanmakuVisibility AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left b...
public getL2RDanmakuVisibility(): boolean { return this.L2RDanmakuVisibility; }
https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git
366c57379ae5dbc81162c632ef3222b658562ffc
gitee
openharmony-sig/jtar
library/src/main/ets/ohos_tar.ets
arkts
addTarPath
添加一个需要tar的文件或目录
public addTarPath(path: string) { if (this.tarPaths.indexOf(path) == -1 ) { this.tarPaths.push(path); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addTarPath 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 strin...
public addTarPath(path: string) { if (this.tarPaths.indexOf(path) == -1 ) { this.tarPaths.push(path); } }
https://gitee.com/openharmony-sig/jtar.git
88049e754b22e3e10aca508c551c2e3166008851
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/NativeModuleManager.ets
arkts
getLoadedModules
获取已加载的模块列表
public getLoadedModules(): string[] { return Array.from(this.nativeModules.keys()); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLoadedModules 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 strin...
public getLoadedModules(): string[] { return Array.from(this.nativeModules.keys()); }
https://github.com/DaLongZhuaZi/manxia
c0514ac23026802adade1b5c29d72d5065f0376e
github
erosTeam/NextE
feature/gallery/src/main/ets/viewmodel/AllThumbnailsViewModel.ets
arkts
loadNext
Load the next preview page next to the current sparse anchor.
async loadNext(): Promise<void> { if (this.loading || !this.hasMore() || this.gid.length === 0) { return } this.loading = true this.error = '' try { const nextPage: number = this.nextForwardPreviewPage() if (nextPage < 0) { this.loading = false return } ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadNext AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#...
async loadNext(): Promise<void> { if (this.loading || !this.hasMore() || this.gid.length === 0) { return } this.loading = true this.error = '' try { const nextPage: number = this.nextForwardPreviewPage() if (nextPage < 0) { this.loading = false return } ...
https://github.com/erosTeam/NextE
3678ee7226229e94bb418592c0acbc679c1052dc
github
apap6628114/nga_oh
entry/src/main/ets/store/settings/domain/FilterKeywordSettings.ets
arkts
load
从持久化对象加载关键词列表(回填 FilterListManager)
load(saved: SettingsState): void { if (saved.filterKeywords) { this.ctx.state.filterKeywords = saved.filterKeywords this.manager.init(saved.filterKeywords) } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left saved AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left SettingsState AST#identifier#Right AST#)#Left ) AS...
load(saved: SettingsState): void { if (saved.filterKeywords) { this.ctx.state.filterKeywords = saved.filterKeywords this.manager.init(saved.filterKeywords) } }
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/settings/domain/FilterKeywordSettings.ets#L62-L67
0c00cbf557155e7bdcc038c9155970f7f15fd081
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/08.reference_types/12.nullish_types/nullable_primitive_types.ets
arkts
main
--- desc: null in primitive type {{t}} params: {{t}} tags: [negative, compile-only] ---
function main(): void { let x: {{t}} = null;
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { let x: {{t}} = null;
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
b9f5dbf0f245e037e786a9792606d3f52c01a71e
gitee
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterManager.ets
arkts
createFlutterView
It's suggested to keep 'oh_flutter_' as the prefix for xcomponent_id. Otherwise it might affect the performance.
createFlutterView(context: Context): FlutterView { let flutterView = new FlutterView(`oh_flutter_${this.flutterViewIndex++}`, context); this.putFlutterView(flutterView.getId(), flutterView); return flutterView; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createFlutterView 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#Left Context AST#identifier#Right AST#)#...
createFlutterView(context: Context): FlutterView { let flutterView = new FlutterView(`oh_flutter_${this.flutterViewIndex++}`, context); this.putFlutterView(flutterView.getId(), flutterView); return flutterView; }
https://gitee.com/openharmony-sig/flutter_engine.git
dd8081cea8f4a9473a8c362546bef824e9bca59d
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/MoonBridge.ets
arkts
startConnectionAsync
异步开始连接
startConnectionAsync(config: StreamConfiguration): Promise<number> { return nativeLib.startConnectionAsync( config.address, config.appVersion, config.gfeVersion || '', config.rtspSessionUrl || '', config.serverCodecModeSupport, config.width, config.height, config.fp...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left startConnectionAsync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right ...
startConnectionAsync(config: StreamConfiguration): Promise<number> { return nativeLib.startConnectionAsync( config.address, config.appVersion, config.gfeVersion || '', config.rtspSessionUrl || '', config.serverCodecModeSupport, config.width, config.height, config.fp...
https://github.com/AlkaidLab/moonlight-harmony
937fc3c4091f2922ddfba324a11bf44af395d9b2
github
terryma2024/happyword
harmonyos/entry/src/main/ets/services/TodayAdventureBuilder.ets
arkts
hashSeed
djb2 string hash truncated to a non-negative 32-bit integer. We intentionally avoid this.rng so word-plan shuffling stays on its own RNG path; boss rotation only depends on regionId + dayKey.
private hashSeed(s: string): number { let h: number = 5381; for (let i: number = 0; i < s.length; i++) { h = ((h << 5) - h) + s.charCodeAt(i); h = h | 0; } return h < 0 ? -h : h; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left hashSeed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left s AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ...
private hashSeed(s: string): number { let h: number = 5381; for (let i: number = 0; i < s.length; i++) { h = ((h << 5) - h) + s.charCodeAt(i); h = h | 0; } return h < 0 ? -h : h; }
https://github.com/terryma2024/happyword
884cf5a10bbf810917b764f371b49729d8dc4581
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/VideoInfoUtil.ets
arkts
videoWidthAndHeightFormat
获取视频标签格式化
static videoWidthAndHeightFormat(size: string, forceDefault: boolean = false) { const sizeArray = size.split(',') const width = sizeArray[0] const height = sizeArray[1] const sizeKey = `${width}x${height}` // 如果 forceDefault 为真,则直接返回默认格式 if (forceDefault) { return `${width} x ${height}`...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left videoWidthAndHeightFormat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left size AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi...
static videoWidthAndHeightFormat(size: string, forceDefault: boolean = false) { const sizeArray = size.split(',') const width = sizeArray[0] const height = sizeArray[1] const sizeKey = `${width}x${height}` // 如果 forceDefault 为真,则直接返回默认格式 if (forceDefault) { return `${width} x ${height}`...
https://github.com/Yebingiscn/SweetVideo
8596f0692dd52d57ec62408c8590786959e23e13
github
openharmony-sig/ohos_byte_global_viewpool
byte_global_viewpool/src/main/ets/ViewPoolManager.ets
arkts
preCreateBuilderOnIdleFrameNoContext
@description 通过UIContext的OnIdle时机预创建组件节点,下次使用快速复用。 @param builder 组件全局创建Builder入口 @param data 这个需要重点关注,需要构建一个空的ViewModel对象,否则会崩溃 @param type 复用的类型 @param timeout onIdle剩余时间阈值,大于这个阈值才会预创建 @param isMeasure 是否主动调用framnode.measure,默认为false。主要为lynx卡片预创建使用 @returns {boolean} 如果内部UIConext为空,返回false。正常执行返回true
preCreateBuilderOnIdleFrameNoContext(builder: WrappedBuilder<ESObject>, data: ESObject, type: string, timeout: number, isMeasure: boolean = false): boolean { if (!this.isEnable) return false if (this.uiContext) { // 需要通过setUIContext提前设置 ScheduleService.postFrameOnIdleCallback(this.uiContext, ()=> { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left preCreateBuilderOnIdleFrameNoContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left builder AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AS...
preCreateBuilderOnIdleFrameNoContext(builder: WrappedBuilder<ESObject>, data: ESObject, type: string, timeout: number, isMeasure: boolean = false): boolean { if (!this.isEnable) return false if (this.uiContext) { // 需要通过setUIContext提前设置 ScheduleService.postFrameOnIdleCallback(this.uiContext, ()=> { ...
https://gitee.com/openharmony-sig/ohos_byte_global_viewpool.git
50d6f37c1726cf60086bc28fdb756f50d6e39f5f
gitee
offlinecat-dev/OCNetORM
src/main/ets/mapping/EntityData.ets
arkts
inferPropertyTypeFromColumn
根据列类型推断属性类型 @param columnType 列类型 @returns 属性类型标识
private static inferPropertyTypeFromColumn(columnType: ColumnType): string { switch (columnType) { case ColumnType.TEXT: return 'string' case ColumnType.INTEGER: return 'number' case ColumnType.REAL: return 'number' case ColumnType.BLOB: return 'object' ...
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 inferPropertyTypeFromColumn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left columnType AST#identifie...
private static inferPropertyTypeFromColumn(columnType: ColumnType): string { switch (columnType) { case ColumnType.TEXT: return 'string' case ColumnType.INTEGER: return 'number' case ColumnType.REAL: return 'number' case ColumnType.BLOB: return 'object' ...
https://github.com/offlinecat-dev/OCNetORM
9434aae66bcfa9c4a235096611c605dba027ab43
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/services/network/HttpClient.ets
arkts
deleteForm
DELETE 表单并返回文本响应
async deleteForm( path: string, form: Record<string, Object>, extraHeaders: Record<string, string> | null = null, readTimeoutMs: number = 60000, connectTimeoutMs: number | null = null, guardOptions: CfGuardOptions | null = null ): Promise<string> { await this.cookieStore.init(); cons...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteForm AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
async deleteForm( path: string, form: Record<string, Object>, extraHeaders: Record<string, string> | null = null, readTimeoutMs: number = 60000, connectTimeoutMs: number | null = null, guardOptions: CfGuardOptions | null = null ): Promise<string> { await this.cookieStore.init(); cons...
https://github.com/Amaz1ny/HarmonyDO-public
80b5f78493d4b502e5530b3a8e3b28cebc2b07f3
github
richshaw2015/nds
ohos/entry/src/main/ets/types/MelonDSNative.ets
arkts
sendTouchEvent
发送触摸事件 @param x 触摸 X 坐标 @param y 触摸 Y 坐标 @param action 触摸动作
static sendTouchEvent(x: number, y: number, action: TouchAction): void { MelonDSNative.native.sendTouchEvent(x, y, action); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left sendTouchEvent 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 numb...
static sendTouchEvent(x: number, y: number, action: TouchAction): void { MelonDSNative.native.sendTouchEvent(x, y, action); }
https://github.com/richshaw2015/nds
3a3c1d5a37ea65b55fe82f0a44c22d8f19721cc0
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test24_original_index.ets
arkts
testNumberParse
--- Number parsing and formatting ---
function testNumberParse(): string { let intStr: string = '42'; let floatStr: string = '3.14'; let intVal: number = parseInt(intStr, 10); let floatVal: number = parseFloat(floatStr); let back: string = intVal.toFixed(0) + ',' + floatVal.toFixed(2); return back; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testNumberParse AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_...
function testNumberParse(): string { let intStr: string = '42'; let floatStr: string = '3.14'; let intVal: number = parseInt(intStr, 10); let floatVal: number = parseFloat(floatStr); let back: string = intVal.toFixed(0) + ',' + floatVal.toFixed(2); return back; }
https://github.com/miaochiahao/ark-ghidra
b242d6a420b0aae0995e1dd38d6502bab7615713
github
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/util/PreferenceUtil.ets
arkts
deleteValue
删除首选项 @param key 键 @returns Promise<void>
public async deleteValue(key: string): Promise<void> { if (this.preferences) { this.preferences.delete(key) .catch(() => { Logger.error(TAG, `删除首选项失败`) }).then(() => { this.saveValue() }) } else { this.initPreference(PREFERENCES_NAME).then(() => { th...
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 deleteValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#...
public async deleteValue(key: string): Promise<void> { if (this.preferences) { this.preferences.delete(key) .catch(() => { Logger.error(TAG, `删除首选项失败`) }).then(() => { this.saveValue() }) } else { this.initPreference(PREFERENCES_NAME).then(() => { th...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
2849ba60a90512ba6db3a78ba5c5a136cbddeb64
gitcode
codelably/tuniao-ui
core/tuniaoui/src/main/ets/components/water-fall/TnWaterFallTypes.ets
arkts
pushData
追加单条数据 @param item 数据项
pushData(item: Object): void { this.dataArray.push(item); this.notifyDataAdd(this.dataArray.length - 1); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left pushData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Object AST#identifier#Right AST#)#Left ) AST#)#...
pushData(item: Object): void { this.dataArray.push(item); this.notifyDataAdd(this.dataArray.length - 1); }
https://github.com/codelably/tuniao-ui
7287ceb82d99f14580feb76a0edd407cd002bac4
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/LimitLine.ets
arkts
isDashedLineEnabled
Returns true if the dashed-line effect is enabled, false if not. Default: disabled @return
public isDashedLineEnabled(): boolean { return this.mDashPathEffect == null ? false : true; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDashedLineEnabled 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 boole...
public isDashedLineEnabled(): boolean { return this.mDashPathEffect == null ? false : true; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
2ab7749b8a3439c68a8fca11cb9a44d352265018
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
downloadFile
下载单个文件(使用系统下载API,仅支持应用私有目录)
private async downloadFile(url: string, filePath: string): Promise<void> { if (!this.context) { throw new Error('应用上下文未设置'); } try { const downloadConfig: request.DownloadConfig = { url: url, filePath: filePath, enableMetered: true, enableRoaming: true };...
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 downloadFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AS...
private async downloadFile(url: string, filePath: string): Promise<void> { if (!this.context) { throw new Error('应用上下文未设置'); } try { const downloadConfig: request.DownloadConfig = { url: url, filePath: filePath, enableMetered: true, enableRoaming: true };...
https://github.com/DaLongZhuaZi/manxia
074990fce9c00565314aaa3b9736864e839b56ea
github
openharmony-sig/flutter_sqflite
sqflite/ohos/src/main/ets/io/flutter/plugins/sqflite/SqflitePlugin.ets
arkts
handleUpdateCall
/更新(包括删除)数据
async handleUpdateCall(call: MethodCall, result: MethodResult): Promise<void> { let rdbStore = DatabaseHelper.getDatabaseOrError(call, result); if (rdbStore == null) { return; } let operation: MethodCallOperation = new MethodCallOperation(call, result); Database.update(operation, rdbStore);...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left handleUpdateCall AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left call AST#identifier#Right AST#type_annotation#Left AS...
async handleUpdateCall(call: MethodCall, result: MethodResult): Promise<void> { let rdbStore = DatabaseHelper.getDatabaseOrError(call, result); if (rdbStore == null) { return; } let operation: MethodCallOperation = new MethodCallOperation(call, result); Database.update(operation, rdbStore);...
https://gitee.com/openharmony-sig/flutter_sqflite.git
ec8a584c4a888b89a1868fbbaf9555675e486094
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LightWeightMap.ets
arkts
hasAll
Checks if all entries from another LightWeightMap are present in this LightWeightMap @param map the LightWeightMap to check entries from @returns true if all entries are present, false otherwise
hasAll(map: LightWeightMap<K, V>): boolean { if (map.length > this.buckets.actualLength) { return false; } for (let index: int = 0; index < map.length; index++) { const key = map.getKeyAt(index)!; if (!this.hasKey(key)) { return false; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left LightWeightMap A...
hasAll(map: LightWeightMap<K, V>): boolean { if (map.length > this.buckets.actualLength) { return false; } for (let index: int = 0; index < map.length; index++) { const key = map.getKeyAt(index)!; if (!this.hasKey(key)) { return false; ...
https://gitcode.com/iop123123/arkts-static-skills
9d05e3702e6e324c3c062145d5845dba7bb28638
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/MouseEmulationService.ets
arkts
start
==================== 内部实现 ====================
private start(): void { this.active = true; this.lastButtons = 0; this.leftStickX = 0; this.leftStickY = 0; this.rightStickX = 0; this.rightStickY = 0; // 启动定时器,每 50ms 轮询摇杆值发送鼠标移动 this.timerId = setInterval(() => { this.tick(); }, MOUSE_EMULATION_REPORT_PERIOD); console...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left start 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#:#Ri...
private start(): void { this.active = true; this.lastButtons = 0; this.leftStickX = 0; this.leftStickY = 0; this.rightStickX = 0; this.rightStickY = 0; // 启动定时器,每 50ms 轮询摇杆值发送鼠标移动 this.timerId = setInterval(() => { this.tick(); }, MOUSE_EMULATION_REPORT_PERIOD); console...
https://github.com/AlkaidLab/moonlight-harmony
949d352c84b0277e671ba7ab389e2692c8254e6f
github
LJ666-ui/harmony-health-care
entry/src/main/ets/core/DataCollector.ets
arkts
startCollection
启动数据采集
public startCollection(interval?: number): void { if (this.isCollecting) { console.log('DataCollector: Already collecting'); return; } if (interval) { this.collectionInterval = interval; } this.isCollecting = true; this.timerId = setInterval(() => { this.collectAllDev...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startCollection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left interval AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#num...
public startCollection(interval?: number): void { if (this.isCollecting) { console.log('DataCollector: Already collecting'); return; } if (interval) { this.collectionInterval = interval; } this.isCollecting = true; this.timerId = setInterval(() => { this.collectAllDev...
https://github.com/LJ666-ui/harmony-health-care
5ded545fbab9526732731d79953b9f1b27b09726
github
honjow/Next2V
shared/src/main/ets/components/StickerPickerPanel.ets
arkts
aboutToAppear
The recent tray is a SNAPSHOT taken once per open (here), not live: a pick records into the holder but the open grid does NOT reshuffle under the user's finger — the next open reflects it. (The panel is conditionally mounted, so aboutToAppear runs on every open and re-reads the latest recent list.)
aboutToAppear(): void { const list: GridEntry[] = [] const separators: number[] = [] this.effectiveGroups().forEach((group: StickerGroup) => { // Separator only BETWEEN two non-empty groups: it needs preceding cells (list.length > 0) and at least // one cell of its own to follow (group.sticker...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { const list: GridEntry[] = [] const separators: number[] = [] this.effectiveGroups().forEach((group: StickerGroup) => { // Separator only BETWEEN two non-empty groups: it needs preceding cells (list.length > 0) and at least // one cell of its own to follow (group.sticker...
https://github.com/honjow/Next2V
159a6965f7c47ca186b746a8f4bc4e17c5255c99
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/models/Notification.ets
arkts
title
获取通知标题
get title(): string { const displayName: string = this.data.displayUsername !== null ? this.data.displayUsername : (this.data.originalUsername !== null ? this.data.originalUsername : (this.data.username !== null ? this.data.username : '')); if (this.notificationTypeId === Notifica...
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left title AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#E...
get title(): string { const displayName: string = this.data.displayUsername !== null ? this.data.displayUsername : (this.data.originalUsername !== null ? this.data.originalUsername : (this.data.username !== null ? this.data.username : '')); if (this.notificationTypeId === Notifica...
https://github.com/Amaz1ny/HarmonyDO-public
1162cc0c5bce1579270e5dee74578f0431fa136d
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/Builder.ets
arkts
setArrowPositionCenter
设置箭头是否居中,气泡弹窗有效 @param isArrowPositionCenter @returns
setArrowPositionCenter(isArrowPositionCenter: boolean): Builder { this.popupConfig.isArrowPositionCenter = isArrowPositionCenter return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setArrowPositionCenter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isArrowPositionCenter AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR...
setArrowPositionCenter(isArrowPositionCenter: boolean): Builder { this.popupConfig.isArrowPositionCenter = isArrowPositionCenter return this }
https://github.com/wuba/omni-ui
ff7c07bffb1ca9adcf54d42ba3301879e296c56c
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrShareService.ets
arkts
toCompact
============================================================================= 紧凑序列化 / 反序列化 (v2 JSON 格式) ============================================================================= 将 CustomKeyDef 转为 v2 紧凑格式
function toCompact(key: CustomKeyDef): CompactKeyV2 { const ck: CompactKeyV2 = { l: key.label, a: encodeAction(key.action), s: key.shape === 'circle' ? 'c' : (key.shape === 'hexagon' ? 'h' : 'r'), b: key.behavior === 'toggle' ? 't' : 'm', x: Math.round(key.xPercent * 1000) / 1000, y: Math.roun...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left toCompact AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left key AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right A...
function toCompact(key: CustomKeyDef): CompactKeyV2 { const ck: CompactKeyV2 = { l: key.label, a: encodeAction(key.action), s: key.shape === 'circle' ? 'c' : (key.shape === 'hexagon' ? 'h' : 'r'), b: key.behavior === 'toggle' ? 't' : 'm', x: Math.round(key.xPercent * 1000) / 1000, y: Math.roun...
https://github.com/AlkaidLab/moonlight-harmony
c17937911e0a0ccab0d1891e683a91394459f274
github
arkui-x/samples
CodeLab/Cases/feature/customcalendarpickerdialog/src/main/ets/view/CustomCalendarPickerDialog.ets
arkts
readyToClose
底部导航栏高度
readyToClose() { setTimeout(() => { this.controller.close(); }, TRANSITION_DURATION) animateTo({ duration: TRANSITION_DURATION, }, () => { this.customY = 800; }) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left readyToClose 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 ...
readyToClose() { setTimeout(() => { this.controller.close(); }, TRANSITION_DURATION) animateTo({ duration: TRANSITION_DURATION, }, () => { this.customY = 800; }) }
https://gitcode.com/arkui-x/samples
f83ba361d5c0b7c243dd054810871402ac49385e
gitcode
HarmonyOS_Samples/MultiPictureBeautification
multipicturecommon/src/main/ets/utils/WindowUtil.ets
arkts
release
Release all registered listeners when component is destroyed
release(): void { if (!this.mainWindow) { return; } try { this.mainWindow.off('windowStatusChange'); this.mainWindow.off('windowSizeChange'); this.mainWindow.off('avoidAreaChange'); this.mainWindow.off('windowTitleButtonRectChange'); this.mainWindow.off('freeWindowModeC...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left release AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left...
release(): void { if (!this.mainWindow) { return; } try { this.mainWindow.off('windowStatusChange'); this.mainWindow.off('windowSizeChange'); this.mainWindow.off('avoidAreaChange'); this.mainWindow.off('windowTitleButtonRectChange'); this.mainWindow.off('freeWindowModeC...
https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification
f8844089e2c2061697c8b4a0a5dc4d2c303e2fde
gitcode
AGenUI/AGenUI
platforms/harmony/agenui/src/main/ets/agenui/AGenEngineUI.ets
arkts
triggerAction
Dispatches a UI action to report user interaction with the component. @param componentId Component ID @param context Context payload
triggerAction(componentId: string, context: object): void { const contextJson = JSON.stringify(context); this.surfaceManager?.triggerAction(this.surfaceId, componentId, contextJson); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left triggerAction AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left componentId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AS...
triggerAction(componentId: string, context: object): void { const contextJson = JSON.stringify(context); this.surfaceManager?.triggerAction(this.surfaceId, componentId, contextJson); }
https://github.com/AGenUI/AGenUI
b39d9181d7fc2e613e2e9819e29d83dbb2d3fad9
github
JackJiang2011/harmonychat
entry/src/main/ets/pages/utils/ToolKits.ets
arkts
exitSystem
#ffffff'; 退出系统。 @param context UIAbilityContext上下文对象
static exitSystem(context: common.UIAbilityContext) { // let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; context.terminateSelf(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left exitSystem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#...
static exitSystem(context: common.UIAbilityContext) { // let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; context.terminateSelf(); }
https://github.com/JackJiang2011/harmonychat
28a9c4596ed44816f0cd2481e6361d9c4c005c46
github
Explore-In-HMOS-Wearable/how-to-use-uiability-lifecycle
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onCreate
Called when the ability is first created
onCreate(): void { hilog.info(0x0000, 'EntryAbility', 'onCreate called'); LifeCycleLog.add('🔵 onCreate: Ability created.'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onCreate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Lef...
onCreate(): void { hilog.info(0x0000, 'EntryAbility', 'onCreate called'); LifeCycleLog.add('🔵 onCreate: Ability created.'); }
https://github.com/Explore-In-HMOS-Wearable/how-to-use-uiability-lifecycle
3099689cdd566b319fdfdfb01659d0afbfb054b7
github
HarmonyOS_Samples/BestPracticeSnippets
DealStrideSolution/entry/src/main/ets/utils/CameraServiceOne.ets
arkts
cameraInputOpenFn
Turn on the camera
async cameraInputOpenFn(cameraInput: camera.CameraInput): Promise<boolean> { let isOpenSuccess: boolean = false; try { await cameraInput.open(); isOpenSuccess = true; Logger.info(TAG, 'cameraInput open success'); } catch (error) { Logger.error(TAG, `createCameraInput failed : ${JSO...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left cameraInputOpenFn AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cameraInput AST#identifier#Right AST#type_annotation...
async cameraInputOpenFn(cameraInput: camera.CameraInput): Promise<boolean> { let isOpenSuccess: boolean = false; try { await cameraInput.open(); isOpenSuccess = true; Logger.info(TAG, 'cameraInput open success'); } catch (error) { Logger.error(TAG, `createCameraInput failed : ${JSO...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
10db45b88854d598e37a2293fb66cae93af10478
gitcode
PollenWang6/HiXD
entry/src/main/ets/services/AttendanceService.ets
arkts
buildUrl
拼接查询参数到 URL
function buildUrl(base: string, params: Record<string, string>): string { const pairs: string[] = []; const keys: string[] = Object.keys(params); for (let i = 0; i < keys.length; i++) { const k: string = keys[i]; const v: string = params[k]; pairs.push(encodeURIComponent(k) + '=' + encodeURIComponent(...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left buildUrl AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left base AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right A...
function buildUrl(base: string, params: Record<string, string>): string { const pairs: string[] = []; const keys: string[] = Object.keys(params); for (let i = 0; i < keys.length; i++) { const k: string = keys[i]; const v: string = params[k]; pairs.push(encodeURIComponent(k) + '=' + encodeURIComponent(...
https://github.com/PollenWang6/HiXD
accf10ce3825533069eb70a6da94890b420a481a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets
arkts
setPriority
Set the priority of the worker @param { WorkerPriority } priority The new priority value for the worker
public setPriority(priority: WorkerPriority): void { if (this.loopStarted.get()) { this.worker.setPriority(priority); } this.priority = priority; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setPriority AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left priority AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
public setPriority(priority: WorkerPriority): void { if (this.loopStarted.get()) { this.worker.setPriority(priority); } this.priority = priority; }
https://gitcode.com/iop123123/arkts-static-skills
c1cc69498c1e6ac3e09928100db710c5aebde5f6
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/String.ets
arkts
split
Splits this String by pattern and returns ordered array of substrings. The order of the resulted array corresponds to the order of the passage of this String from beginning to end. The pattern is excluded from substrings. @param pattern String to split by @throws NullPointerException if pattern param is null @returns s...
public split(pattern: String): String[] { return this.split(pattern, -1); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left split AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left patter...
public split(pattern: String): String[] { return this.split(pattern, -1); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
d21d3efea5ee4a17ff286910a6a7e43f51ec074a
gitee
OHPG/FinMusic
entry/src/main/ets/player/AppPlaybackManager.ets
arkts
playItems
─── 播放列表入口 ────────────────────────────────────────────────────────── 播放全部 @param items 播放列表 @param startId 起始播放项 ID @returns true=播放成功,false=播放器未初始化
public playItems(items: Array<BaseItemDto>, startId: string): boolean { console.info("FinMusic: playItems startId=" + startId + ", items=" + items.length) let args: PlayArgs = { items: items, startId: startId } let result = this.playAll(args) console.info("FinMusic: playItems result=" + result) if...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left playItems AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left items AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_express...
public playItems(items: Array<BaseItemDto>, startId: string): boolean { console.info("FinMusic: playItems startId=" + startId + ", items=" + items.length) let args: PlayArgs = { items: items, startId: startId } let result = this.playAll(args) console.info("FinMusic: playItems result=" + result) if...
https://github.com/OHPG/FinMusic
1301edcadc2419f8a1c5e95be8058ae25c1ec6d6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/ComicConverter.ets
arkts
saveReadingSettings
保存漫画的阅读设置到数据库 @param comicId 漫画ID @param settings 阅读设置 @param userId 用户ID
public static async saveReadingSettings(comicId: string, settings: ReadingSettings, userId: string = 'default_user'): Promise<void> { const saveKey = `${comicId}|${userId}|reading_settings`; let state = ComicConverter.readingSettingsSaveStates.get(saveKey); if (!state) { state = { latestSett...
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 saveReadingSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#i...
public static async saveReadingSettings(comicId: string, settings: ReadingSettings, userId: string = 'default_user'): Promise<void> { const saveKey = `${comicId}|${userId}|reading_settings`; let state = ComicConverter.readingSettingsSaveStates.get(saveKey); if (!state) { state = { latestSett...
https://github.com/DaLongZhuaZi/manxia
b31dd1ae10085f8a1a2060fe6338b416db09ac56
github
the-wwyang/kids-learning-app
src/main/ets/services/AchievementService.ets
arkts
createAchievement
创建成就数据对象 @param config 成就配置 @param currentProgress 当前进度 @param isUnlocked 是否已解锁 @param unlockedAt 解锁时间 @returns 成就数据对象
static createAchievement( config: AchievementConfig, currentProgress: number = 0, isUnlocked: boolean = false, unlockedAt?: string ): Achievement { return { id: config.id, type: config.type, name: config.name, description: config.description, icon: config.icon, ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createAchievement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static createAchievement( config: AchievementConfig, currentProgress: number = 0, isUnlocked: boolean = false, unlockedAt?: string ): Achievement { return { id: config.id, type: config.type, name: config.name, description: config.description, icon: config.icon, ...
https://github.com/the-wwyang/kids-learning-app
1cbdf00545016651a52f0e1b98ca9bfca96d2a06
github
CLMC2025/Vignette
entry/src/main/ets/ui/Animations.ets
arkts
fadeOut
创建淡出动画
static fadeOut(duration: number = 300): AnimationConfig { return new AnimationConfig( AnimationType.FADE_OUT, AnimationDirection.CENTER, duration, 0, Curve.EaseInOut ); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left fadeOut AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left duration AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expressio...
static fadeOut(duration: number = 300): AnimationConfig { return new AnimationConfig( AnimationType.FADE_OUT, AnimationDirection.CENTER, duration, 0, Curve.EaseInOut ); }
https://github.com/CLMC2025/Vignette
55ee4d4f1c0ca97a537205fd100bec94eaefc439
github
AGenUI/AGenUI
playground/harmony/entry/src/main/ets/utils/PlaygroundRuntimeLogger.ets
arkts
getLevelName
Get human-readable log level name
public static getLevelName(level: number): string { switch (level) { case 0: return 'DEBUG'; case 1: return 'INFO'; case 2: return 'WARN'; case 3: return 'ERROR'; case 4: return 'FATAL'; case 5: return 'PERF'; default: return 'UNKNOWN'; } }
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 getLevelName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AS...
public static getLevelName(level: number): string { switch (level) { case 0: return 'DEBUG'; case 1: return 'INFO'; case 2: return 'WARN'; case 3: return 'ERROR'; case 4: return 'FATAL'; case 5: return 'PERF'; default: return 'UNKNOWN'; } }
https://github.com/AGenUI/AGenUI
0cb5beaa14ada8646dfc5246e9eb255d45300b9b
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LightWeightMap.ets
arkts
set
Sets the value for the specified key in the LightWeightMap @param key the key to set in the LightWeightMap @param value the value to set for the key @returns the LightWeightMap object
set(key: K, value: V): Object { let index = this.checkIndexOfKey(key); if (index >= 0) { this.buckets.entryValues[index] = value; } else { this.buckets.ensureUnusedCapacity(); index = ~index; const hashCode = this.hash(key); this.bu...
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#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#Right AST#ERROR#Right AST#,#Left , AST#,#Right AST#i...
set(key: K, value: V): Object { let index = this.checkIndexOfKey(key); if (index >= 0) { this.buckets.entryValues[index] = value; } else { this.buckets.ensureUnusedCapacity(); index = ~index; const hashCode = this.hash(key); this.bu...
https://gitcode.com/iop123123/arkts-static-skills
87ab364ccbd84dec5798f07b74b871d13d7131b9
gitcode
codelably/HCompass
core/di/src/main/ets/ServiceContainer.ets
arkts
size
获取已注册的服务数量 @returns 服务数量
get size(): number { return this.services.size; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left size AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ER...
get size(): number { return this.services.size; }
https://github.com/codelably/HCompass
8eaa8e470edd5cfb2bb4a1113c2f8612141d2240
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
getImageUrl
获取图片URL
async getImageUrl(pageIndex: number): Promise<EngineResult<string>> { if (!this.config) { throw new MangaSourceError( MangaSourceErrorCode.CONFIG_NOT_LOADED, '配置未加载' ); } const startTime = Date.now(); logger.info(TAG, `获取图片URL: 页面 ${pageIndex}`); try { const act...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getImageUrl AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left pageIndex AST#identifier#Right AS...
async getImageUrl(pageIndex: number): Promise<EngineResult<string>> { if (!this.config) { throw new MangaSourceError( MangaSourceErrorCode.CONFIG_NOT_LOADED, '配置未加载' ); } const startTime = Date.now(); logger.info(TAG, `获取图片URL: 页面 ${pageIndex}`); try { const act...
https://github.com/DaLongZhuaZi/manxia
03cf5456cdc8323a119e36ee3adc97441b8e8314
github
Joker-x-dev/CoolMallArkTS
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
handleRegionConfirm
处理地区选择确认 @param {IBestCascaderOption[]} selectedOptions - 选中的地区 @returns {void} 无返回值
handleRegionConfirm(selectedOptions: IBestCascaderOption[]): void { this.isRegionPickerVisible = false; const labels: string[] = selectedOptions.map((item: IBestCascaderOption): string => { return `${item.text ?? ""}`; }); const values: Array<string> = selectedOptions.map((item: IBestCascaderOpt...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left handleRegionConfirm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left selectedOptions AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#...
handleRegionConfirm(selectedOptions: IBestCascaderOption[]): void { this.isRegionPickerVisible = false; const labels: string[] = selectedOptions.map((item: IBestCascaderOption): string => { return `${item.text ?? ""}`; }); const values: Array<string> = selectedOptions.map((item: IBestCascaderOpt...
https://github.com/Joker-x-dev/CoolMallArkTS
c5bbd057048e95924bc69f008507106f478ecf3d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/LocalImageCacheManager.ets
arkts
cleanupDistant
清理远离可见区域的缓存 @param visiblePageIds 当前可见的页面ID列表 @param allPageIds 所有页面ID列表(按顺序) @param keepRange 保留范围(前后各保留多少页)
public cleanupDistant(visiblePageIds: string[], allPageIds: string[], keepRange: number = 15): void { if (visiblePageIds.length === 0 || allPageIds.length === 0) { return; } // 找出可见页面的索引范围 let minVisibleIndex = Infinity; let maxVisibleIndex = -1; for (const visibleId of visiblePage...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left cleanupDistant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left visiblePageIds AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
public cleanupDistant(visiblePageIds: string[], allPageIds: string[], keepRange: number = 15): void { if (visiblePageIds.length === 0 || allPageIds.length === 0) { return; } // 找出可见页面的索引范围 let minVisibleIndex = Infinity; let maxVisibleIndex = -1; for (const visibleId of visiblePage...
https://github.com/DaLongZhuaZi/manxia
d57e7368a40254dd87202f3d77c7cb60ba1a8720
github
OHPG/FinSdk
jellyfin/src/main/ets/api/UserApi.ets
arkts
authenticateWithQuickConnect
authenticateWithQuickConnect @summary Authenticates a user with quick connect. @param quickConnectDto requestParameters Request parameters. @throws {RequiredError} @memberof UserApi
public async authenticateWithQuickConnect(quickConnectDto: QuickConnectDto): Promise<AuthenticationResult> { return this.apiClient.post({ path: "/Users/AuthenticateWithQuickConnect", data: quickConnectDto }) }
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 authenticateWithQuickConnect AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left quickConnectDto AST#identif...
public async authenticateWithQuickConnect(quickConnectDto: QuickConnectDto): Promise<AuthenticationResult> { return this.apiClient.post({ path: "/Users/AuthenticateWithQuickConnect", data: quickConnectDto }) }
https://github.com/OHPG/FinSdk
841a75fd5e4dd825cf6b44fccfc211fe84f2fa5c
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/SelectFileUtil.ets
arkts
copyFileToPrivacySpace
复制视频进入隐私空间(优化版:减少文件打开次数)
static async copyFileToPrivacySpace(context: Context, video_meta_data_encryption: VideoMetadata[], uri: string, sandbox_video: string, sandbox_path: string, date: string, metadata: media.AVMetadata, fileName: string, fileSize: number, pixelMap: image.PixelMap | undefined): Promise<VideoMetadata> { let sou...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left copyFileToPrivacySpace AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#...
static async copyFileToPrivacySpace(context: Context, video_meta_data_encryption: VideoMetadata[], uri: string, sandbox_video: string, sandbox_path: string, date: string, metadata: media.AVMetadata, fileName: string, fileSize: number, pixelMap: image.PixelMap | undefined): Promise<VideoMetadata> { let sou...
https://github.com/Yebingiscn/SweetVideo
1438bfa2318d2cc510dcd022fa708929ab68e617
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/RdpSessionManager.ets
arkts
stopSession
Stop the current RDP session
async stopSession(): Promise<void> { console.info(`${TAG}: Stopping session`); isSessionActive = false; // Stop keepalive timer this.stopKeepaliveTimer(); // Stop background service if (backgroundService) { await backgroundService.stop(); } // Release audio fo...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left stopSession 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...
async stopSession(): Promise<void> { console.info(`${TAG}: Stopping session`); isSessionActive = false; // Stop keepalive timer this.stopKeepaliveTimer(); // Stop background service if (backgroundService) { await backgroundService.stop(); } // Release audio fo...
https://github.com/tangwengang-del/freerdp-harmonyos
831ade0b3182dfe44cdcfb1916265b6a22065735
github
openharmony-sig/fluttertpc_qr_code_scanner
ohos/ohos/src/main/ets/components/plugin/libs/CameraService.ets
arkts
onImageArrival
获取预览流并解析
onImageArrival(receiver: image.ImageReceiver, channel: MethodChannel | null, barcodeFormats: Array<number> = []): void { receiver.on('imageArrival', () => { if (this.isStop) { return; } receiver.readNextImage((err: BusinessError, nextImage: image.Image) => { if (err || nextIm...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onImageArrival AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left receiver AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left image AST#identifier#Right...
onImageArrival(receiver: image.ImageReceiver, channel: MethodChannel | null, barcodeFormats: Array<number> = []): void { receiver.on('imageArrival', () => { if (this.isStop) { return; } receiver.readNextImage((err: BusinessError, nextImage: image.Image) => { if (err || nextIm...
https://gitee.com/openharmony-sig/fluttertpc_qr_code_scanner.git
47eebc321d5d75512c41f89180bc5d0be71e9efd
gitee
XHXYT/Pixark
entry/src/main/ets/viewmodel/HistoryViewModel.ets
arkts
addNovelHistory
添加小说浏览记录 直接传入 API 返回的 PixivNovel 对象即可,去重和转换逻辑在 DAO 层处理
async addNovelHistory(novel: PixivNovel) { try { await this.getNovelDB().saveOrUpdate(novel); } catch (e) { logger.error('addNovelHistory Error', e); } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addNovelHistory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left novel AST#identifier#Right AST#type_annotation#Left AST#:#Left ...
async addNovelHistory(novel: PixivNovel) { try { await this.getNovelDB().saveOrUpdate(novel); } catch (e) { logger.error('addNovelHistory Error', e); } }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/HistoryViewModel.ets#L83-L89
a7594c0fcbdd4c9e418f2c2c788e8d61c0e04b67
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets
arkts
setNull
Sets a current JsonElement to a null value.
setNull(): void { this.setUndefined() this.maybeNullValue = null }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setNull AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left...
setNull(): void { this.setUndefined() this.maybeNullValue = null }
https://gitcode.com/iop123123/arkts-static-skills
17f471d9f78cef314f475b1a2b1e2f5ec06b4037
gitcode
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/CloudStore.ets
arkts
loadAllSshKeys
==================== SshKey CRUD ====================
loadAllSshKeys(): SshKey[] { if (!this.store) { return []; } try { const predicates = new relationalStore.RdbPredicates('sshkeys'); predicates.orderByDesc('createdat'); const rs = this.store.querySync(predicates); const result: SshKey[] = []; while (rs.goToNextRow()) { co...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadAllSshKeys AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left SshKey AST#identifier#Right AST#...
loadAllSshKeys(): SshKey[] { if (!this.store) { return []; } try { const predicates = new relationalStore.RdbPredicates('sshkeys'); predicates.orderByDesc('createdat'); const rs = this.store.querySync(predicates); const result: SshKey[] = []; while (rs.goToNextRow()) { co...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
61fb4f67fe860c587765b849db89f123e15c0403
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
getPaint
Returns the paint object associated with the provided constant. @param which e.g. Chart.PAINT_LEGEND_LABEL @return
public getPaint(which: number): Paint | null { switch (which) { case ChartModel.PAINT_INFO: // case 7: return this.mInfoPaint; case ChartModel.PAINT_DESCRIPTION: // case 11: return this.mDescPaint; } return null; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPaint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left which AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number...
public getPaint(which: number): Paint | null { switch (which) { case ChartModel.PAINT_INFO: // case 7: return this.mInfoPaint; case ChartModel.PAINT_DESCRIPTION: // case 11: return this.mDescPaint; } return null; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
d49b9b2114326db0d709467106b8652437adfd04
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SourceUpdateManager.ets
arkts
checkForUpdates
检查更新 @returns 更新检查结果
public async checkForUpdates(): Promise<UpdateCheckResult> { const result: UpdateCheckResult = { hasUpdate: false, remoteIndex: null, localIndex: this.localIndex, updatedSources: [], newSources: [] }; if (!this.repoUrl || this.repoUrl.length === 0) { logger.warn(TAG, '...
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 checkForUpdates AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
public async checkForUpdates(): Promise<UpdateCheckResult> { const result: UpdateCheckResult = { hasUpdate: false, remoteIndex: null, localIndex: this.localIndex, updatedSources: [], newSources: [] }; if (!this.repoUrl || this.repoUrl.length === 0) { logger.warn(TAG, '...
https://github.com/DaLongZhuaZi/manxia
960c5a4b57a27b43e7c5fad2a783f42bb255fabb
github
openharmony-sig/applications_calculator
feature/calculation/src/main/ets/model/ExpressionsDataSource.ets
arkts
convertTimeStampToDate
Converts the timestamp form to the date form. @param recordItem history record item.
private convertTimeStampToDate(recordItem: LooseObject, preId: string, callBack: Function): void { let date: string = this.dateUtil.today; let expDate: Date = new Date(recordItem.time_stamp); let yearOfExp: number = expDate.getFullYear(); let monthOfExp: number = expDate.getMonth() + 1; let dayOfE...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertTimeStampToDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left recordItem AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#...
private convertTimeStampToDate(recordItem: LooseObject, preId: string, callBack: Function): void { let date: string = this.dateUtil.today; let expDate: Date = new Date(recordItem.time_stamp); let yearOfExp: number = expDate.getFullYear(); let monthOfExp: number = expDate.getMonth() + 1; let dayOfE...
https://gitee.com/openharmony-sig/applications_calculator.git
ca08668178617328ae353369befb1e549b0c2613
gitee
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/pages/BillListPage.ets
arkts
showClearBillsDialog
显示清空账单对话框
showClearBillsDialog() { // 初始化默认日期范围(当前月份的第一天到最后一天) const year = parseInt(this.selectedYear); const month = parseInt(this.selectedMonth); this.clearStartDate = `${this.selectedYear}-${this.selectedMonth}-01`; // 计算月份最后一天 const lastDay = new Date(year, month,...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showClearBillsDialog 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...
showClearBillsDialog() { // 初始化默认日期范围(当前月份的第一天到最后一天) const year = parseInt(this.selectedYear); const month = parseInt(this.selectedMonth); this.clearStartDate = `${this.selectedYear}-${this.selectedMonth}-01`; // 计算月份最后一天 const lastDay = new Date(year, month,...
https://github.com/qiuhaotc/HarmonyOSPlayground
c720e1e6461a45edd73f66fd6fd5836250ff0d86
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Array.ets
arkts
lastIndexOf
lastIndexOf(arr: byte[], key: byte, fromIndex: int) tries to find entry of key into arr which is not greater than fromIndex @param arr array to find a key @param key a value to find @param fromIndex an index of arr to begin search with (including, search is performed backwards) @returns last index of key if found in ar...
function lastIndexOf(arr: byte[], key: byte, fromIndex: int): int throws { return lastIndexOf(arr, key, -1, fromIndex) }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left lastIndexOf AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function lastIndexOf(arr: byte[], key: byte, fromIndex: int): int throws { return lastIndexOf(arr, key, -1, fromIndex) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
c466abd0ab6d8ef19a9b1cebddf12c75a6a23b0b
gitee
Cool_foolisher1/ArkTSRepository
RandomNumberSimulator/entry/src/main/ets/components/random/RandomNumber.ets
arkts
styleTextInput
设置输入框的样式
@Extend(TextInput) function styleTextInput() { .type(InputType.Number) // 设置输入内容的类型 .textAlign(TextAlign.Center) .fontSize(20) .maxLength(4) .borderRadius(10) .margin({ top: 2.5, bottom: 10 }) .border({ width: 2, color: $r('app.color.light_blue') }) .backgroundColor($r('app.color.while')) .caretColor(...
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left TextInput AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_express...
@Extend(TextInput) function styleTextInput() { .type(InputType.Number) // 设置输入内容的类型 .textAlign(TextAlign.Center) .fontSize(20) .maxLength(4) .borderRadius(10) .margin({ top: 2.5, bottom: 10 }) .border({ width: 2, color: $r('app.color.light_blue') }) .backgroundColor($r('app.color.while')) .caretColor(...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
df1c4627a7a66ee395746896b3af510d79a4757b
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/ShareService.ets
arkts
convertToMarkdown
将消息列表转换为 Markdown 格式
convertToMarkdown(messages: ChatMessage[], sessionTitle: string = ''): string { return this.exportService.toMarkdown(this.exportService.buildModel(messages, sessionTitle)) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left convertToMarkdown AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left messages AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left Chat...
convertToMarkdown(messages: ChatMessage[], sessionTitle: string = ''): string { return this.exportService.toMarkdown(this.exportService.buildModel(messages, sessionTitle)) }
https://github.com/LongLiveY96/chatcube
192a94153842045dd3497acb2bed4576c8680a2c
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/services/messagebus/TopicTrackingService.ets
arkts
getHighestPostNumber
获取某个话题最新的 highest_post_number(优先 tracking state,其次 /latest payload) 用于列表页在 MessageBus 更新时即时刷新回复数。
getHighestPostNumber(topicId: number): number { if (topicId <= 0) return 0; let highest: number = 0; if (this.states.has(topicId)) { const s: TrackedTopicState = this.states.get(topicId) as TrackedTopicState; highest = s.highestPostNumber; } if (this.incomingHighestPostNumbers.has(topi...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getHighestPostNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left topicId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left )...
getHighestPostNumber(topicId: number): number { if (topicId <= 0) return 0; let highest: number = 0; if (this.states.has(topicId)) { const s: TrackedTopicState = this.states.get(topicId) as TrackedTopicState; highest = s.highestPostNumber; } if (this.incomingHighestPostNumbers.has(topi...
https://github.com/Amaz1ny/HarmonyDO-public
a4699f86230d21dfa155c70ce87aec4c5a6d87f5
github