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
Joker-x-dev/CoolMallArkTS
core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets
arkts
ensureTableSchema
确保搜索历史表结构正确 @returns {void} 无返回
private ensureTableSchema(): void { const tableName: string = SearchHistoryLocalDataSourceImpl.TABLE_NAME; if (!this.orm.hasTable(tableName)) { this.createSearchHistoryTable(); return; } const tableInfo: SearchHistoryTableInfo[] = this.orm.getTableInfo(tableName) as SearchHistoryTableInf...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left ensureTableSchema 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 AS...
private ensureTableSchema(): void { const tableName: string = SearchHistoryLocalDataSourceImpl.TABLE_NAME; if (!this.orm.hasTable(tableName)) { this.createSearchHistoryTable(); return; } const tableInfo: SearchHistoryTableInfo[] = this.orm.getTableInfo(tableName) as SearchHistoryTableInf...
https://github.com/Joker-x-dev/CoolMallArkTS
78fcec1c95d20f3c2d0d07444292057d8b1f9a1c
github
openharmony/developtools_profiler
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/RadarEntry.ets
arkts
getValue
This is the same as getY(). Returns the value of the RadarEntry. @return
public getValue(): number { return super.getY(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number...
public getValue(): number { return super.getY(); }
https://gitee.com/openharmony/developtools_profiler.git
b6815f52370db27dbea0c4abc91b65e87b647aee
gitee
aimilin6688/KeePassHO
entry/src/main/ets/services/SupportService.ets
arkts
isCanHideSupport
是否可以隐藏支持
public static isCanHideSupport(): Promise<boolean> { return new Promise((resolve, reject) => { // 获取安装时间 const appInstallTime = SettingsService.getSync(SettingsService.KEY_APP_INSTALL_TIME, -1); // 没有安装时间 if (appInstallTime <= 0) { return resolve(false); } // 安装时间超过一个月 ...
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 isCanHideSupport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
public static isCanHideSupport(): Promise<boolean> { return new Promise((resolve, reject) => { // 获取安装时间 const appInstallTime = SettingsService.getSync(SettingsService.KEY_APP_INSTALL_TIME, -1); // 没有安装时间 if (appInstallTime <= 0) { return resolve(false); } // 安装时间超过一个月 ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/SupportService.ets#L46-L57
ced586dc5cfeeb28268cc08664c71f431dd185a4
github
wuba/omni-ui
omni_component/src/main/ets/components/guide/model/HighLightInfoOfComponent.ets
arkts
getShape
获取高亮区域的图形类型
getShape() { return this.shape; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getShape AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#return_statement#Left AST#re...
getShape() { return this.shape; }
https://github.com/wuba/omni-ui
3112069dc4e37f4206a910f585ce409231a350dc
github
PollenWang6/HiXD
entry/src/main/ets/services/ClassService.ets
arkts
getUnscheduledCoursesEhall
未排课列表(本科生 ehall:已选课但尚未排入课表)
async getUnscheduledCoursesEhall(semCode: string, sid: string): Promise<string> { await this.init(); const key = 'unscheduled_' + semCode; return this.cache.getOrFetch<string>(key, async (): Promise<string> => { try { await this.activateAppSession(EHALL_APP_CLASS_TABLE); } catch (_) { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getUnscheduledCoursesEhall AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identif...
async getUnscheduledCoursesEhall(semCode: string, sid: string): Promise<string> { await this.init(); const key = 'unscheduled_' + semCode; return this.cache.getOrFetch<string>(key, async (): Promise<string> => { try { await this.activateAppSession(EHALL_APP_CLASS_TABLE); } catch (_) { ...
https://github.com/PollenWang6/HiXD
1af2f38e9cb8ec258152f981f221ca48f7ef6540
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/messagelist/components/MessageList.ets
arkts
getAsrDisplayManager
Get the ASR display manager instance Used by MessageItem to pass to SoundMessageView
getAsrDisplayManager(): AsrDisplayManager { return this.asrDisplayManager; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAsrDisplayManager 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 AsrDisplayManager AST#identifier#Right AS...
getAsrDisplayManager(): AsrDisplayManager { return this.asrDisplayManager; }
https://github.com/Tencent-RTC/TUIKit_Harmony
890d625cf4acee079d1b1c93f81c194af5727c2f
github
HarmonyOS_Samples/Spatialization
products/entry/src/main/ets/view/AdaptiveTabView.ets
arkts
build
[StartExclude adaptive_tab]
build() { HdsNavDestination() { // [EndExclude adaptive_tab] HdsTabs({ controller: this.controller }) { // [StartExclude adaptive_tab] Repeat(this.tabsBar) .each((repeatItem: RepeatItem<BottomTabBarStyle>) => { TabContent() { WaterFlowView({ currentT...
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() { HdsNavDestination() { // [EndExclude adaptive_tab] HdsTabs({ controller: this.controller }) { // [StartExclude adaptive_tab] Repeat(this.tabsBar) .each((repeatItem: RepeatItem<BottomTabBarStyle>) => { TabContent() { WaterFlowView({ currentT...
https://gitcode.com/HarmonyOS_Samples/Spatialization
82d30f468a097fe993c8ce06477030e852377c4e
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeMap.ets
arkts
get
Returns a value associated with key if present @param k: the key to find in the TreeMap @returns value if associated with key presents
get(key: K): V | undefined { return this.getEntry(key)?.val; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left get AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#Right AST#...
get(key: K): V | undefined { return this.getEntry(key)?.val; }
https://gitcode.com/iop123123/arkts-static-skills
d592d5e5e56d18af12497a19a04c0123c34c3d54
gitcode
dingzhilin1990/zhilinclaw
src/events/EventBus.ets
arkts
subscribeOnce
订阅一次性事件(触发后自动取消订阅) @param event 事件名称 @param handler 事件处理器 @returns 订阅 ID
public subscribeOnce(event: string, handler: EventHandler): string { if (!this.subscribers.has(event)) { this.subscribers.set(event, []); } const id = `sub_once_${++this.subscriptionCounter}`; const subscription: Subscription = { id, handler, once: true }; this.subscr...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left subscribeOnce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
public subscribeOnce(event: string, handler: EventHandler): string { if (!this.subscribers.has(event)) { this.subscribers.set(event, []); } const id = `sub_once_${++this.subscriptionCounter}`; const subscription: Subscription = { id, handler, once: true }; this.subscr...
https://github.com/dingzhilin1990/zhilinclaw
20f8a775cad9843c14911bc3ed80d743f831ac68
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
of
Returns a new array from a set of elements. @returns { Int8Array } - a new Int8Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(): Int8Array { return new Int8Array(0) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression...
public static of(): Int8Array { return new Int8Array(0) }
https://gitcode.com/iop123123/arkts-static-skills
dbc1dd80f4c663c6dc9b60495c40e06fd751e74f
gitcode
Joker-x-dev/CoolMallArkTS
feature/market/src/main/ets/viewmodel/CouponViewModel.ets
arkts
navigateToGoodsCategory
跳转到商品分类页面并带上最低金额 @param {Coupon} coupon - 当前优惠券 @returns {void} 无返回值
navigateToGoodsCategory(coupon: Coupon): void { const minPrice: string = coupon.condition?.fullAmount?.toString() ?? ""; const params: GoodsCategoryParam = { minPrice }; GoodsNavigator.toCategory(params); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left navigateToGoodsCategory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left coupon AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Coupon AST#identifier#Right AS...
navigateToGoodsCategory(coupon: Coupon): void { const minPrice: string = coupon.condition?.fullAmount?.toString() ?? ""; const params: GoodsCategoryParam = { minPrice }; GoodsNavigator.toCategory(params); }
https://github.com/Joker-x-dev/CoolMallArkTS
933a76170ec4eb0fde87e4b77f107941bb9fa6fa
github
Cool_foolisher1/ArkTSRepository
ArkTSDemo/common/src/main/ets/utils/BreakpointSystem.ets
arkts
updateCurrentBreakpoint
更新当前断点 @param breakpoint
private updateCurrentBreakpoint(breakpoint: string) { if (this.currentBreakpoint !== breakpoint) { this.currentBreakpoint = breakpoint AppStorage.setOrCreate(CommonConstant.CURRENT_BREAKPOINT, this.currentBreakpoint) } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateCurrentBreakpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left breakpoint AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left str...
private updateCurrentBreakpoint(breakpoint: string) { if (this.currentBreakpoint !== breakpoint) { this.currentBreakpoint = breakpoint AppStorage.setOrCreate(CommonConstant.CURRENT_BREAKPOINT, this.currentBreakpoint) } }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
9e069cf3e57b74bf78c42707c9c7416459624420
gitcode
Joker-x-dev/CoolMallArkTS
feature/order/src/main/ets/viewmodel/OrderRefundViewModel.ets
arkts
submitRefundApplication
提交退款申请 @returns {void} 无返回值
submitRefundApplication(): void { if (!this.selectedRefundReason) { return; } const params: RefundOrderRequest = new RefundOrderRequest(); params.orderId = this.orderId; params.reason = this.selectedRefundReason.name ?? ""; RequestHelper.repository<boolean>(this.repository.refundOrder(pa...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left submitRefundApplication 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#stat...
submitRefundApplication(): void { if (!this.selectedRefundReason) { return; } const params: RefundOrderRequest = new RefundOrderRequest(); params.orderId = this.orderId; params.reason = this.selectedRefundReason.name ?? ""; RequestHelper.repository<boolean>(this.repository.refundOrder(pa...
https://github.com/Joker-x-dev/CoolMallArkTS
88ba98b8305a5af44b8801b462d77491dcef4f85
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
setTimezoneOffset
Sets the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. @param { int } value new timezone offset @returns { long } get new date value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public setTimezoneOffset(value: int): long { const diff = value - this.getTimezoneOffset(); this.ms += diff * msPerMinute; return this.getTimezoneOffset(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTimezoneOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#ident...
public setTimezoneOffset(value: int): long { const diff = value - this.getTimezoneOffset(); this.ms += diff * msPerMinute; return this.getTimezoneOffset(); }
https://gitcode.com/iop123123/arkts-static-skills
fa78cefbf92e3f734583a4258e3e4d0a4e0ac3d9
gitcode
Yebingiscn/SweetVideo
entry/src/main/ets/controller/MpvController/MpvController.ets
arkts
registerVideoSizeChangedCallback
注册视频尺寸变化回调
private registerVideoSizeChangedCallback() { if (this.videoSizeCallbackRegistered) { return } try { mpvRegisterVideoSizeChangedCallback(() => { salmonLogger.addLog(TAG, '[MpvController] Video size changed, syncing OSD surface size') // 当视频尺寸变化时,同步 OSD Surface 尺寸 if (Set...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerVideoSizeChangedCallback 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_b...
private registerVideoSizeChangedCallback() { if (this.videoSizeCallbackRegistered) { return } try { mpvRegisterVideoSizeChangedCallback(() => { salmonLogger.addLog(TAG, '[MpvController] Video size changed, syncing OSD surface size') // 当视频尺寸变化时,同步 OSD Surface 尺寸 if (Set...
https://github.com/Yebingiscn/SweetVideo
8cff2ad6f670d54450c3bfaead27046844c1be57
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/Logger.ets
arkts
getHilogOutputLevel
获取当前的hilog输出级别
public getHilogOutputLevel(): LogLevel { return this.hilogOutputLevel; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHilogOutputLevel 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 Lo...
public getHilogOutputLevel(): LogLevel { return this.hilogOutputLevel; }
https://github.com/DaLongZhuaZi/manxia
fbbe5c39484b56041daa41bbaea3b6a909a80492
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MainMenuPage.ets
arkts
getGuideTabAnchorId
触发轻微震动反馈
private getGuideTabAnchorId(tabIndex: number): string { switch (tabIndex) { case TabIndex.HOME: return 'guide_main_tab_home'; case TabIndex.LIBRARY: return 'guide_main_tab_library'; case TabIndex.DISCOVER: return 'guide_main_tab_discover'; case TabIndex.SOURCE: ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getGuideTabAnchorId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tabIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AS...
private getGuideTabAnchorId(tabIndex: number): string { switch (tabIndex) { case TabIndex.HOME: return 'guide_main_tab_home'; case TabIndex.LIBRARY: return 'guide_main_tab_library'; case TabIndex.DISCOVER: return 'guide_main_tab_discover'; case TabIndex.SOURCE: ...
https://github.com/DaLongZhuaZi/manxia
585b7341041ac1c1b6ef79c1a22363b745c7fc84
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/VideoInfoUtil.ets
arkts
getVideoWidthAndHeight
获取视频长宽
static getVideoWidthAndHeight(metadata: media.AVMetadata) { if (canIUse('SystemCapability.Multimedia.Media.AVMetadataExtractor')) { const isPortrait = metadata.videoOrientation === '90' || metadata.videoOrientation === '270' const width = parseInt(String(isPortrait ? metadata.videoHeight : metadata.vi...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getVideoWidthAndHeight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left metadata AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Righ...
static getVideoWidthAndHeight(metadata: media.AVMetadata) { if (canIUse('SystemCapability.Multimedia.Media.AVMetadataExtractor')) { const isPortrait = metadata.videoOrientation === '90' || metadata.videoOrientation === '270' const width = parseInt(String(isPortrait ? metadata.videoHeight : metadata.vi...
https://github.com/Yebingiscn/SweetVideo
5382c475e6037cdb486e7bf585b29a722f1d8470
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/LibFreeRDP.ets
arkts
getVersion
Get FreeRDP version
static getVersion(): string { if (!LibFreeRDP.ensureNativeReady()) { return 'unknown'; } return freerdpNative!.freerdpGetVersion(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getVersion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#stri...
static getVersion(): string { if (!LibFreeRDP.ensureNativeReady()) { return 'unknown'; } return freerdpNative!.freerdpGetVersion(); }
https://github.com/tangwengang-del/freerdp-harmonyos
24f13c9aed37767e1e56aad1d8dc71c05200996f
github
AGenUI/AGenUI
platforms/harmony/agenui/src/main/ets/agenui/custom/A2UIComponent.ets
arkts
getWrapBuilder
Implemented by the base class. Subclasses should not override it.
getWrapBuilder(): WrappedBuilder<[HybridBaseView]> { return this._builder; }
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getWrapBuilder 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#:#Le...
getWrapBuilder(): WrappedBuilder<[HybridBaseView]> { return this._builder; }
https://github.com/AGenUI/AGenUI
79fca293ceeb6ae2e69442cc7413213e23dcce37
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/HistoryViewModel.ets
arkts
illustIds
SwiperProvider 接口实现
get illustIds(): number[] { if (this.isNovelMode()) return []; return this.displayList.map(i => Number((i as IllustHistoryInfo).pid)); }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left illustIds 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 number AST#identifier...
get illustIds(): number[] { if (this.isNovelMode()) return []; return this.displayList.map(i => Number((i as IllustHistoryInfo).pid)); }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/HistoryViewModel.ets#L43-L46
e0721977c82e0fd4f554695697e54b49e9a14f38
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/NotificationManager.ets
arkts
sendValidationCompleteNotification
发送校验完成通知
public async sendValidationCompleteNotification( taskId: string, total: number, validCount: number, invalidCount: number ): Promise<boolean> { const config: NotificationConfig = { id: this.getNotificationId(taskId), title: '书源校验完成', text: `共${total}个书源,有效:${validCount},失效:${inv...
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 sendValidationCompleteNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifier...
public async sendValidationCompleteNotification( taskId: string, total: number, validCount: number, invalidCount: number ): Promise<boolean> { const config: NotificationConfig = { id: this.getNotificationId(taskId), title: '书源校验完成', text: `共${total}个书源,有效:${validCount},失效:${inv...
https://github.com/DaLongZhuaZi/manxia
9bbb25ac5505121a5d243b45a4f393762fdebc37
github
LJ666-ui/harmony-health-care
entry/src/main/ets/common/utils/TokenManager.ets
arkts
isNurseLoggedIn
判断护士是否已登录
static isNurseLoggedIn(): boolean { const isLoggedIn = SettingsUtil.get('isLoggedInAsNurse'); const token = SettingsUtil.get('nurseToken'); return isLoggedIn === true && token !== null && token !== ''; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isNurseLoggedIn 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 A...
static isNurseLoggedIn(): boolean { const isLoggedIn = SettingsUtil.get('isLoggedInAsNurse'); const token = SettingsUtil.get('nurseToken'); return isLoggedIn === true && token !== null && token !== ''; }
https://github.com/LJ666-ui/harmony-health-care
70730ec94c062cdaf5eed680cc3670fc51c0e52a
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.xml.ets
arkts
setText
Sets the text content for the current XML element. @param {string} text - The text content to set for the current XML element.
public setText(text: string): void { this.checkEmptyParameter(text); let stringBuilder = new StringBuilder(); if (this.type === XmlType.START_AND_ATTRIBUTES) { this.spliceNamespace(stringBuilder); stringBuilder.append('>'); } ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A...
public setText(text: string): void { this.checkEmptyParameter(text); let stringBuilder = new StringBuilder(); if (this.type === XmlType.START_AND_ATTRIBUTES) { this.spliceNamespace(stringBuilder); stringBuilder.append('>'); } ...
https://gitcode.com/iop123123/arkts-static-skills
78fb7b78ca497ffe60d3acbe4123d0e1d09a74b8
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets
arkts
createIntFromJSONValue
Creates a Int instance based on JSONValue @param { Int } this JSONValue - a JSON representation @param { JSONValue } json @returns { Int } - true if JSON encodes true literal, false if JSON encodes false literal @throws { JSONTypeError } if json does not encode a valid boolean literal
function createIntFromJSONValue(json: JSONValue): Int { if (json instanceof JSONNumber) { let num = (json as JSONNumber).value if (Double.isInteger(num) && Int.MIN_VALUE <= num && num <= Int.MAX_VALUE) { return new Int(Double.toInt(num)) } } throw new JSONTypeError('Canno...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createIntFromJSONValue AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left json AST#identifier#Right AST#type_annotation#Left AST#:#Left :...
function createIntFromJSONValue(json: JSONValue): Int { if (json instanceof JSONNumber) { let num = (json as JSONNumber).value if (Double.isInteger(num) && Int.MIN_VALUE <= num && num <= Int.MAX_VALUE) { return new Int(Double.toInt(num)) } } throw new JSONTypeError('Canno...
https://gitcode.com/iop123123/arkts-static-skills
1f397e24eef45997cc3b2287b1faa0fd2a639900
gitcode
FinalScave/SweetLine
platform/OHOS/sweetline/src/main/ets/Index.ets
arkts
registerStyleName
Register a highlight style for name mapping @param styleName Style name @param styleId Style ID
public registerStyleName(styleName: string, styleId: number): boolean { if (this.nativeHandle == 0) { return false; } return lib.HighlightEngine_RegisterStyleName(this.nativeHandle, styleName, styleId); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left registerStyleName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left styleName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
public registerStyleName(styleName: string, styleId: number): boolean { if (this.nativeHandle == 0) { return false; } return lib.HighlightEngine_RegisterStyleName(this.nativeHandle, styleName, styleId); }
https://github.com/FinalScave/SweetLine
da25a7f2fac6bd5cc69c910ab85d97062488c178
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/AdviceFeedbackDAO.ets
arkts
updateActualSpending
更新实际支出并计算准确性
static async updateActualSpending(feedbackId: number, actualSpending: number): Promise<boolean> { try { // 先获取反馈记录 const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(AdviceFeedback.tableName); predicates.equalTo('feedback_id', feedbackId); ...
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 updateActualSpending AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left feedbackId AST#identifier#Right AST#ERROR#Left AST...
static async updateActualSpending(feedbackId: number, actualSpending: number): Promise<boolean> { try { // 先获取反馈记录 const store = DatabaseManager.getDatabase(); const predicates = new relationalStore.RdbPredicates(AdviceFeedback.tableName); predicates.equalTo('feedback_id', feedbackId); ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
cb692ab2192ed051c3836c976ffc087a2f9c6b15
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/DeviceAdaptationManager.ets
arkts
getDeviceTypeFromAPI
从官方API获取设备类型
private getDeviceTypeFromAPI(): DeviceType { try { const systemDeviceType = deviceInfo.deviceType; // 如果是折叠屏,优先返回折叠屏类型 if (this.isFoldableDevice) { logger.debug(TAG, `设备类型: ${systemDeviceType} (折叠屏)`); return DeviceType.FOLDABLE; } // 根据系统返回的设备类型映射 ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDeviceTypeFromAPI 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#Lef...
private getDeviceTypeFromAPI(): DeviceType { try { const systemDeviceType = deviceInfo.deviceType; // 如果是折叠屏,优先返回折叠屏类型 if (this.isFoldableDevice) { logger.debug(TAG, `设备类型: ${systemDeviceType} (折叠屏)`); return DeviceType.FOLDABLE; } // 根据系统返回的设备类型映射 ...
https://github.com/DaLongZhuaZi/manxia
2d0a254f79481167f452f5b4d45cb9496cd0950b
github
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/utils/RecurringBillService.ets
arkts
shouldDeactivateConfig
判断配置是否应该禁用
private async shouldDeactivateConfig(config: RecurringBillConfig, today: string): Promise<boolean> { // 检查截止日期(今天超过截止日期时禁用) if (config.endDate && today > config.endDate) { return true; } // 检查重复次数 if (config.repeatCount && config.id) { const records = await this.recurringDb.queryR...
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 shouldDeactivateConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AS...
private async shouldDeactivateConfig(config: RecurringBillConfig, today: string): Promise<boolean> { // 检查截止日期(今天超过截止日期时禁用) if (config.endDate && today > config.endDate) { return true; } // 检查重复次数 if (config.repeatCount && config.id) { const records = await this.recurringDb.queryR...
https://github.com/qiuhaotc/HarmonyOSPlayground
b9372a71b48ed2facd5d3372014e7a04a9360b42
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
getHorizontalFlip
Get the current horizontal flip status of the element. @returns boolean - Returns true if the element is horizontally flipped, false otherwise.
public getHorizontalFlip(): boolean { return this.isHorizontalFlip; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHorizontalFlip 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...
public getHorizontalFlip(): boolean { return this.isHorizontalFlip; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
c1da12624b72fcfe753e180335baff19d19b030b
gitee
HarmonyOS_Samples/guide-snippets
ArkGraphics3D/entry/src/main/ets/common/utils.ets
arkts
HandlePinchGestureActionUpdate
pinch such a dizzy, better use touch event
HandlePinchGestureActionUpdate(event: GestureEvent): void { if (!this.pinchDistance_) { this.pinchDistance_ = this.orbitDistance_; } let scale = event.scale; if (scale == 0) { scale = 0.01; } this.orbitDistance_ = this.pinchDistance_ * (1 / scale); this.state = 1; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left HandlePinchGestureActionUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left GestureEvent AST#identif...
HandlePinchGestureActionUpdate(event: GestureEvent): void { if (!this.pinchDistance_) { this.pinchDistance_ = this.orbitDistance_; } let scale = event.scale; if (scale == 0) { scale = 0.01; } this.orbitDistance_ = this.pinchDistance_ * (1 / scale); this.state = 1; }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
fe70d8767fd1f435b97bfaabf4134e71ced68b85
gitcode
bluedeer000/HarmonyCalendar
entry/src/main/ets/services/CalendarSourceAdapterRegistry.ets
arkts
resolveAdapterType
-------- 内部 --------
private resolveAdapterType(account: CalendarAccount): string { // 显式指定的 providerAdapterType 优先 const accountMap: Record<string, Object> = JSON.parse(JSON.stringify(account)); if (accountMap["providerAdapterType"] !== undefined) { return accountMap["providerAdapterType"] as string; } // 已知的 ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left resolveAdapterType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left account AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
private resolveAdapterType(account: CalendarAccount): string { // 显式指定的 providerAdapterType 优先 const accountMap: Record<string, Object> = JSON.parse(JSON.stringify(account)); if (accountMap["providerAdapterType"] !== undefined) { return accountMap["providerAdapterType"] as string; } // 已知的 ...
https://github.com/bluedeer000/HarmonyCalendar
921070577613b2aa5982017cd44a92a59d32e274
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartMessenger.ets
arkts
IsFlutterNavigationExecuted
获取当前flutter页面是否路由跳转,并传递到native侧
IsFlutterNavigationExecuted(channel: String): void { if(channel == "flutter/navigation") { this.flutterNapi.setFlutterNavigationAction(true); Log.d(TAG, "setFlutterNavigationAction -> '" + channel + "'"); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left IsFlutterNavigationExecuted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left channel AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left String AST#identifier#Right AST#ERROR#Rig...
IsFlutterNavigationExecuted(channel: String): void { if(channel == "flutter/navigation") { this.flutterNapi.setFlutterNavigationAction(true); Log.d(TAG, "setFlutterNavigationAction -> '" + channel + "'"); } }
https://gitee.com/openharmony-sig/flutter_engine.git
d74e78b46207c4df2919e8c5dce4c87cbb203301
gitee
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/FootprintRepository.ets
arkts
constructor
构造函数 @param {FootprintLocalDataSource} dataSource 可选的数据源实例
constructor(dataSource: FootprintLocalDataSource = new FootprintLocalDataSourceImpl()) { this.dataSource = dataSource; }
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 dataSource AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifi...
constructor(dataSource: FootprintLocalDataSource = new FootprintLocalDataSourceImpl()) { this.dataSource = dataSource; }
https://github.com/Joker-x-dev/CoolMallArkTS
2834ce9c511b3920409d118eb44ebcb6d5f0e24e
github
DaLongZhuaZi/manxia
entry/src/main/ets/EntryAbility.ets
arkts
runManagedInitialization
执行可监控的初始化流程 所有初始化按顺序执行,并通过AppInitializationManager报告进度
private async runManagedInitialization(): Promise<void> { const initManager = ngfLifecycleOrchestratorFacade; initManager.startInitialization(); ngfCoreEventBridge.publishInitializationState(InitPhase.NOT_STARTED, 'started', '应用初始化流程已启动'); // 阶段1:设置全局上下文 initManager.beginPhase(InitPhase.CONTE...
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 runManagedInitialization AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressio...
private async runManagedInitialization(): Promise<void> { const initManager = ngfLifecycleOrchestratorFacade; initManager.startInitialization(); ngfCoreEventBridge.publishInitializationState(InitPhase.NOT_STARTED, 'started', '应用初始化流程已启动'); // 阶段1:设置全局上下文 initManager.beginPhase(InitPhase.CONTE...
https://github.com/DaLongZhuaZi/manxia
ceba80ffb2f7e58ae8c5379c0a14176d63058af4
github
OHPG/FinMusic
entry/src/main/ets/data/Repository.ets
arkts
getGenreDetail
查询流派详情 @param id @returns
public async getGenreDetail(id: string): Promise<BaseItemDto> { return this.requireApi().getGenreDetail(id) }
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 getGenreDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#...
public async getGenreDetail(id: string): Promise<BaseItemDto> { return this.requireApi().getGenreDetail(id) }
https://github.com/OHPG/FinMusic
7ce0849fb37fcf827549527c6cdcfa7c39bcd74b
github
the-wwyang/kids-learning-app
src/main/ets/services/LearningService.ets
arkts
completeLesson
完成一节课程
public async completeLesson( moduleName: string, starsEarned: number, lessonName?: string ): Promise<boolean> { try { // 保存进度和星星 const success = await appStorage.completeLesson(moduleName, starsEarned); if (success) { // 检查成就更新 await achievementManager.checkAndUpda...
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 completeLesson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleName AST#identifier#Right AST#ERROR#Left AST#:#Lef...
public async completeLesson( moduleName: string, starsEarned: number, lessonName?: string ): Promise<boolean> { try { // 保存进度和星星 const success = await appStorage.completeLesson(moduleName, starsEarned); if (success) { // 检查成就更新 await achievementManager.checkAndUpda...
https://github.com/the-wwyang/kids-learning-app
e56e73f3c3f3f0d10937d73fadee6ea85152f0d4
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/viewmodel/AppViewModel.ets
arkts
loadAllIcons
异步加载所有应用图标(串行加载,避免并发过多)
private async loadAllIcons(nvHttp: NvHttp): Promise<void> { console.info(`AppListViewModel: 开始加载 ${this.apps.length} 个应用图标`); // 串行加载图标,避免并发过多导致卡顿 for (const app of this.apps) { // 检查是否已取消 if (this.iconLoadingCancelled) { console.info(`AppListViewModel: 图标加载被取消,停止加载`); return;...
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 loadAllIcons AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left nvHttp AST#identifier#Right AST#:#Left :...
private async loadAllIcons(nvHttp: NvHttp): Promise<void> { console.info(`AppListViewModel: 开始加载 ${this.apps.length} 个应用图标`); // 串行加载图标,避免并发过多导致卡顿 for (const app of this.apps) { // 检查是否已取消 if (this.iconLoadingCancelled) { console.info(`AppListViewModel: 图标加载被取消,停止加载`); return;...
https://github.com/AlkaidLab/moonlight-harmony
a57c84ba3d2793d46661bf3ecfe6f8733532eab3
github
cpdd5201314/harmonyOS-music-app
products/phone/src/main/ets/pages/MusicDownloadService.ets
arkts
deleteDownloadedFile
删除已下载的文件
async deleteDownloadedFile(filePath: string): Promise<void> { try { if (this.checkFileExists(filePath)) { fs.unlinkSync(filePath); console.info(`[Download] 文件已删除: ${filePath}`); // 从任务列表中移除 this.downloadTasks.forEach((task, key) => { if (task.filePath === filePath)...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteDownloadedFile AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left filePath AST#identifier#Right AST#type_annotation#Left AST...
async deleteDownloadedFile(filePath: string): Promise<void> { try { if (this.checkFileExists(filePath)) { fs.unlinkSync(filePath); console.info(`[Download] 文件已删除: ${filePath}`); // 从任务列表中移除 this.downloadTasks.forEach((task, key) => { if (task.filePath === filePath)...
https://github.com/cpdd5201314/harmonyOS-music-app
cf2e4023ae483aca6d3cc7341eb591b9710c52ea
github
HarmonyOS_Samples/MusicHome
features/playlist/src/main/ets/util/PlaylistDataUtil.ets
arkts
mapSongDtoToUi
Maps a network/database DTO into a {@link PlaylistSongUi} instance. @param dto Song payload from the API layer. @returns Populated UI model.
private static mapSongDtoToUi(dto: SongApiDto): PlaylistSongUi { const ui = new PlaylistSongUi(); ui.id = dto.id; ui.title = dto.title; ui.singer = dto.singer; ui.label = dto.label; return ui; }
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 mapSongDtoToUi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dto AST#identifier#Right AST#:#Left :...
private static mapSongDtoToUi(dto: SongApiDto): PlaylistSongUi { const ui = new PlaylistSongUi(); ui.id = dto.id; ui.title = dto.title; ui.singer = dto.singer; ui.label = dto.label; return ui; }
https://gitcode.com/HarmonyOS_Samples/MusicHome
67d358f964068c32741ff8fb415bc46ee8691174
gitcode
offlinecat-dev/OCNetORM
src/main/ets/query/WhereCondition.ets
arkts
greaterThan
创建大于条件 @param column 列名 @param value 值 @returns WhereCondition 实例
static greaterThan(column: string, value: ValueType): WhereCondition { const condition = new WhereCondition() condition.column = column condition.operator = ConditionOperator.GREATER condition.value = value return condition }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left greaterThan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st...
static greaterThan(column: string, value: ValueType): WhereCondition { const condition = new WhereCondition() condition.column = column condition.operator = ConditionOperator.GREATER condition.value = value return condition }
https://github.com/offlinecat-dev/OCNetORM
c14f7b912a5ed1f76533460b39deda7289b0d59b
github
wuba/omni-ui
omni_component/src/main/ets/components/filterbar/OmniFilterComponentRegistry.ets
arkts
registerRightSlideComponent
注册右滑类型的组件
registerRightSlideComponent(type: string, builder: WrappedBuilder<[OmniFilterItemBean, OnConfirmAction, OnCloseAction]>) { this.rightSlideTypeBuilderPool.set(type, builder); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left registerRightSlideComponent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#id...
registerRightSlideComponent(type: string, builder: WrappedBuilder<[OmniFilterItemBean, OnConfirmAction, OnCloseAction]>) { this.rightSlideTypeBuilderPool.set(type, builder); }
https://github.com/wuba/omni-ui
e103b575a7c851922ad43093ed00e7e959695c17
github
openharmony/xts_tools
sample/ui_compare/uiCompareTest_01/entry/src/ohosTest/ets/test/model/Settings.ets
arkts
createWindow
窗口页面更新 Setting.createWindow(pageURI: String, {X,Y,width,height,dpi}?:{X?:number,Y?:number,width?:number,height?:number,dpi?:number}):void 必填: pageURI:页面路由 选填: X,Y:窗口相对于左上角的位置,默认X=100,Y=100 单位为px width,height:窗口宽高,默认width=600,height=1250 可配置范围:[0,2560],单位为vp dpi:像素密度,默认dpi=330,可配置范围:80-640
createWindow(pageURI: string, X?: number | undefined, Y?: number | undefined, width?: number | undefined, height?: number | undefined, dpi?: number | undefined) { this.windowCreateType = "createWindow" if (X == undefined) { X = Settings.DEFAULT_OFFSET_X; } if (Y == undefined) { Y = Settin...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left createWindow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pageURI AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,...
createWindow(pageURI: string, X?: number | undefined, Y?: number | undefined, width?: number | undefined, height?: number | undefined, dpi?: number | undefined) { this.windowCreateType = "createWindow" if (X == undefined) { X = Settings.DEFAULT_OFFSET_X; } if (Y == undefined) { Y = Settin...
https://gitee.com/openharmony/xts_tools.git
fbb63a27ec60a09f075b709b966ec12878b7fb94
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/EBookDataManager.ets
arkts
getRecordValue
从DatabaseRecord安全地获取字段值 使用Reflect.get避免索引访问限制
function getRecordValue(record: DatabaseRecord, fieldName: string, defaultValue: string | number): string | number { try { const value: string | number | null | undefined = Reflect.get(record, fieldName) as string | number | null | undefined; if (value !== null && value !== undefined) { return value as ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getRecordValue AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left record AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:...
function getRecordValue(record: DatabaseRecord, fieldName: string, defaultValue: string | number): string | number { try { const value: string | number | null | undefined = Reflect.get(record, fieldName) as string | number | null | undefined; if (value !== null && value !== undefined) { return value as ...
https://github.com/DaLongZhuaZi/manxia
47fc5ecfd069263d6d9e1e6527b873018cc4fbaf
github
openharmony/applications_app_samples
code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/utils/UrlUtils.ets
arkts
saveUrl
设置保存上传下载地址
async saveUrl(context: common.UIAbilityContext, url: string) { let preference = await preferences.getPreferences(context, STORE_NAME); await preference.put(URL_KEY, url); await preference.flush(); logger.info(TAG, `saveUrl,url= ${url}`); }
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left saveUrl AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async saveUrl(context: common.UIAbilityContext, url: string) { let preference = await preferences.getPreferences(context, STORE_NAME); await preference.put(URL_KEY, url); await preference.flush(); logger.info(TAG, `saveUrl,url= ${url}`); }
https://github.com/openharmony/applications_app_samples
6af8bcdb378ee13e7065b359b15706415fe23794
github
aimilin6688/KeePassHO
entry/src/main/ets/services/kdbx/KdbxImportService.ets
arkts
handlerImport
处理导入 @param locationInfo 位置信息
private static async handlerImport(locationInfo: LocationInfo) { const exists = await KdbxFileManager.of(locationInfo).exists(locationInfo.filePath); // 文件不存在 if (!exists) { CommonUtils.showToast($r("app.string.file_not_exists")); return; } const fileExt = FilenameUtils.getFileExt(loca...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left handlerImport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left l...
private static async handlerImport(locationInfo: LocationInfo) { const exists = await KdbxFileManager.of(locationInfo).exists(locationInfo.filePath); // 文件不存在 if (!exists) { CommonUtils.showToast($r("app.string.file_not_exists")); return; } const fileExt = FilenameUtils.getFileExt(loca...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxImportService.ets#L43-L81
b58db5f18a61fe322d1d17c3d5c70ac21fcd065a
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BaseDataSet.ets
arkts
resetColors
Resets all colors of this DataSet and recreates the colors array.
public resetColors(): void { if (this.mColors == null) { this.mColors = new JArrayList<Number>(); } this.mColors.clear(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetColors AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression...
public resetColors(): void { if (this.mColors == null) { this.mColors = new JArrayList<Number>(); } this.mColors.clear(); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
27ca89ffb4254512f3b08a819ec5e2153153084b
gitee
codelably/tuniao-ui
core/tuniaoui/src/main/ets/components/water-fall/TnWaterFallTypes.ets
arkts
getData
获取指定索引的数据 @param index 数据索引 @returns 数据对象
getData(index: number): Object { return this.dataArray[index]; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#...
getData(index: number): Object { return this.dataArray[index]; }
https://github.com/codelably/tuniao-ui
b09ed012c5843782b7b753611af5166967b4166d
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/BasePopup.ets
arkts
setDialogOptions
设置弹窗配置 @param dialogOptions
setDialogOptions(dialogOptions: promptAction.BaseDialogOptions) { this.dialogOptions = dialogOptions }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setDialogOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dialogOptions AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#iden...
setDialogOptions(dialogOptions: promptAction.BaseDialogOptions) { this.dialogOptions = dialogOptions }
https://github.com/wuba/omni-ui
d6f02f762eab1b864bdfba9b681a4cce8072c0af
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/String.ets
arkts
join
Concatenates the specified string array by inserting the specified prefix before each element, the specified suffix after each element, and the specified separator between all elements. @param strings string array @param delim separator between all elements @param prefix prefix before each element @param suffix suffix ...
public static join(strings: String[], delim: String, prefix: String, suffix: String): String { let resStr: String = ""; for (let i: int = 0; i < strings.length; i++) { resStr += prefix + strings[i] + suffix; if (i != strings.length - 1) { resStr += delim; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left join AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left strings AST...
public static join(strings: String[], delim: String, prefix: String, suffix: String): String { let resStr: String = ""; for (let i: int = 0; i < strings.length; i++) { resStr += prefix + strings[i] + suffix; if (i != strings.length - 1) { resStr += delim; ...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
04ffeef21ad9819f11c5037ab9786d434d10ea83
gitee
openharmony-sig/ohos-beacon-library
library/src/main/ets/components/beacon/logging/LogManager.ets
arkts
getLogger
Gets the currently set logger @return logger
public getLogger(): Logger { return LogManager.sLogger; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLogger 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 Logger AST#i...
public getLogger(): Logger { return LogManager.sLogger; }
https://gitee.com/openharmony-sig/ohos-beacon-library.git
cbb4ec240468ca8362e69b2894cc190660df589b
gitee
openharmony/codelabs
Data/DeviceHealth/entry/src/main/ets/components/Notification/DialogUtils.ets
arkts
showNotice
弹出通用告警对话框 @param title 标题 @param message 内容 @param onConfirm 点击确定的回调(可选)
static showNotice(title: string | Resource, message: string | Resource, onConfirm?: () => void) { AlertDialog.show({ title: title, message: message, alignment: DialogAlignment.Bottom, offset: { dx: 0, dy: -20 }, primaryButton: { value: '取消', action: () => { ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left showNotice AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left title AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left string AST#identifier...
static showNotice(title: string | Resource, message: string | Resource, onConfirm?: () => void) { AlertDialog.show({ title: title, message: message, alignment: DialogAlignment.Bottom, offset: { dx: 0, dy: -20 }, primaryButton: { value: '取消', action: () => { ...
https://gitcode.com/openharmony/codelabs
9678d45372675cea07c080ff15cb7d702b4deee2
gitcode
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/util/ProcessUtil.ets
arkts
terminateAbility
终止能力 @param context common.UIAbilityContext
public static terminateAbility(context: common.UIAbilityContext): void { try { context.terminateSelf().then(() => { Logger.info(TAG, `终止成功`) }).catch((error: BusinessError) => { Logger.error(TAG, `终止失败, 错误码: ${error.code}, 错误信息: ${error.message}`) }) } catch (error) { c...
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 terminateAbility AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Lef...
public static terminateAbility(context: common.UIAbilityContext): void { try { context.terminateSelf().then(() => { Logger.info(TAG, `终止成功`) }).catch((error: BusinessError) => { Logger.error(TAG, `终止失败, 错误码: ${error.code}, 错误信息: ${error.message}`) }) } catch (error) { c...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
6a2b42f1ae52a1f3647d0db70fdd9276d06a66b6
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets
arkts
constructor
Create EAWorker instance with specified name @param { string } name The name of the worker @param { boolean } [needInterop=false] true if need to create JS runtime
constructor(name: string, needInterop: boolean = false) { this.worker = needInterop ? new InteropWorker(name) : new StaticWorker(name); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
constructor(name: string, needInterop: boolean = false) { this.worker = needInterop ? new InteropWorker(name) : new StaticWorker(name); }
https://gitcode.com/iop123123/arkts-static-skills
eac98a9d993b56a3bb917eeaf025d926974ee059
gitcode
CLMC2025/Vignette
entry/src/main/ets/context/OfflineContext.ets
arkts
getWordInfo
获取词汇信息
private getWordInfo(word: string): WordInfo { const lowerWord = word.toLowerCase(); const wordInfo = this.wordDatabase.get(lowerWord); if (wordInfo !== undefined) { return wordInfo; } // 如果词汇不在数据库中,创建默认信息 return new WordInfo(word, 'n.', ''); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getWordInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left word AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
private getWordInfo(word: string): WordInfo { const lowerWord = word.toLowerCase(); const wordInfo = this.wordDatabase.get(lowerWord); if (wordInfo !== undefined) { return wordInfo; } // 如果词汇不在数据库中,创建默认信息 return new WordInfo(word, 'n.', ''); }
https://github.com/CLMC2025/Vignette
ba5fae0f1cca4ed83cf5533940516324c45c9831
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/model/SessionState.ets
arkts
getPixelMap
Get the pixel map for rendering
getPixelMap(): image.PixelMap | null { return this.pixelMap; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getPixelMap 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 ...
getPixelMap(): image.PixelMap | null { return this.pixelMap; }
https://github.com/tangwengang-del/freerdp-harmonyos
ee448cf6c919da684c5462e2d94dda386c48e425
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/CommonUtils.ets
arkts
toShowToastOptions
转换为提示信息参数 @param message 消息格式 @param duration 延时时间 @returns 结果
private static toShowToastOptions(param: ResourceStr | promptAction.ShowToastOptions, duration?: number): promptAction.ShowToastOptions { if (typeof param === 'string') { return { message: param, duration: duration ?? 2000 }; } if (Object.keys(param).indexOf('bundleName') !== -1) { return { me...
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 toShowToastOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left param AST#identifier#Right AST#:#...
private static toShowToastOptions(param: ResourceStr | promptAction.ShowToastOptions, duration?: number): promptAction.ShowToastOptions { if (typeof param === 'string') { return { message: param, duration: duration ?? 2000 }; } if (Object.keys(param).indexOf('bundleName') !== -1) { return { me...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/CommonUtils.ets#L194-L202
31c17888ca77b1052701b384b58035c65839a0bc
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.List.ets
arkts
swap
swaps the elements of two nodes. @param list1 The first node. @param list2 The second node.
private swap(list1: ListNode<T>, list2: ListNode<T>) { let temp = list1.element list1.element = list2.element list2.element = temp }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left swap AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left list1 AST#identifier#Right AST#:#Left : AST...
private swap(list1: ListNode<T>, list2: ListNode<T>) { let temp = list1.element list1.element = list2.element list2.element = temp }
https://gitcode.com/iop123123/arkts-static-skills
1c156992296583548eee885461d61defd29af917
gitcode
openharmony/codelabs
ETSUI/CoinNote/entry/src/main/ets/component/CalendarView.ets
arkts
getFirstDayOfWeek
获取当月第一天是星期几 (0-6)
getFirstDayOfWeek(year: number, month: number): number { return new Date(year, month, 1).getDay(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getFirstDayOfWeek AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left...
getFirstDayOfWeek(year: number, month: number): number { return new Date(year, month, 1).getDay(); }
https://gitcode.com/openharmony/codelabs
e0d04edd23beaf255c92bdb63b760e904c5aa4cd
gitcode
huaweicloud/huaweicloud-iot-device-sdk-arkts
huaweicloud_iot_device_library/src/main/ets/service/AbstractDevice.ets
arkts
fireServicesChanged
触发多个服务的属性变化,SDK自动上报变化的属性到平台 @param serviceIds 发生变化的服务id列表
public fireServicesChanged(serviceIds: string[]): void { const serviceProperties: ServiceProperty[] = []; serviceIds.forEach(serviceId => { const deviceService = this.getService(serviceId); if (deviceService === null || deviceService === undefined || deviceService.serviceId === null) { Log...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left fireServicesChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left serviceIds AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST...
public fireServicesChanged(serviceIds: string[]): void { const serviceProperties: ServiceProperty[] = []; serviceIds.forEach(serviceId => { const deviceService = this.getService(serviceId); if (deviceService === null || deviceService === undefined || deviceService.serviceId === null) { Log...
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts
841097a93058e7651edbaeef4c1b91d548150577
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/BackgroundImageUtil.ets
arkts
clearBackgroundImage
清除背景图(使用默认 API)
async clearBackgroundImage(): Promise<void> { await this.setBackgroundImageUrl(''); await this.setBackgroundImageType(BackgroundImageType.DEFAULT); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearBackgroundImage 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...
async clearBackgroundImage(): Promise<void> { await this.setBackgroundImageUrl(''); await this.setBackgroundImageType(BackgroundImageType.DEFAULT); }
https://github.com/AlkaidLab/moonlight-harmony
a1fcd44969cead367376c455fc3ed39d797100d4
github
ZestBox-18/kitebook-frontend
commons/kite_utils/src/main/ets/utils/windowInfo/WindowUtil.ets
arkts
setSplitScreen
设置分屏模式
setSplitScreen(bundleName: string, abilityName: string, moduleName: string): void { let context = this.uiContext?.getHostContext() as common.UIAbilityContext; let option: StartOptions = { windowMode: AbilityConstant.WindowMode.WINDOW_MODE_SPLIT_PRIMARY }; let want: Want = { bundleName: bundleName, ability...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setSplitScreen AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left bundleName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AS...
setSplitScreen(bundleName: string, abilityName: string, moduleName: string): void { let context = this.uiContext?.getHostContext() as common.UIAbilityContext; let option: StartOptions = { windowMode: AbilityConstant.WindowMode.WINDOW_MODE_SPLIT_PRIMARY }; let want: Want = { bundleName: bundleName, ability...
https://github.com/ZestBox-18/kitebook-frontend
0e098958bfb2f323be87e6035f3e3b9f79c53aee
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
slice
Creates a slice of current BigInt64Array using range [begin, this.length). @param { int } begin - start index to be taken into slice @returns { BigInt64Array } - a new BigInt64Array with elements of current BigInt64Array[begin, this.length) @syscap SystemCapability.Utils.Lang @FaAndStageModel
public slice(begin: int): BigInt64Array { return this.sliceFromTo(begin, this.lengthInt) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id...
public slice(begin: int): BigInt64Array { return this.sliceFromTo(begin, this.lengthInt) }
https://gitcode.com/iop123123/arkts-static-skills
75a54dcacc3ec8b7b1f9f6ebc98f908dccef2027
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/DdkUsbPoller.ets
arkts
start
启动 DDK 轮询 @param deviceId DDK 设备 ID (来自 findDevice) @param ifaceIndex USB 接口编号 @param inEndpoint 输入端点地址 @param outEndpoint 输出端点地址 (0=无输出) @param maxPacketSize 最大包大小 @param onData 数据回调 @param onError 错误回调 @param timeoutMs 单次读取超时 (默认 100ms) @returns 是否启动成功
start( deviceId: number, ifaceIndex: number, inEndpoint: number, outEndpoint: number, maxPacketSize: number, onData: (data: Uint8Array, length: number) => void, onError: (errorCode: number) => void, timeoutMs: number = 100 ): boolean { if (!ddkInitialized || !ddkNative) { c...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#call_expression#Left AST#identifier#Left start 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#number#Left number AST#number#Right AS...
start( deviceId: number, ifaceIndex: number, inEndpoint: number, outEndpoint: number, maxPacketSize: number, onData: (data: Uint8Array, length: number) => void, onError: (errorCode: number) => void, timeoutMs: number = 100 ): boolean { if (!ddkInitialized || !ddkNative) { c...
https://github.com/AlkaidLab/moonlight-harmony
7bc32b3c0627a41a5dd183834277d5faf0e23c8b
github
IoTAccessControl/ArkTSAnalysis
TestApps/AccountKit-QuickLogin/entry/src/main/ets/pages/ProtocolWebView.ets
arkts
getWebviewWidth
Obtains the page width.
getWebviewWidth() { const WEB_PAGE_MARGIN = 32; const UI_PAGE_MARGIN = 16; const displayWidth: number = px2vp(display.getDefaultDisplaySync().width); return ((displayWidth + (WEB_PAGE_MARGIN - UI_PAGE_MARGIN) * 2) * 100 / displayWidth).toFixed(2) + '%'; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getWebviewWidth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le...
getWebviewWidth() { const WEB_PAGE_MARGIN = 32; const UI_PAGE_MARGIN = 16; const displayWidth: number = px2vp(display.getDefaultDisplaySync().width); return ((displayWidth + (WEB_PAGE_MARGIN - UI_PAGE_MARGIN) * 2) * 100 / displayWidth).toFixed(2) + '%'; }
https://github.com/IoTAccessControl/ArkTSAnalysis
3ff6e64541a876a46f6125962d1a93909a8db01e
github
openharmony-sig/applications_clock
common/src/main/ets/manager/AlarmManager.ets
arkts
getLatestAlarmFromDb
Query the latest alarm data from the database. @param the latest alarm data
async getLatestAlarmFromDb(alarmId: string | number): Promise<AlarmInfo | undefined> { if (!alarmId) { LogUtil.info(TAG, 'get latest alarm from db occurs error, alarmId is empty'); return undefined; } const rdbStore = await this.getRdbStore(); const predicates = new rdb.RdbPredicates(DATA_...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getLatestAlarmFromDb AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alarmId AST#identifier#R...
async getLatestAlarmFromDb(alarmId: string | number): Promise<AlarmInfo | undefined> { if (!alarmId) { LogUtil.info(TAG, 'get latest alarm from db occurs error, alarmId is empty'); return undefined; } const rdbStore = await this.getRdbStore(); const predicates = new rdb.RdbPredicates(DATA_...
https://gitee.com/openharmony-sig/applications_clock.git
dcd75fa55314067115394115555b84517603890d
gitee
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/util/WindowUtil.ets
arkts
setMissionContinueActive
设置任务继续活动 @param context common.UIAbilityContext @param active boolean
public static setMissionContinueActive(context: common.UIAbilityContext, active: boolean): void { const activeState = active ? AbilityConstant.ContinueState.ACTIVE : AbilityConstant.ContinueState.INACTIVE context.setMissionContinueState(activeState).then(() => { Logger.info(TAG, `设置任务继续活动成功`) }).cat...
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 setMissionContinueActive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right A...
public static setMissionContinueActive(context: common.UIAbilityContext, active: boolean): void { const activeState = active ? AbilityConstant.ContinueState.ACTIVE : AbilityConstant.ContinueState.INACTIVE context.setMissionContinueState(activeState).then(() => { Logger.info(TAG, `设置任务继续活动成功`) }).cat...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
b2fbed406282ffb1e2fcfa1fc4e574c8c0323ffa
gitcode
buqiuz/game-puzzle
entry/src/main/ets/model/ImageModel.ets
arkts
getPictureFromAlbum
从图库中选择图片然后划分
async getPictureFromAlbum(splitCount: number): Promise<PictureItem[]> { // 拉起相册,选择图片 let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; PhotoSelectOptions.maxSelectNumber = 1; let photoPicker = new pho...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getPictureFromAlbum AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left splitCount AST#identifier#Right AST#type_annotatio...
async getPictureFromAlbum(splitCount: number): Promise<PictureItem[]> { // 拉起相册,选择图片 let PhotoSelectOptions = new photoAccessHelper.PhotoSelectOptions(); PhotoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE; PhotoSelectOptions.maxSelectNumber = 1; let photoPicker = new pho...
https://github.com/buqiuz/game-puzzle
de9ce461bd1dcbfd45c688d2964321a6bc9a81c1
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/NativeModuleManager.ets
arkts
clearModuleCache
清除模块缓存 @param moduleName 模块名称,不传则清除所有缓存
public clearModuleCache(moduleName?: string): void { if (moduleName) { this.nativeModules.delete(moduleName); logger.debug('NativeModuleManager', `清除模块 ${moduleName} 缓存`); } else { this.nativeModules.clear(); logger.debug('NativeModuleManager', '清除所有模块缓存'); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearModuleCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleName AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#...
public clearModuleCache(moduleName?: string): void { if (moduleName) { this.nativeModules.delete(moduleName); logger.debug('NativeModuleManager', `清除模块 ${moduleName} 缓存`); } else { this.nativeModules.clear(); logger.debug('NativeModuleManager', '清除所有模块缓存'); } }
https://github.com/DaLongZhuaZi/manxia
ed660a0636a1915783bab7be9d1e8543dcb0abe5
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncCondVar.ets
arkts
notifyOne
Unblocks ONE suspended coroutine associated with this CondVar, if it exists. This method is thread-safe in relation to other methods of the CondVar. @param { AsyncMutex } mutex - The mutex associated with the condition, must be locked when calling to ensure correct synchronization @syscap SystemCapability.Utils.Lang pr...
public notifyOne(mutex: AsyncMutex): void { if (this.waiters_ != 0) { this.waitersList_.resume(); this.waiters_--; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left notifyOne AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mutex AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Async...
public notifyOne(mutex: AsyncMutex): void { if (this.waiters_ != 0) { this.waitersList_.resume(); this.waiters_--; } }
https://gitcode.com/iop123123/arkts-static-skills
a6afc812568a40b766a86ca5592eca2e3985d22c
gitcode
xiaofenger_705/protobuf-arkts-generator
runtime/arkpb/Message.ets
arkts
clear
清空所有字段为默认值 @returns this(支持链式调用) 注意:子类应覆盖此方法以清空所有字段
clear(): Message { // 默认实现:只清空未知字段 this.unknownFields.clear() return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clear 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 Message AST#identifier#Right AST#ERROR#Right AST#stateme...
clear(): Message { // 默认实现:只清空未知字段 this.unknownFields.clear() return this }
https://gitcode.com/xiaofenger_705/protobuf-arkts-generator
3db648243d048cbf9e8f650330df9be25f7c89e8
gitcode
GrassyUnknown/Health-Life-HarmonyOS-Next
oh_modules/.ohpm/cjcalendar@2.0.4/oh_modules/cjcalendar/src/main/ets/components/components/CJCalendar.ets
arkts
__initDays
初始化日期项
__initDays() { this.__calcMonthDays(this.currMonth) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left __initDays AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS...
__initDays() { this.__calcMonthDays(this.currMonth) }
https://github.com/GrassyUnknown/Health-Life-HarmonyOS-Next
92f61a4eeebef21bd3e790b2d3bce25e7ca4fc76
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/basecomponent/utils/IMErrorCode.ets
arkts
isFileSizeError
Check if error code indicates file size issue @param code Error code @returns true if it's a file size related error
static isFileSizeError(code: number): boolean { return code === IMErrorCode.ERR_SDK_COMM_FILE_TOO_LARGE || code === IMErrorCode.ERR_SVR_SSO_VCODE || code === IMErrorCode.ERR_SVR_RES_SIZE_LIMIT || code === IMErrorCode.ERR_SVR_COMM_BODY_SIZE_LIMIT || code === IMErrorCode....
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isFileSizeError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
static isFileSizeError(code: number): boolean { return code === IMErrorCode.ERR_SDK_COMM_FILE_TOO_LARGE || code === IMErrorCode.ERR_SVR_SSO_VCODE || code === IMErrorCode.ERR_SVR_RES_SIZE_LIMIT || code === IMErrorCode.ERR_SVR_COMM_BODY_SIZE_LIMIT || code === IMErrorCode....
https://github.com/Tencent-RTC/TUIKit_Harmony
aa2332d013085c68aca8c8b0443ba84f05e184db
github
NissonCX/CQU-HarmonyOS-APP-Dev-Final
entry/src/main/ets/pages/TrendsPage.ets
arkts
getRecordForDate
获取指定日期的记录
getRecordForDate(date: string): HealthRecord | null { return this.records.find(r => r.date === date) || null; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getRecordForDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
getRecordForDate(date: string): HealthRecord | null { return this.records.find(r => r.date === date) || null; }
https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final
b477de53d8e80328cc4d3d5a85403c4f50c6a96b
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamingSession.ets
arkts
resumeDecoder
从后台恢复解码器
resumeDecoder(): void { if (!this.isRunning) { console.warn('[StreamingSession] 串流已停止,无需恢复解码器'); return; } try { (nativeLib as NativeModule).resumeDecoder(); console.info('[StreamingSession] 解码器恢复命令已发送'); } catch (err) { console.error('[StreamingSession] 恢复解码器失败:', err); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resumeDecoder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
resumeDecoder(): void { if (!this.isRunning) { console.warn('[StreamingSession] 串流已停止,无需恢复解码器'); return; } try { (nativeLib as NativeModule).resumeDecoder(); console.info('[StreamingSession] 解码器恢复命令已发送'); } catch (err) { console.error('[StreamingSession] 恢复解码器失败:', err); ...
https://github.com/AlkaidLab/moonlight-harmony
b7dbe50c0aa118ff97d94d0952c14f299d3d8226
github
erosTeam/NextE
shared/src/main/ets/network/EhCookieStore.ets
arkts
isLogin
Logged in once both identity cookies are present.
isLogin(): boolean { return ( this.get(EhConstants.COOKIE_MEMBER_ID).length > 0 && this.get(EhConstants.COOKIE_PASS_HASH).length > 0 ) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isLogin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_b...
isLogin(): boolean { return ( this.get(EhConstants.COOKIE_MEMBER_ID).length > 0 && this.get(EhConstants.COOKIE_PASS_HASH).length > 0 ) }
https://github.com/erosTeam/NextE
07d1b67f721368124996869b5b7709e488018539
github
arkui-x/samples
CodeLab/Cases/feature/containernestedslide/src/main/ets/view/NewsDetailPage.ets
arkts
getWebHeight
获取Web组件高度
getWebHeight() { try { this.webviewController?.runJavaScriptExt('window.innerHeight', (error, result) => { if (error || !result) { return; } let type = result.getType(); if (type === webview.JsMessageType.STRING) { this.webHeight = parseInt(result.getStrin...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getWebHeight 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 ...
getWebHeight() { try { this.webviewController?.runJavaScriptExt('window.innerHeight', (error, result) => { if (error || !result) { return; } let type = result.getType(); if (type === webview.JsMessageType.STRING) { this.webHeight = parseInt(result.getStrin...
https://gitcode.com/arkui-x/samples
12934316a8147e5ea5815e95c27fd08c5ac812b0
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Char.ets
arkts
isDecDigit
isDecDigit() checks whether the char represents a decimal digit. @param { char } value a char to check. @returns { boolean } @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static isDecDigit(value: char): boolean { return value >= c'0' && value <= c'9' }
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 isDecDigit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#...
public static isDecDigit(value: char): boolean { return value >= c'0' && value <= c'9' }
https://gitcode.com/iop123123/arkts-static-skills
b45f1641c2dffca29fd7816f9974ef2b6d69a230
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test45_original_index.ets
arkts
cloneRecord
--- Deep clone via manual copy ---
function cloneRecord(source: Record<string, number>): Record<string, number> { let result: Record<string, number> = {}; let keys: string[] = Object.keys(source); for (let i: number = 0; i < keys.length; i++) { let k: string = keys[i]; result[k] = source[k]; } return result; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left cloneRecord AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left source AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function cloneRecord(source: Record<string, number>): Record<string, number> { let result: Record<string, number> = {}; let keys: string[] = Object.keys(source); for (let i: number = 0; i < keys.length; i++) { let k: string = keys[i]; result[k] = source[k]; } return result; }
https://github.com/miaochiahao/ark-ghidra
59548997b8eed03270742aa1a9617274051cdc2b
github
openharmony/arkui_ace_engine
advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeViewV2.ets
arkts
delaySortNodeIdList
delay sort nodeId list
function delaySortNodeIdList(nodeIdList: Array<int>): void { let taskId: int = 0; taskId = setTimeout((): void => { let len: int = nodeIdList.length; if (len <= 1) { clearTimeout(Double.toInt(taskId)); return; } for (let i: int = 0; i < len - 1; i++) { let minIdx: int = i; fo...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left delaySortNodeIdList AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left nodeIdList AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
function delaySortNodeIdList(nodeIdList: Array<int>): void { let taskId: int = 0; taskId = setTimeout((): void => { let len: int = nodeIdList.length; if (len <= 1) { clearTimeout(Double.toInt(taskId)); return; } for (let i: int = 0; i < len - 1; i++) { let minIdx: int = i; fo...
https://gitcode.com/openharmony/arkui_ace_engine
8b8fbf0f867109a1331dc26a3ee5264d8caad140
gitcode
Joker-x-dev/CoolMallArkTS
feature/main/src/main/ets/viewmodel/CartViewModel.ets
arkts
convertCartsToSelectedGoods
将购物车项转换为 SelectedGoods @param {Cart[]} carts 购物车列表 @returns {SelectedGoods[]} 转换后的 SelectedGoods 列表
private convertCartsToSelectedGoods(carts: Cart[]): SelectedGoods[] { const result: SelectedGoods[] = []; for (const cart of carts) { for (const cartSpec of cart.spec) { // 创建规格对象 const spec = new GoodsSpec(); spec.id = cartSpec.id; spec.goodsId = cartSpec.goodsId; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertCartsToSelectedGoods AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left carts AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#...
private convertCartsToSelectedGoods(carts: Cart[]): SelectedGoods[] { const result: SelectedGoods[] = []; for (const cart of carts) { for (const cartSpec of cart.spec) { // 创建规格对象 const spec = new GoodsSpec(); spec.id = cartSpec.id; spec.goodsId = cartSpec.goodsId; ...
https://github.com/Joker-x-dev/CoolMallArkTS
b95c63b71b33d9e17d8db3839158726afba2a389
github
Joker-x-dev/CoolMallArkTS
feature/main/src/main/ets/viewmodel/MainViewModel.ets
arkts
aboutToAppear
页面出现时触发动画同步 @returns {void} 无返回值
aboutToAppear(): void { super.aboutToAppear(); this.syncCurrentAnimation(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { super.aboutToAppear(); this.syncCurrentAnimation(); }
https://github.com/Joker-x-dev/CoolMallArkTS
942a57633bfbeb07cade187cb3935e467bcc3bf5
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeSet.ets
arkts
getHigherValue
Return the higher value of the given key's element in the TreeSet @param key: the key of the element which will be get the higher value @returns the higher value of the given key's element if exists or undefined
getHigherValue(key: T): T | undefined { return this.treeMap.getHigherKey(key); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getHigherValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier...
getHigherValue(key: T): T | undefined { return this.treeMap.getHigherKey(key); }
https://gitcode.com/iop123123/arkts-static-skills
e13a3299d9d9f9c6ac6c2c60eab3e9fbd7d8eb39
gitcode
openharmony/applications_notes
common/utils/src/main/ets/default/model/databaseModel/NoteData.ets
arkts
constructor
字体进度条大小
constructor(id: number, title: string, uuid: string, folder_uuid: string, content_text: string, content_img: string, note_type: NoteType, is_top: Top, is_favorite: Favorite, is_deleted: Delete, created_time: number, modified_time: number, deleted_time: number, slider_value: number) { t...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST...
constructor(id: number, title: string, uuid: string, folder_uuid: string, content_text: string, content_img: string, note_type: NoteType, is_top: Top, is_favorite: Favorite, is_deleted: Delete, created_time: number, modified_time: number, deleted_time: number, slider_value: number) { t...
https://gitee.com/openharmony/applications_notes.git
dc5de735d4312de0945f865b66b910d4f95eee13
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/CommentNode.ets
arkts
text
获取注释文本
get text(): string { return this._rawText; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left text AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ER...
get text(): string { return this._rawText; }
https://github.com/DaLongZhuaZi/manxia
6d97458a7a4abaf7885c358e31dff576f87ddc49
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets
arkts
getRetentionDaysOptions
获取保留天数选项列表(用于 TextPicker)
public getRetentionDaysOptions(): string[] { return RETENTION_DAYS_OPTIONS.map(days => `${days}天`); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getRetentionDaysOptions 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#Lef...
public getRetentionDaysOptions(): string[] { return RETENTION_DAYS_OPTIONS.map(days => `${days}天`); }
https://github.com/DaLongZhuaZi/manxia
e00804f18379a7f8ea49f492ef9de5e558425298
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/EBookDataManager.ets
arkts
saveEBookChapter
保存章节信息
private async saveEBookChapter(chapter: EBookChapter): Promise<void> { const sql = ` INSERT OR REPLACE INTO ebook_chapter ( id, bookId, chapterNumber, title, content, startPosition, endPosition, wordCount, resourceHref, resourceFile, resourceMediaType, resourceLayoutType, resourceIma...
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 saveEBookChapter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapter AST#identifier#Right AST#:#L...
private async saveEBookChapter(chapter: EBookChapter): Promise<void> { const sql = ` INSERT OR REPLACE INTO ebook_chapter ( id, bookId, chapterNumber, title, content, startPosition, endPosition, wordCount, resourceHref, resourceFile, resourceMediaType, resourceLayoutType, resourceIma...
https://github.com/DaLongZhuaZi/manxia
ab92d0ec475aa4c8f2be19ce862e8c5bc5de5bb4
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundBasicMessageChannel.ets
arkts
setMessageHandler
Registers a message handler on this channel for receiving messages sent from the Flutter application. <p>Overrides any existing handler registration for (the name of) this channel. <p>If no handler has been registered, any incoming message on this channel will be handled silently by sending a null reply. @param handler...
setMessageHandler(handler: SendableMessageHandler<T> | null): void { this.messenger.setMessageHandler(this.name, handler == null ? null : new IncomingSendableMessageHandler(handler, this.codec), this.taskQueue); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setMessageHandler AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left handler AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#instantiation_expression...
setMessageHandler(handler: SendableMessageHandler<T> | null): void { this.messenger.setMessageHandler(this.name, handler == null ? null : new IncomingSendableMessageHandler(handler, this.codec), this.taskQueue); }
https://gitee.com/openharmony-sig/flutter_engine.git
15609296ef38611908cea4bb7a25143a2d565954
gitee
CPF-ApplicationTPC/openharmony_tpc_samples
bc_ohos/entry/src/ohosTest/ets/test/Ability.test.ets
arkts
bytesToHex
工具函数:字节数组转十六进制
function bytesToHex(bytes: Uint8Array): string { return Array.from(bytes) .map(b => b.toString(16).padStart(2, '0')) .join('') .toUpperCase() }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left bytesToHex AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bytes AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Righ...
function bytesToHex(bytes: Uint8Array): string { return Array.from(bytes) .map(b => b.toString(16).padStart(2, '0')) .join('') .toUpperCase() }
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
de74f6a347159837d18dd6c0e05ec4a86b7c21ff
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Source/SuwayomiSourceExecutor.ets
arkts
browse
浏览源(热门/最新)
public async browse(type: 'POPULAR' | 'LATEST' = 'POPULAR', page: number = 1): Promise<ComicInfo[]> { if (!this.currentSourceId) { logger.warn(TAG, '未选择源,无法浏览'); return []; } try { const results = await this.suwayomiSource.browseSource(this.currentSourceId, type, page); return this...
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 browse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Righ...
public async browse(type: 'POPULAR' | 'LATEST' = 'POPULAR', page: number = 1): Promise<ComicInfo[]> { if (!this.currentSourceId) { logger.warn(TAG, '未选择源,无法浏览'); return []; } try { const results = await this.suwayomiSource.browseSource(this.currentSourceId, type, page); return this...
https://github.com/DaLongZhuaZi/manxia
5acc1567ad0c62130345ad6bc580b78db380d41e
github
dingzhilin1990/zhilinclaw
src/agents/AgentBase.ets
arkts
initialize
初始化 Agent
public async initialize(context: AgentContext): Promise<void> { this.context = context; this.log(`${this.config.name} 已初始化`); }
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 initialize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST...
public async initialize(context: AgentContext): Promise<void> { this.context = context; this.log(`${this.config.name} 已初始化`); }
https://github.com/dingzhilin1990/zhilinclaw
c2b2753f0aa00452186c69932c2dd00b3cef771f
github
HarmonyOS_Samples/guide-snippets
ArkGraphics2D/DisplaySync/entry/src/main/ets/DisplaySync/CustomDrawDisplaySync.ets
arkts
aboutToDisappear
[Start display_sync_call_stop]
aboutToDisappear() { if (this.backDisplaySyncSlow) { this.backDisplaySyncSlow.stop(); this.backDisplaySyncSlow = undefined; } if (this.backDisplaySyncFast) { this.backDisplaySyncFast.stop(); this.backDisplaySyncFast = undefined; } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear 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#L...
aboutToDisappear() { if (this.backDisplaySyncSlow) { this.backDisplaySyncSlow.stop(); this.backDisplaySyncSlow = undefined; } if (this.backDisplaySyncFast) { this.backDisplaySyncFast.stop(); this.backDisplaySyncFast = undefined; } }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
6569962f7b15e1e7cf897202c74fd7e5412ac4b7
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectField.ets
arkts
getName
Gets the name of this field. @returns { string } Returns the name of the field.
public getName(): string { return this.name ?? Field.getNameInternal(this.fieldPtr) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#...
public getName(): string { return this.name ?? Field.getNameInternal(this.fieldPtr) }
https://gitcode.com/iop123123/arkts-static-skills
eeaafc302b4a33171b4205e178b87bd99dc0ba33
gitcode
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/utils/UrlUtils.ets
arkts
getAvatarUrl
获取头像 URL 替换 {size} 占位符并解析相对路径
static getAvatarUrl(template: string | null, size: number = 120): string { if (template === null || template.length === 0) { return ''; } const url: string = template.replace('{size}', size.toString()); return UrlUtils.resolveUrl(url); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getAvatarUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left template AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#stri...
static getAvatarUrl(template: string | null, size: number = 120): string { if (template === null || template.length === 0) { return ''; } const url: string = template.replace('{size}', size.toString()); return UrlUtils.resolveUrl(url); }
https://github.com/Amaz1ny/HarmonyDO-public
25ac3b0faa94e4ddb23032c2efb2a10a94a80e87
github
openharmony-tpc/ImageKnife
library/src/main/ets/ImageKnifeLoader.ets
arkts
getImageArrayBuffer
获取图片资源
static async getImageArrayBuffer(request: RequestJobRequest, requestList: List<ImageKnifeRequestWithSource> | undefined,fileKey:string) { let resBuf: ArrayBuffer | undefined let loadError: string = '' //定义图片各个阶段错误信息 let error: ErrorInfo = { code: 0, phase: LoadPhase.PHASE_LOAD } //定义加载时间点 let ...
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 getImageArrayBuffer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#:#L...
static async getImageArrayBuffer(request: RequestJobRequest, requestList: List<ImageKnifeRequestWithSource> | undefined,fileKey:string) { let resBuf: ArrayBuffer | undefined let loadError: string = '' //定义图片各个阶段错误信息 let error: ErrorInfo = { code: 0, phase: LoadPhase.PHASE_LOAD } //定义加载时间点 let ...
https://gitee.com/openharmony-tpc/ImageKnife.git
e3b55e3596568298dd1529e0abfa1b4fe74ac1c2
gitee
LZZLHY/hlib
entry/src/main/ets/api/AppStorageDomainFailover.ets
arkts
onDomainSwitched
把生效域名写回 AppStorage:UI 线路指示更新,首页 @Watch 在可用节点上重载。
onDomainSwitched(newDomain: string): void { AppStorage.setOrCreate<string>(AppStorageKeys.DOMAIN, newDomain); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onDomainSwitched AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left newDomain AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) A...
onDomainSwitched(newDomain: string): void { AppStorage.setOrCreate<string>(AppStorageKeys.DOMAIN, newDomain); }
https://github.com/LZZLHY/hlib
3117b8ffef9fe8ec16d0327ac6559dde2d5600d9
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Database/DatabaseManager.ets
arkts
getTableSum
获取表字段总和(类型安全的聚合查询)
public async getTableSum(tableName: string, columnName: string): Promise<number> { try { const sql = `SELECT SUM(${columnName}) as sum FROM ${tableName}`; const result = await this.queryAggregation<SumQueryResult>(sql); if (!result) { logger.warn(TAG, `表 ${tableName} 字段 ${columnNa...
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 getTableSum AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tableName AST#identifier#Right AST#ERROR#Left AST#:#Left : ...
public async getTableSum(tableName: string, columnName: string): Promise<number> { try { const sql = `SELECT SUM(${columnName}) as sum FROM ${tableName}`; const result = await this.queryAggregation<SumQueryResult>(sql); if (!result) { logger.warn(TAG, `表 ${tableName} 字段 ${columnNa...
https://github.com/DaLongZhuaZi/manxia
4dd35ec2c1ee388adf5bc19d46b7b2f1cb1a7c71
github
openharmony/arkui_ace_engine
advanced_ui_component/treeviewv2/source/treeviewv2.ets
arkts
emitNodeModify
Triggers all callbacks of node modify event. @since 26
public emitNodeModify(argument: CallbackParamV2): void { this.triggerCallbacks(this.nodeModifyEvents, argument); this.triggerOnceCallbacks(this.nodeModifyOnceEvents, argument); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left emitNodeModify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left argument AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public emitNodeModify(argument: CallbackParamV2): void { this.triggerCallbacks(this.nodeModifyEvents, argument); this.triggerOnceCallbacks(this.nodeModifyOnceEvents, argument); }
https://gitcode.com/openharmony/arkui_ace_engine
84483dd890aaee4c1d04ccae76853ac29cf13ac2
gitcode
ASweetBite/HarmonyPulse
entry/src/main/ets/utils/managers/LyricManager.ets
arkts
readLyricFile
读取歌词内容
readLyricFile(path: string): string { try { if (!path) return ''; // 如果路径是以 datashare:// 或 file:// 开头的 URI,跳过 accessSync 检查 // 只有普通沙箱路径才使用 accessSync if (path.startsWith('datashare://') || path.startsWith('file://')) { return fs.readTextSync(path); } // 如果是沙箱路径,保留检查逻辑...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left readLyricFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) A...
readLyricFile(path: string): string { try { if (!path) return ''; // 如果路径是以 datashare:// 或 file:// 开头的 URI,跳过 accessSync 检查 // 只有普通沙箱路径才使用 accessSync if (path.startsWith('datashare://') || path.startsWith('file://')) { return fs.readTextSync(path); } // 如果是沙箱路径,保留检查逻辑...
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/utils/managers/LyricManager.ets#L86-L106
ed7840c801f091bb50890f416b29faa6bcf811dd
github
openharmony-sig/ostest_integration_test
function/bms/bundlemanager/sceneProject/bmsqueryresourceinfo062/entry/src/main/ets/accessibilityextability/AccessibilityExtAbility.ets
arkts
onAccessibilityEvent
Called when an accessibility event occurs, such as when the user touches the application interface. @param event Indicates an accessibility event.
onAccessibilityEvent(accessibilityEvent: AccessibilityEvent) { console.log("[AccessibilityExtAbility] onAccessibilityEvent type: " + accessibilityEvent.eventType); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onAccessibilityEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left accessibilityEvent AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Access...
onAccessibilityEvent(accessibilityEvent: AccessibilityEvent) { console.log("[AccessibilityExtAbility] onAccessibilityEvent type: " + accessibilityEvent.eventType); }
https://gitee.com/openharmony-sig/ostest_integration_test.git
458b4f787965ac807a69f3ce26983a789f2954c8
gitee