nwo
stringclasses
449 values
path
stringlengths
9
173
language
stringclasses
1 value
identifier
stringlengths
1
53
docstring
stringlengths
5
4.13k
function
stringlengths
10
87.2k
ast_function
stringlengths
351
354k
obf_function
stringlengths
10
87.2k
url
stringlengths
30
175
function_sha
stringlengths
40
40
source
stringclasses
3 values
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
drawDescription
Draws the description text in the bottom right corner of the chart (per default)
protected drawDescription(c: CanvasRenderingContext2D): void { // this.width = c.width; // this.height = c.height; // check if description should be drawn if (this.mDescription != null && this.mDescription.isEnabled()) { let position: MPPointF | null = this.mDescription.getPosition(); i...
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left drawDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
protected drawDescription(c: CanvasRenderingContext2D): void { // this.width = c.width; // this.height = c.height; // check if description should be drawn if (this.mDescription != null && this.mDescription.isEnabled()) { let position: MPPointF | null = this.mDescription.getPosition(); i...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
a1276b46b6f1a5d5e441497144157579b000ee51
gitee
codelably/tuniao-ui
core/tuniaoui/src/main/ets/utils/ColorUtils.ets
arkts
isResource
判断是否为资源引用类型 @returns 是否为资源引用类型
function isResource(value: ResourceColor): boolean { return (value as Resource)?.id !== undefined; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isResource AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left value AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Righ...
function isResource(value: ResourceColor): boolean { return (value as Resource)?.id !== undefined; }
https://github.com/codelably/tuniao-ui
1686aaa0a76e90d9ac9b313c253184088189aaa7
github
erosTeam/NextE
shared/src/main/ets/services/EhPageCacheService.ets
arkts
stat
Count + total payload bytes of the unexpired page cache (gallery list + detail), for the cache page.
static async stat(context: common.UIAbilityContext): Promise<CacheStat> { const out: CacheStat = new CacheStat() try { const store: relationalStore.RdbStore = await LocalDataStore.open(context) const rs: relationalStore.ResultSet = await store.querySql( 'SELECT COUNT(*) AS c, COALESCE(SUM(...
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 stat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Rig...
static async stat(context: common.UIAbilityContext): Promise<CacheStat> { const out: CacheStat = new CacheStat() try { const store: relationalStore.RdbStore = await LocalDataStore.open(context) const rs: relationalStore.ResultSet = await store.querySql( 'SELECT COUNT(*) AS c, COALESCE(SUM(...
https://github.com/erosTeam/NextE
9182ef14394992df1331bf629a2575bc28544e70
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/WakeOnLan.ets
arkts
sendUnicast
单播发送(独立 socket,不设 broadcast 标志)
private static async sendUnicast(payload: ArrayBuffer, address: string, ports: number[], isIPv6: boolean): Promise<void> { const family = isIPv6 ? 2 : 1; const udpSocket: socket.UDPSocket = socket.constructUDPSocketInstance(); try { await udpSocket.bind({ address: isIPv6 ? '::' : '0.0.0.0', port: 0,...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left sendUnicast AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pay...
private static async sendUnicast(payload: ArrayBuffer, address: string, ports: number[], isIPv6: boolean): Promise<void> { const family = isIPv6 ? 2 : 1; const udpSocket: socket.UDPSocket = socket.constructUDPSocketInstance(); try { await udpSocket.bind({ address: isIPv6 ? '::' : '0.0.0.0', port: 0,...
https://github.com/AlkaidLab/moonlight-harmony
2743248dffa9d2f07aa2b8a981ec52fcfdfc286a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
constructor
Creates an Float64Array with respect to data, byteOffset and length. @param { ArrayBuffer } buf - data initializer @param { Number | undefined } byteOffset - byte offset from begin of the buf @param { Number | undefined } length - size of elements of type double in newly created Float64Array @throws { RangeError } - In...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Array...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
https://gitcode.com/iop123123/arkts-static-skills
2253142cf0f0b994edf3383501fcecdb8a0c2b71
gitcode
OSpark-Team/Free-PCM
entry/src/main/ets/pages/components/FftSpectrum.ets
arkts
fftRadix2
In-place radix-2 Cooley–Tukey FFT (complex)
function fftRadix2(re: Float32Array, im: Float32Array): void { const n = re.length; // bit-reversal permutation let j = 0; for (let i = 1; i < n; i++) { let bit = n >> 1; while (j & bit) { j ^= bit; bit >>= 1; } j ^= bit; if (i < j) { const tr = re[i]; re[i] = re[j]; re[j] ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left fftRadix2 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left re AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AS...
function fftRadix2(re: Float32Array, im: Float32Array): void { const n = re.length; // bit-reversal permutation let j = 0; for (let i = 1; i < n; i++) { let bit = n >> 1; while (j & bit) { j ^= bit; bit >>= 1; } j ^= bit; if (i < j) { const tr = re[i]; re[i] = re[j]; re[j] ...
https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/entry/src/main/ets/pages/components/FftSpectrum.ets#L47-L91
5e05a8e7d7c62cdf20ca38b8c655b83dcf9cf017
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceSelectorEngine.ets
arkts
validateCSSSelector
验证CSS选择器语法
private validateCSSSelector(selector: string): boolean { try { // 简单的CSS选择器语法检查 // 在HarmonyOS环境中,无法直接使用document.querySelector进行验证 // 这里进行基本的语法检查 if (!selector || selector.trim().length === 0) { return false; } // 检查是否包含基本的CSS选择器字符 const validChars = /^[a-zA-Z0-9\s...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateCSSSelector AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left selector AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS...
private validateCSSSelector(selector: string): boolean { try { // 简单的CSS选择器语法检查 // 在HarmonyOS环境中,无法直接使用document.querySelector进行验证 // 这里进行基本的语法检查 if (!selector || selector.trim().length === 0) { return false; } // 检查是否包含基本的CSS选择器字符 const validChars = /^[a-zA-Z0-9\s...
https://github.com/DaLongZhuaZi/manxia
f724b3979d5470c4521cecf82cb2d43e8d9b8ab7
github
GrassyUnknown/Health-Life-HarmonyOS-Next
oh_modules/.ohpm/cjcalendar@2.0.4/oh_modules/cjcalendar/src/main/ets/components/components/CJCalendar.ets
arkts
__calcMonthDays
计算指定月份的所有日期
__calcMonthDays(month: Date) { month.setDate(1) this.cjCalStatus.title = month.getFullYear() + "-" + (month.getMonth() + 1).toString().padStart(2, "0") // 是否有上一月 if (month.getFullYear() < this.startDate.getFullYear() || (month.getFullYear() == this.startDate.getFullYear() && month.getMonth() <=...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left __calcMonthDays AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left month AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Date AST#identifier#Right AST#ERROR#Righ...
__calcMonthDays(month: Date) { month.setDate(1) this.cjCalStatus.title = month.getFullYear() + "-" + (month.getMonth() + 1).toString().padStart(2, "0") // 是否有上一月 if (month.getFullYear() < this.startDate.getFullYear() || (month.getFullYear() == this.startDate.getFullYear() && month.getMonth() <=...
https://github.com/GrassyUnknown/Health-Life-HarmonyOS-Next
26a1c02278b9722f6937cb52f75fb1c7d8000cab
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
set
Copies elements from an ArrayLike object to the BigUint64Array. @param { ArrayLike<BigInt> } array - An ArrayLike object containing the elements to copy. @param { int } [offset] - Optional. The offset into the target array at which to begin writing values from the source array. The default value is 0. @throws { RangeEr...
public set(array: ArrayLike<BigInt>, offset: int = 0): void { const insertPos = offset if (insertPos < 0 || insertPos + array.length > this.lengthInt) { throw new RangeError("offset is out of bounds") } for (let i = 0; i < array.length; ++i) { this.setUnsafe(i...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left array AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public set(array: ArrayLike<BigInt>, offset: int = 0): void { const insertPos = offset if (insertPos < 0 || insertPos + array.length > this.lengthInt) { throw new RangeError("offset is out of bounds") } for (let i = 0; i < array.length; ++i) { this.setUnsafe(i...
https://gitcode.com/iop123123/arkts-static-skills
aa2ab3bc8670f03fb99907ea0f4366bb05faf24d
gitcode
ASweetBite/HarmonyPulse
entry/src/main/ets/utils/managers/avPlayerManager.ets
arkts
playResources
点击歌曲播放
playResources(song: SongItemType) { SessionManager.startContinuousTask() const index = this.GlobalMusic.songList.findIndex(item => item.id === song.id) if (index !== -1) { this.GlobalMusic.currentMusic = index } else { // 如果不在播放列表中,则插入到首位 this.GlobalMusic.songList.unshift(song) ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left playResources 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...
playResources(song: SongItemType) { SessionManager.startContinuousTask() const index = this.GlobalMusic.songList.findIndex(item => item.id === song.id) if (index !== -1) { this.GlobalMusic.currentMusic = index } else { // 如果不在播放列表中,则插入到首位 this.GlobalMusic.songList.unshift(song) ...
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/utils/managers/avPlayerManager.ets#L157-L169
4bf852c4712b32dbee9fa2efe79d791fae3a1ab5
github
silence17/harmonydemo
entry/src/main/ets/view/refresh/DialogUtils.ets
arkts
isEmptyArr
Check array is empty @param {Array}array @return {boolean} true(empty)
static isEmptyArr(array: Array<any>): boolean { return this.isEmpty(array) || array.length === 0; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isEmptyArr AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left array AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expres...
static isEmptyArr(array: Array<any>): boolean { return this.isEmpty(array) || array.length === 0; }
https://github.com/silence17/harmonydemo
b74a23b16b6d5c0a40beb0a090bff8ecc6daf80d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
getStringByRegexSingle
单个正则获取字符串
private getStringByRegexSingle(pattern: string): string { try { // 处理多个正则组合 (用&&分隔) const patterns = pattern.split('&&').map(p => p.trim()); let content = this.content; for (const p of patterns) { if (!p) continue; const regex = new RegExp(p, 's'); // s标志使.匹...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getStringByRegexSingle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pattern AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string ...
private getStringByRegexSingle(pattern: string): string { try { // 处理多个正则组合 (用&&分隔) const patterns = pattern.split('&&').map(p => p.trim()); let content = this.content; for (const p of patterns) { if (!p) continue; const regex = new RegExp(p, 's'); // s标志使.匹...
https://github.com/DaLongZhuaZi/manxia
0b4e58a1e56bd51bfd5aa3557b01e82db5e8e26a
github
aimilin6688/KeePassHO
entry/src/main/ets/services/RecentFilesService.ets
arkts
removeRecentFile
移除最近打开的文件 @param filePath 文件路径
public async removeRecentFile(recentFile: RecentFile): Promise<void> { try { if (!this.preferences) { return; } // 获取当前的最近文件列表 const recentFiles = await this.getRecentFiles(); // 移除指定文件 const updatedFiles = recentFiles.filter(file => file.filePath !== recentFile.filePa...
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 removeRecentFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left recentFile AST#identifier#Right AST#:#L...
public async removeRecentFile(recentFile: RecentFile): Promise<void> { try { if (!this.preferences) { return; } // 获取当前的最近文件列表 const recentFiles = await this.getRecentFiles(); // 移除指定文件 const updatedFiles = recentFiles.filter(file => file.filePath !== recentFile.filePa...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/RecentFilesService.ets#L381-L407
bde1b6ee8369e656ba40006afa9a87df2c08d6a8
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/ARNavigationService.ets
arkts
initNavigationState
初始化导航状态
private initNavigationState(): ARNavigationState { return { isActive: false, isPaused: false, currentPath: null, currentWaypointIndex: 0, currentPosition: { x: 0, y: 0, z: 0 }, heading: 0, totalDistance: 0, remainingDistance: 0, estimatedTime: 0, estimat...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initNavigationState 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...
private initNavigationState(): ARNavigationState { return { isActive: false, isPaused: false, currentPath: null, currentWaypointIndex: 0, currentPosition: { x: 0, y: 0, z: 0 }, heading: 0, totalDistance: 0, remainingDistance: 0, estimatedTime: 0, estimat...
https://github.com/LJ666-ui/harmony-health-care
b8ee6d0e276ec7d0625363635222ccc3617472a5
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelLoginManager.ets
arkts
savePersistedData
保存持久化数据
async savePersistedData(): Promise<void> { if (!this.dataPreferences) { logger.warn(TAG, 'dataPreferences 未初始化,无法保存数据'); return; } try { // 保存登录状态和Cookie const statusArray: SourceLoginStatus[] = []; this.loginStatus.forEach((status, sourceId) => { const cookies = thi...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left savePersistedData AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Le...
async savePersistedData(): Promise<void> { if (!this.dataPreferences) { logger.warn(TAG, 'dataPreferences 未初始化,无法保存数据'); return; } try { // 保存登录状态和Cookie const statusArray: SourceLoginStatus[] = []; this.loginStatus.forEach((status, sourceId) => { const cookies = thi...
https://github.com/DaLongZhuaZi/manxia
3aee0d92b67f5ee826b2c4677fb935f2fc2dc20d
github
openharmony/applications_mms
entry/src/main/ets/service/SettingService.ets
arkts
shareSmsEnterSelectedText
Share the selected content in the SMSC dialog box. @param actionData @param callback @return
shareSmsEnterSelectedText(actionData) { // The sharing API is not provided. mSettingModel.shareSmsEnterSelectedText(actionData, result => { if (result.code == common.int.SUCCESS) { HiLog.i(TAG, 'shareSmsEnterSelectedText, success'); } else { } ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left shareSmsEnterSelectedText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left actionData AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST...
shareSmsEnterSelectedText(actionData) { // The sharing API is not provided. mSettingModel.shareSmsEnterSelectedText(actionData, result => { if (result.code == common.int.SUCCESS) { HiLog.i(TAG, 'shareSmsEnterSelectedText, success'); } else { } ...
https://gitee.com/openharmony/applications_mms.git
03e41c740c21fd880847fa8b4edb19d58f01e064
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
constructor
Creates an Uint16Array with respect to data, byteOffset and length. @param { ArrayBuffer } buf - data initializer @param { Number | undefined } byteOffset - byte offset from begin of the buf @param { Number | undefined } length - size of elements of type int in newly created Uint16Array @throws { RangeError } - Input p...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Array...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
https://gitcode.com/iop123123/arkts-static-skills
3ead0fe6e8ed08fc5a316f2825a828ded26e06c3
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test57_original_index.ets
arkts
compose
--- Function composition ---
function compose(f: (x: number) => number, g: (x: number) => number): (x: number) => number { return (x: number): number => { return f(g(x)); }; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left compose AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left f AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#f...
function compose(f: (x: number) => number, g: (x: number) => number): (x: number) => number { return (x: number): number => { return f(g(x)); }; }
https://github.com/miaochiahao/ark-ghidra
1bfed325edf99e931d911fbc00350b0c0172287e
github
Harrisonls2004/WaterFlow
entry/src/main/ets/common/utils/CartManager.ets
arkts
setAllSelection
Select/Deselect All.
static async setAllSelection(isSelected: boolean): Promise<void> { let newCartList: ICartItemData[] = []; for (let i = 0; i < cachedCartList.length; i++) { let newItem: ICartItemData = { cartId: cachedCartList[i].cartId, quantity: cachedCartList[i].quantity, selectedColor: cached...
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 setAllSelection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isSelected AST#identifier#Right AST#ERROR#Left AST#:#Le...
static async setAllSelection(isSelected: boolean): Promise<void> { let newCartList: ICartItemData[] = []; for (let i = 0; i < cachedCartList.length; i++) { let newItem: ICartItemData = { cartId: cachedCartList[i].cartId, quantity: cachedCartList[i].quantity, selectedColor: cached...
https://github.com/Harrisonls2004/WaterFlow
e995e888b2ff374f0edd7c5357cb0641ec1dae1f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Console.ets
arkts
group
@section Console.group* API Starts a new logging group with optional label Increases indentation level for subsequent log messages @param {string} [objs] - Data to be printed without additional indent @returns {void}
public group(...objs: Any[]): void { if (objs.length != 0) { this.log(objs) } this.indentationLevel++ }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left group AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left obj...
public group(...objs: Any[]): void { if (objs.length != 0) { this.log(objs) } this.indentationLevel++ }
https://gitcode.com/iop123123/arkts-static-skills
4c1674ae87942ac09a1886b579ef68cdf33fb3a7
gitcode
openharmony/arkui_ace_engine
examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets
arkts
isNumeric
Tests whether the given string can be encoded as a segment in numeric mode. A string is encodable iff each character is in the range 0 to 9.
public static isNumeric(text: string): boolean { return QrSegment.NUMERIC_REGEX.test(text); }
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 isNumeric AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#...
public static isNumeric(text: string): boolean { return QrSegment.NUMERIC_REGEX.test(text); }
https://gitee.com/openharmony/arkui_ace_engine.git
6ac7967fde4f68b3aeb9ffe7951ef79bcde6bbe2
gitee
richshaw2015/nds
ohos/entry/src/main/ets/utils/WebUploadServer.ets
arkts
start
启动服务器
public async start(uploadPath: string, port: number = 8080): Promise<boolean> { if (this.status === ServerStatus.RUNNING) { hilog.info(DOMAIN, TAG, 'Server already running'); return true; } if (this.status === ServerStatus.STARTING) { hilog.info(DOMAIN, TAG, 'Server is starting'); ...
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 start AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left uploadPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:...
public async start(uploadPath: string, port: number = 8080): Promise<boolean> { if (this.status === ServerStatus.RUNNING) { hilog.info(DOMAIN, TAG, 'Server already running'); return true; } if (this.status === ServerStatus.STARTING) { hilog.info(DOMAIN, TAG, 'Server is starting'); ...
https://github.com/richshaw2015/nds
ea928c6dbad445f99135c66456f83199624db49e
github
openharmony-sig/applications_clock
common/src/main/ets/manager/AlarmManager.ets
arkts
getAlarmByAlarmTimeIntent
根据条件查询对应的闹钟 alarmTimeIntent 只有意图框架才能用这个方法 @return 当前条件对应的闹钟
async getAlarmByAlarmTimeIntent(alarmTimeIntent: number): Promise<AlarmInfo[] | undefined> { const rdbStore = await this.getRdbStore(); let predicates = new dataRdb.RdbPredicates(ALARM_CLOCK_DATA_TABLE); predicates = predicates.equalTo('ALARM_TIME_INTENT', alarmTimeIntent); let resultSet: rdb.ResultSe...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAlarmByAlarmTimeIntent AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alarmTimeIntent AST#identifier#Right AST#type_annotat...
async getAlarmByAlarmTimeIntent(alarmTimeIntent: number): Promise<AlarmInfo[] | undefined> { const rdbStore = await this.getRdbStore(); let predicates = new dataRdb.RdbPredicates(ALARM_CLOCK_DATA_TABLE); predicates = predicates.equalTo('ALARM_TIME_INTENT', alarmTimeIntent); let resultSet: rdb.ResultSe...
https://gitee.com/openharmony-sig/applications_clock.git
3d1c91f4f520f10a4c247463234f40d462eb4c4e
gitee
Explore-In-HMOS-Wearable/how-to-use-weather-kit
entry/src/main/ets/components/TTSAnnouncementCard.ets
arkts
splitIntoWords
Split text into words, handling punctuation appropriately
static splitIntoWords(text: string): string[] { return text .split(/\s+/) // Split on whitespace .filter(word => word.trim() !== '') // Remove empty strings .map(word => word.trim()); // Trim each word }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left splitIntoWords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
static splitIntoWords(text: string): string[] { return text .split(/\s+/) // Split on whitespace .filter(word => word.trim() !== '') // Remove empty strings .map(word => word.trim()); // Trim each word }
https://github.com/Explore-In-HMOS-Wearable/how-to-use-weather-kit
0fa78395543902cc7a6fb98b0549f37abd507736
github
aimilin6688/KeePassHO
entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets
arkts
isTemplateEntry
判断条目是否为模板条目
private isTemplateEntry(entry: KdbxEntry): boolean { const flag = entry.fields.get(UserTemplateStrategy.TEMPLATE_FLAG); const flagStr = KdbxUtils.getValueString(flag); return flagStr === UserTemplateStrategy.TEMPLATE_FLAG_VALUE; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isTemplateEntry AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
private isTemplateEntry(entry: KdbxEntry): boolean { const flag = entry.fields.get(UserTemplateStrategy.TEMPLATE_FLAG); const flagStr = KdbxUtils.getValueString(flag); return flagStr === UserTemplateStrategy.TEMPLATE_FLAG_VALUE; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets#L113-L117
835823189bf3e4dfe821d8f83e18e7ae08d5ecc7
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/ReminderDAO.ets
arkts
softDelete
软删除提醒
static async softDelete(userId: number, reminderId: number): Promise<void> { await DAOHelper.softDelete(Reminder.tableName, 'reminder_id', reminderId, '[ReminderDAO]'); }
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 softDelete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST#...
static async softDelete(userId: number, reminderId: number): Promise<void> { await DAOHelper.softDelete(Reminder.tableName, 'reminder_id', reminderId, '[ReminderDAO]'); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
8f863d544351df484d5b85c81727da4adfad5ddf
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Set.ets
arkts
next
Returns the next mapped element in the iteration. @returns { IteratorResult<O> } - The next mapped element in the iteration. @syscap SystemCapability.Utils.Lang @FaAndStageModel
override next(): IteratorResult<O> { const inputIterRes = this.inputIter.next() if (inputIterRes.done) { return new IteratorResult<O>() } else { const output = this.mappingFn(inputIterRes.value as I) return new IteratorResult<O>(output) } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left next 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...
override next(): IteratorResult<O> { const inputIterRes = this.inputIter.next() if (inputIterRes.done) { return new IteratorResult<O>() } else { const output = this.mappingFn(inputIterRes.value as I) return new IteratorResult<O>(output) } }
https://gitcode.com/iop123123/arkts-static-skills
8f1f53f816f0d0ec67fa3c49ac7f7a75656b6d86
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
getTxtTocRules
==================== TXT目录规则 ==================== 获取TXT目录规则
getTxtTocRules(): TxtTocRule[] { return this.txtTocRules.slice(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getTxtTocRules AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ...
getTxtTocRules(): TxtTocRule[] { return this.txtTocRules.slice(); }
https://github.com/DaLongZhuaZi/manxia
397d1852299a97e6e2749aa6c8c54f8b38251fc1
github
openharmony/applications_settings
product/phone/src/main/ets/model/accessibilityImpl/ExtensionServiceManagementModel.ets
arkts
loadIcon
Load icon of AccessibilityService
async loadIcon(bundleInfo: bundleManager.BundleInfo): Promise<string> { let appInfo = bundleInfo.appInfo; let imageValue = ''; let context = GlobalContext.getContext().getObject(GlobalContext.globalKeySettingsAbilityContext) as Context; LogUtil.info(`${MODULE_TAG} getResourceManager appInfo.iconResour...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadIcon AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bundleInfo AST#identifier#Right AST#type_annotation#Left AST#...
async loadIcon(bundleInfo: bundleManager.BundleInfo): Promise<string> { let appInfo = bundleInfo.appInfo; let imageValue = ''; let context = GlobalContext.getContext().getObject(GlobalContext.globalKeySettingsAbilityContext) as Context; LogUtil.info(`${MODULE_TAG} getResourceManager appInfo.iconResour...
https://gitee.com/openharmony/applications_settings.git
c9aec283444e6a6c324f5aa67832ed5bd7a5aa80
gitee
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/MyDemoOld/pages/component/video/VideoPage.ets
arkts
aboutToAppear
视频未播放时的图片
aboutToAppear(): void { this.videoSrc = $rawfile(this.videoData[this.currentIndex]) this.array.push(this.videoData[this.currentIndex]) }
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 { this.videoSrc = $rawfile(this.videoData[this.currentIndex]) this.array.push(this.videoData[this.currentIndex]) }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
680d35ad1a3854eb37c422f68d4e5142156e5aa0
gitcode
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/components/parts/Bookmarks/Panel.ets
arkts
closeAllRightOf_Animated
Close all levels on the right of the given index, with animation. The #idx card is safe from this. @param idx The index of the level to close.
closeAllRightOf_Animated(idx: number) { animateToImmediately(defaultAnimation(), () => { this.closeAllRightOf(idx); }); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left closeAllRightOf_Animated AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left idx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identi...
closeAllRightOf_Animated(idx: number) { animateToImmediately(defaultAnimation(), () => { this.closeAllRightOf(idx); }); }
https://github.com/awaLiny2333/LinysBrowser_NEXT
7792a87ae2fe204ce2dce3770b35b12cde6170c2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/SnapshotCapture.ets
arkts
releasePixelMaps
批量释放PixelMap资源 @param pixelMaps PixelMap映射
public releasePixelMaps(pixelMaps: Map<string, PixelMap>): void { pixelMaps.forEach((pixelMap, id) => { try { pixelMap.release(); } catch (err) { const msg = err instanceof Error ? err.message : String(err); logger.warn(TAG, `释放PixelMap失败: ${id}, ${msg}`); } }); p...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left releasePixelMaps AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left pixelMaps AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri...
public releasePixelMaps(pixelMaps: Map<string, PixelMap>): void { pixelMaps.forEach((pixelMap, id) => { try { pixelMap.release(); } catch (err) { const msg = err instanceof Error ? err.message : String(err); logger.warn(TAG, `释放PixelMap失败: ${id}, ${msg}`); } }); p...
https://github.com/DaLongZhuaZi/manxia
db6cc40aed3133aaf5c0fe7e9df0f58e2e74b77a
github
YANGZX22/Voot
entry/src/main/ets/services/PipSubtitleManager.ets
arkts
setXComponentController
Set XComponent controller
setXComponentController(controller: XComponentController): void { this.xComponentController = controller; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setXComponentController AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left controller AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left XComponentController AST#i...
setXComponentController(controller: XComponentController): void { this.xComponentController = controller; }
https://github.com/YANGZX22/Voot
2846880f89790801ac20c5652a983d4c67a8b0f9
github
openharmony-sig/ohos_highlightguide
library/src/main/ets/highlightguide/model/GuidePage.ets
arkts
addHighLight
添加高亮显示组件/区域 @param highLight 组件id/高亮区域 @param shape 高亮区域形状 @param round 圆角矩形的圆角弧度,只在shape为HighLightShape.ROUND_RECTANGLE时有效 @param padding 高亮区域边缘相对于组件实际区域的边距(该属性只针对高亮区域为组件时有效) @returns
public addHighLight(highLight: string | RectF, shape?: HighLightShape, round?: number, padding?: number): GuidePage { let hlShape: HighLightShape = HighLightShape.RECTANGLE; let hlRound: number = 0; let hlPadding: number = 0; if (shape === null || shape === undefined) { hlShape = HighLightShape...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addHighLight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left highLight AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#str...
public addHighLight(highLight: string | RectF, shape?: HighLightShape, round?: number, padding?: number): GuidePage { let hlShape: HighLightShape = HighLightShape.RECTANGLE; let hlRound: number = 0; let hlPadding: number = 0; if (shape === null || shape === undefined) { hlShape = HighLightShape...
https://gitee.com/openharmony-sig/ohos_highlightguide.git
5ce8f0d34c5c9d3b0a547ebcad79f44f2bd8e1ad
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/Transformer.ets
arkts
getValuesByTouchPoint
Returns a recyclable MPPointD instance. returns the x and y values in the chart at the given touch point (encapsulated in a MPPointD). This method transforms pixel coordinates to coordinates / values in the chart. This is the opposite method to getPixelForValues(...). @param x @param y @return
public getValuesByTouchPoint(x: number, y: number, outputPoint?: MPPointD): MPPointD { let result: MPPointD = (outputPoint != null && outputPoint != undefined) ? outputPoint : MPPointD.getInstance(0, 0); this.ptsBuffer[0] = x; this.ptsBuffer[1] = y; this.pixelsToValue(this.ptsBuffer); result.x ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValuesByTouchPoint 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#Le...
public getValuesByTouchPoint(x: number, y: number, outputPoint?: MPPointD): MPPointD { let result: MPPointD = (outputPoint != null && outputPoint != undefined) ? outputPoint : MPPointD.getInstance(0, 0); this.ptsBuffer[0] = x; this.ptsBuffer[1] = y; this.pixelsToValue(this.ptsBuffer); result.x ...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
62af18f1c679593b7eeb26080c9c125f371031f9
gitee
fbinba3955/Flymby
common/src/main/ets/utils/VolumeUtil.ets
arkts
increaseVolume
增加音量 @param step 增加的步长 (0-1)
public static async increaseVolume(step: number = 0.1): Promise<void> { try { const currentVolume = await VolumeUtil.getMediaVolume(); const newVolume = Math.min(currentVolume + step, VolumeUtil.MAX_VOLUME); await VolumeUtil.setMediaVolume(newVolume); LogUtil.info(`VolumeUtil 增加音量: ${curre...
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 increaseVolume AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ste...
public static async increaseVolume(step: number = 0.1): Promise<void> { try { const currentVolume = await VolumeUtil.getMediaVolume(); const newVolume = Math.min(currentVolume + step, VolumeUtil.MAX_VOLUME); await VolumeUtil.setMediaVolume(newVolume); LogUtil.info(`VolumeUtil 增加音量: ${curre...
https://github.com/fbinba3955/Flymby
a7dd92058a2750eeaba45fe2b480ce1c267c5dd4
github
Joker-x-dev/CoolMallArkTS
core/network/src/main/ets/datasource/order/OrderNetworkDataSourceImpl.ets
arkts
getUserOrderCount
获取用户订单数量汇总 @returns {Promise<NetworkResponse<OrderCount>>} 订单数量信息
async getUserOrderCount(): Promise<NetworkResponse<OrderCount>> { const resp: AxiosResponse<NetworkResponse<OrderCount>> = await NetworkClient.http.get("order/info/userCount"); return resp.data; }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getUserOrderCount AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge...
async getUserOrderCount(): Promise<NetworkResponse<OrderCount>> { const resp: AxiosResponse<NetworkResponse<OrderCount>> = await NetworkClient.http.get("order/info/userCount"); return resp.data; }
https://github.com/Joker-x-dev/CoolMallArkTS
0a29f3c14b314f6036b07275032027786aeaa638
github
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/pages/DataManager.ets
arkts
getRepeatIndexByRule
根据规则获取重复索引(代理给RepeatService)
getRepeatIndexByRule(ruleString: string): number { return this.repeatService.getRepeatIndexByRule(ruleString); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getRepeatIndexByRule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ruleString AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Lef...
getRepeatIndexByRule(ruleString: string): number { return this.repeatService.getRepeatIndexByRule(ruleString); }
https://gitcode.com/openharmony/codelabs
83668453d8b53866ba3eb84495649ed6beb97918
gitcode
openharmony/applications_mms
entry/src/main/ets/pages/infomsg/InfoMsgController.ets
arkts
subscribeInfo
Subscribe to New Messages Received
subscribeInfo() { HiLog.i(TAG, 'subscribeInfo, start'); let events = [common.string.RECEIVE_TRANSMIT_EVENT] let commonEventSubscribeInfo = { events: events }; commonEvent.createSubscriber(commonEventSubscribeInfo, this.createSubscriberCallBack.bind(this)); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left subscribeInfo 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...
subscribeInfo() { HiLog.i(TAG, 'subscribeInfo, start'); let events = [common.string.RECEIVE_TRANSMIT_EVENT] let commonEventSubscribeInfo = { events: events }; commonEvent.createSubscriber(commonEventSubscribeInfo, this.createSubscriberCallBack.bind(this)); }
https://gitee.com/openharmony/applications_mms.git
a902219a5eb596771daa80a53b0a32e8ff356fc3
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets
arkts
preloadChapterPagesInBackground
后台预加载章节页面信息
private async preloadChapterPagesInBackground( mangaId: string, chapters: MangaChapter[], callback: MangaLoadProgressCallback ): Promise<void> { // 异步执行,不阻塞主流程 setTimeout(async () => { try { logger.info(TAG, `[后台] 开始预加载 ${chapters.length} 个章节的页面信息`); let loadedCo...
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 preloadChapterPagesInBackground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mangaId AST#identifier#Right AST#ERR...
private async preloadChapterPagesInBackground( mangaId: string, chapters: MangaChapter[], callback: MangaLoadProgressCallback ): Promise<void> { // 异步执行,不阻塞主流程 setTimeout(async () => { try { logger.info(TAG, `[后台] 开始预加载 ${chapters.length} 个章节的页面信息`); let loadedCo...
https://github.com/DaLongZhuaZi/manxia
95fe4284e950e9ef8aedb7d2ed8c13f0c19dc68b
github
Delsin-Yu/JustPDF
entry/src/main/ets/pages/PDFView.ets
arkts
onBackPress
拦截系统返回键,回到主页而非退出应用
onBackPress(): boolean { this.requestBackToMainMenu(); return true; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackPress 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#stateme...
onBackPress(): boolean { this.requestBackToMainMenu(); return true; }
https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/PDFView.ets#L2370-L2373
bf8d01296b6b0fd10e75ee47b19cdaa5b9721fe8
github
PollenWang6/HiXD
entry/src/main/ets/services/ClassService.ets
arkts
formatWeekRange
格式化周次字符串 "000000001000" → "第16周" 或 "第14-18周"
static formatWeekRange(skzc: string): string { if (!skzc || skzc.length === 0) return ''; const weeks: number[] = []; for (let i = 0; i < skzc.length; i++) { if (skzc[i] === '1') weeks.push(i + 1); } if (weeks.length === 0) return ''; if (weeks.length === 1) return '第' + weeks[0] + '周'; ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatWeekRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left skzc AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
static formatWeekRange(skzc: string): string { if (!skzc || skzc.length === 0) return ''; const weeks: number[] = []; for (let i = 0; i < skzc.length; i++) { if (skzc[i] === '1') weeks.push(i + 1); } if (weeks.length === 0) return ''; if (weeks.length === 1) return '第' + weeks[0] + '周'; ...
https://github.com/PollenWang6/HiXD
fefb1f628336609fc67c5993417bd7ed9771b36a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentHashMap.ets
arkts
values
Returns elements from the ConcurrentHashMap as an values Iterator @returns { IterableIterator<K> } iterator with ConcurrentHashMap values
public override values(): IterableIterator<V> { return this.mappedIterator<V>((e: MapNode<K, V>): V => e.val ); }
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 values AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left...
public override values(): IterableIterator<V> { return this.mappedIterator<V>((e: MapNode<K, V>): V => e.val ); }
https://gitcode.com/iop123123/arkts-static-skills
e9ad0eba8d70e2cf7090f7f14079128b7e6759e6
gitcode
mqxu/HarmonyOS_In_Action
examples/01_foundation/F002_state_management/entry/src/main/ets/utils/StateManager.ets
arkts
isValidInput
验证输入文本是否有效 @param text 输入文本 @returns 是否有效
static isValidInput(text: string): boolean { return text !== null && text !== undefined && text.trim().length > 0; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isValidInput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left str...
static isValidInput(text: string): boolean { return text !== null && text !== undefined && text.trim().length > 0; }
https://github.com/mqxu/HarmonyOS_In_Action
1fbfce27d05c2a7875ec3321d3b3624fede61b67
github
aimilin6688/KeePassHO
entry/src/main/ets/services/store/DistributedKVService.ets
arkts
onDataChange
订阅远端数据变化 @param data 数据变化通知
public static onDataChange(data: distributedKVStore.ChangeNotification) { try { hilog.debug(DOMAIN, TAG, `KVStore onDataChange: ${JSON.stringify(data)}`); EventBus.emit(EventBus.KV_DATA_CHANGE, data); } catch (err) { hilog.error(DOMAIN, TAG, `KVStore onDataChange error: ${err?.code}, ${err?....
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 onDataChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST...
public static onDataChange(data: distributedKVStore.ChangeNotification) { try { hilog.debug(DOMAIN, TAG, `KVStore onDataChange: ${JSON.stringify(data)}`); EventBus.emit(EventBus.KV_DATA_CHANGE, data); } catch (err) { hilog.error(DOMAIN, TAG, `KVStore onDataChange error: ${err?.code}, ${err?....
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/DistributedKVService.ets#L362-L369
6f10e75ff97dc91f5d2a325f0ca4b9a284a54d04
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/RDPPerformanceManager.ets
arkts
getCurrentQuality
获取当前网络质量
getCurrentQuality(): NetworkQuality { return this.currentQuality }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentQuality 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 NetworkQuality AST#identifier#Right AST#ERRO...
getCurrentQuality(): NetworkQuality { return this.currentQuality }
https://github.com/AetheriumSimulator/qemu-hmos
da313f9ad9a50739ffc2d3da78c081de7cbda604
github
qiaomu8559968/FlipClock
clock_component/src/main/ets/components/FlipDigit.ets
arkts
getTopClipShape
获取上半部分裁剪路径 (参考 MyFlipClock)
getTopClipShape(width: number, height: number, radius: number) { return new Path().commands(` M${radius} 0 L${vp2px(width) - radius} 0 A${radius} ${radius} 0 0 1 ${vp2px(width)} ${radius} L${vp2px(width)} ${vp2px(height / 2)} L0 ${vp2px(height / 2)} A${radius} ${radius} 0 0 1 0...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getTopClipShape AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Ri...
getTopClipShape(width: number, height: number, radius: number) { return new Path().commands(` M${radius} 0 L${vp2px(width) - radius} 0 A${radius} ${radius} 0 0 1 ${vp2px(width)} ${radius} L${vp2px(width)} ${vp2px(height / 2)} L0 ${vp2px(height / 2)} A${radius} ${radius} 0 0 1 0...
https://gitcode.com/qiaomu8559968/FlipClock
a80d2ad52b15aaa320e9d00bc520cbcd98e30308
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/ContentPanel.ets
arkts
getGlobalStyleConfig
获取全局样式配置
getGlobalStyleConfig(): PanelStyleConfig { return this.copyStyleConfig(this.globalStyleConfig); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getGlobalStyleConfig 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 PanelStyleConfig AST#identifier#Right AST...
getGlobalStyleConfig(): PanelStyleConfig { return this.copyStyleConfig(this.globalStyleConfig); }
https://github.com/DaLongZhuaZi/manxia
81f368f4323e816242af136ec297bc5c17e71a4b
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/contentSource/facades/AuthInterceptorFacade.ets
arkts
setTokenProvider
设置 Token 提供者函数 该函数在每次请求时被调用以获取最新的 Token @param provider 返回 Token 字符串的函数
setTokenProvider(provider: () => string): void { this.tokenProvider = provider; logger.info(TAG, 'Token 提供者已设置'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setTokenProvider AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left provider AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST...
setTokenProvider(provider: () => string): void { this.tokenProvider = provider; logger.info(TAG, 'Token 提供者已设置'); }
https://github.com/DaLongZhuaZi/NGF
b7e242f812c8759808ec58316b47d46989842f6e
github
OHPG/FinMusic
entry/src/main/ets/data/Repository.ets
arkts
setPlaylist
设置播放列表 @param playList @returns
public async setPlaylist(playList: Array<BaseItemDto>): Promise<void> { let ids = new Array<string>() playList.forEach((item: BaseItemDto) => { ids.push(item.Id!) }) let clientName = "FinMusic" this.playlistId = await this.requireApi().setPlaylist(this.playlistId, ids, clientName) }
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 setPlaylist AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left playList AST#identifier#R...
public async setPlaylist(playList: Array<BaseItemDto>): Promise<void> { let ids = new Array<string>() playList.forEach((item: BaseItemDto) => { ids.push(item.Id!) }) let clientName = "FinMusic" this.playlistId = await this.requireApi().setPlaylist(this.playlistId, ids, clientName) }
https://github.com/OHPG/FinMusic
44f452d1ee69cb68633eaec2295170820f09a62d
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/CombinedChartModel.ets
arkts
setDrawOrder
Sets the order in which the provided data objects should be drawn. The earlier you place them in the provided array, the further they will be in the background. e.g. if you provide new DrawOrer[] { DrawOrder.BAR, DrawOrder.LINE }, the bars will be drawn behind the lines. @param order
public setDrawOrder(order: DrawOrder[]): void { if (order == null || order.length <= 0) return; this.mDrawOrder = order; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDrawOrder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left order AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expressi...
public setDrawOrder(order: DrawOrder[]): void { if (order == null || order.length <= 0) return; this.mDrawOrder = order; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
24e5ee0022ef29b3c52ae39ec906abfc32750692
gitee
CLMC2025/Vignette
entry/src/main/ets/context/OfflineContext.ets
arkts
getRandomWords
获取随机词汇
getRandomWords(count: number): WordInfo[] { const allWords = this.getAllWords(); // NOTE: Math.random() is acceptable here for UI/UX randomization (not security-critical) // This is used only for shuffling word order in offline context generation const shuffled = allWords.sort(() => 0.5 - Math.random(...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getRandomWords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left count AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Rig...
getRandomWords(count: number): WordInfo[] { const allWords = this.getAllWords(); // NOTE: Math.random() is acceptable here for UI/UX randomization (not security-critical) // This is used only for shuffling word order in offline context generation const shuffled = allWords.sort(() => 0.5 - Math.random(...
https://github.com/CLMC2025/Vignette
8a87eaa81e9641533b6507911af6008e85002be1
github
xblLab/HarmonyProjectTemplate
features/course/src/main/ets/viewmodels/Calendar.ets
arkts
isPastDate
判断指定日期是否是过去日期(相对于今天) @param year 要判断的年份 @param month 要判断的月份 @param day 要判断的日期 @param currentYear 当前年份 @param currentMonth 当前月份 @param currentDay 当前日期 @returns 如果是过去日期返回true,否则返回false
private static isPastDate(year: number, month: number, day: number, currentYear: number, currentMonth: number, currentDay: number): boolean { // 如果年份小于当前年份,则是过去日期 if (year < currentYear) { return true; } // 如果年份等于当前年份但月份小于当前月份,则是过去日期 if (year === currentYear && month < currentMonth) { ...
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 isPastDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AS...
private static isPastDate(year: number, month: number, day: number, currentYear: number, currentMonth: number, currentDay: number): boolean { // 如果年份小于当前年份,则是过去日期 if (year < currentYear) { return true; } // 如果年份等于当前年份但月份小于当前月份,则是过去日期 if (year === currentYear && month < currentMonth) { ...
https://github.com/xblLab/HarmonyProjectTemplate
53db442963d229469e0be953f3009d807d72ea76
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/AppStateService.ets
arkts
subscribe
订阅状态变化事件(使用 emitter)
subscribe(callback: (event: emitter.EventData) => void): void { const innerEvent: emitter.InnerEvent = { eventId: APP_STATE_EVENT_ID }; emitter.on(innerEvent, callback); }
AST#program#Left AST#expression_statement#Left AST#identifier#Left subscribe AST#identifier#Right AST#ERROR#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERR...
subscribe(callback: (event: emitter.EventData) => void): void { const innerEvent: emitter.InnerEvent = { eventId: APP_STATE_EVENT_ID }; emitter.on(innerEvent, callback); }
https://github.com/AlkaidLab/moonlight-harmony
b0d30dd0e63b860f7ea679b96a1c3d7a895a12db
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
includes
Determines whether BigInt64Array includes a certain element, returning true or false as appropriate @param { BigInt } searchElement - The element to search for @param { int } [fromIndex] - The position in this array at which to begin searching for searchElement. If fromIndex is undefined, the search starts at index 0. ...
public includes(searchElement: BigInt, fromIndex?: int): boolean { return this.indexOf(searchElement, asIntOrDefault(fromIndex, 0)) != -1 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left searchElement AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left BigInt AST#ide...
public includes(searchElement: BigInt, fromIndex?: int): boolean { return this.indexOf(searchElement, asIntOrDefault(fromIndex, 0)) != -1 }
https://gitcode.com/iop123123/arkts-static-skills
9f2be980ca5e5138620c64aeb5249410ed9d9699
gitcode
Countly/countly-sdk-hos
library/src/main/ets/CountlyInstance.ets
arkts
captureRejection
Wraps a module promise so a rejection is logged with the module/hook name and then resolved. Lets Promise.all act as "allSettled" for us without the SDK depending on Promise.allSettled availability.
private captureRejection(tag: string, p: Promise<void>): Promise<void> { return p.catch((err: Object) => { this.config.logger.e(`${tag} rejected: ${err}`); }); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left captureRejection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
private captureRejection(tag: string, p: Promise<void>): Promise<void> { return p.catch((err: Object) => { this.config.logger.e(`${tag} rejected: ${err}`); }); }
https://github.com/Countly/countly-sdk-hos
4d89691f26e83edd508e61993767a4d9c5d3a1e3
github
LJ666-ui/harmony-health-care
entry/src/main/ets/utils/NavigationManager.ets
arkts
navigateWithParams
页面跳转(带参数) @param url 目标页面路径 @param params 导航参数 @returns Promise<void>
public async navigateWithParams<T extends NavigationParams>(url: string, params: T): Promise<void> { const startTime = Date.now(); try { // 验证路由路径 if (!this.validateRoute(url)) { throw NavigationErrorHandler.createRouteNotFoundError(url); } // 验证参数 if (!params || typeof...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#identifier#Left navigateWithParams AST#identifier#Right AST#<#Left < AST#<#Right AST#type_identifier#Left T AST#type_identifier#Right AST#extends#Left extends AST#extends#Right AST#ERROR#Left AST#t...
public async navigateWithParams<T extends NavigationParams>(url: string, params: T): Promise<void> { const startTime = Date.now(); try { // 验证路由路径 if (!this.validateRoute(url)) { throw NavigationErrorHandler.createRouteNotFoundError(url); } // 验证参数 if (!params || typeof...
https://github.com/LJ666-ui/harmony-health-care
738393d66c7382e90e3898ba49f8de99a57632d2
github
hiyuey3/Hixy_MyMemories
entry/src/main/ets/store/MemoryStore.ets
arkts
getEventById
根据 ID 获取事件 @param id 事件 ID @returns MemoryItem | undefined
function getEventById(id: number): MemoryItem | undefined { return undefined; // 返回 undefined 作为默认值 }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getEventById AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function getEventById(id: number): MemoryItem | undefined { return undefined; // 返回 undefined 作为默认值 }
https://github.com/hiyuey3/Hixy_MyMemories/blob/9769d82c97a877be3d464456e79f66c5c84a9590/entry/src/main/ets/store/MemoryStore.ets#L30-L32
d8fb9a0acef2674c8105b5e6d74cdd7d4a97c9d5
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
filter
Creates a new Int8Array from current Int8Array based on a condition fn. @param { function } fn - the condition to apply for each element @returns { Int8Array } - a new Int8Array @syscap SystemCapability.Utils.Lang @FaAndStageModel
public filter(fn: (val: number, index: int, array: Int8Array) => boolean): Int8Array { let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt) let resLen = 0 for (let i = 0; i < this.lengthInt; ++i) { markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this) ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left filter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R...
public filter(fn: (val: number, index: int, array: Int8Array) => boolean): Int8Array { let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt) let resLen = 0 for (let i = 0; i < this.lengthInt; ++i) { markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this) ...
https://gitcode.com/iop123123/arkts-static-skills
382de8c6f5a48a14b3375362e178ef85ce7c1daf
gitcode
Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie
StackGameWithUnityDevEcoExport/tuanjieLib/src/main/ets/utils/TuanjieNative.ets
arkts
nativeOnResume
Resume engine loop.
public static nativeOnResume(): void { tuanjie.nativeOnResume(); }
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 nativeOnResume AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
public static nativeOnResume(): void { tuanjie.nativeOnResume(); }
https://github.com/Explore-In-HMOS-Wearable/stack-game-with-unity-tuanjie
3439cc26aadeeb34bb388158e9b1533c7d053f34
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadManager.ets
arkts
forceUsbDriverMode
强制切换到 USB 驱动模式 用于用户手动接管或 Game Controller Kit 有问题时 @returns 是否切换成功
async forceUsbDriverMode(): Promise<boolean> { console.info('[GAMEPAD] 用户请求强制切换到 USB 驱动模式'); // 如果已经在纯传统模式,直接返回 if (!this.useGameControllerKit) { console.info('[GAMEPAD] 当前已是 USB 驱动模式'); return true; } // 停止 Game Controller Kit try { gameControllerService.stopMonito...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left forceUsbDriverMode 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#:#Ri...
async forceUsbDriverMode(): Promise<boolean> { console.info('[GAMEPAD] 用户请求强制切换到 USB 驱动模式'); // 如果已经在纯传统模式,直接返回 if (!this.useGameControllerKit) { console.info('[GAMEPAD] 当前已是 USB 驱动模式'); return true; } // 停止 Game Controller Kit try { gameControllerService.stopMonito...
https://github.com/AlkaidLab/moonlight-harmony
4cbabaf7a8c9cc74652b58f43affa0a438434fd0
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/ScraperManager.ets
arkts
searchBangumi
搜索Bangumi
private async searchBangumi( keyword: string, contentType?: ScraperContentType, limit: number = 25 ): Promise<ScraperSearchResult> { let bangumiType: BangumiSubjectType | undefined; switch (contentType) { case ScraperContentType.MANGA: case ScraperContentType.BOOK: bangu...
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 searchBangumi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left...
private async searchBangumi( keyword: string, contentType?: ScraperContentType, limit: number = 25 ): Promise<ScraperSearchResult> { let bangumiType: BangumiSubjectType | undefined; switch (contentType) { case ScraperContentType.MANGA: case ScraperContentType.BOOK: bangu...
https://github.com/DaLongZhuaZi/manxia
899a6a4f7bf21cebacc8a9c8a4d659fc17ae52b7
github
fa223797/Harmonyos-notebook
entry/src/main/ets/viewmodel/UserModel.ets
arkts
constructor
给参数赋值初始变量
constructor(id:number,name:string) { this.id =id this.name = name }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST...
constructor(id:number,name:string) { this.id =id this.name = name }
https://github.com/fa223797/Harmonyos-notebook
68df3e3bdb34cdf798e860f26bd23ce2b6063d12
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/PersonalizedBudgetService.ets
arkts
createPersonalizedConfig
创建个性化预测配置
static async createPersonalizedConfig(userId: number): Promise<ForecastEngineConfig> { const profile = await UserProfileDAO.getByUserId(userId); const thresholds = await PersonalizedBudgetService.getPersonalizedThresholds(userId); const config: ForecastEngineConfig = { algorithm: 'ensemble', ...
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 createPersonalizedConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST...
static async createPersonalizedConfig(userId: number): Promise<ForecastEngineConfig> { const profile = await UserProfileDAO.getByUserId(userId); const thresholds = await PersonalizedBudgetService.getPersonalizedThresholds(userId); const config: ForecastEngineConfig = { algorithm: 'ensemble', ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
d8aefb3aa73f52976e252c4e3cd7735dc5fd8ead
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/07.value_types/02.floating-point_types_and_operations/addition/addition_float.ets
arkts
main
--- desc: check addition of two floats ---
function main(): void { const a: float = {{v.left}} as float const b: float = {{v.right}} as float const v: float = {{v.result}} as float const r: float = a + b if (Float.isNaN(v)) { assert(Float.isNaN(r)) } else { assert r == v } }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { const a: float = {{v.left}} as float const b: float = {{v.right}} as float const v: float = {{v.result}} as float const r: float = a + b if (Float.isNaN(v)) { assert(Float.isNaN(r)) } else { assert r == v } }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
342c1258f6caac08a60bc570c3789a38b7d297f5
gitee
iichen-bycode/ArkTsWanandroid
entry/src/main/ets/viewmodel/SearchViewModel.ets
arkts
search
搜索 @param callback
async search(isRefresh:boolean,key:string,callback: ResultCallback,searchType:string,authorId:number) { if(isRefresh) { this.page = 0 this.articleModel.over = false } if(this.articleModel.over && false) { callback([]) } else { await this.request() .promise(searchType ==...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left search AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left isRefresh AST#identifier#Right AST#typ...
async search(isRefresh:boolean,key:string,callback: ResultCallback,searchType:string,authorId:number) { if(isRefresh) { this.page = 0 this.articleModel.over = false } if(this.articleModel.over && false) { callback([]) } else { await this.request() .promise(searchType ==...
https://github.com/iichen-bycode/ArkTsWanandroid
940ddabb0235fdd26f2caed7024144eccf0ed8c9
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MainMenuPage.ets
arkts
getEBookShelfCovers
获取电子书书架封面列表(按当前预览规则) [修复] 改进封面获取逻辑,支持多种图片来源
private getEBookShelfCovers(): string[] { const covers: string[] = []; // 从电子书获取封面 for (const ebook of this.ebookList) { if (covers.length >= this.getShelfPreviewCountForDisplay()) break; const coverPath = this.getValidEBookCoverPath(ebook); if (coverPath) { covers.push(coverPath...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getEBookShelfCovers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST...
private getEBookShelfCovers(): string[] { const covers: string[] = []; // 从电子书获取封面 for (const ebook of this.ebookList) { if (covers.length >= this.getShelfPreviewCountForDisplay()) break; const coverPath = this.getValidEBookCoverPath(ebook); if (coverPath) { covers.push(coverPath...
https://github.com/DaLongZhuaZi/manxia
60211d7afa2cb7a21d6ae7de4139e9d670dfe7fc
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/DeviceSensorService.ets
arkts
setDataCallback
设置数据回调
setDataCallback(callback: SensorDataCallback | null): void { this.dataCallback = callback; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setDataCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left SensorDat...
setDataCallback(callback: SensorDataCallback | null): void { this.dataCallback = callback; }
https://github.com/AlkaidLab/moonlight-harmony
8126d7fc75c413e9994f9b438bbede05f3563e1d
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/ChartData.ets
arkts
setValueTypeface
Sets the Typeface for all value-labels for all DataSets this data object contains. @param tf
public setValueTypeface(tf: FontFamily): void { if (this.mDataSets) { for (let data of this.mDataSets.dataSource) { data.setValueTypeface(tf); } } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setValueTypeface AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left F...
public setValueTypeface(tf: FontFamily): void { if (this.mDataSets) { for (let data of this.mDataSets.dataSource) { data.setValueTypeface(tf); } } }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
7929b4921097512017447d2d6d2f2d1c18f28777
gitee
HarmonyOS_Samples/BestPracticeSnippets
HDRVivid/ProcessingInterfaceTest/entry/src/main/ets/utils/AVPlayerDemo.ets
arkts
avPlayerLiveDemo
以下demo为通过url设置网络地址来实现播放直播码流的demo
async avPlayerLiveDemo() { try { // 创建avPlayer实例对象 let avPlayer: media.AVPlayer = await media.createAVPlayer(); // 创建状态机变化回调函数 this.setAVPlayerCallback(avPlayer, this.callback); this.isSeek = false; // 不支持seek操作 avPlayer.url = 'http://xxx.xxx.xxx.xxx:xx/xx/index.m3u8'; // 播放hls...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left avPlayerLiveDemo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST...
async avPlayerLiveDemo() { try { // 创建avPlayer实例对象 let avPlayer: media.AVPlayer = await media.createAVPlayer(); // 创建状态机变化回调函数 this.setAVPlayerCallback(avPlayer, this.callback); this.isSeek = false; // 不支持seek操作 avPlayer.url = 'http://xxx.xxx.xxx.xxx:xx/xx/index.m3u8'; // 播放hls...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
fdcaeefc5a029dccefdd91922c49567bfc9c9602
gitcode
HarmonyOS_Samples/BestPracticeSnippets
AppDataSecurity/entry/src/main/ets/pages/Index.ets
arkts
GetAesEncryptProperties
[End get_aes_generate_properties] [Start get_aes_encrypt_properties]
function GetAesEncryptProperties(): Array<huks.HuksParam> { let properties: Array<huks.HuksParam> = [{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES }, { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 }, { tag: huks.HuksTag.HUKS_T...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left GetAesEncryptProperties 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#gen...
function GetAesEncryptProperties(): Array<huks.HuksParam> { let properties: Array<huks.HuksParam> = [{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES }, { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 }, { tag: huks.HuksTag.HUKS_T...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
a611c49ee1c95fb50db7408a0f6af7437b888bab
gitcode
2763981847/Clock-Alarm
entry/src/main/ets/viewmodel/CityItem.ets
arkts
formatUTCOffset
格式化时区偏移,将其转换为形如+HH:mm或-HH:mm的字符串。 @param offset - 时区偏移,单位:小时 @returns 格式化后的时区字符串,例如 +08:00 或 -05:30
static formatUTCOffset(offset: number): string { // 确定符号并取得绝对值 const sign = offset >= 0 ? '+' : '-'; const absoluteOffset = Math.abs(offset); // 分离小时和分钟 const hours = Math.floor(absoluteOffset); const minutes = Math.floor((absoluteOffset - hours) * 60); // 格式化小时和分钟 const formattedHou...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatUTCOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left offset AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
static formatUTCOffset(offset: number): string { // 确定符号并取得绝对值 const sign = offset >= 0 ? '+' : '-'; const absoluteOffset = Math.abs(offset); // 分离小时和分钟 const hours = Math.floor(absoluteOffset); const minutes = Math.floor((absoluteOffset - hours) * 60); // 格式化小时和分钟 const formattedHou...
https://github.com/2763981847/Clock-Alarm
a440177748ac5bf0362701aa9491c488e3082d2c
github
offlinecat-dev/OCNetORM
src/main/ets/core/EntityMetadata.ets
arkts
getIndexes
获取索引元数据列表
getIndexes(): Array<IndexMetadata> { return this.indexes.slice() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getIndexes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right A...
getIndexes(): Array<IndexMetadata> { return this.indexes.slice() }
https://github.com/offlinecat-dev/OCNetORM
6c31f844593fd09573e5a798cdf98a3c62b390e3
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SharedLedgerDAO.ets
arkts
updateMemberCount
更新成员数量(自动计算)
static async updateMemberCount(ledgerId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); // 统计当前账本的成员数量 const countSql = ` SELECT COUNT(*) as count FROM ${LedgerMember.tableName} WHERE ledger_id = ? AND is_deleted = 0 `; const c...
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 updateMemberCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ledgerId AST#identifier#Right AST#ERROR#Left AST#:#Le...
static async updateMemberCount(ledgerId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); // 统计当前账本的成员数量 const countSql = ` SELECT COUNT(*) as count FROM ${LedgerMember.tableName} WHERE ledger_id = ? AND is_deleted = 0 `; const c...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
8d12c0594103b985967e78919cabb7785cba6aae
github
Joker-x-dev/HarmonyKit
feature/auth/src/main/ets/view/LoginPage.ets
arkts
build
构建登录页 @returns {void} 无返回值
build() { AppNavDestination({ title: $r("app.string.login_title"), viewModel: this.vm }) { this.LoginContent(); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c...
build() { AppNavDestination({ title: $r("app.string.login_title"), viewModel: this.vm }) { this.LoginContent(); } }
https://github.com/Joker-x-dev/HarmonyKit
fdb54ae2eba9c932573111d210816d5637d4f25a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Theme/AppColors.ets
arkts
inverseSurface
==================== 反色 ====================
static get inverseSurface(): string { return getColorForCurrentTheme(ColorRole.INVERSE_SURFACE); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left inverseSurface AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
static get inverseSurface(): string { return getColorForCurrentTheme(ColorRole.INVERSE_SURFACE); }
https://github.com/DaLongZhuaZi/manxia
946b2760a4847b89a6986bdd9e0e39e7d99b5482
github
pangpang20/antennaPodHM
entry/src/main/ets/service/PodcastService.ets
arkts
updatePodcastEpisodes
更新播客的Episodes 成功时更新 lastSuccessfulFetch,失败时标记 isFetchFailed
async updatePodcastEpisodes(podcastId: string): Promise<void> { try { console.info(`[PodcastService] Starting to update episodes for podcast: ${podcastId}`); // 从数据库获取播客信息,拿到 feedUrl const podcast = await this.dbService.getPodcastById(podcastId); if (!podcast || !podcast.feedUrl) { ...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left updatePodcastEpisodes AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left podcastId AST#identifier#Right AST#type_annotati...
async updatePodcastEpisodes(podcastId: string): Promise<void> { try { console.info(`[PodcastService] Starting to update episodes for podcast: ${podcastId}`); // 从数据库获取播客信息,拿到 feedUrl const podcast = await this.dbService.getPodcastById(podcastId); if (!podcast || !podcast.feedUrl) { ...
https://github.com/pangpang20/antennaPodHM
93300df56d842a7485e0c7b657643e413870ae50
github
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/utils/HistoryManager.ets
arkts
deleteSimpleHistory
删除基础评估器历史记录
static async deleteSimpleHistory(context: Context, id: string): Promise<void> { try { const prefs = await HistoryManager.getPreferences(context); const historyStr = await prefs.get(HistoryManager.SIMPLE_HISTORY_KEY, '[]') as string; let history: SimpleHistoryItem[] = JSON.parse(historyStr); ...
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 deleteSimpleHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#L...
static async deleteSimpleHistory(context: Context, id: string): Promise<void> { try { const prefs = await HistoryManager.getPreferences(context); const historyStr = await prefs.get(HistoryManager.SIMPLE_HISTORY_KEY, '[]') as string; let history: SimpleHistoryItem[] = JSON.parse(historyStr); ...
https://github.com/qiuhaotc/Sunshine_HarmonyOS
00e8465eeb45ec39e4e843f0bc2a5c98036b7944
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/SharedLedgerService.ets
arkts
deleteLedger
删除账本(软删除)
static async deleteLedger(ledgerId: number, userId: number): Promise<boolean> { try { // 检查权限 const hasPermission = await SharedLedgerService.checkPermission(ledgerId, userId, 'owner'); if (!hasPermission) { throw new Error('无权限删除账本'); } const success = await SharedLedgerDAO...
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 deleteLedger AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ledgerId AST#identifier#Right AST#ERROR#Left AST#:#Left : ...
static async deleteLedger(ledgerId: number, userId: number): Promise<boolean> { try { // 检查权限 const hasPermission = await SharedLedgerService.checkPermission(ledgerId, userId, 'owner'); if (!hasPermission) { throw new Error('无权限删除账本'); } const success = await SharedLedgerDAO...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
9a9b367b072c49a4cde66e537a4d8544a8fb73f9
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/KnowledgeService.ets
arkts
createCategory
创建分类 @param name 分类名称 @param parentId 父分类ID @param icon 图标
async createCategory(name: string, parentId?: string, icon?: string): Promise<ApiResponse<KnowledgeCategory>> { return this.client.post<KnowledgeCategory>('/api/v1/knowledge/categories', { name, parentId, icon }) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createCategory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left name AST#identifier#Right AST#type_annotation#Left AST#:#Left : ...
async createCategory(name: string, parentId?: string, icon?: string): Promise<ApiResponse<KnowledgeCategory>> { return this.client.post<KnowledgeCategory>('/api/v1/knowledge/categories', { name, parentId, icon }) }
https://github.com/David8Idira/AI-OA
aaf6a17b85ed5a7488aa6878447c0e730f04957e
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/UserProfileDAO.ets
arkts
analyzeAndUpdate
自动分析并更新用户画像 基于历史账单和预算数据
static async analyzeAndUpdate(userId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); // 1. 计算平均月收入和支出(最近6个月) const sixMonthsAgo = new Date(); sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() - 6); const startDate = sixMonthsAgo.toISOString().substr...
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 analyzeAndUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left ...
static async analyzeAndUpdate(userId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); // 1. 计算平均月收入和支出(最近6个月) const sixMonthsAgo = new Date(); sixMonthsAgo.setMonth(sixMonthsAgo.getMonth() - 6); const startDate = sixMonthsAgo.toISOString().substr...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
9e19c4c83f5e31ddc8d2afa81bb111be22e8682e
github
LJ666-ui/harmony-health-care
entry/src/main/ets/utils/SampleImageUtil.ets
arkts
checkSampleImageExists
检查示例图片资源是否存在 注意:这个方法在运行时可能无法准确判断,建议在开发时确保资源文件存在
static checkSampleImageExists(imagingType: ImagingType): boolean { // 简单返回true,实际项目中应该检查文件是否存在 return true; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkSampleImageExists AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left imagingType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id...
static checkSampleImageExists(imagingType: ImagingType): boolean { // 简单返回true,实际项目中应该检查文件是否存在 return true; }
https://github.com/LJ666-ui/harmony-health-care
a34bda18f7e3fdce55d6e62cc05a5d550e49a025
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/StreamDownloader.ets
arkts
downloadWithProcessing
─── 公开接口 ───────────────────────────────────────────────────────────────── 批量流式下载并写入文件 @param context UIAbility 上下文(后台任务申请) @param urls 下载 URL 列表 @param outputDir 文件输出目录(需确保已存在) @param options 可选配置
async downloadWithProcessing( context: common.UIAbilityContext, urls: string[], outputDir: string, options?: { /** 进度回调:(已完成数, 总数) */ onProgress?: (completed: number, total: number) => void; /** 自定义文件名,默认 page_0000.jpg */ fileNameProvider?: (index: number, url: string) => strin...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left downloadWithProcessing AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AS...
async downloadWithProcessing( context: common.UIAbilityContext, urls: string[], outputDir: string, options?: { /** 进度回调:(已完成数, 总数) */ onProgress?: (completed: number, total: number) => void; /** 自定义文件名,默认 page_0000.jpg */ fileNameProvider?: (index: number, url: string) => strin...
https://github.com/DaLongZhuaZi/manxia
90f19ad5e9430d2fcd6796a2d1e5bc344fd2c14e
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/SettingsService.ets
arkts
parsePerfOverlayOrientation
解析性能覆盖层方向
private parsePerfOverlayOrientation(orientationStr: string): PerfOverlayOrientation { switch (orientationStr) { case '水平': return PerfOverlayOrientation.HORIZONTAL; case '垂直': return PerfOverlayOrientation.VERTICAL; default: return PerfOverlayOrientation.HORIZONTAL; }...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parsePerfOverlayOrientation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left orientationStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#...
private parsePerfOverlayOrientation(orientationStr: string): PerfOverlayOrientation { switch (orientationStr) { case '水平': return PerfOverlayOrientation.HORIZONTAL; case '垂直': return PerfOverlayOrientation.VERTICAL; default: return PerfOverlayOrientation.HORIZONTAL; }...
https://github.com/AlkaidLab/moonlight-harmony
13b56746cd870b448b9757357090d29e0a73e358
github
openharmony/codelabs
Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets
arkts
setDataChangeListener
Set the data change listening function. @param callback Callback.
setDataChangeListener(callback: (data: distributedKVStore.ChangeNotification) => void): void { if (this.kvStore === undefined) { Logger.error('KvStoreModel', 'setDataChangeListener kvStore is null'); return; } try { this.kvStore.on('dataChange', distributedKVStore.SubscribeType.SUBSCRIB...
AST#program#Left AST#ERROR#Left AST#identifier#Left setDataChangeListener AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left...
setDataChangeListener(callback: (data: distributedKVStore.ChangeNotification) => void): void { if (this.kvStore === undefined) { Logger.error('KvStoreModel', 'setDataChangeListener kvStore is null'); return; } try { this.kvStore.on('dataChange', distributedKVStore.SubscribeType.SUBSCRIB...
https://gitee.com/openharmony/codelabs.git
cc91c6ddd255db1e6039d23b019a9af59602a3ec
gitee
the-wwyang/kids-learning-app
src/main/ets/services/WrongQuestionService.ets
arkts
cleanupMasteredQuestions
清理已掌握的旧错题 @param records 错题记录列表 @param daysAgo 多少天前掌握的错题可以清理 @returns 清理后的错题列表
static cleanupMasteredQuestions( records: WrongQuestionRecord[], daysAgo: number = 30 ): WrongQuestionRecord[] { const cutoffDate = new Date(); cutoffDate.setDate(cutoffDate.getDate() - daysAgo); const cutoffTime = cutoffDate.toISOString(); return records.filter(record => { // 保留未掌握的 ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left cleanupMasteredQuestions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subs...
static cleanupMasteredQuestions( records: WrongQuestionRecord[], daysAgo: number = 30 ): WrongQuestionRecord[] { const cutoffDate = new Date(); cutoffDate.setDate(cutoffDate.getDate() - daysAgo); const cutoffTime = cutoffDate.toISOString(); return records.filter(record => { // 保留未掌握的 ...
https://github.com/the-wwyang/kids-learning-app
43d0911b849c49033bc2a43279aca8005acd30a6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/CacheConfigManager.ets
arkts
getDiskCacheConfig
获取磁盘缓存配置
public getDiskCacheConfig(): DiskCacheConfig { const result: DiskCacheConfig = { maxSize: this.config.diskCache.maxSize, maxAge: this.config.diskCache.maxAge, enabled: this.config.diskCache.enabled, compressionQuality: this.config.diskCache.compressionQuality }; return result; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDiskCacheConfig 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 Dis...
public getDiskCacheConfig(): DiskCacheConfig { const result: DiskCacheConfig = { maxSize: this.config.diskCache.maxSize, maxAge: this.config.diskCache.maxAge, enabled: this.config.diskCache.enabled, compressionQuality: this.config.diskCache.compressionQuality }; return result; }
https://github.com/DaLongZhuaZi/manxia
c12fce317a80f2469b17407cf5d712b5100521f8
github
Joker-x-dev/CoolMallArkTS
feature/auth/src/main/ets/viewmodel/LoginViewModel.ets
arkts
onWechatLoginClick
微信登录点击 @returns {void} 无返回值
onWechatLoginClick(): void { // 第三方登录暂未接入,等待后续实现 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onWechatLoginClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_express...
onWechatLoginClick(): void { // 第三方登录暂未接入,等待后续实现 }
https://github.com/Joker-x-dev/CoolMallArkTS
f954abe727f9cfa16c7c61893ea76f468be1b628
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
setDrawBorders
When enabled, the borders rectangle will be rendered. If this is enabled, there is no point drawing the axis-lines of x- and y-axis. @param enabled
public setDrawBorders(enabled: boolean): void { this.mDrawBorders = enabled; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDrawBorders 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#Lef...
public setDrawBorders(enabled: boolean): void { this.mDrawBorders = enabled; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
09a509566f368bb1ce37cda2b4aef9f98c8e96de
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
getAllLocalPagesByComicId
[性能优化] 批量获取漫画所有章节的页面信息(本地漫画) 单条SQL替代N次逐章节查询,返回按chapterId分组的Map
public async getAllLocalPagesByComicId(comicId: string): Promise<Map<string, PageInfo[]>> { try { const sql = `SELECT p.id, p.chapterId, p.pageNumber, p.imageUrl, p.localPath, p.width, p.height, p.fileSize FROM page p INNER JOIN chapter c ON p....
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 getAllLocalPagesByComicId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left A...
public async getAllLocalPagesByComicId(comicId: string): Promise<Map<string, PageInfo[]>> { try { const sql = `SELECT p.id, p.chapterId, p.pageNumber, p.imageUrl, p.localPath, p.width, p.height, p.fileSize FROM page p INNER JOIN chapter c ON p....
https://github.com/DaLongZhuaZi/manxia
ab93d9acc8d7c4c95bd084f87c7377213e744d5f
github
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/db/MusicMemoryStore.ets
arkts
buildPlaylists
Seeds a default playlist containing demo song ids 1–34.
private buildPlaylists(): PlaylistRow[] { const ids: number[] = []; for (let songId = 1; songId <= 34; songId++) { ids.push(songId); } const playlist = new PlaylistRow(); playlist.playlistId = 1; playlist.title = $r('app.string.playlist_detail_title'); playlist.songIds = ids; ret...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildPlaylists 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 Play...
private buildPlaylists(): PlaylistRow[] { const ids: number[] = []; for (let songId = 1; songId <= 34; songId++) { ids.push(songId); } const playlist = new PlaylistRow(); playlist.playlistId = 1; playlist.title = $r('app.string.playlist_detail_title'); playlist.songIds = ids; ret...
https://gitcode.com/HarmonyOS_Samples/MusicHome
8ed6aa7a274e9584bd60c94862cbbf64e059f1bc
gitcode
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/db/MusicMemoryStore.ets
arkts
getInstance
@returns Shared {@link MusicMemoryStore} instance.
public static getInstance(): MusicMemoryStore { if (MusicMemoryStore.instance === undefined) { MusicMemoryStore.instance = new MusicMemoryStore(); } return MusicMemoryStore.instance; }
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 getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
public static getInstance(): MusicMemoryStore { if (MusicMemoryStore.instance === undefined) { MusicMemoryStore.instance = new MusicMemoryStore(); } return MusicMemoryStore.instance; }
https://gitcode.com/HarmonyOS_Samples/MusicHome
04d9820d09011b7b072b43c5d78fb918acf410f6
gitcode
openharmony/arkcompiler_taihe_ffi_gen
test/ani_optional/user/main.ets
arkts
func_primitive_i8
数值类型测试函数
function func_primitive_i8() { let instance: optionalTest.ExampleInterface = optionalTest.getInterface(); instance.funcPrimitiveI8((5).toByte()) // byte 对应 i8 }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left func_primitive_i8 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_d...
function func_primitive_i8() { let instance: optionalTest.ExampleInterface = optionalTest.getInterface(); instance.funcPrimitiveI8((5).toByte()) // byte 对应 i8 }
https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen
99f1d4e90ba3ea622987bb0f9664edaada6db342
gitcode
Joker-x-dev/CoolMallArkTS
core/ui/src/main/ets/component/appbar/SearchTopAppBar.ets
arkts
build
构建搜索顶部栏 @returns {void} 无返回值
build(): void { IBestNavBar({ isShowBorder: false, leftRightPadding: 12, navBarBgColor: $r("app.color.bg_grey"), leftBuilder: (): void => this.buildLeft(), titleBuilder: (): void => this.buildTitle(), isShowRight: this.isShowRight && this.rightBuilder !== undefined, right...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { IBestNavBar({ isShowBorder: false, leftRightPadding: 12, navBarBgColor: $r("app.color.bg_grey"), leftBuilder: (): void => this.buildLeft(), titleBuilder: (): void => this.buildTitle(), isShowRight: this.isShowRight && this.rightBuilder !== undefined, right...
https://github.com/Joker-x-dev/CoolMallArkTS
a0a031a25655c52e520316ab5d01a0514454351f
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets
arkts
loadOnCurrentTab
Loads an url on current tab. @param url
loadOnCurrentTab(url: string) { const hasCreated = this.ensureTheresOneTab(url); if (hasCreated) { // Do nothing } else { try { if (this.currentTab?.controller) { this.currentTab.restoringWebState = false; this.currentTab.controller.loadUrl(url); } } c...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left loadOnCurrentTab AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Rig...
loadOnCurrentTab(url: string) { const hasCreated = this.ensureTheresOneTab(url); if (hasCreated) { // Do nothing } else { try { if (this.currentTab?.controller) { this.currentTab.restoringWebState = false; this.currentTab.controller.loadUrl(url); } } c...
https://github.com/awaLiny2333/LinysBrowser_NEXT
ed2ffed644bbb63496b022000557f8b175a24ac2
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets
arkts
run
Run task in EAWorker Note: it has no effect if EAWorker was stoped @param { Function } task function to execute @param { ...Any } args argumnents for task to execute with @returns { Promise<R> } Promise that represents the task
public run<R> (task: Function, ...args: FixedArray<Any>): Promise<R> { if (!this.loopStarted.get()) { throw new Error('EAWorker:: Cannot run task when worker is not started'); } return this.worker.run<R>(task, ...args); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left run AST#identifier#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left R AST#identifier#Right AST#binary_expression#Right...
public run<R> (task: Function, ...args: FixedArray<Any>): Promise<R> { if (!this.loopStarted.get()) { throw new Error('EAWorker:: Cannot run task when worker is not started'); } return this.worker.run<R>(task, ...args); }
https://gitcode.com/iop123123/arkts-static-skills
a36317fafdeb38af6726e5efb4d79b3fdf11197a
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayAsListInt.ets
arkts
constructor
Constructs new empty ArrayAsList
constructor() { this.init(0, new Int()); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
constructor() { this.init(0, new Int()); }
https://gitcode.com/iop123123/arkts-static-skills
f1b0f47e49a4ea5f098cffbdaabd5b952bfc2f57
gitcode
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/HttpUtil.ets
arkts
download
文件下载 @param url 下载URL @param filePath 保存路径 @param progressCallback 进度回调
static async download( url: string, filePath: string, progressCallback?: (progress: number) => void ): Promise<void> { // 检查网络状态 if (!HttpUtil.checkNetworkStatus()) { throw new Error('网络不可用'); } const httpRequest = http.createHttp(); try { console.log('[HTTP] 开始下载文...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left download AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left u...
static async download( url: string, filePath: string, progressCallback?: (progress: number) => void ): Promise<void> { // 检查网络状态 if (!HttpUtil.checkNetworkStatus()) { throw new Error('网络不可用'); } const httpRequest = http.createHttp(); try { console.log('[HTTP] 开始下载文...
https://github.com/TDCQCX/ShiHuaMusic-Harmony
ae40c28561aa7cf4b18759b31c4c433151558424
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Array.ets
arkts
lastIndexOf
lastIndexOf(arr: int[], key: int, 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 arr,...
function lastIndexOf(arr: int[], key: int, 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: int[], key: int, fromIndex: int): int throws { return lastIndexOf(arr, key, -1, fromIndex) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
b9c0d77d2197c42c74e879b47024f2fbc4038d8b
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
copyWithin
Makes a copy of internal elements to targetPos from begin to end of Uint8Array. See rules of parameters normalization on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin} @param { int } target - insert index to place copied elements @returns { Uint8Array } @syscap...
public copyWithin(target: int): Uint8Array { this.copyWithinImpl(target, 0, this.lengthInt) return this }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left copyWithin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#...
public copyWithin(target: int): Uint8Array { this.copyWithinImpl(target, 0, this.lengthInt) return this }
https://gitcode.com/iop123123/arkts-static-skills
c4f4db3406493cce1c4f3be0201be5da3a209ce6
gitcode