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
XHXYT/Pixark
entry/src/main/ets/common/utils/ColorUtils.ets
arkts
getColorWithAlphaString
获取指定透明度的颜色值 @param color 基础颜色 @param alphaPercent 透明度百分比,取值范围 0-100(0为全透明,100为完全不透明) @returns string
public getColorWithAlphaString(color: ResourceColor, alphaPercent: number): string { const baseColor = this.getNormalColor(color); // 将百分比限制在 0 - 100 之间 const clampedPercent = Math.max(0, Math.min(100, alphaPercent)); // 将百分比 (0-100) 转换为 255 制式 (0-255),并四舍五入取整 const alpha255 = Math.round((clamped...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getColorWithAlphaString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
public getColorWithAlphaString(color: ResourceColor, alphaPercent: number): string { const baseColor = this.getNormalColor(color); // 将百分比限制在 0 - 100 之间 const clampedPercent = Math.max(0, Math.min(100, alphaPercent)); // 将百分比 (0-100) 转换为 255 制式 (0-255),并四舍五入取整 const alpha255 = Math.round((clamped...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/ColorUtils.ets#L51-L70
762c6d8778aa1dc982d7227a54aa5ae266689407
github
openharmony/vendor_unionman
unionpi_tiger/sample_hzu/smart_home/app/entry/src/main/ets/pages/Index.ets
arkts
startWork
用于刷新获取温湿度值
startWork() { this.getValue(); setInterval(() => { this.getValue(); }, 1000); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startWork 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 AST...
startWork() { this.getValue(); setInterval(() => { this.getValue(); }, 1000); }
https://gitee.com/openharmony/vendor_unionman.git
21568d4d43145ffacdf72900ba425c5b6889b489
gitee
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test11_original_index.ets
arkts
testStringMatch
--- String.match() and search() ---
function testStringMatch(): string { let s: string = 'Hello World 123'; let digits: RegExp = /\d+/; let result: RegExpMatchArray | null = s.match(digits); if (result !== null) { return result[0]; } return 'no match'; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testStringMatch 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 testStringMatch(): string { let s: string = 'Hello World 123'; let digits: RegExp = /\d+/; let result: RegExpMatchArray | null = s.match(digits); if (result !== null) { return result[0]; } return 'no match'; }
https://github.com/miaochiahao/ark-ghidra
d52f8eef2011ee987653636d83e0cc6e7bb52b60
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/security/facades/UserAuthenticationFacade.ets
arkts
checkSupport
检查设备是否支持指定的生物识别 @ohos.permission ohos.permission.ACCESS_BIOMETRIC
checkSupport(authType: userAuth.UserAuthType): boolean { try { userAuth.getAvailableStatus(authType, userAuth.AuthTrustLevel.ATL1); return true; } catch (e) { logger.warn(TAG, '设备不支持认证类型 ' + authType); return false; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left checkSupport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left authType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left userAuth AST...
checkSupport(authType: userAuth.UserAuthType): boolean { try { userAuth.getAvailableStatus(authType, userAuth.AuthTrustLevel.ATL1); return true; } catch (e) { logger.warn(TAG, '设备不支持认证类型 ' + authType); return false; } }
https://github.com/DaLongZhuaZi/NGF
ebe3512c0b7ac50f5597f4d3c8176fd8e41b51bd
github
LJ666-ui/harmony-health-care
entry/src/main/ets/common/utils/HttpUtil.ets
arkts
clearDoctorToken
清除医生Token
static async clearDoctorToken(): Promise<void> { try { AppStorage.setOrCreate<string>('doctorToken', ''); AppStorage.setOrCreate<boolean>('isDoctorLoggedIn', false); const settings: SettingsUtil = SettingsUtil.getInstance(); await settings.clearDoctorAuth(); } catch (error) { con...
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 clearDoctorToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
static async clearDoctorToken(): Promise<void> { try { AppStorage.setOrCreate<string>('doctorToken', ''); AppStorage.setOrCreate<boolean>('isDoctorLoggedIn', false); const settings: SettingsUtil = SettingsUtil.getInstance(); await settings.clearDoctorAuth(); } catch (error) { con...
https://github.com/LJ666-ui/harmony-health-care
798ed2d97e927708506f2edd65c29c32711d2ef4
github
LongLiveY96/chatcube
entry/src/main/ets/models/ChatModels.ets
arkts
toJsonObject
转换为 JSON 对象(用于 API 请求)
toJsonObject(): object { if (this.rawSchema !== null) { return this.rawSchema } const props: Record<string, ToolParameterPropertyJson> = {} this.properties.forEach((value, key) => { if (value.enumValues.length > 0) { props[key] = new ToolParameterPropertyJson(value.type, value.desc...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toJsonObject 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#object#Left object AST#object#Right AST#ERROR#Right AST#statement...
toJsonObject(): object { if (this.rawSchema !== null) { return this.rawSchema } const props: Record<string, ToolParameterPropertyJson> = {} this.properties.forEach((value, key) => { if (value.enumValues.length > 0) { props[key] = new ToolParameterPropertyJson(value.type, value.desc...
https://github.com/LongLiveY96/chatcube
8ddb6681bdaee845f121d86162d40fe428e247df
github
Joker-x-dev/CoolMallArkTS
feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets
arkts
onRequestSuccess
请求成功回调 @param {Order} data - 订单数据 @returns {void} 无返回值
protected onRequestSuccess(data: Order): void { this.cartList = this.convertOrderGoodsToCart(data); super.onRequestSuccess(data); }
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left onRequestSuccess 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#identi...
protected onRequestSuccess(data: Order): void { this.cartList = this.convertOrderGoodsToCart(data); super.onRequestSuccess(data); }
https://github.com/Joker-x-dev/CoolMallArkTS
29e1d7f5d8fdd8f237066c2aca7630c00c622cec
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
getDarkModeBlurStyle
获取深色主题下的模糊样式(与浅色保持一致)
public getDarkModeBlurStyle(): BlurStyle { return this.getGlassBlurStyleForLevel(GlassLevel.CARD); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDarkModeBlurStyle 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 B...
public getDarkModeBlurStyle(): BlurStyle { return this.getGlassBlurStyleForLevel(GlassLevel.CARD); }
https://github.com/DaLongZhuaZi/manxia
d41b90678a317bf73774436da2a62aebe57e724a
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/NovelSourceManagementPage.ets
arkts
selectAll
全选当前筛选后的书源
selectAll(): void { const newSet = new Set<string>(); for (const source of this.filteredSources) { newSet.add(source.id); } this.selectedSourceIds = newSet; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left selectAll 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#Le...
selectAll(): void { const newSet = new Set<string>(); for (const source of this.filteredSources) { newSet.add(source.id); } this.selectedSourceIds = newSet; }
https://github.com/DaLongZhuaZi/manxia
cfd70ee104465aef8d1a63e87c22d3b01738efe5
github
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/svggen/SVGRect.ets
arkts
setWidth
设置宽度 @param newWidth 矩形宽度
public setWidth(newWidth: number): void{ this._width = newWidth; this._rectResultObj['width'] = newWidth; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setWidth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left newWidth AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right...
public setWidth(newWidth: number): void{ this._width = newWidth; this._rectResultObj['width'] = newWidth; }
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
e272c2899e3c248d76a83e6ba9eb85de2120e810
gitee
Harrisonls2004/WaterFlow
entry/src/main/ets/pages/PaymentPage.ets
arkts
getProductImage
产品ID到图片资源的映射
function getProductImage(productId: string | undefined): Resource { const imageMap: Record<string, Resource> = { 'product_001': $r('app.media.ic_holder_50e'), 'product_002': $r('app.media.ic_holder_xs2'), 'product_003': $r('app.media.ic_holder_computer'), 'product_004': $r('app.media.ic_holder_mouse')...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getProductImage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left productId AST#identifier#Right AST#type_annotation#Left AST#:#Left : A...
function getProductImage(productId: string | undefined): Resource { const imageMap: Record<string, Resource> = { 'product_001': $r('app.media.ic_holder_50e'), 'product_002': $r('app.media.ic_holder_xs2'), 'product_003': $r('app.media.ic_holder_computer'), 'product_004': $r('app.media.ic_holder_mouse')...
https://github.com/Harrisonls2004/WaterFlow
2337222e94ebda8bd067ef73bfa13aec94793c2b
github
LambdaYH/ScrcpyForHarmonyOS
app/src/main/ets/helper/AdbKeyManager.ets
arkts
getPrivateKeyBase64
密钥代数,用于检测是否需要重新生成
public getPrivateKeyBase64(): string { return this.privateKeyBase64; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPrivateKeyBase64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string...
public getPrivateKeyBase64(): string { return this.privateKeyBase64; }
https://github.com/LambdaYH/ScrcpyForHarmonyOS
c28581ac0d239d1f5b9761ab882e766176bc9ae0
github
webabcd/HarmonyHttpServer
harmony_httpserver/src/main/ets/HttpServer.ets
arkts
enableLog
是否打印日志(默认开启)
public enableLog(enable:boolean) { log.LOGLEVEL = enable ? model.LogLevel.DEBUG : model.LogLevel.NONE }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left enableLog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left bool...
public enableLog(enable:boolean) { log.LOGLEVEL = enable ? model.LogLevel.DEBUG : model.LogLevel.NONE }
https://github.com/webabcd/HarmonyHttpServer
0305f4003a81284e01d1cb3fd5e265aca1a29e19
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Runtime.ets
arkts
GetHashCode
Returns a hash code for the Object. @param o to calculate hash code from @returns hash code
public GetHashCode(o: Object) : int { return 0; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left GetHashCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Object ...
public GetHashCode(o: Object) : int { return 0; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
fb0c0549217a4d5ddc238308ec3cacd8becf9907
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
equals
Checks for equality this instance with provided object, treated as a StringType @param {Type} other object to be checked against @returns {boolean} true if object also has StringType @syscap SystemCapability.Utils.Lang @FaAndStageModel
public override equals(other: Type): boolean { return other instanceof StringType }
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 equals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#...
public override equals(other: Type): boolean { return other instanceof StringType }
https://gitcode.com/iop123123/arkts-static-skills
c668bdbf1693b82e262cea8b86057e28adedd5d9
gitcode
HarmonyOS_Samples/guide-snippets
ArkGraphics2D/Drawing/ArkTSGraphicsDraw/entry/src/main/ets/drawing/pages/BasicEffect.ets
arkts
setDrawIndex
暴露设置绘制函数下标的方法
setDrawIndex(index: number) { this.myRenderNode.setDrawIndex(index); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setDrawIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right...
setDrawIndex(index: number) { this.myRenderNode.setDrawIndex(index); }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
170ac82e49e7c3245102f25d5e9b5eab910b5557
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceActionEngine.ets
arkts
executeIPBlock
执行IP封禁处理操作
private async executeIPBlock(action: IPBlockAction, context: ActionContext): Promise<boolean> { logger.info(TAG, `处理IP封禁: ${action.action}`); if (action.action === 'retry') { const result = await this.antiCrawler.handleIpBlock(); return result; } else { throw new MangaSourceError( ...
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 executeIPBlock AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left...
private async executeIPBlock(action: IPBlockAction, context: ActionContext): Promise<boolean> { logger.info(TAG, `处理IP封禁: ${action.action}`); if (action.action === 'retry') { const result = await this.antiCrawler.handleIpBlock(); return result; } else { throw new MangaSourceError( ...
https://github.com/DaLongZhuaZi/manxia
1dfdbbbd9fc500e1eff3afb31358a7f80b4db8ce
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncLock.ets
arkts
request
Find or create an instance of AsyncLock using the specified name. @param { string } name - name of the lock to find or create. @returns { AsyncLock } Returns an instance of AsyncLock.
public static request(name: string): AsyncLock { return asyncLockManager.request(name); }
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 request AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Ri...
public static request(name: string): AsyncLock { return asyncLockManager.request(name); }
https://gitcode.com/iop123123/arkts-static-skills
1631be5dfc8f659a6203d4ba6f0d646f06251f1e
gitcode
Tianpei-Shi/MusicDash
src/services/UserService.ets
arkts
login
用户登录 @param username 用户名 @param password 密码
async login(username: string, password: string): Promise<UserInfo | null> { try { const userData = await this.cloudDBService.loginUser(username, password); if (userData) { this.currentUser = UserInfo.fromCloudObject(userData); this.loggedIn = true; return this.currentUser; ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left login AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left username AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:...
async login(username: string, password: string): Promise<UserInfo | null> { try { const userData = await this.cloudDBService.loginUser(username, password); if (userData) { this.currentUser = UserInfo.fromCloudObject(userData); this.loggedIn = true; return this.currentUser; ...
https://github.com/Tianpei-Shi/MusicDash
2d73d15bdf03ab9a1825a13393ff1f6f99bc1ae6
github
openharmony/multimedia_camera_framework
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets
arkts
onCameraStatusChange
监听相机状态变化 @param cameraManager - 相机管理器对象 @returns 无返回值
onCameraStatusChange(cameraManager: camera.CameraManager): void { Logger.info(TAG, 'onCameraStatusChange is called'); try { cameraManager.on('cameraStatus', this.registerCameraStatusChange); } catch (error) { Logger.error(TAG, 'onCameraStatusChange error'); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onCameraStatusChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left cameraManager AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left camera AST#iden...
onCameraStatusChange(cameraManager: camera.CameraManager): void { Logger.info(TAG, 'onCameraStatusChange is called'); try { cameraManager.on('cameraStatus', this.registerCameraStatusChange); } catch (error) { Logger.error(TAG, 'onCameraStatusChange error'); } }
https://gitee.com/openharmony/multimedia_camera_framework.git
cccad6395fdc3e1aa4f611f76773ac4c4a678963
gitee
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/AddressRepository.ets
arkts
getDefaultAddress
获取默认地址 @returns 默认地址或 null
async getDefaultAddress(): Promise<NetworkResponse<Address | null>> { return this.networkDataSource.getDefaultAddress(); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getDefaultAddress AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge...
async getDefaultAddress(): Promise<NetworkResponse<Address | null>> { return this.networkDataSource.getDefaultAddress(); }
https://github.com/Joker-x-dev/CoolMallArkTS
f60b7d6a50820ef4d158685281fc5e3644700c23
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/SmartBudgetService.ets
arkts
evaluateBudgetHealth
评估预算健康度(0-100分)
static async evaluateBudgetHealth(userId: number, currentMonth: string): Promise<number> { hilog.info(HILOG_DOMAIN, LOG_TAG, '评估预算健康度'); try { // 获取当前预算 const budgets = await BudgetDAO.getByUserId(userId); if (budgets.length === 0) { return 0; } // 计算日期范围 const pa...
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 evaluateBudgetHealth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#L...
static async evaluateBudgetHealth(userId: number, currentMonth: string): Promise<number> { hilog.info(HILOG_DOMAIN, LOG_TAG, '评估预算健康度'); try { // 获取当前预算 const budgets = await BudgetDAO.getByUserId(userId); if (budgets.length === 0) { return 0; } // 计算日期范围 const pa...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e7085770339a81981d6373a7d985b7df5814e277
github
FinalScave/SweetLine
platform/OHOS/sweetline/src/main/ets/Index.ets
arkts
getFileNames
Get the exact file names supported by the syntax rule
public getFileNames(): string[] { return lib.SyntaxRule_GetFileNames(this.nativeHandle); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getFileNames 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 string AS...
public getFileNames(): string[] { return lib.SyntaxRule_GetFileNames(this.nativeHandle); }
https://github.com/FinalScave/SweetLine
be45f92b7ba9bfa3b77d5814d0da31964948c3a7
github
Kira-Yagami-Light/Kira-Projects
TodoTask/entry/src/main/ets/data/database/CategoryDao.ets
arkts
convertResultSet
转换 ResultSet 为记录数组 @param resultSet 查询结果集 @returns Array<Record<string, any>> 记录数组
private convertResultSet(resultSet: relationalStore.ResultSet): Array<Record<string, number | string>> { const results: Array<Record<string, number | string>> = []; if (resultSet.rowCount <= 0) { return results; } resultSet.goToFirstRow(); for (let i = 0; i < resultSet.rowCount; i++) { ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertResultSet 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#member_...
private convertResultSet(resultSet: relationalStore.ResultSet): Array<Record<string, number | string>> { const results: Array<Record<string, number | string>> = []; if (resultSet.rowCount <= 0) { return results; } resultSet.goToFirstRow(); for (let i = 0; i < resultSet.rowCount; i++) { ...
https://github.com/Kira-Yagami-Light/Kira-Projects
07e4f2943d7870166c30f02fb6950c99988d08ab
github
aimilin6688/KeePassHO
entry/src/main/ets/entryability/EntryAbility.ets
arkts
loadContentCallback
加载内容回调 @param err @param data
private loadContentCallback<T>(err: BusinessError, data: T): void { if (err.code) { hilog.error(DOMAIN, TAG, 'Ability onWindowStageCreate failed, err: %{public}s', err.message); } else { hilog.info(DOMAIN, TAG, 'Ability onWindowStageCreate success'); this.createUrl = undefined; } if ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#binary_expression#Left AST#identifier#Left loadContentCallback AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Lef...
private loadContentCallback<T>(err: BusinessError, data: T): void { if (err.code) { hilog.error(DOMAIN, TAG, 'Ability onWindowStageCreate failed, err: %{public}s', err.message); } else { hilog.info(DOMAIN, TAG, 'Ability onWindowStageCreate success'); this.createUrl = undefined; } if ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/entryability/EntryAbility.ets#L188-L206
40599dc4a5a1ff9228e58ec622723d2f15483e28
github
youyeyejie/ZhiXing_ActHub
entry/src/main/ets/core/services/FocusTimerEngine.ets
arkts
hasTodo
当前引擎是否已关联待办任务
hasTodo(): boolean { try { return this.todoId > 0; } catch (_error) { return false; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasTodo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_b...
hasTodo(): boolean { try { return this.todoId > 0; } catch (_error) { return false; } }
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/services/FocusTimerEngine.ets#L296-L298
1bcd564d75318f66139d4a72b5829fff1638b50e
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets
arkts
trimRight
Trims all specified characters from the end of this String. @param { char[] } remove that contains the characters to trim @throws { NullPointerError } if remove param is null @returns { String } new right trimmed string @syscap SystemCapability.Utils.Lang @FaAndStageModel
public trimRight(remove: char[]): String { let last: int = this.getLength() - 1; if (this.isEmpty() || !String.isCharOneOf(this.charAt(last), remove)) { return this; } let lastNotSpecCharIdx: int = 0; for (let i: int = last - 1; i >= 0; i--) { if (!Str...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left trimRight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left remove AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left char AST#identifier#...
public trimRight(remove: char[]): String { let last: int = this.getLength() - 1; if (this.isEmpty() || !String.isCharOneOf(this.charAt(last), remove)) { return this; } let lastNotSpecCharIdx: int = 0; for (let i: int = last - 1; i >= 0; i--) { if (!Str...
https://gitcode.com/iop123123/arkts-static-skills
c3685eeb9c232c313608d550772f3bdf0fca9e5f
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.buffer.ets
arkts
writeUInt16LE
Writes an unsigned 16-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 writeUInt16LE(value: long, offset: int = 0): int { this.checkOffset(offset, 2); this.checkValue(value, 0, (Math.pow(2, 16).toLong() - 1), "0", (Math.pow(2, 16) - 1).toString()); this.getDataView().setUint16(offset, value, true); return offset + 2; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left writeUInt16LE 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 writeUInt16LE(value: long, offset: int = 0): int { this.checkOffset(offset, 2); this.checkValue(value, 0, (Math.pow(2, 16).toLong() - 1), "0", (Math.pow(2, 16) - 1).toString()); this.getDataView().setUint16(offset, value, true); return offset + 2; }
https://gitcode.com/iop123123/arkts-static-skills
42c41b373300b58a5b418e712e73e423fa4b3e44
gitcode
openharmony-sig/node_pool
nodepool/src/main/ets/lib/NodePool.ets
arkts
setTypeReuseConfig
设置不同类型节点的老化时间 @param typeCfg
public setTypeReuseConfig(typeCfg: TypeReuseConfig) { this.typeReuseConfigMap.set(typeCfg.type, typeCfg); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTypeReuseConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left typeCfg AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
public setTypeReuseConfig(typeCfg: TypeReuseConfig) { this.typeReuseConfigMap.set(typeCfg.type, typeCfg); }
https://gitee.com/openharmony-sig/node_pool.git
bd8e23a6f6de541ef6f09bfbd43f40b6db6ae33f
gitee
revalue-o/HarmonyOS-Next-Hook-demo
source_codes/ArkTS-inject/entry/src/main/ets/utils/SecurityCheckUtil.ets
arkts
generateNonce
生成随机nonce(16-66字节的base64编码值) 使用Math.random()生成伪随机数
private static generateNonce(): string { // 生成32字节的随机字符串(符合16-66字节要求) const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; let result = ''; // 使用 Math.random() 生成伪随机数 for (let i = 0; i < 32; i++) { const randomValue = Math.floor(Math.random() * chars.length); ...
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 generateNonce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
private static generateNonce(): string { // 生成32字节的随机字符串(符合16-66字节要求) const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; let result = ''; // 使用 Math.random() 生成伪随机数 for (let i = 0; i < 32; i++) { const randomValue = Math.floor(Math.random() * chars.length); ...
https://github.com/revalue-o/HarmonyOS-Next-Hook-demo
6fe60518b6555ebe4fadb6dc3c6c18b934f2822c
github
Eklps/harmony-mall-perf
entry/src/main/ets/viewmodel/CartModel.ets
arkts
getTotalCount
获取购物车商品总数
static getTotalCount(): number { const cartList = AppStorage.get<CartItemType[]>('cartList') || []; return cartList.reduce((total, item) => total + item.quantity, 0); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTotalCount 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#n...
static getTotalCount(): number { const cartList = AppStorage.get<CartItemType[]>('cartList') || []; return cartList.reduce((total, item) => total + item.quantity, 0); }
https://github.com/Eklps/harmony-mall-perf
93e0b287ab212ab939e9c888ef31b0b652edd348
github
pangpang20/antennaPodHM
entry/src/main/ets/service/DatabaseService.ets
arkts
searchEpisodes
搜索单集(支持分页)
async searchEpisodes(keyword: string, offset: number, limit: number): Promise<EpisodeSearchResult> { if (!this.rdbStore) return new EpisodeSearchResult([], 0); try { // 处理关键词:有空格时拆分为多个关键词(AND关系) const keywords = keyword.trim().split(/\s+/).filter(k => k.length > 0); // 转义关键词中的特殊字符 ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left searchEpisodes AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyword AST#identifier#Right AST#type_annotat...
async searchEpisodes(keyword: string, offset: number, limit: number): Promise<EpisodeSearchResult> { if (!this.rdbStore) return new EpisodeSearchResult([], 0); try { // 处理关键词:有空格时拆分为多个关键词(AND关系) const keywords = keyword.trim().split(/\s+/).filter(k => k.length > 0); // 转义关键词中的特殊字符 ...
https://github.com/pangpang20/antennaPodHM
9e957b3e6729e5dff2010ffcc8e0afbc115aabe2
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets
arkts
pipe
Concatenated a Writable to a Readable and switches the Readable to stream mode. @param { Writable } destination - Output writable stream. @param { Object } [options] - Pipeline Options. @returns { Writable } Returns the Writable object. @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory param...
pipe(destination: Writable, options?: Object): Writable { const src: Readable = this; if (src.pipeWritableArrayInner.length === 1 && !src.multiAwaitDrain) { src.multiAwaitDrain = true; } src.pipeWritableArrayInner.push(destination); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left pipe AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left destination AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Writable AST#identifier#Right AST#ERROR#Right AST#,#Left , A...
pipe(destination: Writable, options?: Object): Writable { const src: Readable = this; if (src.pipeWritableArrayInner.length === 1 && !src.multiAwaitDrain) { src.multiAwaitDrain = true; } src.pipeWritableArrayInner.push(destination); ...
https://gitcode.com/iop123123/arkts-static-skills
e84cbc5d64ca80381e7e181487b3002f2d6cba09
gitcode
ZestBox-18/kitebook-frontend
commons/data_core/src/main/ets/services/BillManager.ets
arkts
getBillById
查询单条账单明细,供更新和删除前恢复账户余额使用。
static async getBillById(id: number): Promise<BillBean | null> { const predicates = new relationalStore.RdbPredicates(TABLE_NAME); predicates.equalTo('id', id); return new Promise<BillBean | null>((resolve, reject) => { dbManager.dbStore?.query(predicates) .then(async (result) => { ...
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 getBillById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#R...
static async getBillById(id: number): Promise<BillBean | null> { const predicates = new relationalStore.RdbPredicates(TABLE_NAME); predicates.equalTo('id', id); return new Promise<BillBean | null>((resolve, reject) => { dbManager.dbStore?.query(predicates) .then(async (result) => { ...
https://github.com/ZestBox-18/kitebook-frontend
21a75866e66e0b7fb7901e77fe7ea2640af3d1dd
github
apap6628114/nga_oh
entry/src/main/ets/common/concurrency/Throttler.ets
arkts
getStatus
查询指定 domain 的桶状态(活跃运行数与排队等待数)。 @param domain - 限流维度(通常为请求域名) @returns 桶状态;该 domain 从未被使用时返回全 0
getStatus(domain: string): BucketStatus { const bucket = this.buckets.get(domain); if (!bucket) { const empty: BucketStatus = { running: 0, queued: 0 }; return empty; } const status: BucketStatus = { running: bucket.concurrency, queued: bucket.waiters.length }; return status; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left domain AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST...
getStatus(domain: string): BucketStatus { const bucket = this.buckets.get(domain); if (!bucket) { const empty: BucketStatus = { running: 0, queued: 0 }; return empty; } const status: BucketStatus = { running: bucket.concurrency, queued: bucket.waiters.length }; return status; }
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/common/concurrency/Throttler.ets#L138-L146
9e893d55e4c88967039f486785f10f2f9a34a424
github
openeuler-mirror/arkui-linux
samples/woodfish/openHarnmony_woodfish/entry/src/main/ets/pages/Index.ets
arkts
build
start
build() { Row() { Column() { Column() { Text(this.skin==0?'一只敲木鱼':'一只敲木"余"') .fontSize(50) .fontColor('white') } .margin({top: '15%'}) .width('100%') Column() { if (this.skin == 0) { Image($r('app.media.woodfi...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Row() { Column() { Column() { Text(this.skin==0?'一只敲木鱼':'一只敲木"余"') .fontSize(50) .fontColor('white') } .margin({top: '15%'}) .width('100%') Column() { if (this.skin == 0) { Image($r('app.media.woodfi...
https://github.com/openeuler-mirror/arkui-linux
598fc3af47fb2087d617881306c13549cf5b8966
github
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/HostSyncService.ets
arkts
debugDump
调试: 打印本地数据库行数 (init 后调用)
debugDump(tag: string): void { const dump: string = this.cloud.debugDump(); hilog.info(0x0001, 'CloudSync', "[" + tag + "] " + dump); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left debugDump AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#...
debugDump(tag: string): void { const dump: string = this.cloud.debugDump(); hilog.info(0x0001, 'CloudSync', "[" + tag + "] " + dump); }
https://github.com/Mydstiny/RemoteDeskHarmonyOS
cb5c8d3b9f4ede43c7834b0a995cfb60e1213f92
github
PollenWang6/HiXD
entry/src/main/ets/services/CasLoginService.ets
arkts
syncCasCookieOnly
Sync only CAS CASTGC cookie to WebView CookieJar — write to ONE domain only. Mimics CAS server behavior: when LoginPage WebView logs in, CASTGC is set on ids.xidian.edu.cn with Domain=.xidian.edu.cn. Chromium auto-sends it to all subdomains naturally. Writing to multiple domains with manual setCookie produces cookie he...
async syncCasCookieOnly(): Promise<void> { const WCM = web_webview.WebCookieManager; const idsCookies = this.http.getAllCookies("ids.xidian.edu.cn"); if (idsCookies.length === 0) { console.warn(TAG, "syncCasCookieOnly: no ids cookies to sync"); return; } // 只提取 CASTGC,滤掉 route/JSESSION...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left syncCasCookieOnly AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#ge...
async syncCasCookieOnly(): Promise<void> { const WCM = web_webview.WebCookieManager; const idsCookies = this.http.getAllCookies("ids.xidian.edu.cn"); if (idsCookies.length === 0) { console.warn(TAG, "syncCasCookieOnly: no ids cookies to sync"); return; } // 只提取 CASTGC,滤掉 route/JSESSION...
https://github.com/PollenWang6/HiXD
3f3d5c628c6f8e61b5b34aacbbef0325d7d420d3
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelDictRuleManager.ets
arkts
importDefaultRules
导入默认规则
private async importDefaultRules(): Promise<void> { for (let i = 0; i < DEFAULT_DICT_RULES.length; i++) { const rule = DEFAULT_DICT_RULES[i]; const params: AddDictRuleParams = { name: rule.name, urlRule: rule.urlRule, showRule: rule.showRule, sortNumber: i, enab...
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 importDefaultRules AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ...
private async importDefaultRules(): Promise<void> { for (let i = 0; i < DEFAULT_DICT_RULES.length; i++) { const rule = DEFAULT_DICT_RULES[i]; const params: AddDictRuleParams = { name: rule.name, urlRule: rule.urlRule, showRule: rule.showRule, sortNumber: i, enab...
https://github.com/DaLongZhuaZi/manxia
b3770b5812f9a129ee0709c0b87d627c0ff96034
github
honjow/Next2V
shared/src/main/ets/backup/BackupValidator.ets
arkts
hasEncryptedOnlySection
True when the envelope declares any encryption-only section (userInfo). Such an envelope can only originate from a decrypted container, so restore must validate it with fromEncrypted=true.
static hasEncryptedOnlySection(envelope: BackupEnvelopeV1): boolean { if (!envelope || !Array.isArray(envelope.sections)) { return false } for (let i = 0; i < envelope.sections.length; i++) { if (BACKUP_ENCRYPTED_ONLY_SECTION_NAMES.indexOf(envelope.sections[i]) >= 0) { return true ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left hasEncryptedOnlySection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left envelope AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden...
static hasEncryptedOnlySection(envelope: BackupEnvelopeV1): boolean { if (!envelope || !Array.isArray(envelope.sections)) { return false } for (let i = 0; i < envelope.sections.length; i++) { if (BACKUP_ENCRYPTED_ONLY_SECTION_NAMES.indexOf(envelope.sections[i]) >= 0) { return true ...
https://github.com/honjow/Next2V
fcf419960e270881e163a9c674d929da94026733
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
getExtraBottomOffset
@return the extra offset to be appended to the viewport's bottom
public getExtraBottomOffset(): number { return this.mExtraBottomOffset; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getExtraBottomOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left numbe...
public getExtraBottomOffset(): number { return this.mExtraBottomOffset; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1d24b31cec2d30becf5dcde4e27cd73016d223bd
gitee
webabcd/HarmonyDemo
entry/src/main/ets/pages/basic/Hello.ets
arkts
build
构建 UI(在 build 内通过组件描述需要的 UI)
build() { Column({ space: 20 }) { // 先 import { TitleBar } from '../TitleBar'; 就可以用 TitleBar 了 // 如果之前没有 import 则可以把光标放到 TitleBar() 内然后通过快捷键 alt + enter 添加相关的 import TitleBar() Text(this.message) .fontSize(16) .fontColor(Color.Blue) /* * Button 是一个按钮组件(构造 UI ...
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() { Column({ space: 20 }) { // 先 import { TitleBar } from '../TitleBar'; 就可以用 TitleBar 了 // 如果之前没有 import 则可以把光标放到 TitleBar() 内然后通过快捷键 alt + enter 添加相关的 import TitleBar() Text(this.message) .fontSize(16) .fontColor(Color.Blue) /* * Button 是一个按钮组件(构造 UI ...
https://github.com/webabcd/HarmonyDemo
8bb106a52b01408ea29208f9953532537e0bb0c0
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/contentSource/facades/LoggingInterceptorFacade.ets
arkts
logError
错误记录辅助方法 供外部调用以记录请求过程中捕获的错误 @param url 请求 URL @param error 错误对象
logError(url: string, error: Object | string | number | boolean): void { if (!this.enabled) { return; } let message: string; if (typeof error === 'string') { message = error; } else if (error instanceof Error) { message = error.message; } else { message = String(error);...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left logError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#R...
logError(url: string, error: Object | string | number | boolean): void { if (!this.enabled) { return; } let message: string; if (typeof error === 'string') { message = error; } else if (error instanceof Error) { message = error.message; } else { message = String(error);...
https://github.com/DaLongZhuaZi/NGF
1747208c0665b26ddfd3651f6cc6816854b79f70
github
offlinecat-dev/OCNetORM
src/main/ets/query/PredicateBuilder.ets
arkts
singleValueToString
将单个值转换为字符串(用于描述)
private static singleValueToString(value: ValueType | Array<ValueType> | null): string { if (value === null) { return 'NULL' } if (Array.isArray(value)) { return PredicateBuilder.arrayToString(value) } if (typeof value === 'string') { const escaped = value.replace(/'/g, "''") ...
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 singleValueToString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:...
private static singleValueToString(value: ValueType | Array<ValueType> | null): string { if (value === null) { return 'NULL' } if (Array.isArray(value)) { return PredicateBuilder.arrayToString(value) } if (typeof value === 'string') { const escaped = value.replace(/'/g, "''") ...
https://github.com/offlinecat-dev/OCNetORM
b3cce0fc4cfbd3594d7d4c8c7bc48f4ca098c81c
github
openharmony/applications_settings
product/phone/src/main/ets/pages/bluetooth.ets
arkts
getPairStateText
Get pair state text @param device
getPairStateText(device: BluetoothDevice): string { return device.connectionState == BondState.BOND_STATE_BONDING ? JSON.parse(JSON.stringify($r('app.string.bluetooth_state_pairing'))) : ''; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPairStateText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left device AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BluetoothDevice AST#identifier#Right ...
getPairStateText(device: BluetoothDevice): string { return device.connectionState == BondState.BOND_STATE_BONDING ? JSON.parse(JSON.stringify($r('app.string.bluetooth_state_pairing'))) : ''; }
https://gitee.com/openharmony/applications_settings.git
e8f914cee4624463392d2aea5d2f539e66b35caf
gitee
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/data/api/ApiClient.ets
arkts
delete
DELETE请求
async delete<T>(url: string, headers?: Record<string, string>): Promise<ApiResponse<T>> { return this.request<T>({ url, method: http.RequestMethod.DELETE, header: headers }) }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left delete AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type...
async delete<T>(url: string, headers?: Record<string, string>): Promise<ApiResponse<T>> { return this.request<T>({ url, method: http.RequestMethod.DELETE, header: headers }) }
https://github.com/David8Idira/AI-OA
e8f5f7800fde9b6d01e6dd2292f454e3f0755d0f
github
tdcare/tdwebrtc
src/main/ets/SignalingClient.ets
arkts
sendSessionDescription
发送 SDP (offer/answer)
public sendSessionDescription(sdp: string, sdpType: string, toMac: string, roomId: string): void { const env = this.buildForwardEnvelope(toMac); const data: SignalingData = { action: sdpType, // "offer" 或 "answer" sdp: sdp, room_id: roomId, from_mac: this.mac, to_mac: toMac, ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left sendSessionDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left sdp AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
public sendSessionDescription(sdp: string, sdpType: string, toMac: string, roomId: string): void { const env = this.buildForwardEnvelope(toMac); const data: SignalingData = { action: sdpType, // "offer" 或 "answer" sdp: sdp, room_id: roomId, from_mac: this.mac, to_mac: toMac, ...
https://github.com/tdcare/tdwebrtc
7857f97c4f5f449565ca577dfe146f3d06815cb9
github
751496032/ZRouter
RouterApi/src/main/ets/api/Router.ets
arkts
addRootPageShowObserver
添加根页面显示回调 @param callback
public static addRootPageShowObserver(callback: () => void) { ZRouter.addGlobalLifecycleObserver({ onRootShow: () => { callback() } } as ILifecycleObserver) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#identifier#Left addRootPageShowObserver AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#...
public static addRootPageShowObserver(callback: () => void) { ZRouter.addGlobalLifecycleObserver({ onRootShow: () => { callback() } } as ILifecycleObserver) }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L318-L324
8c266bc4255757fa4fd80bb5eaa1621121f8d46c
github
fbinba3955/Flymby
common/src/main/ets/video/VideoPlayerView.ets
arkts
startReportProgress
开始进度上报
startReportProgress() { if (this.reportProgressListener) { clearInterval(this.reportProgressListener) } this.reportProgressListener = setInterval(() => { if (this.mPlayerStatus === PlayerStatus.PLAYING) { this.doReportProgress(this.currentTime, PlayerStatus.PLAYING) } }, 100...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startReportProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_bloc...
startReportProgress() { if (this.reportProgressListener) { clearInterval(this.reportProgressListener) } this.reportProgressListener = setInterval(() => { if (this.mPlayerStatus === PlayerStatus.PLAYING) { this.doReportProgress(this.currentTime, PlayerStatus.PLAYING) } }, 100...
https://github.com/fbinba3955/Flymby
02d90045b104acffad91ac5e4f96e48f4bd2452f
github
CLMC2025/Vignette
entry/src/main/ets/manager/SessionPlanner.ets
arkts
isCompleted
检查任务是否完成
isCompleted(): boolean { return this.userAnswer !== undefined; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isCompleted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#stateme...
isCompleted(): boolean { return this.userAnswer !== undefined; }
https://github.com/CLMC2025/Vignette
7babd816f80efa7a713bbfb52802b9db5f6924a8
github
DaLongZhuaZi/manxia
entry/src/main/ets/components/PreloadManager.ets
arkts
cleanupDistantCompleted
清理远离当前页的已完成项(节省内存)
cleanupDistantCompleted(keepRange: number = 10): void { const toRemove: number[] = []; this.completed.forEach(pageIndex => { if (Math.abs(pageIndex - this.currentPage) > keepRange) { toRemove.push(pageIndex); } }); toRemove.forEach(index => { this.completed.delete(index...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cleanupDistantCompleted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left keepRange AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#L...
cleanupDistantCompleted(keepRange: number = 10): void { const toRemove: number[] = []; this.completed.forEach(pageIndex => { if (Math.abs(pageIndex - this.currentPage) > keepRange) { toRemove.push(pageIndex); } }); toRemove.forEach(index => { this.completed.delete(index...
https://github.com/DaLongZhuaZi/manxia
b15543b54054c722439651da023d4d94f6fbb524
github
CLMC2025/Vignette
entry/src/main/ets/ui/Animations.ets
arkts
fadeIn
创建淡入动画
static fadeIn(duration: number = 300): AnimationConfig { return new AnimationConfig( AnimationType.FADE_IN, AnimationDirection.CENTER, duration, 0, Curve.EaseInOut ); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left fadeIn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left duration AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression...
static fadeIn(duration: number = 300): AnimationConfig { return new AnimationConfig( AnimationType.FADE_IN, AnimationDirection.CENTER, duration, 0, Curve.EaseInOut ); }
https://github.com/CLMC2025/Vignette
4b90e2af46db91fd6fd5ed29da2cd13d9f614de0
github
openharmony/applications_calendar_data
dataprovider/src/main/ets/DataShareAbilityAuthenticateProxy.ets
arkts
dataOperateAfterVerify
Perform database operations corresponding to permissions @Param uri indicates user's input uri @Param verifyFlag indicates the Check flag returned by permission check @Param dataParameter indicates database operation information to be performed
function dataOperateAfterVerify(uri: string, verifyFlag: number, dataParameter: DataParameter) { if (verifyFlag === PERMISSIONS_FLAG_HIGH) { dataOperateSelectorByHighAuthority(uri, dataParameter); } else if (verifyFlag === PERMISSIONS_FLAG_LOW) { dataOperateSelectorByLowAuthority(uri, dataParameter); } el...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left dataOperateAfterVerify AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left uri AST#identifier#Right AST#type_annotation#Left AST#:#Left : ...
function dataOperateAfterVerify(uri: string, verifyFlag: number, dataParameter: DataParameter) { if (verifyFlag === PERMISSIONS_FLAG_HIGH) { dataOperateSelectorByHighAuthority(uri, dataParameter); } else if (verifyFlag === PERMISSIONS_FLAG_LOW) { dataOperateSelectorByLowAuthority(uri, dataParameter); } el...
https://gitee.com/openharmony/applications_calendar_data.git
5aef95704d0daf1d5ccd86fb0ca2acdd02eec389
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
saveProvider
============ 服务商操作 ============ 保存服务商配置
async saveProvider(provider: ModelProvider, insertAtFront: boolean = false): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null) { return } // 将 models 数组转换为 JSON 字符串(使用扩展格式) const modelsArray: ModelJsonData[] = [] for (let i = 0; i < provider.models.length; i...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveProvider AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left provider AST#identifier#Right AST#type_annotation#Left AST#:#Left ...
async saveProvider(provider: ModelProvider, insertAtFront: boolean = false): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null) { return } // 将 models 数组转换为 JSON 字符串(使用扩展格式) const modelsArray: ModelJsonData[] = [] for (let i = 0; i < provider.models.length; i...
https://github.com/LongLiveY96/chatcube
95c47003dde07a26b9adc5b22f88a0b936af341d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebDAV/WebDAVNativeClient.ets
arkts
getDirectoryContents
获取目录内容(返回完整结果)
async getDirectoryContents(remotePath: string = ''): Promise<WebDAVNativeListResult> { if (!this.initialized) { await this.initialize(); } try { logger.info(TAG, `获取目录内容: ${remotePath}`); const result: WebDAVNativeListResult = getNativeModule().list(remotePath, 1); return resu...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getDirectoryContents AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left remotePath AST#identifie...
async getDirectoryContents(remotePath: string = ''): Promise<WebDAVNativeListResult> { if (!this.initialized) { await this.initialize(); } try { logger.info(TAG, `获取目录内容: ${remotePath}`); const result: WebDAVNativeListResult = getNativeModule().list(remotePath, 1); return resu...
https://github.com/DaLongZhuaZi/manxia
0659e3ba0cd91bc3d9e0bffb7a544fba5d2f2f14
github
ibestservices/ibest-ui
library/src/main/ets/components/checkbox/index.ets
arkts
handleIndeterminateChange
当不确定状态发生改变时 响应按钮UI状态图标变化
handleIndeterminateChange() { clearTimeout(this.isShowIndeterminateTimeId) if (!this.value && !this.indeterminate) { this.isShowIndeterminateTimeId = setTimeout(() => { this.isShowIndeterminateImg = false }, this.baseStyle.animationDuration as number) return } this.isShowIndeterminateImg = this.in...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleIndeterminateChange 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#statemen...
handleIndeterminateChange() { clearTimeout(this.isShowIndeterminateTimeId) if (!this.value && !this.indeterminate) { this.isShowIndeterminateTimeId = setTimeout(() => { this.isShowIndeterminateImg = false }, this.baseStyle.animationDuration as number) return } this.isShowIndeterminateImg = this.in...
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/checkbox/index.ets#L243-L252
670a577db7ea1f1ea9b8b081787b537dd0f4ad14
github
YANGZX22/Voot
entry/src/main/ets/services/ContinuityService.ets
arkts
stopDiscovering
停止发现设备
stopDiscovering(): void { if (!this.dmInstance || !this.isDiscovering) { return; } try { this.dmInstance.stopDiscovering(); this.isDiscovering = false; console.info('[ContinuityService] Stopped discovering devices'); } catch (err) { const e = err as BusinessError; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stopDiscovering 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#{#Left { AST#{#Right AST#met...
stopDiscovering(): void { if (!this.dmInstance || !this.isDiscovering) { return; } try { this.dmInstance.stopDiscovering(); this.isDiscovering = false; console.info('[ContinuityService] Stopped discovering devices'); } catch (err) { const e = err as BusinessError; ...
https://github.com/YANGZX22/Voot
25472a5b9da1d4efb2d35fdfdfd5fe5de7be8447
github
Gramony/Gramony
features/home/src/main/ets/viewmodel/Message/MessageDataSource.ets
arkts
getData
to satisfy the interface
public getData(index: number): Message { return this.sortedMessages.getValueAt(index) || nullMessage; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number ...
public getData(index: number): Message { return this.sortedMessages.getValueAt(index) || nullMessage; }
https://github.com/Gramony/Gramony
c95e41210faec386d5bfd820c926e332a30d9ad1
github
HarmonyOS_Samples/MultiPictureBeautification
features/multipicturebrowsing/src/main/ets/view/PictureListView.ets
arkts
<arrow>
Use unique id as key, never use index in key for dynamic content
(picture: PictureViewModel) => picture.id.toString()
AST#program#Left AST#expression_statement#Left AST#arrow_function#Left AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left picture AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier#Left PictureViewModel AST#type_identifier#Right AS...
(picture: PictureViewModel) => picture.id.toString()
https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification
26a5a9aa291a63de1d535164a9582255038b381e
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
includes
Checks if specified argument is in BigUint64Array @param e search element @param fromIndex start index to search from @returns true if e is in BigUint64Array, false otherwise
public includes(e: BigInt, fromIndex: number): boolean { return this.includes(e, fromIndex as int) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BigInt AST...
public includes(e: BigInt, fromIndex: number): boolean { return this.includes(e, fromIndex as int) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
cc3e096c3554db3270ea318d97662400eff67af6
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/String.ets
arkts
sub
The sub() method creates a string that embeds a string in a <sub> element (<sub>str</sub>), which causes a string to be displayed in a big font.
public sub(): String{ return this.CreateHTMLString("sub", "") }
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#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right...
public sub(): String{ return this.CreateHTMLString("sub", "") }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
0d9786d2a730b2d428ef7d5f0122bf997f8f7908
gitee
codelably/tuniao-ui
core/tuniaoui/src/main/ets/components/toast/TnToast.ets
arkts
closeImmediate
立即关闭(用于连续调用 show() 时清理前一个)
private closeImmediate(): void { this.clearTimer(); if (this.contentNode !== null && this.uiContext !== null) { const node: ComponentContent<TnToastParams> = this.contentNode; try { this.uiContext.getPromptAction().closeCustomDialog(node); } catch (_e) { // 忽略异常 } ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left closeImmediate 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#expr...
private closeImmediate(): void { this.clearTimer(); if (this.contentNode !== null && this.uiContext !== null) { const node: ComponentContent<TnToastParams> = this.contentNode; try { this.uiContext.getPromptAction().closeCustomDialog(node); } catch (_e) { // 忽略异常 } ...
https://github.com/codelably/tuniao-ui
663225fe693c2a2d7acdad947ca6a6269080b796
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/OCRRecognition.ets
arkts
extractFirstNumber
从字符串中提取第一个数字
private static extractFirstNumber(text: string): number { let numStr = ''; let hasDecimal = false; let started = false; for (let i = 0; i < text.length; i++) { const char = text.charAt(i); if (char >= '0' && char <= '9') { numStr += char; started = true; } else if (c...
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 extractFirstNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#L...
private static extractFirstNumber(text: string): number { let numStr = ''; let hasDecimal = false; let started = false; for (let i = 0; i < text.length; i++) { const char = text.charAt(i); if (char >= '0' && char <= '9') { numStr += char; started = true; } else if (c...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
8a8e000fdd2c4ff5b7a3a96497d4b831f338b5e9
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/unary_plus/unary_plus_uint.ets
arkts
main
--- desc: check unary plus operation for unsigned integer operand ---
function main(): void { const v: uint = {{v.value}} assert +(v) == {{v.result}}
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A...
function main(): void { const v: uint = {{v.value}} assert +(v) == {{v.result}}
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
0d679205337076e6789582522a3ab0667737b59d
gitee
JackJiang2011/harmonychat
entry/src/main/ets/pages/ChatPage.ets
arkts
beKickout
被踢的处理逻辑。
beKickout(kickoutInfo: PKickoutInfo) { // 首先释放IM所占资源 IMClientManager.getInstance().releaseMobileIMSDK(); // 提示信息 let alertContent: string = ''; if (kickoutInfo.code === PKickoutInfo.KICKOUT_FOR_DUPLICATE_LOGIN) { alertContent = '账号已在其它地方登陆,当前会话已断开,请退出后重新登陆!'; } else if (kickoutInfo.code...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left beKickout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left kickoutInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PKickoutInfo AST#identif...
beKickout(kickoutInfo: PKickoutInfo) { // 首先释放IM所占资源 IMClientManager.getInstance().releaseMobileIMSDK(); // 提示信息 let alertContent: string = ''; if (kickoutInfo.code === PKickoutInfo.KICKOUT_FOR_DUPLICATE_LOGIN) { alertContent = '账号已在其它地方登陆,当前会话已断开,请退出后重新登陆!'; } else if (kickoutInfo.code...
https://github.com/JackJiang2011/harmonychat
37de6be77f0f18c34ee36106920cd811e0cd4e57
github
kumaleap/ArkLuban
library/src/main/ets/luban/LogUtil.ets
arkts
print
打印JSON对象和JSON字符串 @param obj
static print(tag: string, obj: object | string) { try { if (typeof obj === 'object') { let str = JSON.stringify(obj, null, 2) let arr: string[] = str.split('\n') for (let index = 0; index < arr.length; index++) { LogUtil.debug(tag, arr[index]) } } else { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left print AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:...
static print(tag: string, obj: object | string) { try { if (typeof obj === 'object') { let str = JSON.stringify(obj, null, 2) let arr: string[] = str.split('\n') for (let index = 0; index < arr.length; index++) { LogUtil.debug(tag, arr[index]) } } else { ...
https://github.com/kumaleap/ArkLuban
cc1df0f70599ae40a5a2ec30472ee237157f4932
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryBuilder.ets
arkts
withWhere
关联条件过滤(预加载时应用条件) @param relationName 关联路径,支持嵌套(如 posts.comments) @param callback 过滤条件回调 @returns 当前实例(支持链式调用)
withWhere(relationName: string, callback: (qb: QueryBuilder) => void): QueryBuilder { const normalizedRelationPath = this.normalizeRelationPath(relationName) const targetEntityName = this.resolveRelationPathTargetEntity(normalizedRelationPath) if (targetEntityName.length === 0) { this.morphRelationQ...
AST#program#Left AST#ERROR#Left AST#identifier#Left withWhere AST#identifier#Right AST#(#Left ( AST#(#Right AST#identifier#Left relationName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#Right AST#call_expression#Left AST#identifi...
withWhere(relationName: string, callback: (qb: QueryBuilder) => void): QueryBuilder { const normalizedRelationPath = this.normalizeRelationPath(relationName) const targetEntityName = this.resolveRelationPathTargetEntity(normalizedRelationPath) if (targetEntityName.length === 0) { this.morphRelationQ...
https://github.com/offlinecat-dev/OCNetORM
babbbab33844755fd370bd230a3a4219803cb344
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/GroupManagementDialog.ets
arkts
toggleGroupSelection
切换分组选中状态
toggleGroupSelection(groupName: string): void { const newSet = new Set(this.selectedGroups); if (newSet.has(groupName)) { newSet.delete(groupName); } else { newSet.add(groupName); } this.selectedGroups = newSet; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleGroupSelection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left groupName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left...
toggleGroupSelection(groupName: string): void { const newSet = new Set(this.selectedGroups); if (newSet.has(groupName)) { newSet.delete(groupName); } else { newSet.add(groupName); } this.selectedGroups = newSet; }
https://github.com/DaLongZhuaZi/manxia
86116db908cd8581852b6c600c7b315cf1445a9e
github
ibestservices/ibest-ui
library/src/main/ets/components/picker/index.ets
arkts
getValueByIndex
根据索引获取值
getValueByIndex(): IBestStringNumber[]{ return this.getColumns().map((item, index) => item[this.indexArr[index]]?.value ?? "") }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getValueByIndex 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#call_expression#...
getValueByIndex(): IBestStringNumber[]{ return this.getColumns().map((item, index) => item[this.indexArr[index]]?.value ?? "") }
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/picker/index.ets#L559-L561
43025409988e4441df42ac5c2e63f6c979169e12
github
arkui-x/samples
CodeLab/Cases/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets
arkts
getTitleOpacityOptions
获取子标题显隐参数 @returns {number} 子标题显隐系数
getTitleOpacityOptions(): number { return (this.heightValue - this.animationAttribute.normalTitleHeight) / (this.animationAttribute.expandTitleHeight - this.animationAttribute.normalTitleHeight) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getTitleOpacityOptions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST...
getTitleOpacityOptions(): number { return (this.heightValue - this.animationAttribute.normalTitleHeight) / (this.animationAttribute.expandTitleHeight - this.animationAttribute.normalTitleHeight) }
https://gitcode.com/arkui-x/samples
57d5b1f055e02f71777f5d347472a424a753c0ad
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Theme/AppColors.ets
arkts
getShadowColor
获取阴影颜色(带透明度) @param elevation 阴影高度 (0-24) @returns 阴影颜色字符串
static getShadowColor(elevation: number): string { // 根据elevation计算透明度,范围从0.05到0.3 const alpha = Math.min(0.05 + elevation * 0.01, 0.3); return AppColors.withAlpha(ColorRole.SHADOW, alpha); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getShadowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left elevation AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numbe...
static getShadowColor(elevation: number): string { // 根据elevation计算透明度,范围从0.05到0.3 const alpha = Math.min(0.05 + elevation * 0.01, 0.3); return AppColors.withAlpha(ColorRole.SHADOW, alpha); }
https://github.com/DaLongZhuaZi/manxia
fa223a8e7402a4e498d3e16819ebdef3f2ab2520
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/userdata/history/classes/meowHistoryChunk.ets
arkts
constructor
Constructor for meowHistoryChunk. @param chunkBasePath The base path of the histories. E.g. ".../history". @param indexBasePath The base path of the indices. E.g. ".../history-index". @param chunkName The name of the chunk. Expected "history_YYYY_MM.txt". @author Assisted by DeepSeek @ 2026 Mar 31
constructor(chunkBasePath: string, indexBasePath: string, chunkName: string) { this.indexBasePath = indexBasePath; this.chunkBasePath = chunkBasePath; this.chunkName = chunkName; // Derive the file paths of this chunk according to given chunkName. this.chunkPath = `${chunkBasePath}/${chunkName}`; ...
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 chunkBasePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right ...
constructor(chunkBasePath: string, indexBasePath: string, chunkName: string) { this.indexBasePath = indexBasePath; this.chunkBasePath = chunkBasePath; this.chunkName = chunkName; // Derive the file paths of this chunk according to given chunkName. this.chunkPath = `${chunkBasePath}/${chunkName}`; ...
https://github.com/awaLiny2333/LinysBrowser_NEXT
f5694213e366d1a7e829d32e0bcc830f99b999f3
github
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/pages/BillListPage.ets
arkts
showClearEndDatePickerDialog
显示结束日期选择器
showClearEndDatePickerDialog() { this.showClearEndDatePicker = true; this.showClearStartDatePicker = false; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showClearEndDatePickerDialog 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#state...
showClearEndDatePickerDialog() { this.showClearEndDatePicker = true; this.showClearStartDatePicker = false; }
https://github.com/qiuhaotc/HarmonyOSPlayground
437d74ea762f6c93ae631263abad22e00938bdee
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Task/BackgroundTaskManager.ets
arkts
getMainTaskProgress
获取当前主要任务进度
public getMainTaskProgress(): TaskProgress | null { const activeTasks = this.getActiveTasks(); if (activeTasks.length === 0) { return null; } const runningTask = activeTasks.find((task: BackgroundTask) => task.status === TaskStatus.RUNNING); return runningTask ? runningTask.progress : activ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMainTaskProgress 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#...
public getMainTaskProgress(): TaskProgress | null { const activeTasks = this.getActiveTasks(); if (activeTasks.length === 0) { return null; } const runningTask = activeTasks.find((task: BackgroundTask) => task.status === TaskStatus.RUNNING); return runningTask ? runningTask.progress : activ...
https://github.com/DaLongZhuaZi/manxia
1f60079618f15ab56f3a14b74f63dc264c2cd2c4
github
Countly/countly-sdk-hos
library/src/main/ets/internal/modules/ModuleCrashes.ets
arkts
capOverallStack
Final char-ceiling for the whole crash payload, protects against pathological Worker stacks pushing the request past sane wire sizes. Per-line and per-thread caps already ran upstream.
private capOverallStack(stack: string): string { if (!stack) return ''; return stack.length > MAX_STACK_TRACE_CHARS ? stack.substring(0, MAX_STACK_TRACE_CHARS) : stack; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left capOverallStack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stack AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
private capOverallStack(stack: string): string { if (!stack) return ''; return stack.length > MAX_STACK_TRACE_CHARS ? stack.substring(0, MAX_STACK_TRACE_CHARS) : stack; }
https://github.com/Countly/countly-sdk-hos
a4166f566a507d9d1b144e1ef0ab61b47d413850
github
openharmony/developtools_profiler
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Legend.ets
arkts
calculateDimensions
Calculates the dimensions of the Legend. This includes the maximum width and height of a single entry, as well as the total width and height of the Legend. @param labelpaint
public calculateDimensions(labelpaint: Paint, viewPortHandler: ViewPortHandler): void { var defaultFormSize: number = Utils.convertDpToPixel(this.mFormSize); var stackSpace: number = Utils.convertDpToPixel(this.mStackSpace); var formToTextSpace: number = Utils.convertDpToPixel(this.mFormToTextSpace); ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left calculateDimensions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left labelpaint AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Paint ...
public calculateDimensions(labelpaint: Paint, viewPortHandler: ViewPortHandler): void { var defaultFormSize: number = Utils.convertDpToPixel(this.mFormSize); var stackSpace: number = Utils.convertDpToPixel(this.mStackSpace); var formToTextSpace: number = Utils.convertDpToPixel(this.mFormToTextSpace); ...
https://gitee.com/openharmony/developtools_profiler.git
8f7fdc5702af08ec3c63166e711a20058029fbb4
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
setRendererLeftYAxis
Sets a custom axis renderer for the left axis and overwrites the existing one. @param rendererLeftYAxis
public setRendererLeftYAxis(rendererLeftYAxis: YAxisRenderer): void { this.mAxisRendererLeft = rendererLeftYAxis; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setRendererLeftYAxis AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left rendererLeftYAxis AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Lef...
public setRendererLeftYAxis(rendererLeftYAxis: YAxisRenderer): void { this.mAxisRendererLeft = rendererLeftYAxis; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
2f08713b7a4a5bbaf1f245b704236b2da86a2f3c
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
buildSearchReferencesJson
============ 消息操作 ============
private buildSearchReferencesJson(message: ChatMessage): string { if (message.searchReferences.length === 0) { return '' } const refsArray: SearchReferenceJsonData[] = [] for (let i = 0; i < message.searchReferences.length; i++) { const ref = message.searchReferences[i] refsArray.pu...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildSearchReferencesJson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#...
private buildSearchReferencesJson(message: ChatMessage): string { if (message.searchReferences.length === 0) { return '' } const refsArray: SearchReferenceJsonData[] = [] for (let i = 0; i < message.searchReferences.length; i++) { const ref = message.searchReferences[i] refsArray.pu...
https://github.com/LongLiveY96/chatcube
ab15079327996d03cfe4ba4f7e085fdf4ac7d231
github
XJTUWYD/ArkDiff
entry/src/main/ets/viewmodel/DiffSessionViewModel.ets
arkts
isSideEditing
检查分栏中某侧某行是否在编辑中
isSideEditing(sbsLineIndex: number, side: 'left' | 'right'): boolean { return this.sideEditState !== null && this.sideEditState.lineIndex === sbsLineIndex && this.sideEditSide === side; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isSideEditing AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sbsLineIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , A...
isSideEditing(sbsLineIndex: number, side: 'left' | 'right'): boolean { return this.sideEditState !== null && this.sideEditState.lineIndex === sbsLineIndex && this.sideEditSide === side; }
https://github.com/XJTUWYD/ArkDiff
7c1385fe01253a9caacf1d15f116683bba44f540
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
saveOnlinePageFromSource
保存在线页面信息(兼容旧方法)
async saveOnlinePageFromSource(chapterId: string, pageData: ESObject): Promise<string> { try { const now = Date.now(); const pageId = this.generateId(); const sql = `INSERT INTO online_page (id, chapterId, pageNumber, imageUrl, requestHeaders, width, height, fileSize, createT...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveOnlinePageFromSource AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left chapterId AST#identifier#Right AST#type_annotation#Lef...
async saveOnlinePageFromSource(chapterId: string, pageData: ESObject): Promise<string> { try { const now = Date.now(); const pageId = this.generateId(); const sql = `INSERT INTO online_page (id, chapterId, pageNumber, imageUrl, requestHeaders, width, height, fileSize, createT...
https://github.com/DaLongZhuaZi/manxia
6d1ec99c7ddef9ed45df97363ac07761e592579d
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/DownloadsViewModel.ets
arkts
recreateLostTask
丢失任务重建
private async recreateLostTask(record: DownloadRecordInfo) { if (!record.url || !this.context) { record.status = request.agent.State.FAILED; return; } logger.info(`restartTask: 系统任务丢失, 使用链接重建: ${record.url}`); try { const db = getDownloadRecordTable(this.context); const fileNa...
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 recreateLostTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Le...
private async recreateLostTask(record: DownloadRecordInfo) { if (!record.url || !this.context) { record.status = request.agent.State.FAILED; return; } logger.info(`restartTask: 系统任务丢失, 使用链接重建: ${record.url}`); try { const db = getDownloadRecordTable(this.context); const fileNa...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/DownloadsViewModel.ets#L388-L413
79317b4fdf35c230b3773912ff1141bcdb9b24bc
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryBuilder.ets
arkts
limit
设置 LIMIT @param count 限制数量 @returns 当前实例(支持链式调用)
limit(count: number): QueryBuilder { if (count < 0) { throw new InvalidConditionError('LIMIT', 'LIMIT 值不能为负数') } this.limitValue = count return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left limit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left count AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Ri...
limit(count: number): QueryBuilder { if (count < 0) { throw new InvalidConditionError('LIMIT', 'LIMIT 值不能为负数') } this.limitValue = count return this }
https://github.com/offlinecat-dev/OCNetORM
e4291d15beec5430bbf2f172c3518ab68032338a
github
din0sauria/audio-deepfake-detection
entry/src/main/ets/utils/WindowManager.ets
arkts
setStatusBarLight
设置安全区域文字颜色为浅色
static async setStatusBarLight() { const context = getContext() const win = await window.getLastWindow(context) win.setWindowSystemBarProperties({ statusBarContentColor: "#ffffff" }) }
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 setStatusBarLight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
static async setStatusBarLight() { const context = getContext() const win = await window.getLastWindow(context) win.setWindowSystemBarProperties({ statusBarContentColor: "#ffffff" }) }
https://github.com/din0sauria/audio-deepfake-detection
3e97ada620598f71d8de1ff64f4d4d78888efe56
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Network/ProxyManager.ets
arkts
getHttpRequestProxy
获取用于HTTP请求的代理配置
getHttpRequestProxy(): string | undefined { if (!this.config.enabled) { return undefined; } if (this.config.protocol === ProxyProtocol.SOCKS5) { const bridgePort = this.localBridge.getPort(); if (bridgePort > 0) { return `127.0.0.1:${bridgePort}`; } return undefined; ...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getHttpRequestProxy 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#s...
getHttpRequestProxy(): string | undefined { if (!this.config.enabled) { return undefined; } if (this.config.protocol === ProxyProtocol.SOCKS5) { const bridgePort = this.localBridge.getPort(); if (bridgePort > 0) { return `127.0.0.1:${bridgePort}`; } return undefined; ...
https://github.com/DaLongZhuaZi/manxia
a87be60b16fddffffbd6343ab087df4025588ef3
github
richshaw2015/nds
ohos/entry/src/main/ets/types/MelonDSNative.ets
arkts
initEmulator
初始化模拟器 @param filesDir 应用数据目录路径 @param cacheDir 缓存目录路径 @returns 初始化是否成功
static initEmulator(filesDir: string, cacheDir: string): boolean { return MelonDSNative.native.initEmulator(filesDir, cacheDir); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left initEmulator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filesDir AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#R...
static initEmulator(filesDir: string, cacheDir: string): boolean { return MelonDSNative.native.initEmulator(filesDir, cacheDir); }
https://github.com/richshaw2015/nds
b9a01d265b5e0d09353ff8f4c497caa43ecfe0c4
github
erosTeam/NextE
feature/user/src/main/ets/viewmodel/FavoritesViewModel.ets
arkts
load
First load / reload of the current favcat from page 1.
async load(): Promise<void> { if (this.isLoading) { return } // All page-1 reset paths funnel through load() — bump here so any in-flight loadMore is voided. // Keep current rows visible until the replacement page succeeds; selector switches must not // blank the whole Favorites body. Drop t...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left load AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left...
async load(): Promise<void> { if (this.isLoading) { return } // All page-1 reset paths funnel through load() — bump here so any in-flight loadMore is voided. // Keep current rows visible until the replacement page succeeds; selector switches must not // blank the whole Favorites body. Drop t...
https://github.com/erosTeam/NextE
a3e1d6d8b07300633457dae514bf63c11365d409
github
harmonyos/codelabs
HarmonyOS_NEXT/LoginDemo/entry/src/main/ets/common/utils/CommonUtils.ets
arkts
loginCheckArkTS
CHeck account and password is it empty. @param {string} account account @param {string} password password @return {Resource|string} return check result
private loginCheckArkTS(account: string, password: string): Resource | string { let check: string = ''; if (account === '') { return $r('app.string.please_input_account'); } else if (password === '') { return $r('app.string.please_input_password'); } else { check = CommonConstants.L...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left loginCheckArkTS AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left account AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
private loginCheckArkTS(account: string, password: string): Resource | string { let check: string = ''; if (account === '') { return $r('app.string.please_input_account'); } else if (password === '') { return $r('app.string.please_input_password'); } else { check = CommonConstants.L...
https://gitee.com/harmonyos/codelabs.git
324ffc2c413bbc41f2904026b949f6f39faf3092
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/NotificationService.ets
arkts
clearAll
清空所有通知
static async clearAll(): Promise<void> { const userId =await UserSessionService.getCurrentUserId(); if (!userId) { return; } await NotificationDAO.clearAll(userId); }
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 clearAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left ...
static async clearAll(): Promise<void> { const userId =await UserSessionService.getCurrentUserId(); if (!userId) { return; } await NotificationDAO.clearAll(userId); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
330c274c20c8b13d15922b7fc22516fcbee166cf
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/interop/js/JSRuntime.ets
arkts
setElementBoolean
=================== setElement<TYPE>() ===================
public static setElementBoolean(object: JSValue, index: int, value: boolean): void { 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 setElementBoolean AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left object AST#identifier#Right AST#:#Lef...
public static setElementBoolean(object: JSValue, index: int, value: boolean): void { JSRuntime.checkIntrinsicMethod(); }
https://gitcode.com/iop123123/arkts-static-skills
b41434dee9f068a2a671b6cd00129b5d1d78ca08
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayBlockingQueue.ets
arkts
poll
The poll operation. Pop one element and return it if the queue is not empty. Returns undefined when the queue is empty. No blocking. @returns { T | undefined } the deleted element or when the queue is empty.
override poll(): T | undefined { ConcurrencyHelpers.mutexLock(this.mutex); try { if (this.isQueueEmpty) { return undefined; } const val = this.array[this.curHeadIdx]; this.increaseHeadIdx(); ...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left poll AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#c...
override poll(): T | undefined { ConcurrencyHelpers.mutexLock(this.mutex); try { if (this.isQueueEmpty) { return undefined; } const val = this.array[this.curHeadIdx]; this.increaseHeadIdx(); ...
https://gitcode.com/iop123123/arkts-static-skills
bd0272271b15a5a4b6aea38ca349ec77e403eaad
gitcode
erosTeam/NextE
shared/src/main/ets/settings/CustomProfilesSettings.ets
arkts
remove
Delete a custom (non-built-in) profile; falls back to the first profile if the selected one goes.
static async remove(context: common.UIAbilityContext, uuid: string): Promise<void> { const state: CustomProfilesState = connectCustomProfiles() const target: CustomProfile | null = state.findByUuid(uuid) if (target === null || target.builtin) { return } const next: CustomProfile[] = [] s...
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 remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#R...
static async remove(context: common.UIAbilityContext, uuid: string): Promise<void> { const state: CustomProfilesState = connectCustomProfiles() const target: CustomProfile | null = state.findByUuid(uuid) if (target === null || target.builtin) { return } const next: CustomProfile[] = [] s...
https://github.com/erosTeam/NextE
267694132565a4eb6ee902b8d4a3050e76a8d409
github
bhengubv/aether-protocol
arkts/src/main/ets/protocol/Ed25519Provider.ets
arkts
constructor
Wraps a 32-byte seed; derives and caches the public key.
constructor(seed: Uint8Array) { if (seed.length !== ED25519_SEED_LENGTH) { throw new Error(`Ed25519 seed must be ${ED25519_SEED_LENGTH} bytes (got ${seed.length})`); } this.seed = seed.slice(); this.publicKey = getPublicKey(this.seed); }
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 seed AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uint8Array AST#identifier#Rig...
constructor(seed: Uint8Array) { if (seed.length !== ED25519_SEED_LENGTH) { throw new Error(`Ed25519 seed must be ${ED25519_SEED_LENGTH} bytes (got ${seed.length})`); } this.seed = seed.slice(); this.publicKey = getPublicKey(this.seed); }
https://github.com/bhengubv/aether-protocol
cca842f2bf04a9ce223f0a5c3e4d2e10770a6469
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/database/IndexManager.ets
arkts
createEventSourcingIndexes
创建事件溯源表的索引
private static async createEventSourcingIndexes(): Promise<void> { const store = DatabaseManager.getDatabase(); try { // 领域事件表 - 聚合事件查询索引 await store.executeSql(` CREATE INDEX IF NOT EXISTS idx_domain_events_aggregate ON domain_events(aggregate_type, aggregate_id, version); ...
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 createEventSourcingIndexes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Righ...
private static async createEventSourcingIndexes(): Promise<void> { const store = DatabaseManager.getDatabase(); try { // 领域事件表 - 聚合事件查询索引 await store.executeSql(` CREATE INDEX IF NOT EXISTS idx_domain_events_aggregate ON domain_events(aggregate_type, aggregate_id, version); ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
13a2161696be30ab33f365a7db58e3d216facb06
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
reverse
Creates a new Uint8ClampedArray using reversed data from the current one @returns a new Uint8ClampedArray using reversed data from the current one
public reverse(): Uint8ClampedArray { let res = new Uint8ClampedArray(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 Uint8ClampedAr...
public reverse(): Uint8ClampedArray { let res = new Uint8ClampedArray(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
e22aceadc96b20c3d902b1059dc2fbe1289bba1d
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/deepseek/DeepSeekChatManager.ets
arkts
sendMessage
多轮对话 - 发送消息
async sendMessage( sessionId: string, userMessage: string, systemPrompt?: string ): Promise<string> { // 添加用户消息到历史 siliconFlowClient.addMessageToSession(sessionId, { role: 'user', content: userMessage }); // 获取历史消息 const history = siliconFlowClient.getSessionHistory(sess...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left sendMessage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sessionId AST#identifier#Right AST#type_annotation#Left AS...
async sendMessage( sessionId: string, userMessage: string, systemPrompt?: string ): Promise<string> { // 添加用户消息到历史 siliconFlowClient.addMessageToSession(sessionId, { role: 'user', content: userMessage }); // 获取历史消息 const history = siliconFlowClient.getSessionHistory(sess...
https://github.com/LJ666-ui/harmony-health-care
35e5d304553f3f5a5799a349feda1f9fcb4cdb74
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
constructor
Creates an Float64Array with respect to buf. @param { ArrayLike<Number> | ArrayBuffer } buf - data initializer @throws { RangeError } - Input parameter error. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLength = (buf as ArrayBuffer).getByteLength() if (this.byteLength % Float64Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength should ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Lef...
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLength = (buf as ArrayBuffer).getByteLength() if (this.byteLength % Float64Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength should ...
https://gitcode.com/iop123123/arkts-static-skills
6ac8e3e0d6c08a3e0402d2e771cc72a354db5958
gitcode
the-wwyang/kids-learning-app
src/main/ets/common/UserService.ets
arkts
bindPhone
绑定手机号到现有账户
public async bindPhone(username: string, phone: string, code: string): Promise<OperationResult> { if (!this.isValidPhone(phone)) { return new OperationResult(false, '请输入正确的手机号'); } // 验证验证码 const isCodeValid = await this.verifyCode(phone, code); if (!isCodeValid) { return new Operatio...
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 bindPhone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : AST...
public async bindPhone(username: string, phone: string, code: string): Promise<OperationResult> { if (!this.isValidPhone(phone)) { return new OperationResult(false, '请输入正确的手机号'); } // 验证验证码 const isCodeValid = await this.verifyCode(phone, code); if (!isCodeValid) { return new Operatio...
https://github.com/the-wwyang/kids-learning-app
8f84be7b0f9776b5de229297f6e82663a2da2f7f
github
Nekofox-POT/LinMusic
entry/src/main/ets/package/audio_player/class_audio_player.ets
arkts
toggle_like
更改歌曲喜欢 //
toggle_like() { try { // 获取ino // const tmp = `${fs.statSync(this.play_list[this.play_list_index]).ino}` // 扫描判断 // const index = this.like_list.findIndex(item => item === tmp) if (index !== -1) { log('取消喜欢.') this.like_list.splice(index, 1) this.like_list_p...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left toggle_like 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...
toggle_like() { try { // 获取ino // const tmp = `${fs.statSync(this.play_list[this.play_list_index]).ino}` // 扫描判断 // const index = this.like_list.findIndex(item => item === tmp) if (index !== -1) { log('取消喜欢.') this.like_list.splice(index, 1) this.like_list_p...
https://github.com/Nekofox-POT/LinMusic
bc3795030d767d8880a692682948af3506a408d2
github
trueWangSyutung/Sensitive-Word-Blocking-Module-For-OHOS
sensitiveinput/src/main/ets/module/SensitiveWordChecker.ets
arkts
getWordsByType
根据类型获取敏感词 @param type 类型 @returns 该类型下的敏感词列表
public getWordsByType(type: string): Array<string> { // 这个方法在Trie树结构中较难实现,需要遍历整个树 // 在实际应用中,可以考虑在构建Trie树时同时维护一个类型到词的映射 return []; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getWordsByType 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 s...
public getWordsByType(type: string): Array<string> { // 这个方法在Trie树结构中较难实现,需要遍历整个树 // 在实际应用中,可以考虑在构建Trie树时同时维护一个类型到词的映射 return []; }
https://github.com/trueWangSyutung/Sensitive-Word-Blocking-Module-For-OHOS
fdad23193d8cd8ab18224d809df44c9b50c352d6
github
AGenUI/AGenUI
playground/harmony/entry/src/main/ets/stability/StabilityScenarioEngine.ets
arkts
executeMultiSurface
S3: Multiple surfaces active simultaneously
private executeMultiSurface(): string | null { const sm = new SurfaceManager(this.context); sm.beginTextStream(); for (let i = 0; i < 5; i++) { sm.receiveTextChunk(this.buildCreateSurfaceJSON(`multi-${i}`)); } for (let j = 0; j < 20; j++) { const idx = Math.floor(Math.random() * 5); ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left executeMultiSurface 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_expressi...
private executeMultiSurface(): string | null { const sm = new SurfaceManager(this.context); sm.beginTextStream(); for (let i = 0; i < 5; i++) { sm.receiveTextChunk(this.buildCreateSurfaceJSON(`multi-${i}`)); } for (let j = 0; j < 20; j++) { const idx = Math.floor(Math.random() * 5); ...
https://github.com/AGenUI/AGenUI
12e7bb527b31854cafc4574460de464a1e8e25c7
github