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
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceAntiCrawler.ets
arkts
setOnNeedUserInteraction
设置用户交互回调(当需要用户手动完成验证时调用)
setOnNeedUserInteraction(callback: () => void): void { this.onNeedUserInteraction = callback; }
AST#program#Left AST#ERROR#Left AST#identifier#Left setOnNeedUserInteraction AST#identifier#Right 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#)#Left ) AST#)#Rig...
setOnNeedUserInteraction(callback: () => void): void { this.onNeedUserInteraction = callback; }
https://github.com/DaLongZhuaZi/manxia
891ebd8d1b82799873ab41e07baa321f10283c47
github
LZZLHY/hlib
entry/src/main/ets/viewmodel/DownloadVM.ets
arkts
start
启动下载。返回 task。失败抛错。
static async start(book: Book, ctx: common.UIAbilityContext): Promise<DownloadTask> { if (!DownloadVM.canDownload(book)) { throw new Error('no_download_link'); } // 注册重试上下文:首次入口标记当前域为 attempted。 const bookId: string = String(book.id); const initial: Set<string> = new Set<string>(); initi...
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 start AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left book AST#identifier#Right AST#:#Left : AST#:#Right...
static async start(book: Book, ctx: common.UIAbilityContext): Promise<DownloadTask> { if (!DownloadVM.canDownload(book)) { throw new Error('no_download_link'); } // 注册重试上下文:首次入口标记当前域为 attempted。 const bookId: string = String(book.id); const initial: Set<string> = new Set<string>(); initi...
https://github.com/LZZLHY/hlib
51d2b139ed0546fe085819ae3283a1028ade05ef
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelLoginManager.ets
arkts
removeLoginHeader
删除登录头信息
removeLoginHeader(sourceId: string): void { this.loginHeaderStore.delete(sourceId); this.cookies.delete(sourceId); this.savePersistedData(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeLoginHeader AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) A...
removeLoginHeader(sourceId: string): void { this.loginHeaderStore.delete(sourceId); this.cookies.delete(sourceId); this.savePersistedData(); }
https://github.com/DaLongZhuaZi/manxia
e083236b6042ef469d9467b49528ce93391bca86
github
richshaw2015/nds
ohos/entry/src/main/ets/utils/GameManager.ets
arkts
saveRecentGames
保存最近游戏列表
private async saveRecentGames(): Promise<void> { if (!this.dataPreferences) return; try { await this.dataPreferences.put(KEY_RECENT_GAMES, JSON.stringify(this.recentGames)); await this.dataPreferences.flush(); console.info(`${TAG} Saved ${this.recentGames.length} recent games`); } catch...
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 saveRecentGames AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
private async saveRecentGames(): Promise<void> { if (!this.dataPreferences) return; try { await this.dataPreferences.put(KEY_RECENT_GAMES, JSON.stringify(this.recentGames)); await this.dataPreferences.flush(); console.info(`${TAG} Saved ${this.recentGames.length} recent games`); } catch...
https://github.com/richshaw2015/nds
b195d68d65a67146afdfeeae3d4d3814b4f544a3
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
set
Assigns val as element on insertPos. @description Added to avoid (un)packing a single value into array to use overloaded set(long[], insertPos) @param val value to set @param insertPos index to change
public set(insertPos: number, val: BigInt): void { this.set(insertPos as int, val.getLong()) }
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#identifier#Left insertPos AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#...
public set(insertPos: number, val: BigInt): void { this.set(insertPos as int, val.getLong()) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
f2f56427f4d3704dd1035624da166aa295813cfd
gitee
openharmony-sig/flutter_permission_handler
permission_handler_ohos/ohos/src/main/ets/com/baseflow/permissionhandler/PermissionManager.ets
arkts
checkPermissionStatus
检测权限状态 @param permission 权限 @param context 上下文 @param successCallback 回调结果
public checkPermissionStatus(permission: number, context: common.Context, successCallback: CheckPermissionSuccessCallback): void { this.determinePermissionStatus(permission, successCallback); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left checkPermissionStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left permission AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number A...
public checkPermissionStatus(permission: number, context: common.Context, successCallback: CheckPermissionSuccessCallback): void { this.determinePermissionStatus(permission, successCallback); }
https://gitee.com/openharmony-sig/flutter_permission_handler.git
9b1ddbddc687bba71626424e8c96cc5a2e72a694
gitee
arkui-x/samples
CodeLab/Cases/feature/encapsulationdialog/src/main/ets/dialog/util/DialogOptionsFactory.ets
arkts
getOptionsByDialogType
工厂方法,拿到option @param dialogType @returns
public static getOptionsByDialogType(dialogType: DialogTypeEnum): promptAction.BaseDialogOptions { let options: promptAction.BaseDialogOptions = { maskColor: Color.Transparent, autoCancel: false }; switch (dialogType) { case DialogTypeEnum.BOTTOM: DialogOptionsFactory.fillBottomO...
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 getOptionsByDialogType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dialogType AST#identifier#Right ...
public static getOptionsByDialogType(dialogType: DialogTypeEnum): promptAction.BaseDialogOptions { let options: promptAction.BaseDialogOptions = { maskColor: Color.Transparent, autoCancel: false }; switch (dialogType) { case DialogTypeEnum.BOTTOM: DialogOptionsFactory.fillBottomO...
https://gitcode.com/arkui-x/samples
7103ff7aea9f78b3e86eaa420d8e9ea6a8e63b17
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/highlight/BarHighlighter.ets
arkts
getStackedHighlight
This method creates the Highlight object that also indicates which value of a stacked BarEntry has been selected. @param high the Highlight to work with looking for stacked values @param set @param xVal @param yVal @return
public getStackedHighlight(high: Highlight, set: IBarDataSet, xVal: number, yVal: number): Highlight | null { let entry: BarEntry | null = set.getEntryForXValue(xVal, yVal); if (entry == null) return null; // not stacked if (entry.getYVals() == null) { return high; } else { le...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStackedHighlight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left high AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
public getStackedHighlight(high: Highlight, set: IBarDataSet, xVal: number, yVal: number): Highlight | null { let entry: BarEntry | null = set.getEntryForXValue(xVal, yVal); if (entry == null) return null; // not stacked if (entry.getYVals() == null) { return high; } else { le...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
81962b617db214d07bd683751bc43b6d0d8a2bf0
gitee
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/VibratorManager.ets
arkts
vibratePulse
脉冲振动 — 短促脉冲节奏,模拟科技感扫描
static vibratePulse(): void { VibratorManager.logExecution('vibratePulse'); VibratorManager.vibratePattern([40, 80, 40, 80, 40], 1, VibrationUsage.PHYSICAL_FEEDBACK); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibratePulse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressio...
static vibratePulse(): void { VibratorManager.logExecution('vibratePulse'); VibratorManager.vibratePattern([40, 80, 40, 80, 40], 1, VibrationUsage.PHYSICAL_FEEDBACK); }
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
21ce715669f325ebd2de0fadfb13309dea0c8e57
github
bhengubv/aether-protocol
arkts/src/main/ets/incentive/MeshTipService.ets
arkts
constructor
Pass null for `routing` to always broadcast; pass null for `settle` to use the default no-op settlement provider; pass null for `logger` to disable diagnostics.
constructor( sender: TipMeshSender, signer: TipPacketSigner, identity: TipIdentitySigner, routing: TipRouteResolver | null, settle: MeshTipSettlementProvider | null, logger: TipLogger | null ) { this.sender = sender; this.signer = signer; this.identity = identity; this.routin...
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 sender AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TipMeshSender AST#identifie...
constructor( sender: TipMeshSender, signer: TipPacketSigner, identity: TipIdentitySigner, routing: TipRouteResolver | null, settle: MeshTipSettlementProvider | null, logger: TipLogger | null ) { this.sender = sender; this.signer = signer; this.identity = identity; this.routin...
https://github.com/bhengubv/aether-protocol
add35f7e35eae03002629e285c6ef23996a6afae
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/FinalizationQueue.ets
arkts
constructor
Creates FinalizationQueue object with the specific callback function. One can register an object to this queue and after reclamation of this object the callback function will be called. @param callback_value callback function which will be called after registered object reclamation.
public constructor(callback_value: (value: Object) => void) { this.init_arrays(FinalizationQueue.FIRST_SIZE); this.callback = callback_value; FinalizationQueue.registerInstance(this); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST...
public constructor(callback_value: (value: Object) => void) { this.init_arrays(FinalizationQueue.FIRST_SIZE); this.callback = callback_value; FinalizationQueue.registerInstance(this); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
67fa6db424aca33779497a8ef6728a8997e7b0f3
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
toBinary
Return a string representing the value of this Decimal in base 2, round to `significantDigits` significant digits. @param { double } significantDigits Significant digits. Integer, 1 to MAX_DIGITS inclusive. @returns { string } the string type @throws { BusinessError } 10200001 - The value of `significantDigits` is out ...
public toBinary(significantDigits: double): string { return this.toStringBinary(2, significantDigits); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toBinary AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left significantDigits AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left double AST...
public toBinary(significantDigits: double): string { return this.toStringBinary(2, significantDigits); }
https://gitcode.com/iop123123/arkts-static-skills
7776173349146d69e414d78b2323f1918762b059
gitcode
tdcare/tdwebrtc
src/main/ets/utils/StrUtil.ets
arkts
capitalize
将字符串首字母转换为大写,剩下为小写 @param str 待转换的字符串 @returns 转换后的
static capitalize(str: string = ''): string { if (StrUtil.isNotEmpty(str)) { const firstChar = str.charAt(0).toUpperCase(); const restChars = str.slice(1).toLowerCase(); return firstChar + restChars; } return ''; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left capitalize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#...
static capitalize(str: string = ''): string { if (StrUtil.isNotEmpty(str)) { const firstChar = str.charAt(0).toUpperCase(); const restChars = str.slice(1).toLowerCase(); return firstChar + restChars; } return ''; }
https://github.com/tdcare/tdwebrtc
d061dd93384131d692f8c8a66a9bf41e4fd09966
github
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/dao/EventDao.ets
arkts
getAllEvents
获取所有日程
async getAllEvents(): Promise<CalendarEvent[]> { const rdbStore = await this.initDatabase(); const events: CalendarEvent[] = []; try { const predicates = new relationalStore.RdbPredicates('calendar_events'); predicates.orderByDesc('start_time'); const resultSet = await rdbStore.query( ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAllEvents 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#generic...
async getAllEvents(): Promise<CalendarEvent[]> { const rdbStore = await this.initDatabase(); const events: CalendarEvent[] = []; try { const predicates = new relationalStore.RdbPredicates('calendar_events'); predicates.orderByDesc('start_time'); const resultSet = await rdbStore.query( ...
https://gitcode.com/openharmony/codelabs
59d968e010d7fd5a110bff209e332a8ba4464a76
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets
arkts
equals
Checks for equality this instance with provided object, treated as a Double Returns false if type of provided object is not the same as this type @param { Any } other object to be checked against @returns { boolean } true if provided object and this instance have same value, false otherwise Returns false if type of pro...
public equals(other: Any): boolean { if (this === other) { return true } if (!(other instanceof Double)) { return false } return this.value == (other as Double).value }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left equals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Any AST#identifier#Right...
public equals(other: Any): boolean { if (this === other) { return true } if (!(other instanceof Double)) { return false } return this.value == (other as Double).value }
https://gitcode.com/iop123123/arkts-static-skills
cefcbf573039471db973d985028068ce58bccdfe
gitcode
openharmony/developtools_profiler
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets
arkts
getChartBitmap
Returns the bitmap that represents the chart. @return
public getChartBitmap(): Paint[] { let returnedBitmap: Paint[] = []; let background = this.getBackground(); if (background == null) { background = '#ffffff'; } return returnedBitmap; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getChartBitmap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#express...
public getChartBitmap(): Paint[] { let returnedBitmap: Paint[] = []; let background = this.getBackground(); if (background == null) { background = '#ffffff'; } return returnedBitmap; }
https://gitee.com/openharmony/developtools_profiler.git
bb091b1f4a882a3cd9b0798cc9f9fe69d92f8361
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Task/BackgroundTaskManager.ets
arkts
hasActiveTasks
当前是否有活跃任务
public hasActiveTasks(): boolean { return this.getActiveTasks().length > 0; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hasActiveTasks 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 AS...
public hasActiveTasks(): boolean { return this.getActiveTasks().length > 0; }
https://github.com/DaLongZhuaZi/manxia
8106fceaab76c09fadb2da5416a7aa0d1ca60dda
github
universesons/arcts
entry/src/main/ets/view/UserBaseInfo.ets
arkts
build
回调函数 Initial as an empty function
build() { Column() { TextInput({ placeholder: "请输入你的签名" }) .onChange((value: string) => { signature = value }) .margin({ top: 20 }) .width(200) Button('确定', { type: ButtonType.Normal, stateEffect: true }) .onClick(() => { this.onSignatureChan...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Column() { TextInput({ placeholder: "请输入你的签名" }) .onChange((value: string) => { signature = value }) .margin({ top: 20 }) .width(200) Button('确定', { type: ButtonType.Normal, stateEffect: true }) .onClick(() => { this.onSignatureChan...
https://github.com/universesons/arcts
1cebaf0560bb7d331f79e687c9090d89e4d95500
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/pages/CategoryManagement.ets
arkts
toggleExpand
切换展开/折叠状态
toggleExpand(categoryId: number) { if (this.expandedIds.has(categoryId)) { this.expandedIds.delete(categoryId) } else { this.expandedIds.add(categoryId) } // 重新扁平化 this.loadCategories() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left toggleExpand AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left categoryId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AS...
toggleExpand(categoryId: number) { if (this.expandedIds.has(categoryId)) { this.expandedIds.delete(categoryId) } else { this.expandedIds.add(categoryId) } // 重新扁平化 this.loadCategories() }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
11984369ebe6f2939999c7e3ee771472ec8c7bf8
github
LZZLHY/hlib
entry/src/main/ets/api/HttpClient.ets
arkts
setProxy
设置 HTTP 代理。host 为空串或 port<=0 表示不使用代理。 代理 URL 示例:127.0.0.1:7890 (Clash 本地端口)、vps.example.com:8080。
setProxy(host: string, port: number): void { const cleanedHost: string = host.trim().replace(/^https?:\/\//, '').replace(/\/+$/, ''); if (cleanedHost.length === 0 || port <= 0 || port > 65535) { this.clearProxy(); return; } if (cleanedHost !== this.proxyHost || port !== this.proxyPort) { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setProxy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left host AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#...
setProxy(host: string, port: number): void { const cleanedHost: string = host.trim().replace(/^https?:\/\//, '').replace(/\/+$/, ''); if (cleanedHost.length === 0 || port <= 0 || port > 65535) { this.clearProxy(); return; } if (cleanedHost !== this.proxyHost || port !== this.proxyPort) { ...
https://github.com/LZZLHY/hlib
10e76e29d70b1b0d16cc31ca5519128a1a21a196
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
getTime
Returns the number of milliseconds since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. @returns { long } get new date value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getTime(): long { return this.ms; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTime 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 long AST#ident...
public getTime(): long { return this.ms; }
https://gitcode.com/iop123123/arkts-static-skills
e120219540b82136313fb251d018c5f53ece3c48
gitcode
AetheriumSimulator/qemu-hmos
entry/src/main/ets/components/RDPDisplay.ets
arkts
createMouseInputEvent
创建鼠标输入事件
static createMouseInputEvent(x: number, y: number, buttons: number, flags: number): ArrayBuffer { const buffer = new ArrayBuffer(16) const view = new DataView(buffer) view.setUint16(0, 0x8001, true) // 鼠标事件标识 view.setUint16(2, flags, true) view.setUint16(4, x, true) view.setUint16(6, y, t...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createMouseInputEvent 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...
static createMouseInputEvent(x: number, y: number, buttons: number, flags: number): ArrayBuffer { const buffer = new ArrayBuffer(16) const view = new DataView(buffer) view.setUint16(0, 0x8001, true) // 鼠标事件标识 view.setUint16(2, flags, true) view.setUint16(4, x, true) view.setUint16(6, y, t...
https://github.com/AetheriumSimulator/qemu-hmos
45d78b10de3606e960e239769b0ee266715e95a6
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/common/utils/DAOHelper.ets
arkts
softDelete
软删除记录 @param tableName 表名 @param idColumn 主键列名 @param id 主键值 @param errorPrefix 错误消息前缀
static async softDelete( tableName: string, idColumn: string, id: number, errorPrefix: string = '[DAO]' ): Promise<void> { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); const sql = `UPDATE ${tableName} SET is_deleted = 1, updated_at = ? WHERE ${idColu...
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#identifier#Left tableName AST#identifier#Right AST#ERROR#Left AST#:#Left : A...
static async softDelete( tableName: string, idColumn: string, id: number, errorPrefix: string = '[DAO]' ): Promise<void> { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); const sql = `UPDATE ${tableName} SET is_deleted = 1, updated_at = ? WHERE ${idColu...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
d78090832b1525008fafa9a6b8176337464a2f7b
github
codelably/tuniao-ui
core/tuniaoui/src/main/ets/index.ets
arkts
initTnUI
初始化 Tuniao UI 组件库 @param {window.WindowStage} windowStage - 窗口阶段 @param {common.UIAbilityContext} context - UIAbility 上下文 @returns {void} 无返回值
static initTnUI(windowStage: window.WindowStage, context: common.UIAbilityContext): void { TnUIInitializer.windowStage = windowStage; TnUIInitializer.setGlobalConfig(); ContextUtil.init(context); // 获取屏幕尺寸 顶部和底部规避尺寸 TnUIInitializer.getScreenAndAvoidSize(); // 获取是否是应用 TnUIInitializer.getBun...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left initTnUI AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ident...
static initTnUI(windowStage: window.WindowStage, context: common.UIAbilityContext): void { TnUIInitializer.windowStage = windowStage; TnUIInitializer.setGlobalConfig(); ContextUtil.init(context); // 获取屏幕尺寸 顶部和底部规避尺寸 TnUIInitializer.getScreenAndAvoidSize(); // 获取是否是应用 TnUIInitializer.getBun...
https://github.com/codelably/tuniao-ui
666cecae9646b0527d895017ef6238667fb68979
github
openharmony/applications_call
entry/src/main/ets/common/utils/Clone.ets
arkts
forEach
forEach @param { array } array @param { function } iteratee
private forEach(array, iteratee) { let index = -1; const length = array.length; while (++index < length) { iteratee(array[index], index); } return array; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left forEach AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left array AST#identifier#Right AST#,#Left , AST#,#Right AST#identifier#Left iteratee AST#identifier#Right AST#)...
private forEach(array, iteratee) { let index = -1; const length = array.length; while (++index < length) { iteratee(array[index], index); } return array; }
https://gitee.com/openharmony/applications_call.git
0b77cbdd294b96a38363ecae7923680a30bdd526
gitee
honjow/Next2V
shared/src/main/ets/utils/NodeHeaderHtml.ets
arkts
plainText
Concatenated decoded text with surrounding whitespace trimmed; '' means "nothing to show".
static plainText(rawHtml: string): string { const runs = NodeHeaderHtml.parse(rawHtml) let text = '' for (const run of runs) { text += run.text } return text.trim() }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left plainText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left rawHtml AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right...
static plainText(rawHtml: string): string { const runs = NodeHeaderHtml.parse(rawHtml) let text = '' for (const run of runs) { text += run.text } return text.trim() }
https://github.com/honjow/Next2V
f4d18aedb68b89f6284497af709aea647b6927a2
github
wuba/omni-ui
omni_component/src/main/ets/components/step/OmniSteps.ets
arkts
_getIcon
取当前step的icon,通过状态区分
_getIcon(step: OmniStepItemConfig, index: number): ResourceStr { const s = step.state let icon: ResourceStr switch (s) { case OmniStepState.Doing: //优先取数据的,没有取默认配置的 if (step.doingIcon) { icon = step.doingIcon } else { icon = this.horizontalStepsStyle.doing...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left _getIcon AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left step AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left OmniStepItemConfig AST#identifier#Right AST#,#L...
_getIcon(step: OmniStepItemConfig, index: number): ResourceStr { const s = step.state let icon: ResourceStr switch (s) { case OmniStepState.Doing: //优先取数据的,没有取默认配置的 if (step.doingIcon) { icon = step.doingIcon } else { icon = this.horizontalStepsStyle.doing...
https://github.com/wuba/omni-ui
b45758b0bb845e02344cade0f5dbd52231c1b25e
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets
arkts
stripLeadingZeros
remove leading 0x0
private static stripLeadingZeros(d: ValueArray<int>): ValueArray<int> { let i = d.length - 1 if (i < 0 || d[i] != 0) { return d } for (; i >= 0 && d[i] == 0; --i) {} let result: ValueArray<int> = new ValueArray<int>(i+1) for (; i >= 0; --i) { ...
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 stripLeadingZeros AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left ...
private static stripLeadingZeros(d: ValueArray<int>): ValueArray<int> { let i = d.length - 1 if (i < 0 || d[i] != 0) { return d } for (; i >= 0 && d[i] == 0; --i) {} let result: ValueArray<int> = new ValueArray<int>(i+1) for (; i >= 0; --i) { ...
https://gitcode.com/iop123123/arkts-static-skills
00aee7e0387bfa06bb1cb716c9c6103f4058cec5
gitcode
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/mouse/MouseCursorPlugin.ets
arkts
resolveSystemCursor
Return mouse cursor point style <p>This method guarantees to return a non-null object. @param kind mouse cursor type @returns point style
private resolveSystemCursor(kind: string): pointer.PointerStyle { if (this.systemCursorConstants == null) { this.systemCursorConstants = new HashMap(); this.systemCursorConstants.set("alias", pointer.PointerStyle.DEFAULT); this.systemCursorConstants.set("allScroll", pointer.PointerStyle.MOVE); ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left resolveSystemCursor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left kind AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
private resolveSystemCursor(kind: string): pointer.PointerStyle { if (this.systemCursorConstants == null) { this.systemCursorConstants = new HashMap(); this.systemCursorConstants.set("alias", pointer.PointerStyle.DEFAULT); this.systemCursorConstants.set("allScroll", pointer.PointerStyle.MOVE); ...
https://gitee.com/openharmony-sig/flutter_engine.git
f154b9b75748b0997f516d33ee840a2edf9da899
gitee
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets
arkts
getMaxFixedRectSize
Get max fixed rect size. @param rate @param maxWidth @param maxHeight @returns rect width and height.
static getMaxFixedRectSize(rate: number, maxWidth: number, maxHeight: number): Array<number> { let width = 0; let height = 0; if (rate > (maxWidth / maxHeight)) { width = maxWidth; height = width / rate; } else { height = maxHeight; width = height * rate; } return [widt...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getMaxFixedRectSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rate AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static getMaxFixedRectSize(rate: number, maxWidth: number, maxHeight: number): Array<number> { let width = 0; let height = 0; if (rate > (maxWidth / maxHeight)) { width = maxWidth; height = width / rate; } else { height = maxHeight; width = height * rate; } return [widt...
https://gitee.com/openharmony/codelabs.git
4dbbd3c78e902be632219d09e8dab6a87f6418c3
gitee
HarmonyOS_Samples/sample_in_harmonyos
common/src/main/ets/util/WantUtil.ets
arkts
emptyCheck
Want security monitoring. @param want @returns
static emptyCheck(want?: Want): Want { if (!want) { return {}; } return want; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left emptyCheck AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right ...
static emptyCheck(want?: Want): Want { if (!want) { return {}; } return want; }
https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos
d2e759eb9850a8712418c20ed57485c4c65f5bff
gitcode
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
setUint16
Sets an unsigned short. @param byteOffset The byte offset. @param value The value. @param littleEndian If the value is little endian.
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void { this.dataView?.setUint16(byteOffset, value, littleEndian) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setUint16 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#R...
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void { this.dataView?.setUint16(byteOffset, value, littleEndian) }
https://gitee.com/openharmony-sig/flutter_engine.git
34e372e0d6d0a640586e20457a2ea3d7d6fdc1d2
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Diagnostics/StartupController.ets
arkts
getStatus
获取当前状态
getStatus(): StartupStatus { return this.status; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStatus 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 StartupStatus AST#identifier#Right AST#ERROR#Right A...
getStatus(): StartupStatus { return this.status; }
https://github.com/DaLongZhuaZi/manxia
1310d992f903e91d7f29dc1ff6e0ef8ca2d0a3a9
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
cancelTask
取消正在执行的任务 @param taskId 任务ID
cancelTask(taskId: string): boolean { if (!this.taskExecutor) { return false; } return this.taskExecutor.cancelTask(taskId); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cancelTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AS...
cancelTask(taskId: string): boolean { if (!this.taskExecutor) { return false; } return this.taskExecutor.cancelTask(taskId); }
https://github.com/DaLongZhuaZi/manxia
5c69d087f1bf3196a1ff2a9a6556d74344ad37cb
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
getAnimationSpeed
获取动画速度倍率
public getAnimationSpeed(): number { try { return UserThemeConfigManager.getInstance().animationSpeed; } catch { return 1.0; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAnimationSpeed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number A...
public getAnimationSpeed(): number { try { return UserThemeConfigManager.getInstance().animationSpeed; } catch { return 1.0; } }
https://github.com/DaLongZhuaZi/manxia
ea9ac58cd2a5d035036478c62913bdf6c5f4a558
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ArrayList.ets
arkts
increaseCapacityTo
Increases the capacity of the ArrayList to at least the given new capacity. @param newCapacity - The minimum new capacity for the ArrayList.
public increaseCapacityTo(newCapacity: int): void { if (newCapacity > Int.MAX_VALUE) { throw createBusinessError(CapacityErrorCodeId, `The current capacity has reached the maximum limit.`); } if (newCapacity > this.length) { this.increaseCap(newCapacity); } ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left increaseCapacityTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left newCapacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AS...
public increaseCapacityTo(newCapacity: int): void { if (newCapacity > Int.MAX_VALUE) { throw createBusinessError(CapacityErrorCodeId, `The current capacity has reached the maximum limit.`); } if (newCapacity > this.length) { this.increaseCap(newCapacity); } ...
https://gitcode.com/iop123123/arkts-static-skills
2f694b02604b31c07fa90fdcbb614dba5232e671
gitcode
openharmony/codelabs
ETSUI/PositioningDemo/entry/src/main/ets/model/PlanModel.ets
arkts
constructor
完成度(0-100)
constructor( name: string, description: string, goal: string, startDate: number, endDate: number, dailyTasks: DailyTask[] ) { this.id = Date.now().toString(); this.name = name; this.description = description; this.goal = goal; this.startDate = startDate; this.endDate ...
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 name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
constructor( name: string, description: string, goal: string, startDate: number, endDate: number, dailyTasks: DailyTask[] ) { this.id = Date.now().toString(); this.name = name; this.description = description; this.goal = goal; this.startDate = startDate; this.endDate ...
https://gitcode.com/openharmony/codelabs
f2eb7544810babb7ec53d6628f6d974c708fc28d
gitcode
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
delayRefresh
Delay refresh. @param delay
private delayRefresh(delay: number): void { this.isWaitingRefresh = true; this.timeoutId = setTimeout(() => { this.cropShow.enlargeCropArea(); this.splitLineShow = false; this.refresh(); this.isWaitingRefresh = false; }, delay); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left delayRefresh AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left delay AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left...
private delayRefresh(delay: number): void { this.isWaitingRefresh = true; this.timeoutId = setTimeout(() => { this.cropShow.enlargeCropArea(); this.splitLineShow = false; this.refresh(); this.isWaitingRefresh = false; }, delay); }
https://gitee.com/openharmony/codelabs.git
2db524fc37612213d0bc081efc4105cc90656f1a
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
removeDictRule
删除字典规则
async removeDictRule(name: string): Promise<void> { this.dictRules = this.dictRules.filter(r => r.name !== name); await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.DICT_RULES, this.dictRules); }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left removeDictRule AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Le...
async removeDictRule(name: string): Promise<void> { this.dictRules = this.dictRules.filter(r => r.name !== name); await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.DICT_RULES, this.dictRules); }
https://github.com/DaLongZhuaZi/manxia
dbad1d92ba50a6f312b3f458d4f78fde96e922e5
github
Explore-In-HMOS-Wearable/how-to-use-weather-kit
entry/src/main/ets/utils/WeatherIconHelper.ets
arkts
getDefaultIcon
Get default icon for condition using switch statement
private getDefaultIcon(condition: WeatherCondition): Resource { switch (condition) { case WeatherCondition.SUNNY: return $r('app.media.sunny'); case WeatherCondition.PARTLY_CLOUDY: return $r('app.media.partlycloudy'); case WeatherCondition.CLOUDY: return $r('app.media.clo...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDefaultIcon AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left condition AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
private getDefaultIcon(condition: WeatherCondition): Resource { switch (condition) { case WeatherCondition.SUNNY: return $r('app.media.sunny'); case WeatherCondition.PARTLY_CLOUDY: return $r('app.media.partlycloudy'); case WeatherCondition.CLOUDY: return $r('app.media.clo...
https://github.com/Explore-In-HMOS-Wearable/how-to-use-weather-kit
cc62a47feef330934160a0f5dcbfd0b6f084f471
github
honjow/Next2V
feature/node/src/main/ets/viewmodel/NodeIndexViewModel.ets
arkts
loadAllNodes
Load all nodes
async loadAllNodes(options?: NodeIndexLoadOptions): Promise<void> { const loadOptions: NodeIndexLoadOptions = options || {} const publishDefaultNodes = loadOptions.publishDefaultNodes !== false this.publishDefaultNodes = publishDefaultNodes this.isLoading = true this.nodeIndexPhase = 'loading' ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadAllNodes AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left options AST#identifier#Right AST#?#Left ? AST#?#Right AST#type_ann...
async loadAllNodes(options?: NodeIndexLoadOptions): Promise<void> { const loadOptions: NodeIndexLoadOptions = options || {} const publishDefaultNodes = loadOptions.publishDefaultNodes !== false this.publishDefaultNodes = publishDefaultNodes this.isLoading = true this.nodeIndexPhase = 'loading' ...
https://github.com/honjow/Next2V
2f0f1678db1334e9586c44753eb7a8c271ec10c1
github
ZestBox-18/kitebook-frontend
commons/kite_utils/src/main/ets/utils/windowInfo/WindowUtil.ets
arkts
recover
恢复窗口状态
recover(): void { try { if (this.mainWindow.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { this.mainWindow.recover() .then(() => { hilog.info(0x0000, 'testLog', `Succeeded in recovering the window.`); }) .catch((err: BusinessError) => { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left recover AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left...
recover(): void { try { if (this.mainWindow.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { this.mainWindow.recover() .then(() => { hilog.info(0x0000, 'testLog', `Succeeded in recovering the window.`); }) .catch((err: BusinessError) => { ...
https://github.com/ZestBox-18/kitebook-frontend
b5998b91976e9f2f850ec5845c265e1069d7e278
github
openharmony-sig/FastBle
library/src/main/ets/BleManager.ets
arkts
getReConnectInterval
Get connect retry interval @return
public getReConnectInterval(): number { return this.reConnectInterval; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getReConnectInterval AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left numbe...
public getReConnectInterval(): number { return this.reConnectInterval; }
https://gitee.com/openharmony-sig/FastBle.git
a10cfe333a33459472e206cb887bf7822e913eb1
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayAsListInt.ets
arkts
pushBack
Pushes a value to the end of the List @param e value to push
public override pushBack(e: Int): void { if (this.curSize == this.data.length) { let newData : ValueArray<int> = new ValueArray<int>(ArrayAsListInt.getNewCapacity(this.data.length)); for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i...
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 pushBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : AST#:#Ri...
public override pushBack(e: Int): void { if (this.curSize == this.data.length) { let newData : ValueArray<int> = new ValueArray<int>(ArrayAsListInt.getNewCapacity(this.data.length)); for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i...
https://gitcode.com/iop123123/arkts-static-skills
aa95145b5c4655cd6255451cff05bc4e266b050b
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/components/ShortcutManager.ets
arkts
saveShortcuts
保存快捷键配置(完整列表,保留排序)
private async saveShortcuts(): Promise<void> { if (!this.prefs) return; try { await this.prefs.put(ShortcutManager.KEY_SHORTCUTS, JSON.stringify(this.shortcuts)); await this.prefs.put(ShortcutManager.KEY_DELETED_BUILTINS, JSON.stringify(this.deletedBuiltinIds)); await this.prefs.flush()...
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 saveShortcuts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
private async saveShortcuts(): Promise<void> { if (!this.prefs) return; try { await this.prefs.put(ShortcutManager.KEY_SHORTCUTS, JSON.stringify(this.shortcuts)); await this.prefs.put(ShortcutManager.KEY_DELETED_BUILTINS, JSON.stringify(this.deletedBuiltinIds)); await this.prefs.flush()...
https://github.com/AlkaidLab/moonlight-harmony
1b8829302d291349723d973804642f0c23a40ded
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Source/SourceManager.ets
arkts
sortSourcesByPinned
按置顶状态排序图源列表(置顶的在前面,然后按置顶顺序排序)
sortSourcesByPinned(sources: SourceInfo[]): SourceInfo[] { const pinned = sources.filter(s => s.isPinned); const unpinned = sources.filter(s => !s.isPinned); return [...pinned, ...unpinned]; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left sortSourcesByPinned AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left sources AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#iden...
sortSourcesByPinned(sources: SourceInfo[]): SourceInfo[] { const pinned = sources.filter(s => s.isPinned); const unpinned = sources.filter(s => !s.isPinned); return [...pinned, ...unpinned]; }
https://github.com/DaLongZhuaZi/manxia
e033e82fb8cacbb889be8c8d99b3db5000110f8d
github
tdcare/tdwebrtc
src/main/ets/utils/LogUtil.ets
arkts
info
打印INFO级别日志 @param args
static info(...args: string[] | object[]): void { LogUtil.uniLog(args, hilog.LogLevel.INFO); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left info 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 args...
static info(...args: string[] | object[]): void { LogUtil.uniLog(args, hilog.LogLevel.INFO); }
https://github.com/tdcare/tdwebrtc
dc5c9858582407fe557eaa73ab7835353d473aab
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test22_original_index.ets
arkts
testFlatten2D
--- 2D array flatten (manual) ---
function testFlatten2D(): string { let matrix: number[][] = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; let flat: number[] = []; for (let i: number = 0; i < matrix.length; i++) { let row: number[] = matrix[i]; for (let j: number = 0; j < row.length; j++) { flat.push(row[j]); } } return String(flat[4]...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testFlatten2D 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_ty...
function testFlatten2D(): string { let matrix: number[][] = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; let flat: number[] = []; for (let i: number = 0; i < matrix.length; i++) { let row: number[] = matrix[i]; for (let j: number = 0; j < row.length; j++) { flat.push(row[j]); } } return String(flat[4]...
https://github.com/miaochiahao/ark-ghidra
708e0cc8dce600a73fa19943d28fef09ba5c9344
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/customkey/CustomKeyStore.ets
arkts
createProfile
创建新配置
static async createProfile(name: string): Promise<CustomKeyProfile | null> { await CustomKeyStore.ensureInit(); if (CustomKeyStore.profiles!.find(p => p.name === name)) { return null; // 名称重复 } const profile = createDefaultProfile(name); CustomKeyStore.profiles!.push(profile); CustomKeyS...
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 createProfile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST...
static async createProfile(name: string): Promise<CustomKeyProfile | null> { await CustomKeyStore.ensureInit(); if (CustomKeyStore.profiles!.find(p => p.name === name)) { return null; // 名称重复 } const profile = createDefaultProfile(name); CustomKeyStore.profiles!.push(profile); CustomKeyS...
https://github.com/AlkaidLab/moonlight-harmony
bede01397bc4d90b2472ab57d4fc13289c265bde
github
DaLongZhuaZi/manxia
entry/src/main/ets/ShareExtAbility/ShareExtAbility.ets
arkts
extractSharedUris
从Want中提取分享的文件URI列表
private extractSharedUris(want: Want): string[] { const uris: string[] = []; try { // 尝试从parameters中获取URI if (want.parameters) { // 单个文件:uri字段 if (want.parameters['uri']) { const uri = String(want.parameters['uri']); logger.info(TAG, `从parameters.uri获取到文件: ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractSharedUris AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
private extractSharedUris(want: Want): string[] { const uris: string[] = []; try { // 尝试从parameters中获取URI if (want.parameters) { // 单个文件:uri字段 if (want.parameters['uri']) { const uri = String(want.parameters['uri']); logger.info(TAG, `从parameters.uri获取到文件: ...
https://github.com/DaLongZhuaZi/manxia
531e006224d02b2f59d3eaf9934dab8ec36062eb
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
convertTestResultsToRecord
转换TestResults为Record类型
private convertTestResultsToRecord(testResults: TestResults): TestResultsRecord { return { config: testResults.config, tests: testResults.tests }; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertTestResultsToRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left testResults AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right...
private convertTestResultsToRecord(testResults: TestResults): TestResultsRecord { return { config: testResults.config, tests: testResults.tests }; }
https://github.com/DaLongZhuaZi/manxia
5f59fb4e212b6916c8f056f8e3001cbc9eb1a4e9
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/data/facades/DataFacade.ets
arkts
loadAllEntitiesFromRdb
启动时将所有 RDB 数据加载到内存 Map
private async loadAllEntitiesFromRdb(): Promise<void> { if (!this.rdbStore) { return; } try { const predicates = new relationalStore.RdbPredicates('ngf_entities'); const resultSet = this.rdbStore.querySync(predicates, ['entity_name', 'entity_id', 'payload_json']); const count = res...
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 loadAllEntitiesFromRdb AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#...
private async loadAllEntitiesFromRdb(): Promise<void> { if (!this.rdbStore) { return; } try { const predicates = new relationalStore.RdbPredicates('ngf_entities'); const resultSet = this.rdbStore.querySync(predicates, ['entity_name', 'entity_id', 'payload_json']); const count = res...
https://github.com/DaLongZhuaZi/NGF
191a0b5eb96990f184ecd8134e3223e43fff48d6
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/PathPlanner.ets
arkts
getDestinationsByCategory
按分类获取POI列表 @category 分类
public getDestinationsByCategory(category: DestinationCategory): NavigationDestination[] { if (!this.buildingData) return []; return this.buildingData.pois.filter(poi => poi.category === category); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDestinationsByCategory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left category AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id...
public getDestinationsByCategory(category: DestinationCategory): NavigationDestination[] { if (!this.buildingData) return []; return this.buildingData.pois.filter(poi => poi.category === category); }
https://github.com/LJ666-ui/harmony-health-care
d8888aec9f92753740f0515c67dd433a4b7b3b04
github
terryma2024/happyword
harmonyos/entry/src/ohosTest/ets/test/BoundDeviceInfoFlow.ui.test.ets
arkts
nextNicknameDifferentFrom
Pick a nickname guaranteed to differ from `current`. Run-to-run stability matters more than aesthetics here: the test asserts that the row + ConfigPage label flip from "before" to "after", which requires the two strings to compare unequal. Using a timestamped suffix also keeps the value short enough to satisfy the 32-c...
function nextNicknameDifferentFrom(current: string): string { const base: string = '小明测试'; const suffix: string = (Date.now() % 100000).toString().padStart(5, '0'); const candidate: string = `${base}${suffix}`; if (candidate === current) { return `${base}${(Date.now() + 1) % 100000}`; } return candidate...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left nextNicknameDifferentFrom AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left current AST#identifier#Right AST#type_annotation#Left AST#:#...
function nextNicknameDifferentFrom(current: string): string { const base: string = '小明测试'; const suffix: string = (Date.now() % 100000).toString().padStart(5, '0'); const candidate: string = `${base}${suffix}`; if (candidate === current) { return `${base}${(Date.now() + 1) % 100000}`; } return candidate...
https://github.com/terryma2024/happyword
4ec418af2c044e8fe03877027a4f731f71b4f412
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/arkts/concurrent/TaskPoolDemo.ets
arkts
sample1
taskpool.Task() - 创建一个任务(指定一个 @Concurrent 函数,及其需要的参数) taskpool.execute() - 在任务池中执行指定的任务
async function sample1(): Promise<string> { try { let task: taskpool.Task = new taskpool.Task(fun1, 1, 2) return `taskpool result: ${await taskpool.execute(task)}` } catch (e) { return "taskpool error: " + e } }
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left sample1 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 ...
async function sample1(): Promise<string> { try { let task: taskpool.Task = new taskpool.Task(fun1, 1, 2) return `taskpool result: ${await taskpool.execute(task)}` } catch (e) { return "taskpool error: " + e } }
https://github.com/webabcd/HarmonyDemo
4ad16221c9589ef64aabb92095e6b6140c3fafc3
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
executeTask
执行任务 @param taskId 任务ID @param params 初始参数
async executeTask(taskId: string, params?: Record<string, Object | undefined>): Promise<TaskResult> { if (!this.taskExecutor) { return { taskId, success: false, error: '任务执行器未初始化', duration: 0, stepResults: {} }; } // 确保任务已注册 this.registerTasksFromC...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left executeTask AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left taskId AST#identifier#Right AST#t...
async executeTask(taskId: string, params?: Record<string, Object | undefined>): Promise<TaskResult> { if (!this.taskExecutor) { return { taskId, success: false, error: '任务执行器未初始化', duration: 0, stepResults: {} }; } // 确保任务已注册 this.registerTasksFromC...
https://github.com/DaLongZhuaZi/manxia
5d4dbde7a3ccb7dc8ae20eb50c3d41a8f0cbe4f1
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewNetworkTester.ets
arkts
generateSuggestions
生成诊断建议
private generateSuggestions(report: TestReport): string[] { const suggestions: string[] = []; // HTTP测试分析 if (!report.httpTest.success) { if (report.httpTest.connectionType === 'CONNECTION_CLOSED') { suggestions.push('🔴 连接被关闭:尝试更换域名或使用代理'); suggestions.push('🔴 检查网络连接是否稳定'); ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateSuggestions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left report AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
private generateSuggestions(report: TestReport): string[] { const suggestions: string[] = []; // HTTP测试分析 if (!report.httpTest.success) { if (report.httpTest.connectionType === 'CONNECTION_CLOSED') { suggestions.push('🔴 连接被关闭:尝试更换域名或使用代理'); suggestions.push('🔴 检查网络连接是否稳定'); ...
https://github.com/DaLongZhuaZi/manxia
27aeebe2ad5b2c9d0b5e597bcbe509dc21813a50
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/DevKeyVerifier.ets
arkts
computeKey
根据设备 ID 计算激活码(同步) SHA-256(salt + deviceId) 取前 8 位大写 hex
static computeKey(deviceId: string): string { const payload = DEV_KEY_SALT + deviceId.toLowerCase(); const encoder = new util.TextEncoder(); const data = encoder.encodeInto(payload); const md = cryptoFramework.createMd('SHA256'); md.updateSync({ data } as cryptoFramework.DataBlob); const diges...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left computeKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Rig...
static computeKey(deviceId: string): string { const payload = DEV_KEY_SALT + deviceId.toLowerCase(); const encoder = new util.TextEncoder(); const data = encoder.encodeInto(payload); const md = cryptoFramework.createMd('SHA256'); md.updateSync({ data } as cryptoFramework.DataBlob); const diges...
https://github.com/AlkaidLab/moonlight-harmony
6204c2ca4f275d53d3774a78768175494d8918a2
github
openharmony-tpc/ohos_coap
libcoap/src/main/ets/components/mainpage/CoapClient.ets
arkts
addOption
客户端自定义新增一个option选项 @param optionNum:number数字型,value:string字符串型
addOption(optionNum: number, value: string|number) { this.coapClient.addOption(optionNum, value, this.classId); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left addOption AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left optionNum AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#...
addOption(optionNum: number, value: string|number) { this.coapClient.addOption(optionNum, value, this.classId); }
https://gitee.com/openharmony-tpc/ohos_coap.git
6130367ac5b6ad53cebc7fb538b3d506a8658296
gitee
openharmony-sig/amountinputtext
libamountinput/src/main/ets/utils/CurrencyManager.ets
arkts
getCurrencySymbol
根据币种code(例如CNY)获取币种符号(例如¥) @param code
static getCurrencySymbol(code): string { let target = CurrencyManager.getCurrencyList().find((element) => element.code === code); return target.symbol; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCurrencySymbol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left code AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
static getCurrencySymbol(code): string { let target = CurrencyManager.getCurrencyList().find((element) => element.code === code); return target.symbol; }
https://gitee.com/openharmony-sig/amountinputtext.git
96cb7bbd208369cae805eeea13ccf16fd393d1b4
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Value.ets
arkts
setFieldByName
Sets field value by it's name @param name of field @param val @{link reflect.Value} @throws error if this value doesn't have field with {@link name} or type of {@link val} doesn't assignable to type of this value
public setFieldByName(name: string, val: reflect.Value): void { let f = this.typ.getFieldByName(name) if (f.isStatic()) { throw new Error("Field must be not static") } let ft:Type let fvalue = this.getFieldByName(name) if (fvalue.getType() instanceof Undef...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setFieldByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
public setFieldByName(name: string, val: reflect.Value): void { let f = this.typ.getFieldByName(name) if (f.isStatic()) { throw new Error("Field must be not static") } let ft:Type let fvalue = this.getFieldByName(name) if (fvalue.getType() instanceof Undef...
https://gitcode.com/iop123123/arkts-static-skills
0fcc98c8e2e82e147b0cc5b4987c2bee511c8e49
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/storage/ftp/FTPHandler.ets
arkts
exists
检查文件或目录是否存在
public async exists(path: string): Promise<boolean> { try { const fileInfo = await this.getFileInfo(path); return fileInfo != null; } catch (error) { if (error instanceof Error && error.message && error.message.includes('File not found')) { return false; } throw new Error...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left exists AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Righ...
public async exists(path: string): Promise<boolean> { try { const fileInfo = await this.getFileInfo(path); return fileInfo != null; } catch (error) { if (error instanceof Error && error.message && error.message.includes('File not found')) { return false; } throw new Error...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/ftp/FTPHandler.ets#L105-L115
814ccf8f83bf79802001e53965c159c374965413
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/UserDAO.ets
arkts
insert
插入单条用户
static async insert(user: User) { if (!user.validate()) throw new Error('[UserDAO] 插入失败,数据验证不通过'); const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); user.createdAt = now; user.updatedAt = now; const valueBucket: relationalStore.ValuesBucket = { username:...
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 insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left user AST#identifier#Right AST#:#Left : AST#:#Righ...
static async insert(user: User) { if (!user.validate()) throw new Error('[UserDAO] 插入失败,数据验证不通过'); const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); user.createdAt = now; user.updatedAt = now; const valueBucket: relationalStore.ValuesBucket = { username:...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
8c514d3773340d30e217979eb951566ffa87ef78
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/TypeGuards.ets
arkts
isNonEmptyString
检查值是否为非空字符串 @param value - 要检查的值 @returns 是否为非空字符串
static isNonEmptyString(value: Object): boolean { if (!TypeGuards.isString(value)) { return false; } const strValue = value as string; return strValue.trim().length > 0; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isNonEmptyString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
static isNonEmptyString(value: Object): boolean { if (!TypeGuards.isString(value)) { return false; } const strValue = value as string; return strValue.trim().length > 0; }
https://github.com/DaLongZhuaZi/manxia
41bf9aaa404765ecbb3dc32433729876dc450a40
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/ReminderService.ets
arkts
markAsProcessed
标记提醒为已处理
private static markAsProcessed(reminderId: number): void { ReminderService.processedReminders.set(reminderId, Date.now()); }
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 markAsProcessed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left reminderId AST#identifier#Right AST#ERROR#Left AST#...
private static markAsProcessed(reminderId: number): void { ReminderService.processedReminders.set(reminderId, Date.now()); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
5078c9860ead1e11c1c6a0a4ff6dbd2d3a239d20
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/NovelSourceManagementPage.ets
arkts
moveSourceInList
移动书源到指定位置 @param fromIndex 当前位置索引 @param toIndex 目标位置索引
moveSourceInList(fromIndex: number, toIndex: number): void { if (fromIndex < 0 || fromIndex >= this.filteredSources.length) return; if (toIndex < 0 || toIndex >= this.filteredSources.length) return; if (fromIndex === toIndex) return; // 交换位置 const temp = this.filteredSources[fromIndex]; t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left moveSourceInList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fromIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , A...
moveSourceInList(fromIndex: number, toIndex: number): void { if (fromIndex < 0 || fromIndex >= this.filteredSources.length) return; if (toIndex < 0 || toIndex >= this.filteredSources.length) return; if (fromIndex === toIndex) return; // 交换位置 const temp = this.filteredSources[fromIndex]; t...
https://github.com/DaLongZhuaZi/manxia
f028b9eef49833cc3dba7df2c745d15db0abb2b2
github
OnceWeWere/Weather_HarmonyOS
entry/src/main/ets/pages/Index.ets
arkts
hideUpdateTips
--- 辅助函数:收起顶部更新提示 ---
hideUpdateTips() { if (this.showUpdateTips) { this.getUIContext().animateTo({ duration: 300 }, () => { this.updateTipsHeight = 0; this.updateTipsOpacity = 0; }); setTimeout(() => { this.showUpdateTips = false; }, 300); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left hideUpdateTips AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
hideUpdateTips() { if (this.showUpdateTips) { this.getUIContext().animateTo({ duration: 300 }, () => { this.updateTipsHeight = 0; this.updateTipsOpacity = 0; }); setTimeout(() => { this.showUpdateTips = false; }, 300); } }
https://github.com/OnceWeWere/Weather_HarmonyOS
9ad41be2c024dff753677fb26297b6d1eea65a8b
github
CsCesium/KantaiHomo
entry/src/main/ets/infra/fairy/service/FairyService.ets
arkts
snapToEdge
Snap the ball to the nearest horizontal edge. Call this at the end of a drag gesture.
async snapToEdge(): Promise<void> { const d = display.getDefaultDisplaySync(); const ballPx = Math.round(vp2px(FAIRY_BALL_VP)); const snapX = (this.posXPx + ballPx / 2 < d.width / 2) ? 0 : (d.width - ballPx); await this.moveTo(snapX, this.posYPx); await this.savePosition(); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left snapToEdge 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#generic_t...
async snapToEdge(): Promise<void> { const d = display.getDefaultDisplaySync(); const ballPx = Math.round(vp2px(FAIRY_BALL_VP)); const snapX = (this.posXPx + ballPx / 2 < d.width / 2) ? 0 : (d.width - ballPx); await this.moveTo(snapX, this.posYPx); await this.savePosition(); }
https://github.com/CsCesium/KantaiHomo
a18331909a7484677c9ea59c5e5a082f434e4e68
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets
arkts
toString
Converts this object to a string @returns { String } return the string value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public override toString(): String { return Double.toString(this.value, 10); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le...
public override toString(): String { return Double.toString(this.value, 10); }
https://gitcode.com/iop123123/arkts-static-skills
e39e4fd7ca7056e0b5eeed9ee559e6dfde5eaa38
gitcode
openharmony/applications_app_samples
code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangeSeekBarView.ets
arkts
initUIRange
初始化视频剪辑范围
initUIRange() { this.componentRect = [0, 0, this.componentMaxWidth, this.componentMaxHeight]; this.leftThumbRect = [0, 0, this.leftThumbWidth, this.componentMaxHeight]; this.leftThumbPosition = { x: this.leftThumbRect[0], y: this.leftThumbRect[1] }; this.leftTextPosition = { x: this.leftThumbRect[0],...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initUIRange 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...
initUIRange() { this.componentRect = [0, 0, this.componentMaxWidth, this.componentMaxHeight]; this.leftThumbRect = [0, 0, this.leftThumbWidth, this.componentMaxHeight]; this.leftThumbPosition = { x: this.leftThumbRect[0], y: this.leftThumbRect[1] }; this.leftTextPosition = { x: this.leftThumbRect[0],...
https://github.com/openharmony/applications_app_samples
bd69d3b42a9ad9fd41b5637d10c68b1ce87ede82
github
the-wwyang/kids-learning-app
src/main/ets/utils/AnimationUtils.ets
arkts
interpolate
计算数字动画的中间值 @param start 起始值 @param end 结束值 @param progress 进度 (0-1) @returns 当前值
static interpolate(start: number, end: number, progress: number): number { return Math.round(start + (end - start) * progress); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left interpolate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left num...
static interpolate(start: number, end: number, progress: number): number { return Math.round(start + (end - start) * progress); }
https://github.com/the-wwyang/kids-learning-app
742052dba9aaf4b62aad2185d75f2910a765067f
github
ZestBox-18/kitebook-frontend
features/home/src/main/ets/utils/HomeIndexCalculator.ets
arkts
formatAmount
将金额格式化为两位小数和千分位形式。
static formatAmount(amount: number): string { const fixedAmount: string = amount.toFixed(2); const amountParts: string[] = fixedAmount.split('.'); let integerPart: string = amountParts[0]; const decimalPart: string = amountParts[1]; const resultParts: string[] = []; while (integerPart.length ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatAmount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left amount AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left n...
static formatAmount(amount: number): string { const fixedAmount: string = amount.toFixed(2); const amountParts: string[] = fixedAmount.split('.'); let integerPart: string = amountParts[0]; const decimalPart: string = amountParts[1]; const resultParts: string[] = []; while (integerPart.length ...
https://github.com/ZestBox-18/kitebook-frontend
2826bcca936527839bd5854a9ef3e11a019cd7a9
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/UsbDriverService.ets
arkts
rescanDevices
手动触发设备重新扫描 可用于在设备空闲断开后手动重连
async rescanDevices(): Promise<void> { console.info(`${TAG} 手动触发设备重新扫描`); // 清空已处理设备列表,强制重新枚举所有设备 this.processedDevices.clear(); await this.enumerateDevices(); }
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left rescanDevices 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 A...
async rescanDevices(): Promise<void> { console.info(`${TAG} 手动触发设备重新扫描`); // 清空已处理设备列表,强制重新枚举所有设备 this.processedDevices.clear(); await this.enumerateDevices(); }
https://github.com/AlkaidLab/moonlight-harmony
2b3db0b55a37301e0ab3e6acc1b0f69d1817b305
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoSourceParser.ets
arkts
normalizeSourceUrl
归一化书源URL,去除附加标识(如 ##@xxx)和无效片段
private static normalizeSourceUrl(rawUrl: string): string { let result = rawUrl.trim(); const extensionSeparator = result.indexOf('##'); if (extensionSeparator >= 0) { result = result.substring(0, extensionSeparator).trim(); } const fragmentIndex = result.indexOf('#'); if (fragmentIndex...
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 normalizeSourceUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rawUrl AST#identifier#Right AST#:...
private static normalizeSourceUrl(rawUrl: string): string { let result = rawUrl.trim(); const extensionSeparator = result.indexOf('##'); if (extensionSeparator >= 0) { result = result.substring(0, extensionSeparator).trim(); } const fragmentIndex = result.indexOf('#'); if (fragmentIndex...
https://github.com/DaLongZhuaZi/manxia
c21a209b4edb4aa55ae14e64093ef9adf3c7b50d
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/AudioVibrationService.ets
arkts
triggerGameTimeVibration
游戏模式时长振动(兼容): 50-300ms 持续
private triggerGameTimeVibration(intensity: number): void { if (intensity < 5) return; const duration = Math.floor(50 + intensity * 2.5); // 50-300ms vibrator.startVibration({ type: 'time', duration: duration }, { id: 0, usage: 'physicalFeedback' }).catch((_: Error) => { /...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left triggerGameTimeVibration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left intensity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left num...
private triggerGameTimeVibration(intensity: number): void { if (intensity < 5) return; const duration = Math.floor(50 + intensity * 2.5); // 50-300ms vibrator.startVibration({ type: 'time', duration: duration }, { id: 0, usage: 'physicalFeedback' }).catch((_: Error) => { /...
https://github.com/AlkaidLab/moonlight-harmony
674faa84e9fc44fb2abe8dd3507ecdaca0c0b9ac
github
dingzhilin1990/zhilinclaw
src/security/OAuthGateway.ets
arkts
registerProvider
注册 OAuth 提供商 @param config 提供商配置
public registerProvider(config: OAuthProviderConfig): void { this.providers.set(config.id, config); console.log(`[OAuthGateway] 已注册 OAuth 提供商:${config.name}`); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left registerProvider AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public registerProvider(config: OAuthProviderConfig): void { this.providers.set(config.id, config); console.log(`[OAuthGateway] 已注册 OAuth 提供商:${config.name}`); }
https://github.com/dingzhilin1990/zhilinclaw
83ec5026315b963dd1b87e025a768a03827520c3
github
Kira-Yagami-Light/Kira-Projects
TodoTask/entry/src/main/ets/data/repository/TaskRepository.ets
arkts
getAllTasks
获取所有任务 @returns Promise<Array<TaskListData>> 任务模型数组
async getAllTasks(): Promise<Array<TaskListData>> { try { const records = await this.dao.queryAll(); return records.map(r => TaskListData.fromRecord(r)); } catch (err) { Logger.error(this.LOG_TAG, `Failed to get all tasks: ${JSON.stringify(err)}`); return []; } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAllTasks 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#generic_...
async getAllTasks(): Promise<Array<TaskListData>> { try { const records = await this.dao.queryAll(); return records.map(r => TaskListData.fromRecord(r)); } catch (err) { Logger.error(this.LOG_TAG, `Failed to get all tasks: ${JSON.stringify(err)}`); return []; } }
https://github.com/Kira-Yagami-Light/Kira-Projects
a299ec20cf9a5aae21afc6eec28f47fcf782e1b6
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MainMenuPage.ets
arkts
getGlassShadowColor
获取玻璃效果阴影颜色(使用延迟加载的用户配置)
private getGlassShadowColor(): string { if (!this.userThemeShadowEnabled) { return 'rgba(0, 0, 0, 0)'; } if (this.themeState.currentTheme === ThemeType.LIGHT) { return 'rgba(0, 0, 0, 0.1)'; } else { return 'rgba(0, 0, 0, 0.3)'; } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getGlassShadowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left str...
private getGlassShadowColor(): string { if (!this.userThemeShadowEnabled) { return 'rgba(0, 0, 0, 0)'; } if (this.themeState.currentTheme === ThemeType.LIGHT) { return 'rgba(0, 0, 0, 0.1)'; } else { return 'rgba(0, 0, 0, 0.3)'; } }
https://github.com/DaLongZhuaZi/manxia
33568073a27606380acb46bedec2f08799a4e6e4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Editor/FileEditorService.ets
arkts
replaceInContent
替换文件内容
public replaceInContent(content: string, searchText: string, replaceText: string, caseSensitive: boolean = false, useRegex: boolean = false, replaceAll: boolean = true): ReplaceResult { let pattern: RegExp; if (useRegex) { try { pattern = new RegExp(searchText, caseSensitive ? (replace...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left replaceInContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left content AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#strin...
public replaceInContent(content: string, searchText: string, replaceText: string, caseSensitive: boolean = false, useRegex: boolean = false, replaceAll: boolean = true): ReplaceResult { let pattern: RegExp; if (useRegex) { try { pattern = new RegExp(searchText, caseSensitive ? (replace...
https://github.com/DaLongZhuaZi/manxia
c2251bc82c7d8e7108086d9c6ccdce8936ae15bf
github
LongLiveY96/chatcube
entry/src/main/ets/services/PreferencesService.ets
arkts
getMaterialType
获取材质类型
async getMaterialType(): Promise<number> { return await this.getNumber(PreferenceKeys.MATERIAL_TYPE, 100) // ADAPTIVE }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getMaterialType AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#gene...
async getMaterialType(): Promise<number> { return await this.getNumber(PreferenceKeys.MATERIAL_TYPE, 100) // ADAPTIVE }
https://github.com/LongLiveY96/chatcube
93155b72b88e1c260fc81ac9ed1623a94fba9180
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/system/windows/classes/meowAppHost.ets
arkts
lastFocusedWindowId
Get the last focused window ID.
get lastFocusedWindowId() { return this.windowFocusHistory[this.windowFocusHistory.length - 1]; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left lastFocusedWindowId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AS...
get lastFocusedWindowId() { return this.windowFocusHistory[this.windowFocusHistory.length - 1]; }
https://github.com/awaLiny2333/LinysBrowser_NEXT
f5ca2918184ff1a6f575b044cb5af4054a8191b2
github
harmonyos/codelabs
HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/common/database/tables/TaskInfoApi.ets
arkts
deleteDataByID
delete taskInfo @param taskInfo @param callback
deleteDataByID(taskInfo: TaskInfo, callback: Function): void { let tableName = Const.TASK_INFO.tableName; if (!tableName) { return; } let predicates = new dataRdb.RdbPredicates(tableName); predicates.equalTo('date', taskInfo.date).and().equalTo('taskID', taskInfo.taskID); RdbUtils.del(pr...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteDataByID AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TaskInfo AST#identifier#Right AST#,#L...
deleteDataByID(taskInfo: TaskInfo, callback: Function): void { let tableName = Const.TASK_INFO.tableName; if (!tableName) { return; } let predicates = new dataRdb.RdbPredicates(tableName); predicates.equalTo('date', taskInfo.date).and().equalTo('taskID', taskInfo.taskID); RdbUtils.del(pr...
https://gitee.com/harmonyos/codelabs.git
9fcc10792251228d3a29ca56ae7f2bf385b40d47
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets
arkts
validateAction
验证单个操作
private validateAction(action: Action, index: number, workflowName: string): ValidateActionResult { // 验证基本字段 if (!action.type) { return { valid: false, error: `工作流 ${workflowName} 第 ${index + 1} 个操作缺少type字段` }; } // 根据操作类型验证特定字段 switch (action.type) { case Ac...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateAction AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
private validateAction(action: Action, index: number, workflowName: string): ValidateActionResult { // 验证基本字段 if (!action.type) { return { valid: false, error: `工作流 ${workflowName} 第 ${index + 1} 个操作缺少type字段` }; } // 根据操作类型验证特定字段 switch (action.type) { case Ac...
https://github.com/DaLongZhuaZi/manxia
1a19306c6b9dafeca1abb05692d91addebea6f7f
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/Builder.ets
arkts
asBubble
气泡弹窗 @param customBuilder @param args @returns
asBubble<T extends object>(customBuilder: WrappedBuilder<T[]>, args?: T): BubblePopup<T> { let popup = new BubblePopup<T>(customBuilder) popup.setAttachViewId(this.attachViewId) popup.setDialogOptions(this.dialogOptions) popup.setParams(args) popup.setPopupConfig(this.popupConfig) popup.setPop...
AST#program#Left AST#ERROR#Left AST#identifier#Left asBubble 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#predefined_type#Left AST#object#Left object AST#object#Right AST#predefined_type#Right AST#>#Left ...
asBubble<T extends object>(customBuilder: WrappedBuilder<T[]>, args?: T): BubblePopup<T> { let popup = new BubblePopup<T>(customBuilder) popup.setAttachViewId(this.attachViewId) popup.setDialogOptions(this.dialogOptions) popup.setParams(args) popup.setPopupConfig(this.popupConfig) popup.setPop...
https://github.com/wuba/omni-ui
23447598e7040c61019f4d598b8923f9eda810ea
github
hiyuey3/Hixy_MyMemories
entry/src/main/ets/store/MemoryStore.ets
arkts
getEvents
获取所有事件 @returns MemoryItem[]
function getEvents(): MemoryItem[] { return []; // 返回空数组作为默认值 }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getEvents 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#array_type#Left A...
function getEvents(): MemoryItem[] { return []; // 返回空数组作为默认值 }
https://github.com/hiyuey3/Hixy_MyMemories/blob/9769d82c97a877be3d464456e79f66c5c84a9590/entry/src/main/ets/store/MemoryStore.ets#L21-L23
5f2e37ecdb071d90e98156c8f8d3669e127843fd
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets
arkts
getString
Gets a string value from an object by key. @param {string} key - The key to look up @returns {string} The string value @throws {JsonTypeError} If the value is not a string or if this element is not an object @throws {RangeError} If the key is not found
getString(key: string): string { return this.getElement(key).asString() }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#...
getString(key: string): string { return this.getElement(key).asString() }
https://gitcode.com/iop123123/arkts-static-skills
8ba300e3e1a46ad869de43cf3feb04a3f56827e7
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/ThemeManager.ets
arkts
notifyThemeChangeListeners
通知所有主题变更监听器
private notifyThemeChangeListeners(): void { const isDark = this.isDarkMode(); for (const listener of this.themeChangeListeners) { listener(isDark); } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyThemeChangeListeners 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#Lef...
private notifyThemeChangeListeners(): void { const isDark = this.isDarkMode(); for (const listener of this.themeChangeListeners) { listener(isDark); } }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ThemeManager.ets#L148-L153
36cae2f68189c5b81b1cb2eab984527a6d674e94
github
HarmonyOS_Samples/guide-snippets
Ability/ApplicationContextDemo/entry/src/main/ets/entrylifecycleability/EntryLifecycleAbility.ets
arkts
onAbilityDestroy
当UIAbility被销毁时被调用
onAbilityDestroy(uiAbility) { hilog.info(DOMAIN_NUMBER, TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); },
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onAbilityDestroy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left uiAbility AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right A...
onAbilityDestroy(uiAbility) { hilog.info(DOMAIN_NUMBER, TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); },
https://gitcode.com/HarmonyOS_Samples/guide-snippets
f31f5313013d449f9fd0ee418bda970cdbb0ae9f
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/AxisBase.ets
arkts
constructor
default constructor
constructor() { super(); this.mTextSize = Utils.handleDataValues(10); this.mXOffset = Utils.handleDataValues(5); this.mYOffset = Utils.handleDataValues(5); this.mLimitLines = new JArrayList<LimitLine>(); this.mGridLines = new JArrayList<LimitLine>(); }
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() { super(); this.mTextSize = Utils.handleDataValues(10); this.mXOffset = Utils.handleDataValues(5); this.mYOffset = Utils.handleDataValues(5); this.mLimitLines = new JArrayList<LimitLine>(); this.mGridLines = new JArrayList<LimitLine>(); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
4e9b72db1d8bff17c29a9593bd63aef13763e55f
gitee
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/utils/SecurityToolkit.ets
arkts
aesDecrypt
AES-GCM 解密 @param cipherBase64 Base64 编码的 (IV + 密文 + authTag) @param keyBase64 Base64 编码的 AES 密钥 @param ivBase64 未使用(IV 已包含在 cipherBase64 中),保留参数兼容 @returns 解密后的明文
async aesDecrypt(cipherBase64: string, keyBase64: string, ivBase64: string): Promise<NGFEncryptResult> { try { const combined: Uint8Array = this.base64ToUint8Array(cipherBase64); if (combined.length < 28) { return new NGFEncryptResult(false, ''); } const ivBytes: Uint8Array = combi...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left aesDecrypt AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cipherBase64 AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async aesDecrypt(cipherBase64: string, keyBase64: string, ivBase64: string): Promise<NGFEncryptResult> { try { const combined: Uint8Array = this.base64ToUint8Array(cipherBase64); if (combined.length < 28) { return new NGFEncryptResult(false, ''); } const ivBytes: Uint8Array = combi...
https://github.com/DaLongZhuaZi/NGF
8f2d20a60d9a161a4853994b35ebc48d1f890ed6
github
openharmony/applications_permission_manager
permissionmanager/src/main/ets/ServiceExtAbility/GrantDialogModel.ets
arkts
createWindow
创建模态窗口 @param context ServiceExtensionContext @param name 窗口名 @param rect 窗口参数 @param want return
public async createWindow( context: common.ServiceExtensionContext, name: string, rect: display.Rect, want: Want ): Promise<void> { try { let configuration: window.Configuration = { ctx: context, name, windowType: window.WindowType.TYPE_DIALOG } const win = await wi...
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 createWindow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : A...
public async createWindow( context: common.ServiceExtensionContext, name: string, rect: display.Rect, want: Want ): Promise<void> { try { let configuration: window.Configuration = { ctx: context, name, windowType: window.WindowType.TYPE_DIALOG } const win = await wi...
https://gitee.com/openharmony/applications_permission_manager.git
050b6fb3b9367048a869d8b43e3d6423f0bbba4b
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Array.ets
arkts
initFromArray
Helper function copying array elements from given primitive `Object[]` array.
private initFromArray(d: T[]): void { this.data = new T[d.length]; for (let k: int = 0; k < d.length; k++) { this.data[k] = d[k]; } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initFromArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expressi...
private initFromArray(d: T[]): void { this.data = new T[d.length]; for (let k: int = 0; k < d.length; k++) { this.data[k] = d[k]; } }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
2ff35c1810e255bf0f07899993328c0daeafb3c4
gitee
aimilin6688/KeePassHO
entry/src/main/ets/services/otp/OtpCompatibilityManager.ets
arkts
getParsers
获取所有已注册的解析器(用于测试) @returns 解析器列表
public getParsers(): IOtpFieldParser[] { return [...this.parsers]; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getParsers 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 IOtpFieldPa...
public getParsers(): IOtpFieldParser[] { return [...this.parsers]; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/otp/OtpCompatibilityManager.ets#L97-L99
22cbadb72c3d19de406769f9810ca5b85e33f7b4
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/components/ShortcutManager.ets
arkts
getShortcuts
获取所有快捷键
getShortcuts(): Shortcut[] { return [...this.shortcuts]; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getShortcuts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Shortcut AST#identifier#Right AST#...
getShortcuts(): Shortcut[] { return [...this.shortcuts]; }
https://github.com/AlkaidLab/moonlight-harmony
a8c91f2392673a498b7838283534c7e3ed2ae641
github
offlinecat-dev/OCNetORM
example/repository/UserRepository.ets
arkts
deleteUser
删除用户(软删除) @param id 用户ID @returns 删除结果
async deleteUser(id: number): Promise<DeleteResult> { return await this.repository.removeById(id) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteUser AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#...
async deleteUser(id: number): Promise<DeleteResult> { return await this.repository.removeById(id) }
https://github.com/offlinecat-dev/OCNetORM
23dd8d1b4f37217d6326f5b42b09eb2841ed974c
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
lastIndexOf
Moves backwards and search val. @param val a value to search @returns right-most index of val. -1 if val not found
public lastIndexOf(val: number): number { return this.lastIndexOf(val as double as int as byte, this.length - 1) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left lastIndexOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left val AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left numbe...
public lastIndexOf(val: number): number { return this.lastIndexOf(val as double as int as byte, this.length - 1) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
0a7d8c37f4c796e3c382d8aaf746ee1c1b7bbf2f
gitee
erosTeam/NextE
shared/src/main/ets/settings/DownloadQueueSettings.ets
arkts
prepareGallerySeeds
Prepare the EH-correct image-page seed list for a gallery task: preview pages yield `/s/` imagePageUrl entries; a later downloader resolves each image page to the real one-shot image URL.
static async prepareGallerySeeds( context: common.UIAbilityContext, gid: string, token: string, isEx: boolean, firstPageImages: EhGalleryImage[], previewPageCount: number, preferOriginal: boolean = false, ): Promise<void> { const key: string = DownloadQueueSettings.taskKey(gid, token...
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 prepareGallerySeeds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#L...
static async prepareGallerySeeds( context: common.UIAbilityContext, gid: string, token: string, isEx: boolean, firstPageImages: EhGalleryImage[], previewPageCount: number, preferOriginal: boolean = false, ): Promise<void> { const key: string = DownloadQueueSettings.taskKey(gid, token...
https://github.com/erosTeam/NextE
0bcd86a2098da8059f3741458f22739f8430c5b2
github
openharmony/applications_call
entry/src/main/ets/common/components/FuncBtn.ets
arkts
iconClassName
Button group style display @return {string} - Button group style display
iconClassName() { if (this.isDisable) { this.textColor = '#8c8c8c'; return 'disable'; } if (this.isActive) { this.textColor = '#007DFF'; return 'enable'; } if (this.btnType == 'msg') { this.textColor = '#8c8c8c'; return ''; } this.textColor = 'rgb(255, 2...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left iconClassName 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...
iconClassName() { if (this.isDisable) { this.textColor = '#8c8c8c'; return 'disable'; } if (this.isActive) { this.textColor = '#007DFF'; return 'enable'; } if (this.btnType == 'msg') { this.textColor = '#8c8c8c'; return ''; } this.textColor = 'rgb(255, 2...
https://gitee.com/openharmony/applications_call.git
cb889256b0b32691e66f37d5295fac63b5cb94fe
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/MetadataXmlGenerator.ets
arkts
parseComicInfoXml
解析ComicInfo.xml内容
static parseComicInfoXml(xmlContent: string): MangaMetadata | null { try { const getTagValue = (tagName: string): string => { const regex = new RegExp(`<${tagName}>([\\s\\S]*?)</${tagName}>`, 'i'); const match = xmlContent.match(regex); return match ? MetadataXmlGenerator.unescapeXml...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left parseComicInfoXml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left xmlContent AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s...
static parseComicInfoXml(xmlContent: string): MangaMetadata | null { try { const getTagValue = (tagName: string): string => { const regex = new RegExp(`<${tagName}>([\\s\\S]*?)</${tagName}>`, 'i'); const match = xmlContent.match(regex); return match ? MetadataXmlGenerator.unescapeXml...
https://github.com/DaLongZhuaZi/manxia
bfad12e81ca63c966410b0844332ad72f28b6d32
github
LJ666-ui/harmony-health-care
entry/src/main/ets/common/accessibility/AccessibilityConfig.ets
arkts
disableElderlyMode
禁用老年模式(恢复标准模式)
public async disableElderlyMode(): Promise<void> { await this.updateSettings({ elderlyMode: false, largeFontMode: false, minTouchTarget: 44, baseFontSize: 16, confirmationLevel: 'important', reduceMotion: false, contrastRatio: 4.5 }); }
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 disableElderlyMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
public async disableElderlyMode(): Promise<void> { await this.updateSettings({ elderlyMode: false, largeFontMode: false, minTouchTarget: 44, baseFontSize: 16, confirmationLevel: 'important', reduceMotion: false, contrastRatio: 4.5 }); }
https://github.com/LJ666-ui/harmony-health-care
14f31c9507e57e461cd8ce5f66a0c75b9589645d
github