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
YANGZX22/Voot
entry/src/main/ets/services/ModelDownloadService.ets
arkts
setProgressCallback
设置进度回调
public setProgressCallback(callback: DownloadProgressCallback | null): void { this.progressCallback = callback; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setProgressCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_e...
public setProgressCallback(callback: DownloadProgressCallback | null): void { this.progressCallback = callback; }
https://github.com/YANGZX22/Voot
280e13e16bb15e700cf29c363902f31ff2501ee3
github
holg/eulumdat-rs
EulumdatHarmonyOS/Eulumdat/entry/src/main/ets/model/EulumdatEngine.ets
arkts
getInstance
Get the singleton instance
public static getInstance(): EulumdatEngine { if (EulumdatEngine.instance === null) { EulumdatEngine.instance = new EulumdatEngine(); } return EulumdatEngine.instance; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
public static getInstance(): EulumdatEngine { if (EulumdatEngine.instance === null) { EulumdatEngine.instance = new EulumdatEngine(); } return EulumdatEngine.instance; }
https://github.com/holg/eulumdat-rs
0eed78a779e5b203efee88f5c95c66fa52953ed5
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
internal
Creates a slice of current Uint16Array using range [begin, end) @param begin start index to be taken into slice @param end last index to be taken into slice @returns a new Uint16Array with elements of current Uint16Array[begin;end) where end index is excluded @link https://developer.mozilla.org/en-US/docs/Web/JavaScrip...
/* public */ internal slice(begin: int, end: int): Uint16Array { if (begin < -this.length) { begin = 0 } if (begin < 0) { begin = this.length + begin } if (begin >= this.length) { return new Uint16Array(new ArrayBuffer(0)) } ...
AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#call_expression#Left AST#identifier#Left internal 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#Ri...
/* public */ internal slice(begin: int, end: int): Uint16Array { if (begin < -this.length) { begin = 0 } if (begin < 0) { begin = this.length + begin } if (begin >= this.length) { return new Uint16Array(new ArrayBuffer(0)) } ...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
21c8a00eec144d0f3d941038225ee2c4a105924f
gitee
HarmonyOS_Samples/sample_in_harmonyos
common/src/main/ets/pushservice/PushServiceManager.ets
arkts
uploadPushToken
upload the push token to server. @returns Promise<void>
private async uploadPushToken(): Promise<void> { try { const pushToken: string = await pushService.getToken(); const params: PushTokenParams = { pushToken, } PushService.postPushToken(params); } catch (err) { const error: BusinessError = err as BusinessError; Logger...
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 uploadPushToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
private async uploadPushToken(): Promise<void> { try { const pushToken: string = await pushService.getToken(); const params: PushTokenParams = { pushToken, } PushService.postPushToken(params); } catch (err) { const error: BusinessError = err as BusinessError; Logger...
https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos
d7151b444a735f5236b3771ed2272556c1135c22
gitcode
darcycui/DarcyHarmonyNext
entry/src/main/ets/pages/entry/sp/SPPage.ets
arkts
addListener
订阅数据变更 当执行flush()时触发
function addListener(sp: preferences.Preferences) { Log.info('on listener') sp.on('change', (key: string) => { Log.warn(`The key ${key} changed.`) getSP(sp) }) }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left addListener AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sp AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right ...
function addListener(sp: preferences.Preferences) { Log.info('on listener') sp.on('change', (key: string) => { Log.warn(`The key ${key} changed.`) getSP(sp) }) }
https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/sp/SPPage.ets#L108-L114
7056e2daef81cc85874d4ff92b76cac049cf90ae
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryBuilder.ets
arkts
groupBy
==================== GROUP BY 支持 ==================== 添加 GROUP BY 列 @param column 列名或属性名 @returns 当前实例(支持链式调用)
groupBy(column: string): QueryBuilder { const resolvedColumn = this.getResolvedColumnName(column) if (resolvedColumn === null) { throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`) } if (!this.groupByColumns.includes(resolvedColumn)) { this.groupByColumns...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left groupBy 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 string AST#identifier#Right AST#)#Left ) AST#)...
groupBy(column: string): QueryBuilder { const resolvedColumn = this.getResolvedColumnName(column) if (resolvedColumn === null) { throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`) } if (!this.groupByColumns.includes(resolvedColumn)) { this.groupByColumns...
https://github.com/offlinecat-dev/OCNetORM
a03149aca376f5c48f433c3120f4a4e916eb72e7
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets
arkts
applyEasing
应用缓动函数
public static applyEasing(progress: number, easing: AnimationEasing): number { switch (easing) { case AnimationEasing.LINEAR: return progress; case AnimationEasing.EASE: return AnimationUtils.easeInOut(progress); case AnimationEasing.EASE_IN: return progress * progress; ...
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 applyEasing AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left progress AST#identifier#Right AST#ERROR#Left AST#:#Left : ...
public static applyEasing(progress: number, easing: AnimationEasing): number { switch (easing) { case AnimationEasing.LINEAR: return progress; case AnimationEasing.EASE: return AnimationUtils.easeInOut(progress); case AnimationEasing.EASE_IN: return progress * progress; ...
https://github.com/DaLongZhuaZi/manxia
2754068c00b1c6decc2de038b350649389f8cfc2
github
CLMC2025/Vignette
entry/src/main/ets/database/DBManager.ets
arkts
createText
==================== TEXT OPERATIONS ====================
async createText( title: string, content: string, sourceType: string = 'paste', sourceRef: string = '' ): Promise<number> { return this.textRepo.createText(title, content, sourceType, sourceRef); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createText AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left title AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
async createText( title: string, content: string, sourceType: string = 'paste', sourceRef: string = '' ): Promise<number> { return this.textRepo.createText(title, content, sourceType, sourceRef); }
https://github.com/CLMC2025/Vignette
9396768995c09f16eb9bd583b9948e6dba97b32a
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/ternary/ternary_int.ets
arkts
main
--- desc: check ternary if-else operation with condition of integer operand ---
function main(): void { const a: int = {{v.condition}} const b: int = {{v.ifTrue}} const c: int = {{v.ifFalse}} assert (a ? b : c) == {{v.result}}
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { const a: int = {{v.condition}} const b: int = {{v.ifTrue}} const c: int = {{v.ifFalse}} assert (a ? b : c) == {{v.result}}
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
cb5a2ce513e3568fb290d6a22fa1c65229cfce7a
gitee
openharmony/applications_permission_manager
permissionmanager/src/main/ets/ServiceExtAbility/GrantDialogModel.ets
arkts
getGrantGroups
获取所有授权权限组 @param callerAppInfo 调用方信息 @param context 应用上下文 @param appName 应用名 @param locationFlag 位置权限组flag @param pasteBoardName 剪贴板信息 return
public getGrantGroups( callerAppInfo: CallerAppInfo, context: common.ServiceExtensionContext, appName: string, locationFlag: number, pasteBoardName: string ): PermissionGroupConfig[] { return PermissionGroupManager.getInstance().getGroupConfigs( callerAppInfo, context, appName, locatio...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getGrantGroups AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callerAppInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi...
public getGrantGroups( callerAppInfo: CallerAppInfo, context: common.ServiceExtensionContext, appName: string, locationFlag: number, pasteBoardName: string ): PermissionGroupConfig[] { return PermissionGroupManager.getInstance().getGroupConfigs( callerAppInfo, context, appName, locatio...
https://gitee.com/openharmony/applications_permission_manager.git
992393a4ba9e98bb415f7bc89aadddf7a3acdf2a
gitee
Cool_foolisher1/ArkTSRepository
GuardianAssistant/entry/src/main/ets/pages/Cleaner/CleanerSelectPage.ets
arkts
onSelectedChange
当选择按钮发生变化时,计算节省空间大小
onSelectedChange() { try { if (canIUse('SystemCapability.FileManagement.PhotoAccessHelper.Core')) { // 根据选中的 uri 过滤出选中的图片资源 const selectedList = this.list.filter(item => this.selectedUris.includes(item.uri)) // 通过 reduce 累加文件大小 this.selectedSize = selectedList.reduce((acc, v)...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onSelectedChange 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...
onSelectedChange() { try { if (canIUse('SystemCapability.FileManagement.PhotoAccessHelper.Core')) { // 根据选中的 uri 过滤出选中的图片资源 const selectedList = this.list.filter(item => this.selectedUris.includes(item.uri)) // 通过 reduce 累加文件大小 this.selectedSize = selectedList.reduce((acc, v)...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
3ca52aaabad5e17edc682adc00f5abbf7e447d56
gitcode
HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
products/phone/src/main/ets/pages/customScan/model/ScanLayout.ets
arkts
refreshScanLayout
Update the layout when the window width and height change. @param width @param height
public refreshScanLayout(width: number, height: number): void { Logger.info(TAG, `Start to refresh scanLayout. width: ${width}, height ${height}.`); this.setIsFullScreen(width, height); this.setMarginD(width, height); this.setTopLayout(); this.setBottomLayout(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left refreshScanLayout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public refreshScanLayout(width: number, height: number): void { Logger.info(TAG, `Start to refresh scanLayout. width: ${width}, height ${height}.`); this.setIsFullScreen(width, height); this.setMarginD(width, height); this.setTopLayout(); this.setBottomLayout(); }
https://gitcode.com/HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
f38b584a714775685424224f159540d7b8cc62ee
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets
arkts
updateChaptersToDatabase
更新章节到数据库 [修复] 使用原始章节的number字段或从标题提取章节号
private async updateChaptersToDatabase(comicId: string, newChapters: WebViewChapterInfo[]): Promise<void> { try { for (let i = 0; i < newChapters.length; i++) { const ch = newChapters[i]; const chapterExternalId = ch.id || `chapter_${i}`; // [修复] 使用原始章节的number字段,如果没有则从标题提取 ...
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 updateChaptersToDatabase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left...
private async updateChaptersToDatabase(comicId: string, newChapters: WebViewChapterInfo[]): Promise<void> { try { for (let i = 0; i < newChapters.length; i++) { const ch = newChapters[i]; const chapterExternalId = ch.id || `chapter_${i}`; // [修复] 使用原始章节的number字段,如果没有则从标题提取 ...
https://github.com/DaLongZhuaZi/manxia
e81efa6bcd9a6de111cfc370fbd4bcbbfaa3178d
github
Cool_foolisher1/ArkTSRepository
GraphicalCode/features/algorithm/src/main/ets/service/AlgorithmService.ets
arkts
getComponentDataByPreference
从首选项获取组件数据 @param currentPage 当前页 @param pageSize 每页上的资源数据数量 @returns Promise<ResponseModel<ComponentModel>>
public getComponentDataByPreference(currentPage: number, pageSize: number): Promise<ResponseModel<ComponentModel>> { return new Promise((resolve: (value: ResponseModel<ComponentModel>) => void, reject: (reason?: string) => void) => { PreferenceUtil.getInstance() .getValue<Record<string, Respon...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getComponentDataByPreference AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left currentPage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left ...
public getComponentDataByPreference(currentPage: number, pageSize: number): Promise<ResponseModel<ComponentModel>> { return new Promise((resolve: (value: ResponseModel<ComponentModel>) => void, reject: (reason?: string) => void) => { PreferenceUtil.getInstance() .getValue<Record<string, Respon...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
d38a17cb93fc3711eb76e6694a1aab1aa7ebf42e
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test17_original_index.ets
arkts
testGuardPattern
--- Boolean short-circuit as guard ---
function testGuardPattern(x: number | undefined): string { if (x !== undefined && x > 10) { return 'big:' + String(x); } return 'small or missing'; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testGuardPattern AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left x AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function testGuardPattern(x: number | undefined): string { if (x !== undefined && x > 10) { return 'big:' + String(x); } return 'small or missing'; }
https://github.com/miaochiahao/ark-ghidra
43750ea178bb89bdac46b71c01c52b68b8feac89
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
refreshCustomBackgroundForCurrentTheme
根据当前实际主题刷新通用背景键,使旧组件透明兼容
private refreshCustomBackgroundForCurrentTheme(): void { const isActive = AppStorage.get<boolean>(CUSTOM_THEME_KEYS.IS_CUSTOM_THEME_ACTIVE); if (isActive !== true) { // 未启用自定义主题时,保持默认值 return; } const lightPath = AppStorage.get<string>(CUSTOM_THEME_KEYS.BACKGROUND_IMAGE_LIGHT) || ''; c...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left refreshCustomBackgroundForCurrentTheme 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 ...
private refreshCustomBackgroundForCurrentTheme(): void { const isActive = AppStorage.get<boolean>(CUSTOM_THEME_KEYS.IS_CUSTOM_THEME_ACTIVE); if (isActive !== true) { // 未启用自定义主题时,保持默认值 return; } const lightPath = AppStorage.get<string>(CUSTOM_THEME_KEYS.BACKGROUND_IMAGE_LIGHT) || ''; c...
https://github.com/DaLongZhuaZi/manxia
0438e656816feb493f35500de854677eb258701d
github
openharmony/codelabs
Data/FirstStartDemo/entry/src/main/ets/view/CustomDialogComponent.ets
arkts
fancy
Common text styles.
@Extend(Text) function fancy() { .fontColor($r("app.color.dialog_fancy_text_color")) .fontSize($r("app.float.dialog_fancy_text_size")) .textAlign(TextAlign.Center) .fontWeight(FontWeight.Medium) .layoutWeight(CommonConstants.COMMON_LAYOUT_WEIGHT) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
@Extend(Text) function fancy() { .fontColor($r("app.color.dialog_fancy_text_color")) .fontSize($r("app.float.dialog_fancy_text_size")) .textAlign(TextAlign.Center) .fontWeight(FontWeight.Medium) .layoutWeight(CommonConstants.COMMON_LAYOUT_WEIGHT) }
https://gitee.com/openharmony/codelabs.git
6b1fcdc0449ea0e17748cdbea5397a268e5a0ef7
gitee
Xiwei753/xiezuoruanjian
apps/harmony/entry/src/main/ets/bridge/NativeWriterCoreBridge.ets
arkts
resolveChapterLocation
通过 Core FFI 的 resolveChapterLocation 查找 chapterId 所在的 projectId 和 volumeId。 不再使用遍历项目树的临时方案。
private async resolveChapterLocation(chapterId: string): Promise<ChapterLocationResult | null> { try { const jsonStr: string = this.getNativeModule().nativeResolveChapterLocation(chapterId) const result = this.parseEnvelope<ChapterLocationResult>(jsonStr) if (result.success && result.data) { ...
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 resolveChapterLocation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chapterId AST#identifier#Right AST#ERROR#Left...
private async resolveChapterLocation(chapterId: string): Promise<ChapterLocationResult | null> { try { const jsonStr: string = this.getNativeModule().nativeResolveChapterLocation(chapterId) const result = this.parseEnvelope<ChapterLocationResult>(jsonStr) if (result.success && result.data) { ...
https://github.com/Xiwei753/xiezuoruanjian
31e75a30de7feb41fee2393ec90d314b31df6c5b
github
Vsolon0401/MallShopping
features/commoditydetail/src/main/ets/components/CommodityDetail.ets
arkts
fetchAddressList
初始化收货地址
fetchAddressList() { addressService.fetchAddressList().then(res => { const addressInfoList = res.data as UserAddress[] this.defaultAddress = addressInfoList.find(address => address.defaultStatus === 1) }) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fetchAddressList 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...
fetchAddressList() { addressService.fetchAddressList().then(res => { const addressInfoList = res.data as UserAddress[] this.defaultAddress = addressInfoList.find(address => address.defaultStatus === 1) }) }
https://github.com/Vsolon0401/MallShopping
e810a56ed2b4e08a24daff87ab602e302bbe1efc
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Theme/UserThemeConfig.ets
arkts
cornerRadius
兼容旧调用,等价于组件圆角
public get cornerRadius(): number { return this.componentCornerRadius; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left cornerRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
public get cornerRadius(): number { return this.componentCornerRadius; }
https://github.com/DaLongZhuaZi/manxia
28222648d0a6ff56e06ce42bc08b657fea7ee234
github
YANGZX22/Voot
entry/src/main/ets/workers/NonStreamingAsrWithVadWorker.ets
arkts
post
-------- utils --------
function post(msg: MessageToMain): void { workerPort.postMessage(msg); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left post AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left msg AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ty...
function post(msg: MessageToMain): void { workerPort.postMessage(msg); }
https://github.com/YANGZX22/Voot
ba624e0b2f45f9ceb2883a9ae32ffe987c09aa3d
github
ZestBox-18/kitebook-frontend
features/record/src/main/ets/components/AddBillSheetComponent.ets
arkts
build
构建半模态主体布局,顶部直接展示模式切换与关闭操作。
build() { Column() { this.TopActionSection() Stack({ alignContent: Alignment.Top }) { Scroll(this.scroller) { Column({ space: 12 }) { this.CategoryGridSection() } .width('100%') .padding({ left: 16, right: 16, top: 6, bottom: 20 }) }...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Column() { this.TopActionSection() Stack({ alignContent: Alignment.Top }) { Scroll(this.scroller) { Column({ space: 12 }) { this.CategoryGridSection() } .width('100%') .padding({ left: 16, right: 16, top: 6, bottom: 20 }) }...
https://github.com/ZestBox-18/kitebook-frontend
ca2cebd9cabfa122bda8734cbb0950092b9e64d9
github
OHPG/FinSdk
jellyfin/src/main/ets/api/ItemsApi.ets
arkts
updateItemUserData
updateItemUserData @summary Update Item User Data. @param {ItemsApiUpdateItemUserDataRequest} requestParameters Request parameters. @param {*} [options] Override http request option. @throws {RequiredError} @memberof ItemsApi
public async updateItemUserData(requestParameters: ItemsApiUpdateItemUserDataRequest): Promise<UserItemDataDto> { this.assertParam(requestParameters.itemId) let params: Record<string, string | undefined> = { "userId": requestParameters.userId } return this.apiClient.post({path: `/UserItems/${req...
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 updateItemUserData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Righ...
public async updateItemUserData(requestParameters: ItemsApiUpdateItemUserDataRequest): Promise<UserItemDataDto> { this.assertParam(requestParameters.itemId) let params: Record<string, string | undefined> = { "userId": requestParameters.userId } return this.apiClient.post({path: `/UserItems/${req...
https://github.com/OHPG/FinSdk
efa2c3c04fc9ef668269f7fb4aa2bab30227c65d
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test34_original_index.ets
arkts
dayType
=== Round 34: Switch-case with return, boolean short-circuit, nested object access, multidimensional array, recursive data structure (tree depth), mutex simulation === --- Switch-case with explicit returns ---
function dayType(day: number): string { if (day === 0) { return 'sunday'; } if (day === 1) { return 'monday'; } if (day === 2) { return 'tuesday'; } if (day === 3) { return 'wednesday'; } if (day === 4) { return 'thursday'; } if (day === 5) { return 'friday'; } if (day ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left dayType AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left day AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
function dayType(day: number): string { if (day === 0) { return 'sunday'; } if (day === 1) { return 'monday'; } if (day === 2) { return 'tuesday'; } if (day === 3) { return 'wednesday'; } if (day === 4) { return 'thursday'; } if (day === 5) { return 'friday'; } if (day ...
https://github.com/miaochiahao/ark-ghidra
f205d0ad6d398aa1b763c3f8cf2a94137e6dc21c
github
CPF-ApplicationTPC/imageknifepro
entry/src/main/ets/pages/TestDesiredSizeDecode.ets
arkts
computeAspectFitDecodeSize
与 native DesiredSizeDetail 一致的解码目标尺寸,用于预览布局回退。
public static computeAspectFitDecodeSize(ws: number, hs: number, wd: number, hd: number): DesiredSizeLayoutPx { if (DesiredSizeDemoDownSampling.shouldDecodeFullImage(ws, hs, wd, hd)) { return { width: ws, height: hs } } const pixelRatio = ws / hs const thumbnailRatio = wd / hd let outW = 0 ...
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 computeAspectFitDecodeSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ws AST#identifier#Right AST#...
public static computeAspectFitDecodeSize(ws: number, hs: number, wd: number, hd: number): DesiredSizeLayoutPx { if (DesiredSizeDemoDownSampling.shouldDecodeFullImage(ws, hs, wd, hd)) { return { width: ws, height: hs } } const pixelRatio = ws / hs const thumbnailRatio = wd / hd let outW = 0 ...
https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/entry/src/main/ets/pages/TestDesiredSizeDecode.ets#L92-L111
23e72b7b25101059cad30d0b37df94ba497dc18a
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Console.ets
arkts
println
Prints a long to the console and puts newline @param i value to print
public println(i: long): void { this.print(i); this.println(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left println AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left i AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left long AST#id...
public println(i: long): void { this.print(i); this.println(); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
a9490cd9376d03d410316c2a4a0c04e8fd3db0df
gitee
honjow/Next2V
shared/src/main/ets/network/ApiService.ets
arkts
checkinHeaders
Real-browser fidelity headers for the daily check-in requests (see CHECKIN_USER_AGENT). Referer varies per step so the redeem looks like it was navigated to from the mission page.
private checkinHeaders(referer: string): Record<string, string> { return { 'User-Agent': ApiService.CHECKIN_USER_AGENT, 'Referer': referer } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left checkinHeaders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left referer AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri...
private checkinHeaders(referer: string): Record<string, string> { return { 'User-Agent': ApiService.CHECKIN_USER_AGENT, 'Referer': referer } }
https://github.com/honjow/Next2V
33c9019eabb701f4c217f71544e7f08698001899
github
webabcd/HarmonyDemo
harmonydemo2/entry/src/main/ets/entryability/EntryAbility.ets
arkts
parseWantShare
解析 Want 中的分享数据,并保存在 AppStorage 中
parseWantShare(want: Want) { /* * systemShare.getSharedData() - 获取分享过来的数据(需要在 module.json5 做相关的配置) * SharedData - 分享数据(请参见 /HarmonyDemo/entry/src/main/ets/pages/ipc/ShareDemo 中的相关说明) * getRecords() - 获取分享数据中的所有记录 * SharedRecord - 分享数据中的某条记录 */ systemShare.getSharedData(want).then((d...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left parseWantShare AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right ...
parseWantShare(want: Want) { /* * systemShare.getSharedData() - 获取分享过来的数据(需要在 module.json5 做相关的配置) * SharedData - 分享数据(请参见 /HarmonyDemo/entry/src/main/ets/pages/ipc/ShareDemo 中的相关说明) * getRecords() - 获取分享数据中的所有记录 * SharedRecord - 分享数据中的某条记录 */ systemShare.getSharedData(want).then((d...
https://github.com/webabcd/HarmonyDemo
d15875640595a2c75bbfa0a3ccafd93c1fd35517
github
openharmony/applications_mms
entry/src/main/ets/pages/settings/advancedSettings/advancedSettingsController.ets
arkts
clickSmsCheckbox
Click Checkbox in the line of the message.
clickSmsCheckbox(e) { this.checkedValueOfSms = e.checked; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left clickSmsCheckbox AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left e AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expre...
clickSmsCheckbox(e) { this.checkedValueOfSms = e.checked; }
https://gitee.com/openharmony/applications_mms.git
9d5384e761e4afa6985c5c16e31a134dcab50833
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsEngine.ets
arkts
isEngineReady
检查是否就绪(WebView或Native引擎任一就绪即可)
isEngineReady(): boolean { return this.isReady || this.nativeEngineReady; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isEngineReady 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#state...
isEngineReady(): boolean { return this.isReady || this.nativeEngineReady; }
https://github.com/DaLongZhuaZi/manxia
e4c05d007475b52b1fe4aa6220d3d8429895c3ed
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/DeviceAdaptationManager.ets
arkts
isBreakpointGreaterOrEqual
判断是否大于等于指定断点
public isBreakpointGreaterOrEqual(targetBreakpoint: Breakpoint): boolean { const breakpointOrder: Breakpoint[] = [Breakpoint.XS, Breakpoint.SM, Breakpoint.MD, Breakpoint.LG]; const currentIndex = breakpointOrder.indexOf(this.getCurrentBreakpoint()); const targetIndex = breakpointOrder.indexOf(targetBreakp...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isBreakpointGreaterOrEqual AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetBreakpoint AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifie...
public isBreakpointGreaterOrEqual(targetBreakpoint: Breakpoint): boolean { const breakpointOrder: Breakpoint[] = [Breakpoint.XS, Breakpoint.SM, Breakpoint.MD, Breakpoint.LG]; const currentIndex = breakpointOrder.indexOf(this.getCurrentBreakpoint()); const targetIndex = breakpointOrder.indexOf(targetBreakp...
https://github.com/DaLongZhuaZi/manxia
f4fc91ede9f3fb8b5720c095787656dd2a9e62f9
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SettingsManager.ets
arkts
getString
获取字符串设置
getString(key: string, defaultValue: string = ''): string { return this.settingsCache.get(key) || defaultValue; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#...
getString(key: string, defaultValue: string = ''): string { return this.settingsCache.get(key) || defaultValue; }
https://github.com/DaLongZhuaZi/manxia
856f5c1e8969618baaec07999eaada1cdb1a5ef7
github
webabcd/HarmonyUtils
harmony_utils/src/main/ets/UrlHelper.ets
arkts
query
获取 url 参数
static query(url: string, key: string): string { let urlObject = uri.URL.parseURL(url); let paramsObject = new uri.URLParams(urlObject.search.slice(1)); let value = paramsObject.get(key); return value || "" }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
static query(url: string, key: string): string { let urlObject = uri.URL.parseURL(url); let paramsObject = new uri.URLParams(urlObject.search.slice(1)); let value = paramsObject.get(key); return value || "" }
https://github.com/webabcd/HarmonyUtils
d3c0ff687fc9fcaceddd9c6f62f4013d98bf8432
github
kumaleap/ArkLuban
library/src/main/ets/luban/Luban.ets
arkts
generateCompressedFileName
生成文件名 @param sourcePath 源文件路径 @returns 生成的文件名
private generateCompressedFileName(sourcePath: string): string { if (this.config.onRename) { return this.config.onRename(sourcePath); } const extension = LubanEngine.getOutputExtension(sourcePath, this.config.focusAlpha || false); return LubanUtils.generateOutputFileName(sourcePath, extension);...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateCompressedFileName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourcePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left ...
private generateCompressedFileName(sourcePath: string): string { if (this.config.onRename) { return this.config.onRename(sourcePath); } const extension = LubanEngine.getOutputExtension(sourcePath, this.config.focusAlpha || false); return LubanUtils.generateOutputFileName(sourcePath, extension);...
https://github.com/kumaleap/ArkLuban
4b57ee9d6f72763cb3f20a1a0e655085bc1a9938
github
CLMC2025/Vignette
entry/src/main/ets/context/ContextValidator.ets
arkts
validateDifficulty
验证难度适配性
private validateDifficulty( context: string, userLevel: DifficultyLevel, result: ValidationResult ): void { const wordCount = context.split(/\s+/).length; const avgWordLength = context.replace(/\s+/g, '').length / wordCount; // 根据用户级别检查词汇复杂度 const expectedMaxWordLength = this.getMaxWord...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateDifficulty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left context AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
private validateDifficulty( context: string, userLevel: DifficultyLevel, result: ValidationResult ): void { const wordCount = context.split(/\s+/).length; const avgWordLength = context.replace(/\s+/g, '').length / wordCount; // 根据用户级别检查词汇复杂度 const expectedMaxWordLength = this.getMaxWord...
https://github.com/CLMC2025/Vignette
d8983c133072a67a0e48f10b6ffaadf27e47fd89
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/BackgroundBlurOverlay.ets
arkts
onVisibleChange
监听isVisible变化,触发动画
onVisibleChange(): void { if (this.isVisible) { // 后台快照抓取很快,进入后台时遮罩必须立即成为可见状态。 this.shouldRender = true; this.animatedOpacity = 1; this.iconScale = 1.0; } else { // 退出动画:先播放淡出,再隐藏组件 this.getUIContext().animateTo({ duration: 200, curve: Curve.EaseIn, ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onVisibleChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression...
onVisibleChange(): void { if (this.isVisible) { // 后台快照抓取很快,进入后台时遮罩必须立即成为可见状态。 this.shouldRender = true; this.animatedOpacity = 1; this.iconScale = 1.0; } else { // 退出动画:先播放淡出,再隐藏组件 this.getUIContext().animateTo({ duration: 200, curve: Curve.EaseIn, ...
https://github.com/DaLongZhuaZi/manxia
6beacc7dcc6c46bcc2facdacebbcf8458f943a4e
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
checkWriteCapacity
check buffer capacity.
checkWriteCapacity(slen: number): void { if (this.mByteOffset + slen > this.dataView!.byteLength) { let newCapacity = this.dataView!.byteLength + (this.dataView!.byteLength >> 1); if (newCapacity < this.dataView!.byteLength + slen + 512) { newCapacity = this.dataView!.byteLength + slen + 512; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left checkWriteCapacity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left slen AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Lef...
checkWriteCapacity(slen: number): void { if (this.mByteOffset + slen > this.dataView!.byteLength) { let newCapacity = this.dataView!.byteLength + (this.dataView!.byteLength >> 1); if (newCapacity < this.dataView!.byteLength + slen + 512) { newCapacity = this.dataView!.byteLength + slen + 512; ...
https://gitee.com/openharmony-sig/flutter_engine.git
a7cc26902f2fc8208172d37238f75e5cbbbac9ee
gitee
xufei5789651/HmWan
commons/utils/src/main/ets/manager/PreferenceManager.ets
arkts
saveUserData
保存用户数据到用户首选项持久化文件中
private saveUserData() { console.log(TAG,'saveUserData'); this.preferences!.flush(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left saveUserData 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...
private saveUserData() { console.log(TAG,'saveUserData'); this.preferences!.flush(); }
https://github.com/xufei5789651/HmWan
5d0a96e859e3b682a548610cc8081592cab0d976
github
openharmony/arkui_advanced_ui_component
atomicserviceweb/source/atomicserviceweb.ets
arkts
interceptUrl
拦截url请求
interceptUrl(url: string, isMainFrame: boolean, requestResourceType: number): boolean { if (!url) { return false; } if (url.startsWith(RESOURCE_RAWFILE)) { return true; } // 主页面或iframe页面,走域名白名单校验 if (this.isMainPageOrIframeRequest(isMainFrame, requestResourceType)) { return t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left interceptUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST...
interceptUrl(url: string, isMainFrame: boolean, requestResourceType: number): boolean { if (!url) { return false; } if (url.startsWith(RESOURCE_RAWFILE)) { return true; } // 主页面或iframe页面,走域名白名单校验 if (this.isMainPageOrIframeRequest(isMainFrame, requestResourceType)) { return t...
https://gitee.com/openharmony/arkui_advanced_ui_component.git
bc0c3887d608c0cb4c0f92958fd593ae20ca0361
gitee
yongoe1024/RdbPlus
rdbplus/src/main/ets/core/Wrapper.ets
arkts
notEq
不等于 @param field 字段 @param value 值 @returns Wrapper
notEq(field: string, value: relationalStore.ValueType, condition: boolean = true): Wrapper { if (condition) { this.whereList.push(`and ${field} != ?`) this.valueList.push(value) } return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left notEq AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left field AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Ri...
notEq(field: string, value: relationalStore.ValueType, condition: boolean = true): Wrapper { if (condition) { this.whereList.push(`and ${field} != ?`) this.valueList.push(value) } return this }
https://github.com/yongoe1024/RdbPlus/blob/83f7347b7ac692941729d3464923155948e876bb/rdbplus/src/main/ets/core/Wrapper.ets#L54-L60
7e1bd232a99248fbaf60a70c559432c73728458b
github
openharmony/applications_call
entry/src/main/ets/common/components/BottomBtn.ets
arkts
onHangUp
this method is to call the hangup interface
onHangUp() { this.mCallServiceProxy.hangUpCall(this.callData.callId); if (this.callList.length === 1) { this.hangup = true; globalThis.calluiAbilityContext?.terminateSelf().then((data) => { LogUtils.i(TAG, 'onHangUp terminateSelfCallBack'); }); } LogUtils.i(TAG, 'onHangUp thi...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onHangUp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AS...
onHangUp() { this.mCallServiceProxy.hangUpCall(this.callData.callId); if (this.callList.length === 1) { this.hangup = true; globalThis.calluiAbilityContext?.terminateSelf().then((data) => { LogUtils.i(TAG, 'onHangUp terminateSelfCallBack'); }); } LogUtils.i(TAG, 'onHangUp thi...
https://gitee.com/openharmony/applications_call.git
684902a305e144d0759ea9eb83aa9f6d4f460b46
gitee
aimilin6688/KeePassHO
entry/src/main/ets/components/loading/LoadingDialogUtils.ets
arkts
showLoading
显示 loading hud @param value 可不传
async showLoading(value: ResourceStr | LoadingSettings = ''): Promise<void> { this.loadingList.push(value); // 延时100ms,避免loading闪烁 setTimeout(() => { const param = this.loadingList.pop(); if (param) { let loading = new LoadingActionOptions(LoadingState.LOADING, param) if (Promp...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left showLoading AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left...
async showLoading(value: ResourceStr | LoadingSettings = ''): Promise<void> { this.loadingList.push(value); // 延时100ms,避免loading闪烁 setTimeout(() => { const param = this.loadingList.pop(); if (param) { let loading = new LoadingActionOptions(LoadingState.LOADING, param) if (Promp...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/components/loading/LoadingDialogUtils.ets#L22-L36
a75d58d43a79d37e319b4f3ef4c833551a82056f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Either.ets
arkts
$_invoke
Creates a new instance of a Left<L,R> with L data @param { L } data for Left @returns { Left<L,R> } A new Left instance @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static $_invoke<L, R>(data: L): Left<L, R> { return new Left<L,R>(data) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#binary_expression#Left AST#identifier#Left $_invoke AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left L AST#identifier#Right AST#binary_expression#Right AST#,#Left , AST#,#Right AS...
public static $_invoke<L, R>(data: L): Left<L, R> { return new Left<L,R>(data) }
https://gitcode.com/iop123123/arkts-static-skills
0f1affdbf5a30c4724fdef444c67fc61eec24ea0
gitcode
Harrisonls2004/WaterFlow
entry/src/main/ets/common/utils/MessageManager.ets
arkts
sendMessage
Send a message.
static async sendMessage( senderUsername: string, receiverUsername: string, content: string, receiverId?: number ): Promise<boolean> { try { // 强制服务器消息发送模式 if (SERVER_ENABLED && receiverId !== undefined) { try { const response = await MessageApi.sendMessage(receiver...
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 sendMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left senderUsername AST#identifier#Right AST#ERROR#Left AST#:#Le...
static async sendMessage( senderUsername: string, receiverUsername: string, content: string, receiverId?: number ): Promise<boolean> { try { // 强制服务器消息发送模式 if (SERVER_ENABLED && receiverId !== undefined) { try { const response = await MessageApi.sendMessage(receiver...
https://github.com/Harrisonls2004/WaterFlow
16180cc96576d5c276989f891bc638829ecd8d55
github
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/SVGXMLChecker.ets
arkts
_readProlog
读取Prolog
private _readProlog(): boolean{ let _svgStringReader: StringReader = this._svgStringReader!; let mark = _svgStringReader.charIndex; // 读取文件声明 this._readXmlDeclaration(); // 循环读取杂项信息:注释、处理命令、空白字符 while (this._readMisc()) { } // 读取文档类型 if (this._readDocTypeDeclaration()) { ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left _readProlog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AS...
private _readProlog(): boolean{ let _svgStringReader: StringReader = this._svgStringReader!; let mark = _svgStringReader.charIndex; // 读取文件声明 this._readXmlDeclaration(); // 循环读取杂项信息:注释、处理命令、空白字符 while (this._readMisc()) { } // 读取文档类型 if (this._readDocTypeDeclaration()) { ...
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
3cfcc28ba28c17ea56d0e77a599f6a413b33f3ec
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
at
Returns an instance of primitive type at passed index. @param { int } index - index to look at @returns { BigInt | undefined } - a primitive at index @syscap SystemCapability.Utils.Lang @FaAndStageModel
public at(index: int): BigInt | undefined { let k: int if (index >= 0) { k = index } else { k = this.lengthInt + index } if (k < 0 || k >= this.lengthInt) { return undefined } return new BigInt(this.getUnsafe(k)) }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left at AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERR...
public at(index: int): BigInt | undefined { let k: int if (index >= 0) { k = index } else { k = this.lengthInt + index } if (k < 0 || k >= this.lengthInt) { return undefined } return new BigInt(this.getUnsafe(k)) }
https://gitcode.com/iop123123/arkts-static-skills
1514a7839558c62cd253be3097a6014475ef3f28
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
constructor
Creates an Int16Array with respect to length. @param length data initializer
public constructor(length: int) { this.length = length this.byteLength = length * Int16Array.BYTES_PER_ELEMENT this.byteOffset = 0 this.buffer = new ArrayBuffer(this.byteLength) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left length AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier...
public constructor(length: int) { this.length = length this.byteLength = length * Int16Array.BYTES_PER_ELEMENT this.byteOffset = 0 this.buffer = new ArrayBuffer(this.byteLength) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
41dd6215cd4220492d176b4a0ed745001f732224
gitee
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/view/MyDemoOldView.ets
arkts
textStyle
文本样式 @param event 点击页面跳转事件
@Extend(Text) function textStyle(event: () => void) { .fontSize(20) .textAlign(TextAlign.Start) .fontWeight(FontWeight.Bold) .width('100%') .margin({ left: 30 }) .onClick(event) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
@Extend(Text) function textStyle(event: () => void) { .fontSize(20) .textAlign(TextAlign.Start) .fontWeight(FontWeight.Bold) .width('100%') .margin({ left: 30 }) .onClick(event) }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
664ceb39e2a51748b410a25130e7b202d3a42903
gitcode
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/utils/RouterManager.ets
arkts
pop
返回上一页
static pop(animated: boolean = true): void { if (RouterManager.pathStack !== null) { RouterManager.pathStack.pop(animated); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left pop AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left animated AST#identifier#Right AST#:#Left : AST#:#Right AST#E...
static pop(animated: boolean = true): void { if (RouterManager.pathStack !== null) { RouterManager.pathStack.pop(animated); } }
https://github.com/Amaz1ny/HarmonyDO-public
ef8ef31968e9ef6a52e192608094d7b13d3c0f31
github
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/database/BillDatabase.ets
arkts
queryBillsByYearMonthAndCategory
按年月和分类查询账单
async queryBillsByYearMonthAndCategory(year: string, month: string, category: string): Promise<BillModel[]> { if (!this.rdbStore) { throw new Error('数据库未初始化'); } const yearMonth = `${year}-${month.padStart(2, '0')}`; const predicates = new relationalStore.RdbPredicates(t...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left queryBillsByYearMonthAndCategory AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left year AST#ide...
async queryBillsByYearMonthAndCategory(year: string, month: string, category: string): Promise<BillModel[]> { if (!this.rdbStore) { throw new Error('数据库未初始化'); } const yearMonth = `${year}-${month.padStart(2, '0')}`; const predicates = new relationalStore.RdbPredicates(t...
https://github.com/qiuhaotc/HarmonyOSPlayground
5c5ef24232a79e7240143b5f27eb3b362bfb6ac1
github
HarmonyCandies/image_cropper
image_cropper/src/main/ets/common/ImageCropperController.ets
arkts
originalCropAspectRatio
/ Retrieves the original aspect ratio of the crop rectangle before any changes. / Returns null, or a value equal to or greater than 0.
get originalCropAspectRatio(): number | null { return this.getActionDetails().originalCropAspectRatio; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left originalCropAspectRatio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left ...
get originalCropAspectRatio(): number | null { return this.getActionDetails().originalCropAspectRatio; }
https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/common/ImageCropperController.ets#L54-L56
d672cf8193475175cbde5b1e3ee29ab226d727f5
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/security/facades/UserAuthenticationFacade.ets
arkts
authenticate
拉起系统指纹或人脸认证弹窗 @param challenge 认证挑战值,用于防重放攻击 @param title 自定义弹窗标题 @ohos.permission ohos.permission.ACCESS_BIOMETRIC
async authenticate(challenge: Uint8Array, title: string = '安全验证'): Promise<boolean> { logger.info(TAG, '发起用户身份验证'); const authParam: userAuth.AuthParam = { challenge: challenge, authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FINGERPRINT, userAuth.UserAuthType.FACE], authTrustLe...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left authenticate AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left challenge AST#identifier#Right AST#type_annotation#Left A...
async authenticate(challenge: Uint8Array, title: string = '安全验证'): Promise<boolean> { logger.info(TAG, '发起用户身份验证'); const authParam: userAuth.AuthParam = { challenge: challenge, authType: [userAuth.UserAuthType.PIN, userAuth.UserAuthType.FINGERPRINT, userAuth.UserAuthType.FACE], authTrustLe...
https://github.com/DaLongZhuaZi/NGF
c97225e7389d8e93b5c258e95bc7f865fc7ae104
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
internal
Returns an instance of primitive type at passed index. @param index index to look at @returns a primitive at index public
/* public */ internal at(index: int): number { throw new Error("not implemented") }
AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#call_expression#Left AST#identifier#Left internal AST#identifier#Right AST#ERROR#Left AST#identifier#Left at AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right...
/* public */ internal at(index: int): number { throw new Error("not implemented") }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
8d342fd52823cd7010981b339284842c26f769ca
gitee
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/utils/ClipboardManager.ets
arkts
getLocalClipboard
Get current local clipboard content
async getLocalClipboard(): Promise<string> { try { const systemPasteboard = pasteboard.getSystemPasteboard(); const pasteData = await systemPasteboard.getData(); if (pasteData) { return pasteData.getPrimaryText() || ''; } } catch (error) { const err = error as Busi...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getLocalClipboard AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge...
async getLocalClipboard(): Promise<string> { try { const systemPasteboard = pasteboard.getSystemPasteboard(); const pasteData = await systemPasteboard.getData(); if (pasteData) { return pasteData.getPrimaryText() || ''; } } catch (error) { const err = error as Busi...
https://github.com/tangwengang-del/freerdp-harmonyos
d22353a600f87719f02a7e26009ea602c7722fdb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Short.ets
arkts
toShort
Returns value of this instance @returns { short } value as short @syscap SystemCapability.Utils.Lang @FaAndStageModel
public override toShort(): short { return this.value; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left toShort AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
public override toShort(): short { return this.value; }
https://gitcode.com/iop123123/arkts-static-skills
f487ec4d372ac4cbd199afc1b535cf0986c383a8
gitcode
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/StringReader.ets
arkts
reset
重置字符索引为给定的位置,如果未给出索引位置,则重置为输入字符串的开头。 @param index 索引位置,如果索引为负数,向后移动指定字符数,直至字符串开头
public reset(index: number = 0): void { this.charIndex = index >= 0 ? Math.min(this._charCount, index) : Math.max(0, this.charIndex + index); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left reset AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ER...
public reset(index: number = 0): void { this.charIndex = index >= 0 ? Math.min(this._charCount, index) : Math.max(0, this.charIndex + index); }
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
311560e528a976d18367b64daf21404a7b4e87e8
gitee
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets
arkts
setupFlutterEngine
初始化flutterEngine
async setupFlutterEngine() { // First, check if the host wants to use a cached FlutterEngine. const cachedEngineId = this.host?.getCachedEngineId(); Log.d(TAG, "cachedEngineId=" + cachedEngineId); if (cachedEngineId && cachedEngineId.length > 0) { this.flutterEngine = FlutterEngineCache.getInsta...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setupFlutterEngine AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { A...
async setupFlutterEngine() { // First, check if the host wants to use a cached FlutterEngine. const cachedEngineId = this.host?.getCachedEngineId(); Log.d(TAG, "cachedEngineId=" + cachedEngineId); if (cachedEngineId && cachedEngineId.length > 0) { this.flutterEngine = FlutterEngineCache.getInsta...
https://gitee.com/openharmony-sig/flutter_engine.git
2851ad1d7bbd4d07e67f78289a3b088aa38118d5
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
setDragYEnabled
Set this to true to enable dragging on the Y axis @param enabled
public setDragYEnabled(enabled: boolean): void { this.mDragYEnabled = enabled; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDragYEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public setDragYEnabled(enabled: boolean): void { this.mDragYEnabled = enabled; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
5d3d76c937b0a3c38dda65c93010ee0e1467ee1d
gitee
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/services/ReminderService.ets
arkts
getReminderType
获取提醒类型
private getReminderType(): reminderManager.ReminderType { try { if (reminderManager.ReminderType.REMINDER_TYPE_TIMER !== undefined) { return reminderManager.ReminderType.REMINDER_TYPE_TIMER; } if (reminderManager.ReminderType.REMINDER_TYPE_ALARM !== undefined) { return reminderMa...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getReminderType 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#member_expression#L...
private getReminderType(): reminderManager.ReminderType { try { if (reminderManager.ReminderType.REMINDER_TYPE_TIMER !== undefined) { return reminderManager.ReminderType.REMINDER_TYPE_TIMER; } if (reminderManager.ReminderType.REMINDER_TYPE_ALARM !== undefined) { return reminderMa...
https://gitcode.com/openharmony/codelabs
ea8a070b2a898dfb049d83a617105670c22bcf17
gitcode
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/DataCrypto.ets
arkts
uint8ArrayToString
Uint8Array → 字符串 (UTF-8) — 使用 buffer API 正确解码多字节字符
private uint8ArrayToString(data: Uint8Array): string { return buffer.from(data).toString('utf-8'); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left uint8ArrayToString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
private uint8ArrayToString(data: Uint8Array): string { return buffer.from(data).toString('utf-8'); }
https://github.com/Mydstiny/RemoteDeskHarmonyOS
09b0d02fe7982caaafd1d16f65b72b1a2caaa368
github
who7708/harmonyos-codelabs
HmosWorld/commons/common/src/main/ets/service/repository/UserResourcesRepository.ets
arkts
getViewedResources
Access the network to obtain user browsing data @returns LearningResource[]
getViewedResources(): Promise<LearningResource[]> { return this.service.getViewedResource(); }
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left getViewedResources AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right...
getViewedResources(): Promise<LearningResource[]> { return this.service.getViewedResource(); }
https://github.com/who7708/harmonyos-codelabs
70dedcc20a8012f00a12484319eb2b498f38e651
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
reverse
Creates a new Uint16Array using reversed data from the current one @returns a new Uint16Array using reversed data from the current one
public reverse(): Uint16Array { let res = new Uint16Array(this) for (let i = 0; i < this.length; ++i) { res.set(this.length - 1 - i, this.at(i)) } return res }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reverse 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 Uint16Array AS...
public reverse(): Uint16Array { let res = new Uint16Array(this) for (let i = 0; i < this.length; ++i) { res.set(this.length - 1 - i, this.at(i)) } return res }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
fa0e8e54ee04f2b4c57ad4739f01ab6ffdf36a17
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/FavoriteModelsService.ets
arkts
isFavorite
检查是否已收藏 @param modelId 模型 ID @param providerId 供应商 ID(可选,兼容旧调用) @returns 是否已收藏
isFavorite(modelId: string, providerId?: string): boolean { if (providerId !== undefined) { // 精确匹配:同时匹配 modelId 和 providerId return this.favoriteModels.some(f => f.modelId === modelId && f.providerId === providerId) } // 兼容旧调用:仅按 modelId 匹配(用于向后兼容) return this.favoriteModels.some(f => f.m...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isFavorite AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left modelId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#Rig...
isFavorite(modelId: string, providerId?: string): boolean { if (providerId !== undefined) { // 精确匹配:同时匹配 modelId 和 providerId return this.favoriteModels.some(f => f.modelId === modelId && f.providerId === providerId) } // 兼容旧调用:仅按 modelId 匹配(用于向后兼容) return this.favoriteModels.some(f => f.m...
https://github.com/LongLiveY96/chatcube
20ea0562358061817cf91d0f8eba7f66d105c00e
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/OCRRecognition.ets
arkts
incrementRetry
增加重试次数
incrementRetry(): boolean { this.retryCount += 1; this.updatedAt = new Date().toISOString(); return this.retryCount <= 3; // 最多重试3次 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left incrementRetry 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#stat...
incrementRetry(): boolean { this.retryCount += 1; this.updatedAt = new Date().toISOString(); return this.retryCount <= 3; // 最多重试3次 }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
c094d82be255ca08513dfeecd7e4a91ae2d86b6f
github
holg/eulumdat-rs
EulumdatHarmonyOS/Eulumdat/entry/src/main/ets/model/EulumdatEngine.ets
arkts
generateLdcMesh
Generate 3D mesh data for the photometric solid (LDC) The mesh represents the luminous intensity distribution as a 3D surface where the distance from center equals the intensity at that angle. @param cStep C-plane angle step in degrees (smaller = smoother, default 10) @param gStep Gamma angle step in degrees (smaller =...
public generateLdcMesh( cStep: number = 10, gStep: number = 10, scale: number = 1.0, colorMode: ColorMode = ColorMode.Heatmap ): LdcMeshData { return eulumdat_napi.generateLdcMesh(cStep, gStep, scale, colorMode); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left generateLdcMesh AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cStep AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expr...
public generateLdcMesh( cStep: number = 10, gStep: number = 10, scale: number = 1.0, colorMode: ColorMode = ColorMode.Heatmap ): LdcMeshData { return eulumdat_napi.generateLdcMesh(cStep, gStep, scale, colorMode); }
https://github.com/holg/eulumdat-rs
c73a64133c0733b71603a51e410f1790fe55c80b
github
richshaw2015/nds
ohos/entry/src/main/ets/utils/CheatManager.ets
arkts
getCheatsForGame
======================================================================== 合并与状态管理 ======================================================================== 获取当前游戏的合并金手指列表(在线 + 本地) 并恢复启用状态
async getCheatsForGame(gameCode: string, checksum: string): Promise<MergedCheatFolder[]> { const result: MergedCheatFolder[] = []; // 并行获取在线和本地 const results = await Promise.all([ this.fetchOnlineCheats(gameCode, checksum), Promise.resolve(this.parseLocalCheats(gameCode, checksum)), ]); ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCheatsForGame AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left gameCode AST#identifier#Right AST#type_annotation#Left AST#:#L...
async getCheatsForGame(gameCode: string, checksum: string): Promise<MergedCheatFolder[]> { const result: MergedCheatFolder[] = []; // 并行获取在线和本地 const results = await Promise.all([ this.fetchOnlineCheats(gameCode, checksum), Promise.resolve(this.parseLocalCheats(gameCode, checksum)), ]); ...
https://github.com/richshaw2015/nds
b0298c4db1996c9050cc6d819d25c0e08f759ac4
github
HarmonyOS_Samples/sample_in_harmonyos
common/src/main/ets/util/WantUtil.ets
arkts
getParameter
Get param value by key from want. @param want @param key @param defValue @returns value from parameter with key.
static getParameter<T>(want: Want, key: string, defValue?: T): T | undefined { if (!want || !want.parameters || !key) { return undefined; } const result = want.parameters[key]; if (!result) { return defValue; } return result as T; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#binary_expression#Left AST#identifier#Left getParameter AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Left ( AST#(#...
static getParameter<T>(want: Want, key: string, defValue?: T): T | undefined { if (!want || !want.parameters || !key) { return undefined; } const result = want.parameters[key]; if (!result) { return defValue; } return result as T; }
https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos
d73e11f51e420ea6f9ab57b2cace4e97777f14c4
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/CloudSyncRecordDAO.ets
arkts
getInProgressSync
查询进行中的同步任务
static async getInProgressSync(userId: number): Promise<CloudSyncRecord | null> { const store: relationalStore.RdbStore = DatabaseManager.getDatabase(); const sql: string = `SELECT * FROM ${CloudSyncRecord.tableName} WHERE user_id = ? AND status = 'in_progress' ORDER BY sta...
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 getInProgressSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left...
static async getInProgressSync(userId: number): Promise<CloudSyncRecord | null> { const store: relationalStore.RdbStore = DatabaseManager.getDatabase(); const sql: string = `SELECT * FROM ${CloudSyncRecord.tableName} WHERE user_id = ? AND status = 'in_progress' ORDER BY sta...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
b8fca5bab676f0492995832af5d9a26d37cc4427
github
Joker-x-dev/CoolMallArkTS
core/designsystem/src/main/ets/component/Row.ets
arkts
build
渲染布局 @returns {void} 无返回值 @example RowSpaceBetweenCenter() { Text("A"); Text("B"); }
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.SpaceBetween, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.margi...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.SpaceBetween, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.margi...
https://github.com/Joker-x-dev/CoolMallArkTS
723c57421bf6091410d1ef895b1bc39256bbb2e0
github
codelably/HCompass
packages/spatialization/src/main/ets/view/ImmersiveLightView.ets
arkts
buildTabBarStyles
构建 Tab 栏样式列表
function buildTabBarStyles(): BottomTabBarStyle[] { const styles: BottomTabBarStyle[] = []; for (let i = 0; i < TAB_TITLES.length; i++) { styles.push(new BottomTabBarStyle( { normal: new SymbolGlyphModifier(TAB_ICONS[i]) }, TAB_TITLES[i], )); } return styles; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left buildTabBarStyles AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#array_typ...
function buildTabBarStyles(): BottomTabBarStyle[] { const styles: BottomTabBarStyle[] = []; for (let i = 0; i < TAB_TITLES.length; i++) { styles.push(new BottomTabBarStyle( { normal: new SymbolGlyphModifier(TAB_ICONS[i]) }, TAB_TITLES[i], )); } return styles; }
https://github.com/codelably/HCompass
8d81a3ac757181f5d31b000bb30cf583f5c68557
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/PieChartModel.ets
arkts
isDrawHoleEnabled
returns true if the hole in the center of the pie-chart is set to be visible, false if not @return
public isDrawHoleEnabled(): boolean { return this.mDrawHole; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDrawHoleEnabled 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 isDrawHoleEnabled(): boolean { return this.mDrawHole; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
85e9d1e392368b1aa19c4aaa1f8b38445e034ea0
gitee
openharmony/third_party_typescript
tests/arkTSTest/testcase/arkts-no-ctor-signatures-funcs/arkts-no-ctor-signatures-funcs-3-ok.ets
arkts
createPerson
define a createPerson function that takes a constructor and arguments and returns an instance of Person
function createPerson(Ctor: PersonCtor, name: string, age: number): Person { return Ctor(name, age); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createPerson AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left Ctor AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Rig...
function createPerson(Ctor: PersonCtor, name: string, age: number): Person { return Ctor(name, age); }
https://gitee.com/openharmony/third_party_typescript.git
5041350c06fe5c2e45afa56d33ad053d47d49a12
gitee
offlinecat-dev/OCNetORM
src/main/ets/query/SubQuery.ets
arkts
whereLike
添加 LIKE 条件 @param column 列名 @param pattern 匹配模式 @returns 当前实例(支持链式调用)
whereLike(column: string, pattern: string): SubQuery { const condition = WhereCondition.like(column, pattern) condition.logicalOperator = LogicalOperator.AND this.conditions.push(condition) return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left whereLike 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 string AST#identifier#Right AST#,#Left , AST...
whereLike(column: string, pattern: string): SubQuery { const condition = WhereCondition.like(column, pattern) condition.logicalOperator = LogicalOperator.AND this.conditions.push(condition) return this }
https://github.com/offlinecat-dev/OCNetORM
4b9a1a1cabcb1192e19041fccac83d5b55b2e726
github
aimilin6688/KeePassHO
entry/src/main/ets/services/TypeDefined.ets
arkts
getIndexByType
根据认证方式类型获取索引 @param type 认证方式类型 @returns 索引,如果未找到则返回-1
public static getIndexByType(type: string): number { const types = AuthType.getAllTypes(); for (let i = 0; i < types.length; i++) { if (types[i].type === type) { return i; } } return -1; }
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 getIndexByType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : A...
public static getIndexByType(type: string): number { const types = AuthType.getAllTypes(); for (let i = 0; i < types.length; i++) { if (types[i].type === type) { return i; } } return -1; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/TypeDefined.ets#L244-L252
ea8703381b5054fe03f742ff83cc3de2b82c86e2
github
Joker-x-dev/CoolMallArkTS
core/base/src/main/ets/viewmodel/BaseViewModel.ets
arkts
aboutToRecycle
组件即将回收 @returns {void} 无返回值
aboutToRecycle(): void { }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToRecycle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#...
aboutToRecycle(): void { }
https://github.com/Joker-x-dev/CoolMallArkTS
12d751260c3a74933c8e2a384960263740dea75a
github
darcycui/DarcyHarmonyNext
entry/src/main/ets/pages/entry/status/watch/WatchPage.ets
arkts
onMessageChange
回调函数必须是组件的成员函数
onMessageChange(changedPropertyName?: string) { // 通过参数区分是哪个属性变化 Log.log(`WatchPage changedPropertyName: ${changedPropertyName}`); Log.log(`WatchPage message: ${this.message}`) Log.log(`WatchPage name: ${this.name}`) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onMessageChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left changedPropertyName AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#string#Left strin...
onMessageChange(changedPropertyName?: string) { // 通过参数区分是哪个属性变化 Log.log(`WatchPage changedPropertyName: ${changedPropertyName}`); Log.log(`WatchPage message: ${this.message}`) Log.log(`WatchPage name: ${this.name}`) }
https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/status/watch/WatchPage.ets#L11-L16
310bbf444e267bc9dc6f6f9c3f42e3276e45f4e3
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
getMinutes
Returns the minutes in the specified date according to local time. @returns { int } An integer number, between 0 and 59 representing the minutes in the given date according to local time. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getMinutes(): int { let localTime = this.ms - this.TZOffset * 60 * msPerSecond; return ecmaMinFromTime(localTime); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMinutes 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 int AST#ide...
public getMinutes(): int { let localTime = this.ms - this.TZOffset * 60 * msPerSecond; return ecmaMinFromTime(localTime); }
https://gitcode.com/iop123123/arkts-static-skills
2e3390cdbb6559d519d92d431b06886f44731288
gitcode
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/RdpSessionManager.ets
arkts
handleNetworkRestored
Handle network restored
private handleNetworkRestored(): void { if (!isSessionActive) { return; } console.info(`${TAG}: Handling network restored`); // Update notification if (backgroundService && RdpBackgroundService.isServiceRunning()) { backgroundService.updateNotification('网络已恢复,正在重连...'); }...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleNetworkRestored 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 voi...
private handleNetworkRestored(): void { if (!isSessionActive) { return; } console.info(`${TAG}: Handling network restored`); // Update notification if (backgroundService && RdpBackgroundService.isServiceRunning()) { backgroundService.updateNotification('网络已恢复,正在重连...'); }...
https://github.com/tangwengang-del/freerdp-harmonyos
4a7a2063c27a9c6d1d27333814f94fb783559d40
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/AbstractController.ets
arkts
notifyTouchpadInput
报告触摸板数据
protected notifyTouchpadInput(active: boolean, x: number, y: number): void { if (this.listener) { this.listener.reportTouchpadInput(this.deviceId, active, x, y); } }
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left notifyTouchpadInput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left active AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#i...
protected notifyTouchpadInput(active: boolean, x: number, y: number): void { if (this.listener) { this.listener.reportTouchpadInput(this.deviceId, active, x, y); } }
https://github.com/AlkaidLab/moonlight-harmony
8d2c4961020ffacebb73f81b978a9118a1849dad
github
luojiang001/Pulse
Pulse/entry/src/main/ets/pages/component/ShouYe/DoctorListComponent.ets
arkts
onSearchChange
监听搜索词变化
onSearchChange() { this.applyFilters(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onSearchChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
onSearchChange() { this.applyFilters(); }
https://github.com/luojiang001/Pulse
c1460f9dbe0b14843dd95b484a32a0a4d5f55269
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
sqrt
Return a new Decimal whose value is the square root of `n`, rounded to `precision` significant digits using rounding mode `rounding`. @param { Value } n {double | string | Decimal} @returns { Decimal } the Decimal type
static sqrt(n: Value): Decimal { return new Decimal(n).sqrt(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left sqrt AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R...
static sqrt(n: Value): Decimal { return new Decimal(n).sqrt(); }
https://gitcode.com/iop123123/arkts-static-skills
e29973f16e23ad418beece2cf5e893f9c34c0c7e
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamInputHandler.ets
arkts
handleAxisEvent
==================== 滚轮输入 ==================== 处理鼠标滚轮事件(挂载在 XComponent 上以确保 native surface 能接收轴事件)
handleAxisEvent(event: AxisEvent): void { if (!this.viewModel?.isConnected) return; const vertical = event.getVerticalAxisValue(); const horizontal = event.getHorizontalAxisValue(); // scrollStep: 系统「鼠标滚轮速度」设置的放大倍数(文档:上报数值受系统放大倍数影响) // 对于串流,我们模拟物理鼠标→应发送原始每格数据,让远端 PC 应用自己的滚轮速度 // 因此需要除以 scrol...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left handleAxisEvent 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 AxisEvent AST#identifier#Right AST#)#Le...
handleAxisEvent(event: AxisEvent): void { if (!this.viewModel?.isConnected) return; const vertical = event.getVerticalAxisValue(); const horizontal = event.getHorizontalAxisValue(); // scrollStep: 系统「鼠标滚轮速度」设置的放大倍数(文档:上报数值受系统放大倍数影响) // 对于串流,我们模拟物理鼠标→应发送原始每格数据,让远端 PC 应用自己的滚轮速度 // 因此需要除以 scrol...
https://github.com/AlkaidLab/moonlight-harmony
115b35d95a13993381b79f891c1176b135dec273
github
erosTeam/NextE
shared/src/main/ets/parser/HtmlSelectorUtils.ets
arkts
urlDecode
Safe percent-decode. EH carries some fields inside URL paths (e.g. `/uploader/marki%C3%B1o`), which must be decoded for display (`markiño`); returns the input unchanged on malformed input.
static urlDecode(s: string): string { if (s.length === 0) { return s } try { return decodeURIComponent(s) } catch (e) { return s } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left urlDecode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left s AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AS...
static urlDecode(s: string): string { if (s.length === 0) { return s } try { return decodeURIComponent(s) } catch (e) { return s } }
https://github.com/erosTeam/NextE
b74b1b19cc1f6ea68e673e64051c801f1092644d
github
tdcare/tdwebrtc
src/main/ets/utils/NetworkUtil.ets
arkts
isCellularDataEnabledSync
检查蜂窝数据业务是否启用。 @returns
static isCellularDataEnabledSync(): boolean { return data.isCellularDataEnabledSync(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isCellularDataEnabledSync 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...
static isCellularDataEnabledSync(): boolean { return data.isCellularDataEnabledSync(); }
https://github.com/tdcare/tdwebrtc
47714318ba6b0d95f9013e44551a4e20784af414
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/basecomponent/utils/ContextProvider.ets
arkts
getAppContext
Get the application context @returns the application context, or null if uninitialized
static getAppContext(): common.Context | null { const provider = ContextProvider.getInstance(); if (!provider._appContext) { hilog.warn(0x0000, 'ContextProvider', 'Context not initialized, please call init() first'); } return provider._appContext; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getAppContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left A...
static getAppContext(): common.Context | null { const provider = ContextProvider.getInstance(); if (!provider._appContext) { hilog.warn(0x0000, 'ContextProvider', 'Context not initialized, please call init() first'); } return provider._appContext; }
https://github.com/Tencent-RTC/TUIKit_Harmony
95e957c04fcf11494248118c0940e4c652013422
github
huaweicloud/huaweicloud-iot-device-sdk-arkts
huaweicloud_iot_device_library/src/main/ets/client/DeviceClient.ets
arkts
propertyListener
设置属性监听器,用于接收平台下发的属性读写。 此监听器只能接收平台到直连设备的请求,子设备的请求由AbstractGateway处理 @param propertyListener 属性监听器
public set propertyListener(value: PropertyListener | null) { this._propertyListener = value; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left set AST#identifier#Right AST#call_expression#Left AST#identifier#Left propertyListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : A...
public set propertyListener(value: PropertyListener | null) { this._propertyListener = value; }
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts
53c0701aca600593a32595e6e553afd293c5ac1a
github
HarmonyOS_Samples/hmosworld
HMOSWorld/Application/commons/audioplayer/src/main/ets/service/SpeechPlayerService.ets
arkts
releaseTextToSpeechEngine
Release TextToSpeechEngine
public releaseTextToSpeechEngine() { try { this.ttsEngine?.shutdown(); Logger.info(TAG, 'Succeeded to release textToSpeechEngine.'); } catch (error) { Logger.error(TAG, `Failed to release textToSpeechEngine.Cause: ${(error as BusinessError).message}`); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left releaseTextToSpeechEngine 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 ...
public releaseTextToSpeechEngine() { try { this.ttsEngine?.shutdown(); Logger.info(TAG, 'Succeeded to release textToSpeechEngine.'); } catch (error) { Logger.error(TAG, `Failed to release textToSpeechEngine.Cause: ${(error as BusinessError).message}`); } }
https://gitcode.com/HarmonyOS_Samples/hmosworld
4aa3da58c77730061f9089d99144edacef42637f
gitcode
HarmonyOS_Samples/BestPracticeSnippets
OptimizationAppDelay/entry/src/main/ets/view/LoadingView.ets
arkts
startAnimation
[Start start_animation] Skeleton diagram, presenting skeleton animation in a fading way.
startAnimation(): void { this.getUIContext().animateTo(CommonConstants.SKELETON_ANIMATION, () => { this.listOpacity = CommonConstants.HALF_OPACITY; }); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left startAnimation 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_blo...
startAnimation(): void { this.getUIContext().animateTo(CommonConstants.SKELETON_ANIMATION, () => { this.listOpacity = CommonConstants.HALF_OPACITY; }); }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
20719190d6c2c39c69f17d07435732d68a3c367e
gitcode
Dabing-0x19d/berverage_HarmonyOS6.0
entry/src/main/ets/pages/cacender.ets
arkts
onRefreshKeyChanged
刷新触发时的回调
onRefreshKeyChanged() { this.loadData() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onRefreshKeyChanged 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_bloc...
onRefreshKeyChanged() { this.loadData() }
https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0
f97aab1ad699ce91cd31c9ae30b30fb121116fbf
github
harmonyos/codelabs
HarmonyOS_NEXT/RankingDemo/entry/src/main/ets/viewmodel/RankViewModel.ets
arkts
loadRankDataSource2
Load data from the rankData2 of the Mock file,but rankData2 is different from rankData1.
loadRankDataSource2(): RankData[] { return rankData2; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left loadRankDataSource2 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left RankData AST...
loadRankDataSource2(): RankData[] { return rankData2; }
https://gitee.com/harmonyos/codelabs.git
50969ee7ccb298baf1c894295dfacf3b20f69e0f
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceAPIEngine.ets
arkts
normalizeHeaders
规范化headers,确保类型安全
private normalizeHeaders(input?: Object): Object { // 初始化默认Headers const headers: Record<string, string> = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safa...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left normalizeHeaders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ER...
private normalizeHeaders(input?: Object): Object { // 初始化默认Headers const headers: Record<string, string> = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safa...
https://github.com/DaLongZhuaZi/manxia
047cb79c4d71bcfaaa633a73ef22d7a207dc608f
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets
arkts
isFinite
Check if the current RationalNumber object represents a finite value. @returns { boolean } if the denominator is not 0 return true otherwise return false.
public isFinite(): boolean { return this.mden !== 0; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isFinite 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#bool...
public isFinite(): boolean { return this.mden !== 0; }
https://gitcode.com/iop123123/arkts-static-skills
87b4c03684834374e0db3278f69f8e8ad7db5c4d
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/ShareExtAbility/ShareExtAbility.ets
arkts
launchMainAppWithFiles
启动主应用并传递文件URI
private async launchMainAppWithFiles(uris: string[], fileType: string): Promise<void> { try { const taskParams: ExternalFileTaskParams = ExternalFileTaskFactory.createShareTask( this.mapShareTypeToTaskKind(fileType), uris, ExternalFileTaskSource.SYSTEM_SHARE, uris.length > 0 ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left launchMainAppWithFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uris AST#identifier#Right AST#...
private async launchMainAppWithFiles(uris: string[], fileType: string): Promise<void> { try { const taskParams: ExternalFileTaskParams = ExternalFileTaskFactory.createShareTask( this.mapShareTypeToTaskKind(fileType), uris, ExternalFileTaskSource.SYSTEM_SHARE, uris.length > 0 ...
https://github.com/DaLongZhuaZi/manxia
27ce9cbd51aebc8eb30d84170777628ff2103751
github
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/ConversationMemory.ets
arkts
cleanupExpiredSessions
清理过期会话
cleanupExpiredSessions(): number { const now = Date.now(); const ttl = this.config.sessionTTL * 1000; let cleanedCount = 0; for (const [sessionId, context] of this.storage.entries()) { if (now - context.updatedAt > ttl) { this.storage.delete(sessionId); cleanedCount++; } ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cleanupExpiredSessions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST...
cleanupExpiredSessions(): number { const now = Date.now(); const ttl = this.config.sessionTTL * 1000; let cleanedCount = 0; for (const [sessionId, context] of this.storage.entries()) { if (now - context.updatedAt > ttl) { this.storage.delete(sessionId); cleanedCount++; } ...
https://github.com/LJ666-ui/harmony-health-care
984495c3af4ef28371bdf5cc4558274779a8b16d
github
ZestBox-18/kitebook-frontend
commons/data_core/src/main/ets/services/AccountManager.ets
arkts
hasBillReferenceByColumn
判断账单表的指定列中是否存在对账户名称的引用。
private static async hasBillReferenceByColumn(columnName: string, name: string): Promise<boolean> { const predicates = new relationalStore.RdbPredicates(BILL_TABLE_NAME); predicates.equalTo(columnName, name); return new Promise<boolean>((resolve, reject) => { dbManager.dbStore?.query(predicates) ...
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 hasBillReferenceByColumn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left colum...
private static async hasBillReferenceByColumn(columnName: string, name: string): Promise<boolean> { const predicates = new relationalStore.RdbPredicates(BILL_TABLE_NAME); predicates.equalTo(columnName, name); return new Promise<boolean>((resolve, reject) => { dbManager.dbStore?.query(predicates) ...
https://github.com/ZestBox-18/kitebook-frontend
263c70b7786fed6b33c097576743bf50c1bbfd9d
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LightWeightMap.ets
arkts
remove
Removes the entry with the specified key from the LightWeightMap @param key the key to remove from the LightWeightMap @returns the value associated with the key if it was removed, undefined otherwise
remove(key: K): V | undefined { const index = this.getIndexOfKey(key); if (index < 0) { return undefined; } const value = this.buckets.entryValues[index]; this.buckets.remove(index); return value; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#Right A...
remove(key: K): V | undefined { const index = this.getIndexOfKey(key); if (index < 0) { return undefined; } const value = this.buckets.entryValues[index]; this.buckets.remove(index); return value; }
https://gitcode.com/iop123123/arkts-static-skills
9938a556c9c62cffa194a459c5a873aef392bdb9
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/MultiAgentOrchestrator.ets
arkts
constructor
构造函数 @param intentClassifier 意图分类器 @param memory 对话记忆管理器 @param ragRetriever RAG检索器
constructor( intentClassifier: IntentClassifier, memory: ConversationMemory, ragRetriever: RAGRetriever ) { this.intentClassifier = intentClassifier; this.memory = memory; this.ragRetriever = ragRetriever; }
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 intentClassifier AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left IntentClassifier ...
constructor( intentClassifier: IntentClassifier, memory: ConversationMemory, ragRetriever: RAGRetriever ) { this.intentClassifier = intentClassifier; this.memory = memory; this.ragRetriever = ragRetriever; }
https://github.com/LJ666-ui/harmony-health-care
32c471dd3c1458e282e1341609cb9fb134c983a0
github
LJ666-ui/harmony-health-care
entry/src/main/ets/medicalimaging/ImagingTypeClassifier.ets
arkts
classifyByFeatures
基于特征分类 @param features 图像特征 @returns 分类结果
private classifyByFeatures(features: ImageFeatures): ClassificationResult { // 计算与各类型的相似度 const scores: { type: ImagingType; score: number }[] = []; this.typeFeatures.forEach((template, type) => { let score = 0; let weightSum = 0; // 宽高比相似度 if (template.aspectRatio) { con...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left classifyByFeatures AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left features AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi...
private classifyByFeatures(features: ImageFeatures): ClassificationResult { // 计算与各类型的相似度 const scores: { type: ImagingType; score: number }[] = []; this.typeFeatures.forEach((template, type) => { let score = 0; let weightSum = 0; // 宽高比相似度 if (template.aspectRatio) { con...
https://github.com/LJ666-ui/harmony-health-care
802a251cdad933f8aa75a100c108a1daf2776dc5
github
HarmonyOS_Samples/BestPracticeSnippets
HDRVivid/AVRecorder/entry/src/main/ets/utils/FileUtil.ets
arkts
writeBufferToFile
Save the arraybuffer to a file.
static writeBufferToFile(path: string, arrayBuffer: ArrayBuffer): number { try { let file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); let value = fileIo.writeSync(file.fd, arrayBuffer); fileIo.closeSync(file); return value; } catch (err) { Logger...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left writeBufferToFile 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#Lef...
static writeBufferToFile(path: string, arrayBuffer: ArrayBuffer): number { try { let file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE); let value = fileIo.writeSync(file.fd, arrayBuffer); fileIo.closeSync(file); return value; } catch (err) { Logger...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
6a5b9b6d56ee5dba50c9cc4a0dc504a4928612cc
gitcode
jschwe/ServoDemo
entry/src/main/ets/pages/Index.ets
arkts
onBackPress
Called when the user swipes from the right or left edge to the middle Default behavior is bringing the app to the background.
onBackPress(): boolean { servoshell.goBack(); return true; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackPress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#stateme...
onBackPress(): boolean { servoshell.goBack(); return true; }
https://github.com/jschwe/ServoDemo
7eeacd9d4fba05fd8fa2327fb2943afee4837b7a
github