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
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/CategoryDAO.ets
arkts
getCategoryTree
获取分类树(包含子分类) @param userId 用户ID @param type 分类类型 @returns 分类树结构
static async getCategoryTree(userId: number, type: 'expense' | 'income'): Promise<CategoryTreeNode[]> { const store = DatabaseManager.getDatabase(); const sql = ` SELECT * FROM categories WHERE user_id = ? AND type = ? AND is_deleted = 0 ORDER BY sort_order ASC, category_id ASC `; ...
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 getCategoryTree AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left :...
static async getCategoryTree(userId: number, type: 'expense' | 'income'): Promise<CategoryTreeNode[]> { const store = DatabaseManager.getDatabase(); const sql = ` SELECT * FROM categories WHERE user_id = ? AND type = ? AND is_deleted = 0 ORDER BY sort_order ASC, category_id ASC `; ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
fecef6d421e425e69f3e47507fd60a27bcbc51a3
github
CLMC2025/Vignette
entry/src/main/ets/algorithm/Algorithm.ets
arkts
isUsingOptimizedParams
Check if using optimized parameters
isUsingOptimizedParams(): boolean { return this.usingOptimizedParams; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isUsingOptimizedParams 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 ...
isUsingOptimizedParams(): boolean { return this.usingOptimizedParams; }
https://github.com/CLMC2025/Vignette
73c2004cc53f84b400fa7e9e93b9a9a5df91302e
github
wuba/omni-ui
omni_component/src/main/ets/components/pullable/OmniPullToRefreshLayout.ets
arkts
build
主要构建方法
build() { RefreshLayout({ scroller: this.scroller, webviewController: this.webviewController, controller: this.controller, config: this.config, headerView: () => { this.defHeaderView() }, onCanPullRefresh: () => { if(!this.scroller) return false; i...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c...
build() { RefreshLayout({ scroller: this.scroller, webviewController: this.webviewController, controller: this.controller, config: this.config, headerView: () => { this.defHeaderView() }, onCanPullRefresh: () => { if(!this.scroller) return false; i...
https://github.com/wuba/omni-ui
8926ea172bed5350a7c006eb863aa4492025db33
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/CartRepository.ets
arkts
updateCartSpecCount
更新购物车中商品的规格数量 @param {number} goodsId 商品ID @param {number} specId 规格ID @param {number} count 规格数量 @returns {Promise<void>} Promise<void>
updateCartSpecCount(goodsId: number, specId: number, count: number): Promise<void> { return this.dataSource.updateCartSpecCount(goodsId, specId, count); }
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left updateCartSpecCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left goodsId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left numb...
updateCartSpecCount(goodsId: number, specId: number, count: number): Promise<void> { return this.dataSource.updateCartSpecCount(goodsId, specId, count); }
https://github.com/Joker-x-dev/CoolMallArkTS
b787877c7b7e9195b8e04c5c0af279d5b4db1c58
github
killetom/ktretrofit
ktretrofit/src/main/ets/retrofit/util/MetadataUtil.ets
arkts
definePartMapParameter
Define part map parameter metadata
static definePartMapParameter(paramIndex: number, target: Object, propertyKey: string | symbol): void { let partMapParams = this.getMetadata('retrofit:partMapParams', target, propertyKey) as number[] || []; partMapParams.push(paramIndex); this.defineMetadata('retrofit:partMapParams', partMapParams, target...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left definePartMapParameter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left paramIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number ...
static definePartMapParameter(paramIndex: number, target: Object, propertyKey: string | symbol): void { let partMapParams = this.getMetadata('retrofit:partMapParams', target, propertyKey) as number[] || []; partMapParams.push(paramIndex); this.defineMetadata('retrofit:partMapParams', partMapParams, target...
https://github.com/killetom/ktretrofit
fc4cf104d1dc39430e56600f859ad52627633dbe
github
ZestBox-18/kitebook-frontend
commons/data_core/src/main/ets/services/BillManager.ets
arkts
buildUpdatedBill
合并旧账单和补丁,得到更新后的完整账单数据。
private static buildUpdatedBill(originalBill: BillBean, patch: Partial<BillBean>): BillBean { const nextBill: BillBean = new BillBean(); nextBill.id = originalBill.id; nextBill.type = patch.type !== undefined ? patch.type : originalBill.type; nextBill.category = patch.category !== undefined ? patch.ca...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left buildUpdatedBill AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left originalBill AST#identifier#Right AST#ERROR#Left A...
private static buildUpdatedBill(originalBill: BillBean, patch: Partial<BillBean>): BillBean { const nextBill: BillBean = new BillBean(); nextBill.id = originalBill.id; nextBill.type = patch.type !== undefined ? patch.type : originalBill.type; nextBill.category = patch.category !== undefined ? patch.ca...
https://github.com/ZestBox-18/kitebook-frontend
94fb44077304da72a2473365356f1c67fb6dbea2
github
honjow/Next2V
shared/src/main/ets/settings/AccountMetaPublisher.ets
arkts
harvestFromHtml
Guards: only the active account's cookie, only once an account context exists (holder.ownerKey set), only when the strict nav widget is present. In-memory only (no context here) — the preferences cache keeps the last authoritative value; this just keeps the live holder current between fetches.
static harvestFromHtml(html: string, cookie: string): void { if (!html || !cookie || cookie !== CookieJarSettings.getCurrentCookie()) { return } const holder = connectAccountMeta() const ownerKey = holder.ownerKey // Only enrich when the holder's value already belongs to THIS cookie (set by ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left harvestFromHtml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
static harvestFromHtml(html: string, cookie: string): void { if (!html || !cookie || cookie !== CookieJarSettings.getCurrentCookie()) { return } const holder = connectAccountMeta() const ownerKey = holder.ownerKey // Only enrich when the holder's value already belongs to THIS cookie (set by ...
https://github.com/honjow/Next2V
d7aceb9a4d8008e5eb08b8a63b2861545deaca4c
github
openharmony/codelabs
ETSUI/ECommerce/entry/src/main/ets/model/DataModels.ets
arkts
constructor
Demo 字段:完整性校验占位
constructor(id: string, userId: number, totalAmount: number, createTime: number, status: number, signature: string) { this.id = id; this.userId = userId; this.totalAmount = totalAmount; this.createTime = createTime; this.status = status; this.signature = signature; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST...
constructor(id: string, userId: number, totalAmount: number, createTime: number, status: number, signature: string) { this.id = id; this.userId = userId; this.totalAmount = totalAmount; this.createTime = createTime; this.status = status; this.signature = signature; }
https://gitcode.com/openharmony/codelabs
1b233d02a165c2f37d066986ae73e270e9d730e2
gitcode
azhu0001/localsend-harmony
entry/src/main/ets/utils/FileProvider.ets
arkts
getFileSuffixName
获取文件后缀 @param fileName 文件名 @returns
static getFileSuffixName(fileName: string): string { const suffixIndex = fileName.lastIndexOf('.') if (suffixIndex > 0) { return fileName.substring(suffixIndex + 1) } return '' }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getFileSuffixName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fileName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
static getFileSuffixName(fileName: string): string { const suffixIndex = fileName.lastIndexOf('.') if (suffixIndex > 0) { return fileName.substring(suffixIndex + 1) } return '' }
https://gitcode.com/azhu0001/localsend-harmony
d3d67f90aa9e9006f3a088e0c5664002c1ddfe0d
gitcode
fbinba3955/Flymby
common/src/main/ets/utils/StringUtil.ets
arkts
splitText
截取字符串的前几位和后几位,中间用省略号代替
static splitText(originText: string, startCharLong: number, endCharLong: number): string { // 如果title超过10个字符,截取前5个后5个,中间有…替代,返回string格式数据 if (originText.length > startCharLong + endCharLong) { return originText.slice(0, startCharLong) + '…' + originText.slice(-endCharLong) } else { return orig...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left splitText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left originText AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Ri...
static splitText(originText: string, startCharLong: number, endCharLong: number): string { // 如果title超过10个字符,截取前5个后5个,中间有…替代,返回string格式数据 if (originText.length > startCharLong + endCharLong) { return originText.slice(0, startCharLong) + '…' + originText.slice(-endCharLong) } else { return orig...
https://github.com/fbinba3955/Flymby
73ebbebde75473c083d4f25602d691dec2595745
github
Vincent-Leon/zotero-harmony
entry/src/main/ets/api/ZoteroClient.ets
arkts
verifyKey
GET /keys/{key}. Verifies the key and resolves the numeric userID. The userID is cached on the client for subsequent calls.
async verifyKey(): Promise<KeyVerification> { const raw = await this.send(`/keys/${this.apiKey}`, undefined); const parsed = parseKeyVerification(raw.body); this.userId = parsed.userID; return parsed; }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left verifyKey AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_ty...
async verifyKey(): Promise<KeyVerification> { const raw = await this.send(`/keys/${this.apiKey}`, undefined); const parsed = parseKeyVerification(raw.body); this.userId = parsed.userID; return parsed; }
https://github.com/Vincent-Leon/zotero-harmony
2aff7304a67bbdc9bd2124570ee81c593467443b
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/interop/js/JSRuntime.ets
arkts
getValueBoolean
================ getValue<TYPE>() ================
public static getValueBoolean(value: JSValue): boolean { JSRuntime.checkIntrinsicMethod(); }
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 getValueBoolean AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left :...
public static getValueBoolean(value: JSValue): boolean { JSRuntime.checkIntrinsicMethod(); }
https://gitcode.com/iop123123/arkts-static-skills
217dd846bff2ccacba16fe31993c5831d67cb428
gitcode
terryma2024/happyword
harmonyos/entry/src/main/ets/services/CocosBattleBridge.ets
arkts
sendStateTick
Called by the hosting page's countdown timer after engine.tick(1).
sendStateTick(): void { if (this.disposed) { return; } this.sendState(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left sendStateTick 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#L...
sendStateTick(): void { if (this.disposed) { return; } this.sendState(); }
https://github.com/terryma2024/happyword
3e5f1d0dc9699a2659b807d5fbbae127b19ae287
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/dialogs/public/WoofKeyShortcutPicker/parts/Keyboard.ets
arkts
clickAction
Called when a key is clicked. @param key The key clicked.
clickAction(key: string) { if (isModifier(key)) { // If selected, then deselect, vice versa if (this.initialSelected.includes(key)) { // Remove key from selected if (this.initialSelected.length == 2) { // Unless the value key is a function key, or we don't allow removing all ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left clickAction 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 AS...
clickAction(key: string) { if (isModifier(key)) { // If selected, then deselect, vice versa if (this.initialSelected.includes(key)) { // Remove key from selected if (this.initialSelected.length == 2) { // Unless the value key is a function key, or we don't allow removing all ...
https://github.com/awaLiny2333/LinysBrowser_NEXT
a47ce6c68da5cf9497a3b4f28c0c46cd57723473
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/app/scratchingboard/scripts/url.ets
arkts
splitToken
Splits a token (potentially containing urls) into MeowScratchingBoardData[]. @param token The token to be analyzed. @returns MeowScratchingBoardData[] @author DeepSeek Web @ May 13 2026
function splitToken(token: string): MeowScratchingBoardData[] { const urlMatch = findFirstUrlInToken(token); if (urlMatch === null) { // meow(`No URL found in token [${token}]`, 'splitToken'); return [new MeowScratchingBoardData(MeowScratchingBoardDataType.TEXT, token)]; } const url = urlMatch.url; c...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left splitToken AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left token AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Righ...
function splitToken(token: string): MeowScratchingBoardData[] { const urlMatch = findFirstUrlInToken(token); if (urlMatch === null) { // meow(`No URL found in token [${token}]`, 'splitToken'); return [new MeowScratchingBoardData(MeowScratchingBoardDataType.TEXT, token)]; } const url = urlMatch.url; c...
https://github.com/awaLiny2333/LinysBrowser_NEXT
7c7875621c19fdaea217bfef500d3e76bee1ed3b
github
CarGuo/GSYGithubAppOH
entry/src/main/ets/service/DynamicService.ets
arkts
fetchUserEvents
拉取指定用户自身行为事件,对齐 RN 端 [store/actions/event.js](../../../../../../../reactnative/GSYGithubApp/app/store/actions/event.js) `getEvent(page, login)` 走 `GET /users/:login/events`,被 BasePersonPage(MyPage / UserDetail)使用。 与 fetchReceivedEvents 共用同一份 DynamicStore 视图模型,调用方决定切换。
async fetchUserEvents(user: string, page: number): Promise<FetchReceivedResult> { if (!user || user.length === 0) { const empty: FetchReceivedResult = new FetchReceivedResult(false, 0, [], false, 'empty user'); this.store.setError(empty.msg); return empty; } const finalPage: number = pa...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left fetchUserEvents AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left user AST#identifier#Right AST...
async fetchUserEvents(user: string, page: number): Promise<FetchReceivedResult> { if (!user || user.length === 0) { const empty: FetchReceivedResult = new FetchReceivedResult(false, 0, [], false, 'empty user'); this.store.setError(empty.msg); return empty; } const finalPage: number = pa...
https://github.com/CarGuo/GSYGithubAppOH
d0ed61c8fe146b49a89b78409195dea802980537
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.buffer.ets
arkts
writeUInt32LE
Writes an unsigned 32-bit integer to the buffer at the specified offset using little-endian format @param {long} value - Value to write @param {int} [offset=0] - Number of bytes to skip before writing @returns {int} Offset plus the number of bytes written
public writeUInt32LE(value: long, offset: int = 0): int { this.checkOffset(offset, 4); this.checkValue(value, 0, (Math.pow(2, 32).toLong() - 1), "0", (Math.pow(2, 32) - 1).toString()); this.set32Litter(offset, value); return offset + 4; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left writeUInt32LE AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left long AST#identifi...
public writeUInt32LE(value: long, offset: int = 0): int { this.checkOffset(offset, 4); this.checkValue(value, 0, (Math.pow(2, 32).toLong() - 1), "0", (Math.pow(2, 32) - 1).toString()); this.set32Litter(offset, value); return offset + 4; }
https://gitcode.com/iop123123/arkts-static-skills
939d7fbb5bbe6b50a3ffa65b3dc0f437a9d909e2
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/XAxis.ets
arkts
isAvoidFirstLastClippingEnabled
returns true if avoid-first-lastclipping is enabled, false if not @return
public isAvoidFirstLastClippingEnabled(): boolean { return this.mAvoidFirstLastClipping; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isAvoidFirstLastClippingEnabled 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#boolea...
public isAvoidFirstLastClippingEnabled(): boolean { return this.mAvoidFirstLastClipping; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
cbfe47dfdadd1079606676c34fe591424b13bf9e
gitee
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test7_original_index.ets
arkts
testReduce
--- Array reduce ---
function testReduce(): number { let nums: number[] = [1, 2, 3, 4, 5]; let total: number = nums.reduce((acc: number, cur: number): number => { return acc + cur; }, 0); return total; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testReduce 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#...
function testReduce(): number { let nums: number[] = [1, 2, 3, 4, 5]; let total: number = nums.reduce((acc: number, cur: number): number => { return acc + cur; }, 0); return total; }
https://github.com/miaochiahao/ark-ghidra
2aa582ed25aa223d7aafe752229c17ba06c68c2c
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeSet.ets
arkts
getLowerValue
Return the lower value of the given key's element in the TreeSet @param key:the key of the element which will be get the lower value @returns the lower value of the given key's element if exists or undefined
getLowerValue(key: T): T | undefined { return this.treeMap.getLowerKey(key); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLowerValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#...
getLowerValue(key: T): T | undefined { return this.treeMap.getLowerKey(key); }
https://gitcode.com/iop123123/arkts-static-skills
5775bd8137c9bcf695a11f9334a32c025a1ffb3b
gitcode
openharmony/xts_tools
sample/AppSampleF/entry/src/main/ets/model/CameraModel.ets
arkts
scanCode
扫描二维码 @param w,h
async scanCode(w: number, h: number) { try { let qrCode: QRCode = new QRCode(); let wh: ImageWH = { width: w, height: h } let text: string = await qrCode.decode(this.pixelMap as image.PixelMap, wh); Logger.info(TAG, 'text==JSON.stringify===' + JSON.stringify(text)) ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left scanCode AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left w AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Rig...
async scanCode(w: number, h: number) { try { let qrCode: QRCode = new QRCode(); let wh: ImageWH = { width: w, height: h } let text: string = await qrCode.decode(this.pixelMap as image.PixelMap, wh); Logger.info(TAG, 'text==JSON.stringify===' + JSON.stringify(text)) ...
https://gitee.com/openharmony/xts_tools.git
1f849ae35a2d5165dec0a9fb0821340fd9d2ad70
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/SettingsBackupService.ets
arkts
reloadInMemoryState
导入后重新加载内存状态 清除 NvHttp 缓存、重新加载 ComputerManager 的电脑列表, 避免后台轮询用旧的内存状态覆盖已恢复的持久化数据。
private static async reloadInMemoryState(): Promise<void> { try { // 1. 清除 NvHttp 的 uniqueId 静态缓存,下次请求从文件重读 NvHttp.clearCachedUniqueId(); // 2. 重新加载 ComputerManager 的电脑列表 const mgr = ComputerManager.getInstance(); await mgr.reloadFromPersistence(); console.info(`${TAG} 内存状态已重...
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 reloadInMemoryState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#a...
private static async reloadInMemoryState(): Promise<void> { try { // 1. 清除 NvHttp 的 uniqueId 静态缓存,下次请求从文件重读 NvHttp.clearCachedUniqueId(); // 2. 重新加载 ComputerManager 的电脑列表 const mgr = ComputerManager.getInstance(); await mgr.reloadFromPersistence(); console.info(`${TAG} 内存状态已重...
https://github.com/AlkaidLab/moonlight-harmony
cb05d1b28b48f50d404760d99388b055b8872b50
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
reverse
Creates a new Float64Array using reversed data from the current one @returns a new Float64Array using reversed data from the current one
public reverse(): Float64Array { let res = new Float64Array(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 Float64Array A...
public reverse(): Float64Array { let res = new Float64Array(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
fa5b44b7cd0211c616097b1d9aeaa569ea7b63b0
gitee
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/ThemeUtil.ets
arkts
isDarkMode
检查是否为深色模式
static isDarkMode(): boolean { try { // 鸿蒙系统深色模式检测 const colorMode = display.getDarkMode(); return colorMode === display.DarkMode.DARK; } catch (error) { console.warn('无法检测系统深色模式:', error); return false; } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isDarkMode 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#bo...
static isDarkMode(): boolean { try { // 鸿蒙系统深色模式检测 const colorMode = display.getDarkMode(); return colorMode === display.DarkMode.DARK; } catch (error) { console.warn('无法检测系统深色模式:', error); return false; } }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
8c24141032107142aeac70fab8d61b3262047e6d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceAntiCrawler.ets
arkts
detectAntiCrawler
检测当前页面是否存在反爬虫机制
async detectAntiCrawler(): Promise<AntiCrawlerResult> { try { logger.debug(TAG, '开始检测反爬虫机制'); // 获取页面内容 const pageContent = await this.getPageContent(); const pageTitle = await this.getPageTitle(); const currentUrl = await this.getCurrentUrl(); // 检测Cloudflare if (this....
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left detectAntiCrawler 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#:#Rig...
async detectAntiCrawler(): Promise<AntiCrawlerResult> { try { logger.debug(TAG, '开始检测反爬虫机制'); // 获取页面内容 const pageContent = await this.getPageContent(); const pageTitle = await this.getPageTitle(); const currentUrl = await this.getCurrentUrl(); // 检测Cloudflare if (this....
https://github.com/DaLongZhuaZi/manxia
5534a9922340d4c052ef050ad8c789d9946eca4e
github
Cool_foolisher1/ArkTSRepository
RandomNumberSimulator/entry/src/main/ets/components/random/RandomNumber.ets
arkts
styleInternalRow
设置内部Row的样式 @param width 宽
@Extend(Row) function styleInternalRow(width: Length) { .width(width) .alignItems(VerticalAlign.Center) .borderRadius(10) .margin({ top: 25, bottom: 10 }) .border({ width: 2, color: $r('app.color.light_blue') }) .backgroundColor($r('app.color.lightest_blue')) }
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 Row AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri...
@Extend(Row) function styleInternalRow(width: Length) { .width(width) .alignItems(VerticalAlign.Center) .borderRadius(10) .margin({ top: 25, bottom: 10 }) .border({ width: 2, color: $r('app.color.light_blue') }) .backgroundColor($r('app.color.lightest_blue')) }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
06d5b3d70bd7321502e38cef74ee039f1621a30c
gitcode
codelably/HCompass
core/spatialization/src/main/ets/util/MaterialUtil.ets
arkts
getMaterialOptions
为 Menu/Dialog 选项注入材质效果(API 23 原样返回,API 26+ 可注入 systemMaterial) @param option 原始选项对象 @returns 选项对象
public static getMaterialOptions<T>(option: T): T { return option; }
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 getMaterialOptions AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#...
public static getMaterialOptions<T>(option: T): T { return option; }
https://github.com/codelably/HCompass
2851118a4e64af164aa2d5e3a07f9e4380b33055
github
FinalScave/SweetLine
platform/OHOS/demo/src/main/ets/pages/ResourceUtils.ets
arkts
getString
Get string resource
static async getString(context: Context | undefined, resourceId: number): Promise<string> { try { if (context == undefined) { return ''; } const resourceMgr: resourceManager.ResourceManager = context.resourceManager; return await resourceMgr.getStringValue(resourceId); } catch ...
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 getString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#...
static async getString(context: Context | undefined, resourceId: number): Promise<string> { try { if (context == undefined) { return ''; } const resourceMgr: resourceManager.ResourceManager = context.resourceManager; return await resourceMgr.getStringValue(resourceId); } catch ...
https://github.com/FinalScave/SweetLine
b87794146c7c3ff1c5ca7ae95188ab58a19220b1
github
DaLongZhuaZi/manxia
entry/src/main/ets/MyAbilityStage.ets
arkts
onMemoryLevel
💾 内存不足时调用
onMemoryLevel(level: number): void { AppStorage.setOrCreate(MEMORY_WARNING_LEVEL_KEY, level); AppStorage.setOrCreate(MEMORY_WARNING_TIME_KEY, Date.now()); logger.warn('MyAbilityStage', `⚠️ 内存警告: 级别${level}`); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onMemoryLevel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) ...
onMemoryLevel(level: number): void { AppStorage.setOrCreate(MEMORY_WARNING_LEVEL_KEY, level); AppStorage.setOrCreate(MEMORY_WARNING_TIME_KEY, Date.now()); logger.warn('MyAbilityStage', `⚠️ 内存警告: 级别${level}`); }
https://github.com/DaLongZhuaZi/manxia
4fa60f288fc653959b73a0df0503cf1354935e2d
github
aimilin6688/KeePassHO
entry/src/main/ets/storage/onedrive/OneDriveClient.ets
arkts
parseResourceList
解析资源列表信息 @param data API响应数据(包含 value 数组) @returns OneDriveResource[] 资源信息列表
public parseResourceList(data: Record<string, Object>): OneDriveResource[] { const resources: OneDriveResource[] = []; try { // 检查是否有 value 数组 const value = data['value']; if (value && Array.isArray(value)) { for (const item of value as Array<Object>) { const itemData = it...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left parseResourceList 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#instantiation_...
public parseResourceList(data: Record<string, Object>): OneDriveResource[] { const resources: OneDriveResource[] = []; try { // 检查是否有 value 数组 const value = data['value']; if (value && Array.isArray(value)) { for (const item of value as Array<Object>) { const itemData = it...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/onedrive/OneDriveClient.ets#L671-L691
6a3fae544a399ec0ebf42070eea4d59374c30503
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/app/tabs/classes/meowTabInfo.ets
arkts
updateSlimUA
Updates the slim state and use the slim UA if possible.
updateSlimUA() { // Do nothing if the tab is already set an override UA. if (this.overrideUA != undefined) { return; } const ua4s = userAgent4Slim(); if (!ua4s) { return; } // Change UA according to slim UA. if (this.myUi.myLayout.wideMode) { if (this.inSlim) { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateSlimUA AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ...
updateSlimUA() { // Do nothing if the tab is already set an override UA. if (this.overrideUA != undefined) { return; } const ua4s = userAgent4Slim(); if (!ua4s) { return; } // Change UA according to slim UA. if (this.myUi.myLayout.wideMode) { if (this.inSlim) { ...
https://github.com/awaLiny2333/LinysBrowser_NEXT
24aed20acf3a6de9d9395e6f271f901cb1854ecb
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
getFollowingSiblings
获取后续兄弟元素
private getFollowingSiblings(element: string, tag: string, fullContent: string): string[] { const results: string[] = []; const elementIndex = fullContent.indexOf(element); if (elementIndex === -1) return results; const afterContent = fullContent.substring(elementIndex + element.length); cons...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getFollowingSiblings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS...
private getFollowingSiblings(element: string, tag: string, fullContent: string): string[] { const results: string[] = []; const elementIndex = fullContent.indexOf(element); if (elementIndex === -1) return results; const afterContent = fullContent.substring(elementIndex + element.length); cons...
https://github.com/DaLongZhuaZi/manxia
3d1d20250632dc741aa8223960b51c4ee3e93d75
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/AxisBase.ets
arkts
setGranularityEnabled
Enabled/disable granularity control on axis value intervals. If enabled, the axis interval is not allowed to go below a certain granularity. Default: false @param enabled
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setGranularityEnabled 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#identif...
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
7ea6f57bf4d4c0aa3b54cee00e2db23c0d35ad9a
gitee
fbinba3955/Flymby
common/src/main/ets/utils/DateUtil.ets
arkts
formatTimestamp
格式化时间戳 @param timestamp 时间戳(毫秒) @param format 格式字符串 @returns 格式化的时间字符串
static formatTimestamp(timestamp: number, format: string): string { const date = new Date(timestamp); switch (format) { case 'HH:mm': return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; case 'HH:mm:ss': return `${date.getHo...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatTimestamp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left timestamp AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numb...
static formatTimestamp(timestamp: number, format: string): string { const date = new Date(timestamp); switch (format) { case 'HH:mm': return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; case 'HH:mm:ss': return `${date.getHo...
https://github.com/fbinba3955/Flymby
c21c6a78fd77ed367a81f082044b962bdd4240d4
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/UserInfoRepository.ets
arkts
updatePassword
更新用户密码 @param {Record<string, string>} params - 修改密码参数 @returns {Promise<NetworkResponse<Unknown>>} 更新结果
async updatePassword(params: Record<string, string>): Promise<NetworkResponse<Unknown>> { return this.networkDataSource.updatePassword(params); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updatePassword AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left ...
async updatePassword(params: Record<string, string>): Promise<NetworkResponse<Unknown>> { return this.networkDataSource.updatePassword(params); }
https://github.com/Joker-x-dev/CoolMallArkTS
f5ed2b97327fe0dbf5111945e8974fa8cbe53141
github
751496032/ZRouter
RouterApi/src/main/ets/api/Router.ets
arkts
popToRootWithResult
@deprecated @see {ZRouter.getInstance().popToRootWithResult} @param result @param animated
public static popToRootWithResult<T>(result: T, animated: boolean = true) { ZRouter.getRouterMgr().popToRootWithResult<T>(result, animated) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left popToRootWithResult AST#identifier#Right AST#<#Left <...
public static popToRootWithResult<T>(result: T, animated: boolean = true) { ZRouter.getRouterMgr().popToRootWithResult<T>(result, animated) }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L478-L480
df0ac3a6e336da41e6244139520d831ded23fbe9
github
LongLiveY96/chatcube
entry/src/main/ets/services/PreferencesService.ets
arkts
setNotifyEnabled
设置通知总开关
async setNotifyEnabled(enabled: boolean): Promise<void> { await this.setBoolean(PreferenceKeys.NOTIFY_ENABLED, enabled) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setNotifyEnabled AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left enabled AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async setNotifyEnabled(enabled: boolean): Promise<void> { await this.setBoolean(PreferenceKeys.NOTIFY_ENABLED, enabled) }
https://github.com/LongLiveY96/chatcube
4fe3eab9cee6df48dd7ed2efef5799c119f7ec0c
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/pages/AccountManagement.ets
arkts
getTypeLabel
辅助函数:根据类型获取图标或名称
getTypeLabel(type: string): string { const map: Record<string, string> = { 'cash': '现金', 'bank': '银行卡', 'credit_card': '信用卡', 'other': '其他' }; return map[type] || type; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getTypeLabel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AS...
getTypeLabel(type: string): string { const map: Record<string, string> = { 'cash': '现金', 'bank': '银行卡', 'credit_card': '信用卡', 'other': '其他' }; return map[type] || type; }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
fb2bb5670baf97e32870fd17fca15c63e6122d9b
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
find
Finds the first element in the Int32Array that satisfies the condition @param fn the condition to apply for each element @returns the first element that satisfies fn TODO: return int | undefined as in JS
public find(fn: (val: int, index: int, array: Int32Array) => boolean): int { for (let i = 0; i < this.length; ++i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Int32Array.find: not implemented if element wa...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left find AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ...
public find(fn: (val: int, index: int, array: Int32Array) => boolean): int { for (let i = 0; i < this.length; ++i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Int32Array.find: not implemented if element wa...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
ca456f51b90d7390380719b0c39d8779d56c0843
gitee
fa223797/Harmonyos-notebook
entry/src/main/ets/viewmodel/TaskParameModel.ets
arkts
constructor
因为谁都有可能用,未来传参的时候这个就做成“范形”传参,t代表啥类型都可以
constructor(value:T) { this.value = value }
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#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right AST#ERROR#Right AST#)...
constructor(value:T) { this.value = value }
https://github.com/fa223797/Harmonyos-notebook
bb152149bbd87615f1eef3b39d3a92256ffccea0
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/EventSourcing.ets
arkts
createEventTypeStats
创建事件类型统计
static createEventTypeStats(eventType: string, count: number): EventTypeStats { const result: EventTypeStats = { eventType: eventType, count: count }; return result; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createEventTypeStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left eventType AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST...
static createEventTypeStats(eventType: string, count: number): EventTypeStats { const result: EventTypeStats = { eventType: eventType, count: count }; return result; }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
003d590b572927468c641de0ddc4abd2332e466d
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/utils/PlaySpeedManager.ets
arkts
resetToDefault
重置为默认速度
async resetToDefault(): Promise<void> { await this.setPlaySpeed(PlaySpeedManager.DEFAULT_SPEED) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left resetToDefault 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#gener...
async resetToDefault(): Promise<void> { await this.setPlaySpeed(PlaySpeedManager.DEFAULT_SPEED) }
https://github.com/SMAT-Lab/PhantomRendering
4a57c9c40bc6f43649d912927dd354329d874f7a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectMethod.ets
arkts
getReturnType
Gets the return type of the method. @returns { Class } Returns the Class object representing the method's return type.
public getReturnType(): Class { return Method.getReturnTypeImpl(this.methodPtr)! }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getReturnType 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 Class AS...
public getReturnType(): Class { return Method.getReturnTypeImpl(this.methodPtr)! }
https://gitcode.com/iop123123/arkts-static-skills
b86b18df28b0f7385872b686279f6235922c68ae
gitcode
codelably/HCompass
core/di/src/main/ets/ServiceContainer.ets
arkts
register
注册服务 @template T 服务类型 @param key 服务标识符 @param factory 服务工厂函数 @param options 注册选项
register<T>(key: ServiceKey, factory: ServiceFactory<T>, options?: ServiceOptions): void { const singleton = options?.singleton !== false; // 默认为单例 const descriptor: ServiceDescriptor<T> = { factory, singleton, instance: undefined }; this.services.set(key, descriptor as ServiceDescri...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left register AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#ERROR#Left AST#formal_parameters#Left AST#(#...
register<T>(key: ServiceKey, factory: ServiceFactory<T>, options?: ServiceOptions): void { const singleton = options?.singleton !== false; // 默认为单例 const descriptor: ServiceDescriptor<T> = { factory, singleton, instance: undefined }; this.services.set(key, descriptor as ServiceDescri...
https://github.com/codelably/HCompass
0a9a0f145874f90359b0261531e07f4caa19d2e5
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
downloadEBookWithCookies
使用 HTTP 下载电子书并携带 cookies 适用于需要认证的图源(如 ZLibrary) 包含重试逻辑以应对临时 503 错误
private async downloadEBookWithCookies(url: string, filePath: string, sourceId: number, bookUrl?: string): Promise<void> { const cookieManager = CookieManager.getInstance(); const cookieStr = await cookieManager.getCookieStringForUrl(sourceId, url); // 使用真实的浏览器 headers 以通过反爬检查 const buildHeaders = ()...
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 downloadEBookWithCookies AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST...
private async downloadEBookWithCookies(url: string, filePath: string, sourceId: number, bookUrl?: string): Promise<void> { const cookieManager = CookieManager.getInstance(); const cookieStr = await cookieManager.getCookieStringForUrl(sourceId, url); // 使用真实的浏览器 headers 以通过反爬检查 const buildHeaders = ()...
https://github.com/DaLongZhuaZi/manxia
abf661c9f6b5d7ac8ee58b2a9544277cfe7d8919
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/PieDataSet.ets
arkts
getValueLinePart1OffsetPercentage
When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size @Override
public getValueLinePart1OffsetPercentage(): number { return this.mValueLinePart1OffsetPercentage; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValueLinePart1OffsetPercentage 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#numb...
public getValueLinePart1OffsetPercentage(): number { return this.mValueLinePart1OffsetPercentage; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
60c5f04a5f1a41ed284658def84ffd59dc6fe372
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamWindowManager.ets
arkts
registerWindowSizeListener
注册窗口大小变化监听器
private registerWindowSizeListener(win: window.Window): void { this.unregisterWindowSizeListener(win); this.windowSizeChangeHandler = (_size: window.Size) => { this.notifyWindowSizeChanged(); }; try { win.on('windowSizeChange', this.windowSizeChangeHandler); } catch (_e) {} }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerWindowSizeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left win AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#mem...
private registerWindowSizeListener(win: window.Window): void { this.unregisterWindowSizeListener(win); this.windowSizeChangeHandler = (_size: window.Size) => { this.notifyWindowSizeChanged(); }; try { win.on('windowSizeChange', this.windowSizeChangeHandler); } catch (_e) {} }
https://github.com/AlkaidLab/moonlight-harmony
30d14f5473dca005546279338b1680a4188084fa
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/components/VideoComp.ets
arkts
onVideoPause
在视频暂停时触发
onVideoPause() { emitter.on(Constants.GLOBAL_VIDEO_CONTROLLER_PAUSE, () => { this.pauseVideo() }) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onVideoPause AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ...
onVideoPause() { emitter.on(Constants.GLOBAL_VIDEO_CONTROLLER_PAUSE, () => { this.pauseVideo() }) }
https://github.com/SMAT-Lab/PhantomRendering
26f7a07b2f3740ce86a9d937cd94f15a8260391d
github
Nekofox-POT/LinMusic
entry/src/main/ets/package/audio_player/by_ffmpeg_player.ets
arkts
ffmpeg_callback
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 回调函数 // ////////// 准备就绪回调 //
private ffmpeg_callback() { // 准备就绪回调 // nativeModule.register_ready_callback(() => { this.set_player_ready?.() }) // 播放状态回调 // nativeModule.register_status_callback((status: string) => { this.play_status_update?.(status) }) // 播放进度回调 // nativeModule.register_time_callba...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left ffmpeg_callback 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#{#L...
private ffmpeg_callback() { // 准备就绪回调 // nativeModule.register_ready_callback(() => { this.set_player_ready?.() }) // 播放状态回调 // nativeModule.register_status_callback((status: string) => { this.play_status_update?.(status) }) // 播放进度回调 // nativeModule.register_time_callba...
https://github.com/Nekofox-POT/LinMusic
ee82b822d8b79efdf8270cb14a1e9e4e8a228b3c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Tracking/TrackingManager.ets
arkts
markAsFailed
标记记录同步失败
public async markAsFailed(contentId: string, trackerId: TrackerId): Promise<boolean> { return this.updateTrackRecord(contentId, trackerId, { syncStatus: SyncStatus.FAILED }); }
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 markAsFailed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left contentId AST#identifier#Right AST#ERROR#Left AST#:#Left :...
public async markAsFailed(contentId: string, trackerId: TrackerId): Promise<boolean> { return this.updateTrackRecord(contentId, trackerId, { syncStatus: SyncStatus.FAILED }); }
https://github.com/DaLongZhuaZi/manxia
b3135bee2d1bdcddb847c1fb37f3eb1c29912d8c
github
offlinecat-dev/OCNetORM
src/main/ets/database/DatabaseManager.ets
arkts
getConfig
获取当前数据库配置 @returns 数据库配置,如果未初始化返回 null
getConfig(): DatabaseConfig | null { return this.config }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getConfig 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 AST#identifier#Left DatabaseConfig AST#identi...
getConfig(): DatabaseConfig | null { return this.config }
https://github.com/offlinecat-dev/OCNetORM
aefdaa44b4881a7b8f82ca156bc7ae200cdc72e3
github
HarmonyOS_Codelabs/arkts-intermediate-syntax
entry/src/main/ets/services/LocalDeviceService.ets
arkts
getLocations
获取所有位置(自动去重) @returns string[] 位置列表
getLocations(): string[] { return [...this.locations]; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLocations 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#string#Left string AST#string#Right AST#ERROR#Righ...
getLocations(): string[] { return [...this.locations]; }
https://gitcode.com/HarmonyOS_Codelabs/arkts-intermediate-syntax
cd1bbcb13ea0767cd199642a12c20021eed6e60f
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
removeBrowseHistory
删除单条历史浏览记录
async removeBrowseHistory(sourceId: string, bookUrl: string): Promise<void> { const key = `${sourceId}_${bookUrl}`; this.browseHistory = this.browseHistory.filter(h => `${h.sourceId}_${h.bookUrl}` !== key ); await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.BROWSE_HISTORY, this.browseHistor...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left removeBrowseHistory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#...
async removeBrowseHistory(sourceId: string, bookUrl: string): Promise<void> { const key = `${sourceId}_${bookUrl}`; this.browseHistory = this.browseHistory.filter(h => `${h.sourceId}_${h.bookUrl}` !== key ); await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.BROWSE_HISTORY, this.browseHistor...
https://github.com/DaLongZhuaZi/manxia
091100f48dc71d24be1f6fcfc273f7625f7d3f7c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets
arkts
sub
Performs floating point subtraction of this instance with provided one, returns the result as new instance @param { Double } other Right hand side of the subtraction @returns { Double } Result of the subtraction @syscap SystemCapability.Utils.Lang @FaAndStageModel
public sub(other: Double): Double { return new Double((this.value - other.toDouble()) as double) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sub AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public sub(other: Double): Double { return new Double((this.value - other.toDouble()) as double) }
https://gitcode.com/iop123123/arkts-static-skills
4ef5f1a539ae44fd3c1d199364091247f66c3e99
gitcode
HarmonyOS_Samples/sample_in_harmonyos
common/src/main/ets/trackmanager/TrackManager.ets
arkts
getParentFrameNode
Get the actual parent click node. @param node @returns
public getParentFrameNode(node: FrameNode): FrameNode | null { if (node === null) { return null; } if (node?.getCustomProperty(TRACK_KEY)) { return node; } return this.getParentFrameNode(node?.getParent() as FrameNode); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getParentFrameNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left node AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public getParentFrameNode(node: FrameNode): FrameNode | null { if (node === null) { return null; } if (node?.getCustomProperty(TRACK_KEY)) { return node; } return this.getParentFrameNode(node?.getParent() as FrameNode); }
https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos
4cdc77bec5d67a1bf21baa7acdb163928b1e0bea
gitcode
OHPG/FinSdk
jellyfin/src/main/ets/api/UserApi.ets
arkts
getCurrentUser
getCurrentUser @summary Gets the user based on auth token. @throws {RequiredError} @memberof UserApi
public async getCurrentUser(): Promise<UserDto> { return this.apiClient.get({ path: "/Users/Me" }) }
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 getCurrentUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:...
public async getCurrentUser(): Promise<UserDto> { return this.apiClient.get({ path: "/Users/Me" }) }
https://github.com/OHPG/FinSdk
f44ba0eeafc40b34eebe7fb90e169f3bbd085306
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/TaskExecutor.ets
arkts
resumeTask
恢复等待中的任务
async resumeTask(taskId: string, userInput?: Record<string, Object | undefined>): Promise<void> { const context = this.runningTasks.get(taskId); if (context && context.status === TaskStatus.WAITING) { // 合并用户输入 if (userInput) { const inputKeys = Object.keys(userInput); for (let i =...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left resumeTask AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left taskId AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS...
async resumeTask(taskId: string, userInput?: Record<string, Object | undefined>): Promise<void> { const context = this.runningTasks.get(taskId); if (context && context.status === TaskStatus.WAITING) { // 合并用户输入 if (userInput) { const inputKeys = Object.keys(userInput); for (let i =...
https://github.com/DaLongZhuaZi/manxia
06aa7c2e1d21062dd39c89c16e268a209f4832e3
github
erosTeam/NextE
shared/src/main/ets/network/EhApiService.ets
arkts
postProfileAction
Profile action on uconfig.php (eros_fe postEhProfile): action '' = select, 'create' / 'rename' / 'delete' / 'default'. profileSet is the profile value; name is for create/rename. Returns the re-parsed config for the resulting active profile.
async postProfileAction( isEx: boolean, action: string, profileSet: string, name: string, ): Promise<EhProfileSettings> { const url: string = `${EhConstants.baseUrl(isEx)}/uconfig.php` const pairs: string[] = [this.formPair('profile_action', action)] if (name.length > 0) { pairs.pu...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left postProfileAction AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left isEx AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async postProfileAction( isEx: boolean, action: string, profileSet: string, name: string, ): Promise<EhProfileSettings> { const url: string = `${EhConstants.baseUrl(isEx)}/uconfig.php` const pairs: string[] = [this.formPair('profile_action', action)] if (name.length > 0) { pairs.pu...
https://github.com/erosTeam/NextE
1d471eb40a224aba2ebbc001787684e99520816e
github
xblLab/HarmonyProjectTemplate
commons/lib_common/src/main/ets/utils/FileUtils.ets
arkts
getCache
读取缓存大小,单位Byte
static getCache() { return storageStatistics.getCurrentBundleStats().then((bundleStats: storageStatistics.BundleStats) => { Logger.info(TAG, 'getCurrentBundleStats successfully:' + JSON.stringify(bundleStats)); Logger.info(TAG, 'appSize :' + bundleStats.appSize); Logger.info(TAG, 'cacheSize :' +...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCache 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#...
static getCache() { return storageStatistics.getCurrentBundleStats().then((bundleStats: storageStatistics.BundleStats) => { Logger.info(TAG, 'getCurrentBundleStats successfully:' + JSON.stringify(bundleStats)); Logger.info(TAG, 'appSize :' + bundleStats.appSize); Logger.info(TAG, 'cacheSize :' +...
https://github.com/xblLab/HarmonyProjectTemplate
ee4ecaca7c1460b8a617fafd0478528b12fd8503
github
LJ666-ui/harmony-health-care
entry/src/main/ets/components/charts/base/BaseChart.ets
arkts
setData
更新数据 @param newData 新数据
public setData(newData: ChartData<T>): void { this.data = newData; this.notifyDataChange(); this.refresh(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_express...
public setData(newData: ChartData<T>): void { this.data = newData; this.notifyDataChange(); this.refresh(); }
https://github.com/LJ666-ui/harmony-health-care
f9efdf6d9c58ec642277e78cf7c3d20dbba33b0d
github
dingzhilin1990/zhilinclaw
src/agents/AgentBase.ets
arkts
callAI
调用 AI 模型生成响应
protected async callAI(prompt: string, systemPrompt?: string): Promise<string> { if (!this.aiModelAdapter) { this.log('警告:未设置 AI 模型适配器,使用模拟响应'); return this.getSimulatedResponse(prompt); } try { const messages: ChatMessage[] = []; if (systemPrompt || this.config.systemPromp...
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left callAI AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left prompt AST#identifier#Right AST#:#Left :...
protected async callAI(prompt: string, systemPrompt?: string): Promise<string> { if (!this.aiModelAdapter) { this.log('警告:未设置 AI 模型适配器,使用模拟响应'); return this.getSimulatedResponse(prompt); } try { const messages: ChatMessage[] = []; if (systemPrompt || this.config.systemPromp...
https://github.com/dingzhilin1990/zhilinclaw
aba2f881af214b7cfe5c0a7889187a7542232d1b
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamingSession.ets
arkts
initializeNative
--------------------------------------------------------------------------- 内部 — Native 初始化 ---------------------------------------------------------------------------
private async initializeNative(): Promise<void> { console.info('初始化 Native 模块'); const callbacks: StreamCallbacks = { drSetup: (videoFormat: number, width: number, height: number, redrawRate: number): void => { const actualCodec = StreamingSession.detectCodec(videoFormat); const actualH...
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 initializeNative AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ...
private async initializeNative(): Promise<void> { console.info('初始化 Native 模块'); const callbacks: StreamCallbacks = { drSetup: (videoFormat: number, width: number, height: number, redrawRate: number): void => { const actualCodec = StreamingSession.detectCodec(videoFormat); const actualH...
https://github.com/AlkaidLab/moonlight-harmony
77976c6424af696b4e8546d6987988e387c1ae32
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
valueOf
Returns the object itself @returns { Float64Array } @syscap SystemCapability.Utils.Lang @FaAndStageModel
public valueOf(): Float64Array { return this }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left valueOf 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 Float64Array A...
public valueOf(): Float64Array { return this }
https://gitcode.com/iop123123/arkts-static-skills
a904da46c9aae330150bae2db5f78bb8981c9b2c
gitcode
arkui-x/samples
CodeLab/Cases/feature/foldablescreencases/src/main/ets/model/AVPlayerModel.ets
arkts
seek
跳跃播放 @param timeMs 跳跃到歌曲的毫秒时间点 @returns {void}
seek(timeMs: number): void { if (!this.avPlayer) { logger.error('avPlayer no create.'); return; } this.avPlayer.seek(timeMs); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left seek AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left timeMs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Ri...
seek(timeMs: number): void { if (!this.avPlayer) { logger.error('avPlayer no create.'); return; } this.avPlayer.seek(timeMs); }
https://gitcode.com/arkui-x/samples
9d5731578ca9ac3d985135fe202680e7672bcb5b
gitcode
openharmony-sig/applications_calculator
common/src/main/ets/util/CommonUtil.ets
arkts
checkFoldIsFolded
Check whether the foldable phone is folded. @return {boolean} Whether the foldable phone is folded.
static checkFoldIsFolded(): boolean { return display.getFoldStatus() === FOLD_STATUS_FOLDED; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkFoldIsFolded 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...
static checkFoldIsFolded(): boolean { return display.getFoldStatus() === FOLD_STATUS_FOLDED; }
https://gitee.com/openharmony-sig/applications_calculator.git
8e82c4434a20cf73459f26802e8f06fe11aca9f8
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/PreferencesUtil.ets
arkts
init
初始化(需要在应用启动时调用)
static init(context: Context): void { PreferencesUtil.contextRef = context; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#E...
static init(context: Context): void { PreferencesUtil.contextRef = context; }
https://github.com/AlkaidLab/moonlight-harmony
e744e92ed70e99d17915726542af342a6e981cdb
github
ZestBox-18/kitebook-frontend
commons/base/src/main/ets/utils/DebounceManager.ets
arkts
shouldBlock
阻塞防抖:检查方法是否应该被阻止执行 @param methodName 方法名称 @param delayMs 防抖时间(毫秒) @returns true表示应该被阻止,false表示可以执行
public shouldBlock(methodName: string, delayMs: number): boolean { const now = Date.now(); const lastExecutionTime = DebounceManager.methodsMap.get(methodName); if (lastExecutionTime && (now - lastExecutionTime) < delayMs) { console.info(`[DebounceManager] ${methodName}方法在${delayMs}毫秒内已执行过,跳过`); ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left shouldBlock AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left methodName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#...
public shouldBlock(methodName: string, delayMs: number): boolean { const now = Date.now(); const lastExecutionTime = DebounceManager.methodsMap.get(methodName); if (lastExecutionTime && (now - lastExecutionTime) < delayMs) { console.info(`[DebounceManager] ${methodName}方法在${delayMs}毫秒内已执行过,跳过`); ...
https://github.com/ZestBox-18/kitebook-frontend
33a8a3ac1c962586274c8386c59101e7e5ee9f13
github
AGenUI/AGenUI
platforms/harmony/agenui/src/main/ets/agenui/bridge/MeasurementManager.ets
arkts
register
Register measurement callback for a specified component type @param type Component type string (e.g. "Text", "Image", "Table") @param handler Measurement callback function
register(type: string, handler: MeasurementHandler): void { // Adapt handler to the format expected by NAPI side (pass through parameters directly) const wrappedHandler = ( paramJson: string, widthMode: number, maxWidth: number, heightMode: number, maxHeight: number ): Measur...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left register AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#...
register(type: string, handler: MeasurementHandler): void { // Adapt handler to the format expected by NAPI side (pass through parameters directly) const wrappedHandler = ( paramJson: string, widthMode: number, maxWidth: number, heightMode: number, maxHeight: number ): Measur...
https://github.com/AGenUI/AGenUI
c270b8d795ce5709623200a98ff150090f6ea928
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/ChartData.ets
arkts
getXMax
Returns the maximum x-value this data object contains. @return
public getXMax(): number { return this.mXMax; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getXMax AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#...
public getXMax(): number { return this.mXMax; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
7be9befc93a07359c8470b0b89613970b3049cb5
gitee
wuba/omni-ui
omni_component/src/main/ets/components/guide/core/Controller.ets
arkts
_onGuideDisAppear
私有方法,不建议用户使用:用于组件通知Controller控制器当前组件是否移除
_onGuideDisAppear(): void { hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'Component mask and indicator: aboutToDisAppear'); this.isGuideShowing = false; this.isGuideAppear = false; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left _onGuideDisAppear 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_...
_onGuideDisAppear(): void { hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'Component mask and indicator: aboutToDisAppear'); this.isGuideShowing = false; this.isGuideAppear = false; }
https://github.com/wuba/omni-ui
2feb61bf1a1fa6e6cd26a2a68e24426a99d7c93f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
assignableFrom
Checks if a type is assignable to this enum type @param {Type} other Type to check @returns {boolean} True if type is assignable @syscap SystemCapability.Utils.Lang @FaAndStageModel
public override assignableFrom(other: Type): boolean { if (super.assignableFrom(other)) { return true } if (!(other instanceof EnumType)) { return false } let rt = other as EnumType return this.getName() == rt.getName() }
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 assignableFrom AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left ...
public override assignableFrom(other: Type): boolean { if (super.assignableFrom(other)) { return true } if (!(other instanceof EnumType)) { return false } let rt = other as EnumType return this.getName() == rt.getName() }
https://gitcode.com/iop123123/arkts-static-skills
40d915e98ef96dc8ce8954fbf109e140404c275a
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test8_original_index.ets
arkts
testRecordAccess
--- Record access pattern ---
function testRecordAccess(): string { let rec: Record<string, string> = {}; rec['regular'] = 'normal'; rec['extra'] = 'value'; return rec['regular'] + '|' + rec['extra']; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testRecordAccess AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined...
function testRecordAccess(): string { let rec: Record<string, string> = {}; rec['regular'] = 'normal'; rec['extra'] = 'value'; return rec['regular'] + '|' + rec['extra']; }
https://github.com/miaochiahao/ark-ghidra
ba7ceef2b69c0af36e4f7e5770ae17f0988a438c
github
tdcare/tdwebrtc
src/main/ets/AudioCapture.ets
arkts
getSampleRateEnum
将数字采样率映射到枚举值
private getSampleRateEnum(rate: number): audio.AudioSamplingRate { if (rate === 8000) return audio.AudioSamplingRate.SAMPLE_RATE_8000; if (rate === 11025) return audio.AudioSamplingRate.SAMPLE_RATE_11025; if (rate === 12000) return audio.AudioSamplingRate.SAMPLE_RATE_12000; if (rate === 16000) return ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getSampleRateEnum AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rate AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
private getSampleRateEnum(rate: number): audio.AudioSamplingRate { if (rate === 8000) return audio.AudioSamplingRate.SAMPLE_RATE_8000; if (rate === 11025) return audio.AudioSamplingRate.SAMPLE_RATE_11025; if (rate === 12000) return audio.AudioSamplingRate.SAMPLE_RATE_12000; if (rate === 16000) return ...
https://github.com/tdcare/tdwebrtc
00a3c4f02932ab88937a448424bbc529d5306aaa
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/UnifiedDownloadManager.ets
arkts
clearCompletedTasks
清理已完成的任务
public clearCompletedTasks(): number { const completedIds: string[] = []; const completedTaskIds = this.taskIdsByStatus.get(UnifiedTaskStatus.COMPLETED); if (completedTaskIds) { for (const taskId of completedTaskIds) { completedIds.push(taskId); } } completedIds.forEach(id...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearCompletedTasks 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...
public clearCompletedTasks(): number { const completedIds: string[] = []; const completedTaskIds = this.taskIdsByStatus.get(UnifiedTaskStatus.COMPLETED); if (completedTaskIds) { for (const taskId of completedTaskIds) { completedIds.push(taskId); } } completedIds.forEach(id...
https://github.com/DaLongZhuaZi/manxia
c2ea9a384096adb1e7b6fa7dea112b35d1c7e4ba
github
harmonyos/codelabs
HarmonyOS_NEXT/LoginDemo/entry/src/main/ets/common/utils/CommonUtils.ets
arkts
showToastContent
Show toast content. @param {Resource | string} content content to show
public showToastContent(content: Resource | string): void { promptAction.showToast({ message: content, duration: CommonConstants.TOAST_DURATION }); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left showToastContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left content AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expre...
public showToastContent(content: Resource | string): void { promptAction.showToast({ message: content, duration: CommonConstants.TOAST_DURATION }); }
https://gitee.com/harmonyos/codelabs.git
3afa7fac43ffe698fdaf2acf60325a290f98d852
gitee
ibestservices/ibest-ui
library/src/main/ets/components/slider/index.ets
arkts
getScaleSize
获取刻度大小
getScaleSize(){ return this.realBarHeight + 4 }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getScaleSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ...
getScaleSize(){ return this.realBarHeight + 4 }
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/slider/index.ets#L149-L151
9ce6e2436004c7e8393d597edf1165d640fca99e
github
CPF-ApplicationTPC/ohos_dataorm
entry/src/main/ets/pages/SyncApi.ets
arkts
deleteByKey
按Key删除首条
deleteByKey() { if (!this.noteDao) { return; } let notes = this.notesQuery?.listSync() ?? [] if (!notes || notes.length === 0) { return; } let firstNote = notes[0]; this.noteDao.deleteByKeySync(firstNote.getId()); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left deleteByKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
deleteByKey() { if (!this.noteDao) { return; } let notes = this.notesQuery?.listSync() ?? [] if (!notes || notes.length === 0) { return; } let firstNote = notes[0]; this.noteDao.deleteByKeySync(firstNote.getId()); }
https://gitcode.com/CPF-ApplicationTPC/ohos_dataorm/blob/fbc87b313143db372545fe1a46ca1dc6b45b13dd/entry/src/main/ets/pages/SyncApi.ets#L146-L156
62fabe08f87a0bffd147932b02009227874e08a4
gitcode
ZestBox-18/kitebook-frontend
features/home/src/main/ets/viewmodels/HomeViewModels.ets
arkts
constructor
构建一个首页资产账户展示对象。
constructor(name: string, subtitle: string, amount: number, icon: Resource, isLiability: boolean) { this.name = name; this.subtitle = subtitle; this.amount = amount; this.icon = icon; this.isLiability = isLiability; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
constructor(name: string, subtitle: string, amount: number, icon: Resource, isLiability: boolean) { this.name = name; this.subtitle = subtitle; this.amount = amount; this.icon = icon; this.isLiability = isLiability; }
https://github.com/ZestBox-18/kitebook-frontend
0dd0207b149470db128e01924ae16c5c5fee061c
github
harmonyos/codelabs
HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/common/database/tables/DayInfoApi.ets
arkts
insertData
Insert dayInfo. @param dayInfo @param callback
insertData(dayInfo: DayInfo, callback: Function): void { const valueBucket = generateBucket(dayInfo); RdbUtils.insert('dayInfo', valueBucket).then(result => { callback(result); }) Logger.info('DayInfoTable', 'Insert dayInfo finished.'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left insertData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dayInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DayInfo AST#identifier#Right AST#,#Left , ...
insertData(dayInfo: DayInfo, callback: Function): void { const valueBucket = generateBucket(dayInfo); RdbUtils.insert('dayInfo', valueBucket).then(result => { callback(result); }) Logger.info('DayInfoTable', 'Insert dayInfo finished.'); }
https://gitee.com/harmonyos/codelabs.git
1dff33343b502c1844927878dde0b6d988595182
gitee
PollenWang6/HiXD
entry/src/main/ets/services/ClassService.ets
arkts
parseClassChanges
解析课程变更列表
static parseClassChanges(body: string): ClassChange[] { const out: ClassChange[] = []; try { const obj: Record<string, Object> = JSON.parse(body) as Record<string, Object>; const datas: Record<string, Object> = obj['datas'] as Record<string, Object>; const xsdkkc: Record<string, Object> = da...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left parseClassChanges AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left body AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
static parseClassChanges(body: string): ClassChange[] { const out: ClassChange[] = []; try { const obj: Record<string, Object> = JSON.parse(body) as Record<string, Object>; const datas: Record<string, Object> = obj['datas'] as Record<string, Object>; const xsdkkc: Record<string, Object> = da...
https://github.com/PollenWang6/HiXD
919f6403e6e4a73d517519414ff6b758ec0ecd6a
github
aimilin6688/KeePassHO
entry/src/main/ets/services/kdbx/KdbxCsvService.ets
arkts
getTotpFieldValue
获取TOTP字段值 @param entry 实体 @returns 结果
private static getTotpFieldValue(entry: KdbxEntry) { for (let field of entry.fields) { const value = KdbxUtils.getValueString(field[1]); if (KdbxUtils.isTotpUrl(value)) { return value; } } return ''; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getTotpFieldValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#L...
private static getTotpFieldValue(entry: KdbxEntry) { for (let field of entry.fields) { const value = KdbxUtils.getValueString(field[1]); if (KdbxUtils.isTotpUrl(value)) { return value; } } return ''; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxCsvService.ets#L236-L244
1082d856014ad144b794246833f9aa229470f747
github
jjjjjjava/ffmpeg_tools
example/BasicUsage.ets
arkts
rtsp
============================================================ 网络流 ============================================================ RTSP 录制
rtsp(): void { const cmd = FFmpegFactory.downloadRtsp('rtsp://192.168.1.100/stream', '/record.mp4', 60); this.run(cmd); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left rtsp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left AS...
rtsp(): void { const cmd = FFmpegFactory.downloadRtsp('rtsp://192.168.1.100/stream', '/record.mp4', 60); this.run(cmd); }
https://github.com/jjjjjjava/ffmpeg_tools
754eb0c49e159bcff3d44e64700499e4d1a0adac
github
OHPG/FinSdk
jellyfin/src/main/ets/api/UserLibraryApi.ets
arkts
getIntros
getIntros @summary Gets intros to play before the main media item plays. @param {UserLibraryApiGetIntrosRequest} requestParameters Request parameters. @throws {RequiredError} @memberof UserLibraryApi
public async getIntros(requestParameters: UserLibraryApiGetIntrosRequest): Promise<BaseItemDtoQueryResult> { this.assertParam(requestParameters.itemId) return this.apiClient.get({path: `/Items/${requestParameters.itemId}/Intros`, parameters: requestParameters, excludeParams: ['itemId']}) }
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 getIntros AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST#:#L...
public async getIntros(requestParameters: UserLibraryApiGetIntrosRequest): Promise<BaseItemDtoQueryResult> { this.assertParam(requestParameters.itemId) return this.apiClient.get({path: `/Items/${requestParameters.itemId}/Intros`, parameters: requestParameters, excludeParams: ['itemId']}) }
https://github.com/OHPG/FinSdk
e9c191a7c54efea99e0030eb5c8b3fa514ef7ca0
github
arkui-x/samples
CodeLab/Cases/feature/calendarswitch/src/main/ets/customcalendar/view/WeekViewItem.ets
arkts
updateWeekData
更新周数据
updateWeekData() { this.getWeekViewData(this.weekNum); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateWeekData 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...
updateWeekData() { this.getWeekViewData(this.weekNum); }
https://gitcode.com/arkui-x/samples
d61f22c649cfba7dffbdd3c36ff298f04f86f1fd
gitcode
openharmony/applications_calendar_data
datamanager/src/main/ets/processor/alerts/AlertsProcessor.ets
arkts
isEventSameWithAlertId
检查待插入的 alert 与 event 表中是否存在相同 event_id 的元组 @param rdbStore rdb数据库 @param values 插入操作的数据 @return true 相同 false 不相同
async function isEventSameWithAlertId(rdbStore: data_rdb.RdbStore, values: data_rdb.ValuesBucket): Promise<boolean> { Log.debug(TAG, 'isEventSameWithAlertId start'); let resultSet = await queryEventIdAndCreatorByAlert(rdbStore, values); try { if (resultSet === null || resultSet === undefined) { return f...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left isEventSameWithAlertId AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rdbStore AST#identifier#Ri...
async function isEventSameWithAlertId(rdbStore: data_rdb.RdbStore, values: data_rdb.ValuesBucket): Promise<boolean> { Log.debug(TAG, 'isEventSameWithAlertId start'); let resultSet = await queryEventIdAndCreatorByAlert(rdbStore, values); try { if (resultSet === null || resultSet === undefined) { return f...
https://gitee.com/openharmony/applications_calendar_data.git
09d635150a159d03afc7361939fb16db0614b2f6
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/common/utils/DAOHelper.ets
arkts
convertToApprovalRecord
转换为ApprovalRecord
static convertToApprovalRecord(resultSet: relationalStore.ResultSet): ApprovalRecord { const record = new ApprovalRecord(); record.recordId = DAOHelper.getNumberValue(resultSet, 'record_id'); record.billId = DAOHelper.getNumberValue(resultSet, 'bill_id'); record.approverId = DAOHelper.getNumberValue(r...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left convertToApprovalRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#mem...
static convertToApprovalRecord(resultSet: relationalStore.ResultSet): ApprovalRecord { const record = new ApprovalRecord(); record.recordId = DAOHelper.getNumberValue(resultSet, 'record_id'); record.billId = DAOHelper.getNumberValue(resultSet, 'bill_id'); record.approverId = DAOHelper.getNumberValue(r...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e30a817138db6d31fdbb5b2958d92eb3d899fc76
github
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/svggen/SVGRect.ets
arkts
setX
设置x坐标 @param newX x坐标值
public setX(newX: number): void{ this._x = newX; this._rectResultObj['x'] = newX; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left setX AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newX AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public setX(newX: number): void{ this._x = newX; this._rectResultObj['x'] = newX; }
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
080129fd493a89d427e2350b8e522976a8484b72
gitee
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/constants/ApiConstants.ets
arkts
userFollowing
获取关注列表
static userFollowing(username: string): string { return `/u/${username}/follow/following`; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left userFollowing AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#...
static userFollowing(username: string): string { return `/u/${username}/follow/following`; }
https://github.com/Amaz1ny/HarmonyDO-public
d6163206800e616cef6c53f0e62ed4fbbc1dde2c
github
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/model/SongDataSource.ets
arkts
unregisterDataChangeListener
Removes a previously registered listener. @param listener Same instance passed to {@link registerDataChangeListener}.
public unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unregisterDataChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST...
public unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { this.listeners.splice(pos, 1); } }
https://gitcode.com/HarmonyOS_Samples/MusicHome
8b3666265bb652b0b1d81ef51b74d73023d3d168
gitcode
YANGZX22/Voot
entry/src/main/ets/entryability/EntryAbility.ets
arkts
loadInitialPage
根据引导状态决定加载哪个页面
private async loadInitialPage(windowStage: window.WindowStage): Promise<void> { try { const isFirstLaunch = await OnboardingStorage.isFirstLaunch(this.context); // 只有首次启动才进入 WelcomePage // 非首次启动直接进入 Index,由 Index 内部检测 IP 和验证状态并弹窗处理 let targetPage = 'pages/Index'; if (isFirstL...
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 loadInitialPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifie...
private async loadInitialPage(windowStage: window.WindowStage): Promise<void> { try { const isFirstLaunch = await OnboardingStorage.isFirstLaunch(this.context); // 只有首次启动才进入 WelcomePage // 非首次启动直接进入 Index,由 Index 内部检测 IP 和验证状态并弹窗处理 let targetPage = 'pages/Index'; if (isFirstL...
https://github.com/YANGZX22/Voot
a9926e6dc114b8f4ed1668b10064da73f422c111
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryBuilder.ets
arkts
hasPagination
检查是否设置了分页 @returns 是否设置了分页
hasPagination(): boolean { return this.pageNumber > 0 && this.pageSizeValue > 0 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasPagination 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...
hasPagination(): boolean { return this.pageNumber > 0 && this.pageSizeValue > 0 }
https://github.com/offlinecat-dev/OCNetORM
267e780c50b9510e1f4ddc8791be6f670aa17c45
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/SmartCategory.ets
arkts
matchesMerchant
检查商户名称是否匹配
matchesMerchant(merchantName: string): boolean { if (this.merchantPattern === '') { return false; } const lowerPattern = this.merchantPattern.toLowerCase(); const lowerName = merchantName.toLowerCase(); return lowerName.indexOf(lowerPattern) >= 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left matchesMerchant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left merchantName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left )...
matchesMerchant(merchantName: string): boolean { if (this.merchantPattern === '') { return false; } const lowerPattern = this.merchantPattern.toLowerCase(); const lowerName = merchantName.toLowerCase(); return lowerName.indexOf(lowerPattern) >= 0; }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
b0f5aa93083c0ee16743721461c8fc2c9d487472
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/KdbxUtils.ets
arkts
getFavoriteItems
在数据库中获取所有收藏的条目和分组 @param database 数据库 @returns 收藏的条目和分组列表
public static getFavoriteItems(database: Kdbx): Array<KdbxGroup | KdbxEntry> { const favoriteItems: Array<KdbxGroup | KdbxEntry> = []; if (!database) { return favoriteItems; } const rootGroup = database.getDefaultGroup(); const collectFavorites = (group: KdbxGroup) => { // 收集收藏的分组 ...
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 getFavoriteItems AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left database AST#identifier#Right AST#ERROR#Left AST#:#Le...
public static getFavoriteItems(database: Kdbx): Array<KdbxGroup | KdbxEntry> { const favoriteItems: Array<KdbxGroup | KdbxEntry> = []; if (!database) { return favoriteItems; } const rootGroup = database.getDefaultGroup(); const collectFavorites = (group: KdbxGroup) => { // 收集收藏的分组 ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/KdbxUtils.ets#L478-L503
56b3cbc88830c57af5c2896a39c7981e0e70b098
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/security/CryptoDemo.ets
arkts
sha256
计算指定数据的 sha256 哈希值
public static sha256(data: Uint8Array): Uint8Array { let sha256 = cryptoFramework.createMd('SHA256'); sha256.updateSync({ data: data }); let sha256Result = sha256.digestSync(); return sha256Result.data }
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 sha256 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Rig...
public static sha256(data: Uint8Array): Uint8Array { let sha256 = cryptoFramework.createMd('SHA256'); sha256.updateSync({ data: data }); let sha256Result = sha256.digestSync(); return sha256Result.data }
https://github.com/webabcd/HarmonyDemo
9a6eb115e49626b7cdd3c9039a347bb0e5009e46
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/ChatViewModel.ets
arkts
addMessage
添加消息到数据库
async addMessage(message: ChatMessage): Promise<void> { if (this.currentSession === null) { console.error('ChatViewModel', 'Cannot add message: no current session') return } await this.databaseService.addMessage(this.currentSession.id, message) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left addMessage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left message AST#identifier#Right AST#t...
async addMessage(message: ChatMessage): Promise<void> { if (this.currentSession === null) { console.error('ChatViewModel', 'Cannot add message: no current session') return } await this.databaseService.addMessage(this.currentSession.id, message) }
https://github.com/LongLiveY96/chatcube
0738e3942b1d51d19fcec3057aec98d84e5804ac
github
arkui-x/samples
CodeLab/Cases/feature/compressfile/src/main/ets/components/CompressFileComponent.ets
arkts
aboutToAppear
rawfile下指定目录所有待压缩文件名字
aboutToAppear(): void { this.initCompressFile(this.beCompressFileDir); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { this.initCompressFile(this.beCompressFileDir); }
https://gitcode.com/arkui-x/samples
33891ea4818830112913ea52df285c0085b0ee66
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Search/SearchIntentParser.ets
arkts
getSupportedPrefixes
获取支持的前缀列表(用于UI提示)
static getSupportedPrefixes(): string[] { const prefixes: string[] = []; for (let i = 0; i < SearchIntentParser.ID_PREFIXES.length; i++) { prefixes.push(SearchIntentParser.ID_PREFIXES[i].prefix); } return prefixes; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getSupportedPrefixes 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 s...
static getSupportedPrefixes(): string[] { const prefixes: string[] = []; for (let i = 0; i < SearchIntentParser.ID_PREFIXES.length; i++) { prefixes.push(SearchIntentParser.ID_PREFIXES[i].prefix); } return prefixes; }
https://github.com/DaLongZhuaZi/manxia
c967021bf2503f506c12de7f860869debe64ed8e
github
XJTUWYD/ArkDiff
entry/src/main/ets/engine/MyersEngine.ets
arkts
computeNative
================== C++ 原生调用 ==================
private static computeNative( linesA: string[], linesB: string[], m: number, n: number ): LcsResult { try { const t0 = Date.now(); const result: NativeDiffResult = nativeMyers.computeDiff(linesA, linesB) as NativeDiffResult; // 校验原生返回结构,避免桥接层异常导致后续 undefined 访问 if (!result || !Array....
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left computeNative AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left linesA AST#identifier#Right AST#:#Left...
private static computeNative( linesA: string[], linesB: string[], m: number, n: number ): LcsResult { try { const t0 = Date.now(); const result: NativeDiffResult = nativeMyers.computeDiff(linesA, linesB) as NativeDiffResult; // 校验原生返回结构,避免桥接层异常导致后续 undefined 访问 if (!result || !Array....
https://github.com/XJTUWYD/ArkDiff
c5cf29bc4abbb8016c6e428b06fb6e389f59c05b
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/animation/AnimatableExtendDemo.ets
arkts
animatableWidthHeight
@AnimatableExtend - 用于为指定的组件自定义可动画的属性方法 仅支持在全局定义 函数的参数类型仅支持 number 或 AnimatableArithmetic<T> 对象 为 Column 组件定义一个名为 animatableWidthHeight() 的属性方法,此属性方法是可动画的,即可以通过 animation() 实现属性动画 animatableWidthHeight() 接收一个 number 类型的参数,且函数体内只能调用 Column 的属性方法
@AnimatableExtend(Column) function animatableWidthHeight(value: number) { .width(value) .height(value) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left AnimatableExtend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Column AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_...
@AnimatableExtend(Column) function animatableWidthHeight(value: number) { .width(value) .height(value) }
https://github.com/webabcd/HarmonyDemo
df9055689543e54eef5c6da193663e2649cda532
github
yangyongzhen/hmmovie
entry/src/main/ets/utils/EfAVPlayer.ets
arkts
reset
用于重置播放器
async reset() { await this.avPlayer?.reset() }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left reset AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AS...
async reset() { await this.avPlayer?.reset() }
https://github.com/yangyongzhen/hmmovie
1a24791700ea42259b1304dd1e45d19baf370843
github