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 |
|---|---|---|---|---|---|---|---|---|---|---|
Coke0807/NewsAPP-HarmonyOS | NewsApp/entry/src/main/ets/pages/NewsPage.ets | arkts | handleLogout | 处理退出登录 | handleLogout() {
AuthUtil.clearLoginInfo();
promptAction.showToast({ message: '已退出登录' });
router.replaceUrl({ url: 'pages/LoginPage' });
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleLogout 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 ... | handleLogout() {
AuthUtil.clearLoginInfo();
promptAction.showToast({ message: '已退出登录' });
router.replaceUrl({ url: 'pages/LoginPage' });
} | https://github.com/Coke0807/NewsAPP-HarmonyOS | d8dbfa67bf369211cf936452be6aebe356c62ecb | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/NovelSourceManagementPage.ets | arkts | hideSourceContextMenu | 隐藏书源操作菜单 | hideSourceContextMenu(): void {
this.showSourceContextMenu = false;
this.contextMenuHoverAction = '';
this.contextMenuSource = null;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hideSourceContextMenu 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#statem... | hideSourceContextMenu(): void {
this.showSourceContextMenu = false;
this.contextMenuHoverAction = '';
this.contextMenuSource = null;
} | https://github.com/DaLongZhuaZi/manxia | dceb33c215059db8b9588193b1fb1468c0ff7e4e | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/TaskExecutor.ets | arkts | registerWorkflows | 批量注册工作流 | registerWorkflows(workflows: Record<string, Action[]>): void {
const names = Object.keys(workflows);
for (let i = 0; i < names.length; i++) {
const name = names[i];
const actions = workflows[name];
if (actions) {
this.registerWorkflow(name, actions);
}
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerWorkflows AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left workflows AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Record AST#iden... | registerWorkflows(workflows: Record<string, Action[]>): void {
const names = Object.keys(workflows);
for (let i = 0; i < names.length; i++) {
const name = names[i];
const actions = workflows[name];
if (actions) {
this.registerWorkflow(name, actions);
}
}
} | https://github.com/DaLongZhuaZi/manxia | 139aeecfb4b56c75f0f8ac2de5ef5d26954b8a36 | github |
openharmony/multimedia_camera_framework | frameworks/js/camera_napi/demo/entry/src/main/ets/Dialog/SettingDialog.ets | arkts | getHdrVideoBol | HDR录像持久化,再次进入,确定开关是否开启 | getHdrVideoBol(bol: boolean): void {
let cameraConfig: CameraConfig = GlobalContext.get().getObject('cameraConfig') as CameraConfig;
cameraConfig.hdrVideoBol = bol;
GlobalContext.get().setObject('cameraConfig', cameraConfig);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getHdrVideoBol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bol AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#)#Left ) ... | getHdrVideoBol(bol: boolean): void {
let cameraConfig: CameraConfig = GlobalContext.get().getObject('cameraConfig') as CameraConfig;
cameraConfig.hdrVideoBol = bol;
GlobalContext.get().setObject('cameraConfig', cameraConfig);
} | https://gitee.com/openharmony/multimedia_camera_framework.git | e1c54f712cdfd23e0e7a28240970361b6a844135 | gitee |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/utils/FootprintManager.ets | arkts | getAllFootprints | Get all footprints | private static async getAllFootprints(): Promise<IFootprint[]> {
try {
if (!FootprintManager.preferencesInstance) {
console.error('FootprintManager: Preferences not initialized');
return [];
}
const footprintsJson = await FootprintManager.preferencesInstance.get(FootprintManager... | 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 getAllFootprints AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#argu... | private static async getAllFootprints(): Promise<IFootprint[]> {
try {
if (!FootprintManager.preferencesInstance) {
console.error('FootprintManager: Preferences not initialized');
return [];
}
const footprintsJson = await FootprintManager.preferencesInstance.get(FootprintManager... | https://github.com/Harrisonls2004/WaterFlow | 97be4c8e07f08545963b4b1c3e91e2bf70fd8c1f | github |
OHPG/FinSdk | jellyfin/src/main/ets/api/VideosApi.ets | arkts | mergeVersions | mergeVersions
@summary Merges videos into a single record.
@param {VideosApiMergeVersionsRequest} requestParameters Request parameters.
@throws {RequiredError}
@memberof VideosApi | public async mergeVersions(requestParameters: VideosApiMergeVersionsRequest): Promise<void> {
return this.apiClient.get({path: "/Videos/MergeVersions", parameters: requestParameters})
} | 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 mergeVersions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST... | public async mergeVersions(requestParameters: VideosApiMergeVersionsRequest): Promise<void> {
return this.apiClient.get({path: "/Videos/MergeVersions", parameters: requestParameters})
} | https://github.com/OHPG/FinSdk | ce4504ca21ae31fafd453e3ca9a179ad8bf895d8 | github |
apap6628114/nga_oh | entry/src/main/ets/parser/_shared/HtmlEntityCodec.ets | arkts | fromCodePoint | HTML 实体解码统一工具
项目内存在两类语义不同的解码需求,此处集中导出,避免多份重复实现:
- `decodeHtmlEntities`:BBCode 帖子正文解码。除标准实体外,还需把 `<br>` 转为换行、
剥离残余 HTML 标签,因为 BBCode 解析器以纯文本切片为单位处理。
- `unescapeHtml`:纯文本字段(用户名、标题、签名、消息内容等)解码,仅反转实体,
不触碰 `<`、标签或换行,避免吞掉合法文本。
两者都支持 `[` / `]` / ` ` / `&#十进制;` / `&#x十六进制;`(含 BMP 之外代理对编码)。
把单个码点转为字符串,码点在 BMP 之外时输出... | function fromCodePoint(code: number): string {
if (code <= 0xFFFF) return String.fromCharCode(code)
const hi: number = 0xD800 + ((code - 0x10000) >> 10)
const lo: number = 0xDC00 + ((code - 0x10000) & 0x3FF)
return String.fromCharCode(hi) + String.fromCharCode(lo)
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left fromCodePoint AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left code AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function fromCodePoint(code: number): string {
if (code <= 0xFFFF) return String.fromCharCode(code)
const hi: number = 0xD800 + ((code - 0x10000) >> 10)
const lo: number = 0xDC00 + ((code - 0x10000) & 0x3FF)
return String.fromCharCode(hi) + String.fromCharCode(lo)
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/_shared/HtmlEntityCodec.ets#L19-L24 | 67ea0ae04954111a25720fc3327614b477e856bf | github |
PollenWang6/HiXD | entry/src/main/ets/services/SportService.ets | arkts | isAuthFailure | 检查响应是否认证失败 | private isAuthFailure(response: Record<string, Object>): boolean {
const returnCode: string = String(response['returnCode'] ?? '');
if (returnCode === '401' || returnCode === '402') return true;
const returnMsg: string = String(response['returnMsg'] ?? response['msg'] ?? '');
const keywords: string[] ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isAuthFailure AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left response AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Rig... | private isAuthFailure(response: Record<string, Object>): boolean {
const returnCode: string = String(response['returnCode'] ?? '');
if (returnCode === '401' || returnCode === '402') return true;
const returnMsg: string = String(response['returnMsg'] ?? response['msg'] ?? '');
const keywords: string[] ... | https://github.com/PollenWang6/HiXD | 3926ac58473958de905d13ec594d0b7fb8803221 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/Short.ets | arkts | equals | Checks for equality this instance with provided object, treated as a Short
@param other object to be checked against
@returns true if provided object and this instance have same value, false otherwise
Returns false if type of provided object is not the same as this type | public override equals(other: Object|null): boolean {
if (other instanceof Short) {
return this.value == (other as Short).shortValue();
}
return false;
} | 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#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#... | public override equals(other: Object|null): boolean {
if (other instanceof Short) {
return this.value == (other as Short).shortValue();
}
return false;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | b3df3e3cfa849d216394c563a513dcc315f16dcc | gitee |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/AccountManager.ets | arkts | addSeedAccount | 写入默认账户数据,供空表初始化时复用。 | private static async addSeedAccount(account: AccountBean): Promise<void> {
const now: number = Date.now();
const data: relationalStore.ValuesBucket = {
name: account.name,
balance: account.balance,
type: account.type,
icon: account.icon,
created_at: now,
updated_at: now
... | 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 addSeedAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ... | private static async addSeedAccount(account: AccountBean): Promise<void> {
const now: number = Date.now();
const data: relationalStore.ValuesBucket = {
name: account.name,
balance: account.balance,
type: account.type,
icon: account.icon,
created_at: now,
updated_at: now
... | https://github.com/ZestBox-18/kitebook-frontend | 9712012934530cc2d2c13f40ec9b4d993a082244 | github |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/pages/ProfilePage.ets | arkts | getGoalDirectionDesc | 获取目标方向描述 | getGoalDirectionDesc(goal: HealthGoal): string {
const direction = goal.direction || GoalDirection.INCREASE;
const typeName = this.getGoalTypeName(goal.type);
switch (direction) {
case GoalDirection.DECREASE:
return `${typeName}(减少到${goal.targetValue}${goal.unit})`;
case GoalDirection... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getGoalDirectionDesc AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left goal AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left HealthGoal AST#identifier#Right AST... | getGoalDirectionDesc(goal: HealthGoal): string {
const direction = goal.direction || GoalDirection.INCREASE;
const typeName = this.getGoalTypeName(goal.type);
switch (direction) {
case GoalDirection.DECREASE:
return `${typeName}(减少到${goal.targetValue}${goal.unit})`;
case GoalDirection... | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | c6efe8d5ccb2256de423ca7caef476ded4d0acae | github |
HarmonyOS_Codelabs/arkts-intermediate-syntax | entry/src/main/ets/model/Device.ets | arkts | constructor | 构造函数:初始化设备的核心属性
@param id 设备ID
@param name 设备名称
@param type 设备类型
@param location 安装位置 | constructor(id: string, name: string, type: DeviceType, location: Location) {
this.id = id;
this.name = name;
this.type = type;
this.location = location;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST... | constructor(id: string, name: string, type: DeviceType, location: Location) {
this.id = id;
this.name = name;
this.type = type;
this.location = location;
} | https://gitcode.com/HarmonyOS_Codelabs/arkts-intermediate-syntax | 809ba69c8731c1a2282fb3979d5f394608f3b904 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewImageLoader.ets | arkts | setChapterId | 设置章节ID | setChapterId(chapterId: string): ImageRequestBuilder {
this.chapterId = chapterId;
return this;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setChapterId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chapterId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)... | setChapterId(chapterId: string): ImageRequestBuilder {
this.chapterId = chapterId;
return this;
} | https://github.com/DaLongZhuaZi/manxia | b39f14fac59644e56bad9a611077aa44c949d656 | github |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/services/DataExportService.ets | arkts | generateHtml | ==========================================
辅助方法
==========================================
========================================== | private static async generateHtml(contacts: Contact[], events: Event[]): Promise<string> {
DataExportService.logger.info('Generating HTML Report...');
const nowStr = new Date().toLocaleString();
let html = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Data Backup Report</title>
<style>
... | 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 generateHtml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left co... | private static async generateHtml(contacts: Contact[], events: Event[]): Promise<string> {
DataExportService.logger.info('Generating HTML Report...');
const nowStr = new Date().toLocaleString();
let html = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Data Backup Report</title>
<style>
... | https://gitcode.com/openharmony/codelabs | 451ce4ff6ee786f71f8e7d9b30acfc997705dec3 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Diagnostics/StartupController.ets | arkts | recordExecutionResult | 记录执行结果 | private recordExecutionResult(result: StartupExecutionResult): void {
this.executionResults.push(result);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left recordExecutionResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left result AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private recordExecutionResult(result: StartupExecutionResult): void {
this.executionResults.push(result);
} | https://github.com/DaLongZhuaZi/manxia | 3738ef0d3c12f1caeea34bcc1c793bf94f33177a | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GamepadManager.ets | arkts | getControllerSlot | 获取 controllerId 对应的槽位 | getControllerSlot(controllerId: number): number {
const deviceKey = this.controllerIdToDeviceKey.get(controllerId);
if (deviceKey) {
const slot = this.deviceKeyToSlot.get(deviceKey);
if (slot !== undefined) return slot;
}
// 回退:钳位到 0,避免原始 controllerId (可能 ≥1000) 溢出
return 0;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getControllerSlot AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left controllerId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left... | getControllerSlot(controllerId: number): number {
const deviceKey = this.controllerIdToDeviceKey.get(controllerId);
if (deviceKey) {
const slot = this.deviceKeyToSlot.get(deviceKey);
if (slot !== undefined) return slot;
}
// 回退:钳位到 0,避免原始 controllerId (可能 ≥1000) 溢出
return 0;
} | https://github.com/AlkaidLab/moonlight-harmony | f2c6e7c0ee4f21f5446dcd0c67aa5e89b32964cf | github |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/services/ApprovalService.ets | arkts | transferApproval | 转交审批
@param approvalId 审批ID
@param nodeId 节点ID
@param transferAssigneeId 被转交给人的ID
@param comment 转交原因 | async transferApproval(approvalId: string, nodeId: string, transferAssigneeId: string, comment?: string): Promise<ApiResponse<any>> {
return this.approvalAction({ approvalId, nodeId, action: 'transfer', comment, transferAssigneeId })
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left transferApproval AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left approvalId AST#identifier#Right AST#type_annotation#Left AST#:... | async transferApproval(approvalId: string, nodeId: string, transferAssigneeId: string, comment?: string): Promise<ApiResponse<any>> {
return this.approvalAction({ approvalId, nodeId, action: 'transfer', comment, transferAssigneeId })
} | https://github.com/David8Idira/AI-OA | 3d910ee28fe7c7c0781984f4f7cc6de9a045cde1 | github |
HarmonyOS_Samples/guide-snippets | ArkData/DataShare/ShareConfig/entry/src/main/ets/pages/Index.ets | arkts | watchConfigChanges | [End get_shared_config]
[Start watch_shared_config] | function watchConfigChanges() {
dataShare.createDataProxyHandle().then((dsProxyHelper) => {
const uris: string[] = [
'datashareproxy://com.samples.shareconfig/config1',
'datashareproxy://com.samples.shareconfig/config2'
];
const config: dataShare.DataProxyConfig = {
type: dataShare.DataP... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left watchConfigChanges AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expressi... | function watchConfigChanges() {
dataShare.createDataProxyHandle().then((dsProxyHelper) => {
const uris: string[] = [
'datashareproxy://com.samples.shareconfig/config1',
'datashareproxy://com.samples.shareconfig/config2'
];
const config: dataShare.DataProxyConfig = {
type: dataShare.DataP... | https://gitcode.com/HarmonyOS_Samples/guide-snippets | 84b6800c572d55fcf5961aad9f2c944b0be58f8d | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | whereIn | 添加 IN 条件
@param column 列名或属性名
@param values 值数组
@returns 当前实例(支持链式调用) | whereIn(column: string, values: Array<ValueType>): QueryBuilder {
const resolvedColumn = this.getResolvedColumnName(column)
if (resolvedColumn === null) {
throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`)
}
if (values.length === 0) {
throw new InvalidCo... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left whereIn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,... | whereIn(column: string, values: Array<ValueType>): QueryBuilder {
const resolvedColumn = this.getResolvedColumnName(column)
if (resolvedColumn === null) {
throw new InvalidConditionError(column, `列 '${column}' 在实体 '${this.entityName}' 中不存在`)
}
if (values.length === 0) {
throw new InvalidCo... | https://github.com/offlinecat-dev/OCNetORM | 7fd417ff2b62c7f9a9657eeb6acbf2b92cd6c714 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | internal | Creates a BigUint64Array with the same ArrayBuffer
@param begin start index, inclusive
@returns new BigUint64Array with the same ArrayBuffer
public | /* public */ internal subarray(begin: int): BigUint64Array {
return this.subarray(begin, this.length)
} | AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#identifier#Left internal AST#identifier#Right AST#call_expression#Left AST#identifier#Left subarray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Lef... | /* public */ internal subarray(begin: int): BigUint64Array {
return this.subarray(begin, this.length)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | b2ca24f1f42ab4068950885adbedb69c796d1b61 | gitee |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Reader.ets | arkts | skipType | Skip unknown field by wire type | skipType(wt: number): void {
switch (wt) {
case 0: this.uint32(); break
case 1: this.pos += 8; break
case 2: { const l = this.uint32(); this.pos += l; break }
case 5: this.pos += 4; break
default: throw new Error('invalid wire type')
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left skipType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left wt AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Ri... | skipType(wt: number): void {
switch (wt) {
case 0: this.uint32(); break
case 1: this.pos += 8; break
case 2: { const l = this.uint32(); this.pos += l; break }
case 5: this.pos += 4; break
default: throw new Error('invalid wire type')
}
} | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | 83242c99fbfa0d5097548bc332f77ccdbf398cd4 | gitcode |
LongLiveY96/chatcube | entry/src/main/ets/services/AIApiService.ets | arkts | createToolResultMessage | 创建工具结果消息 | static createToolResultMessage(toolCallId: string, content: string): RequestMessage {
const msg = new RequestMessage('tool', content)
msg.toolCallId = toolCallId
return msg
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createToolResultMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left toolCallId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string... | static createToolResultMessage(toolCallId: string, content: string): RequestMessage {
const msg = new RequestMessage('tool', content)
msg.toolCallId = toolCallId
return msg
} | https://github.com/LongLiveY96/chatcube | a8cff2496f7a906b28ea6f1688e0d7ef06afdfdb | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/CryptoService.ets | arkts | deriveKey | ── v2: PBKDF2 密码派生(新格式,跨安装可用)──
从密码 + 盐派生 AES-256 密钥 | private static async deriveKey(password: string, salt: Uint8Array): Promise<cryptoFramework.SymKey> {
const kdf = cryptoFramework.createKdf('PBKDF2|SHA256');
const encoder = new util.TextEncoder();
const spec: cryptoFramework.PBKDF2Spec = {
algName: 'PBKDF2',
password: encoder.encodeInto(passw... | 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 deriveKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left password AST#identif... | private static async deriveKey(password: string, salt: Uint8Array): Promise<cryptoFramework.SymKey> {
const kdf = cryptoFramework.createKdf('PBKDF2|SHA256');
const encoder = new util.TextEncoder();
const spec: cryptoFramework.PBKDF2Spec = {
algName: 'PBKDF2',
password: encoder.encodeInto(passw... | https://github.com/AlkaidLab/moonlight-harmony | dcda2dd9b37147f280239a1fc0d76e456a98dbae | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | getChars | Gets the char sequence that is representing the part of
this string between begin and end indexes. The range is
a half-interview [begin, end).
@param { int } begin index to start from
@param { int } end past the ending index
@throws { StringIndexOutOfBoundsError } if begin > end, if begin is negative or >= length
if en... | public getChars(begin: int, end: int): char[] {
// #24515: Need to remove the following function call after primitive type refactoring
let ret : ValueArray<char> = this.getCharsImpl(begin, end);
let tmpForceBox : Array<char> = new Array<char>(ret.length, (i) => {
return ret[i]
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getChars AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Rig... | public getChars(begin: int, end: int): char[] {
// #24515: Need to remove the following function call after primitive type refactoring
let ret : ValueArray<char> = this.getCharsImpl(begin, end);
let tmpForceBox : Array<char> = new Array<char>(ret.length, (i) => {
return ret[i]
... | https://gitcode.com/iop123123/arkts-static-skills | 1c31e52bbd5770fd3e939893520d09370400f66d | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/renderer/BarChartRenderer.ets | arkts | setHighlightDrawPos | Sets the drawing position of the highlight object based on the riven bar-rect.
@param high | protected setHighlightDrawPos(high: Highlight, bar: MyRect): void {
high.setDraw(bar.centerX(), bar.top);
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left setHighlightDrawPos AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left high AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ide... | protected setHighlightDrawPos(high: Highlight, bar: MyRect): void {
high.setDraw(bar.centerX(), bar.top);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | e7fba65614ae23cc183379b8d09107dba076a502 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/SmartPreloadStrategy.ets | arkts | updateNetworkStatus | 更新网络状态 | private async updateNetworkStatus(): Promise<void> {
try {
const netHandle = await connection.getDefaultNet();
const netCapabilities = await connection.getNetCapabilities(netHandle);
if (netCapabilities.bearerTypes.includes(connection.NetBearType.BEARER_WIFI)) {
this.networkType =... | 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 updateNetworkStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Rig... | private async updateNetworkStatus(): Promise<void> {
try {
const netHandle = await connection.getDefaultNet();
const netCapabilities = await connection.getNetCapabilities(netHandle);
if (netCapabilities.bearerTypes.includes(connection.NetBearType.BEARER_WIFI)) {
this.networkType =... | https://github.com/DaLongZhuaZi/manxia | 41f9241525c9c0bffb9a3d7da3cffef874b34736 | github |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/services/auth/AuthService.ets | arkts | getCurrentUser | 获取当前登录用户 | static async getCurrentUser(): Promise<User | null> {
const userId = AppStorage.get<string>(AppStorageKeys.CURRENT_USER_ID) || ''
if (userId.length === 0) {
return null
}
return await UserDao.findById(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 getCurrentUser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | static async getCurrentUser(): Promise<User | null> {
const userId = AppStorage.get<string>(AppStorageKeys.CURRENT_USER_ID) || ''
if (userId.length === 0) {
return null
}
return await UserDao.findById(userId)
} | https://github.com/encorexin/WordPressCMS | b722533905f2c8a8ab255963395ca4446975daed | github |
openharmony/vendor_unionman | unionpi_tiger/sample_hzu/TV_research/entry/src/main/ets/pages/Index.ets | arkts | toHexString | 生成0-255之间的随机整数,然后转换为两位的十六进制字符串 | function toHexString(num: number): string {
let hex = num.toString(16);
if (hex.length === 1) {
hex = '0' + hex;
}
return hex;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left toHexString AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left num AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right... | function toHexString(num: number): string {
let hex = num.toString(16);
if (hex.length === 1) {
hex = '0' + hex;
}
return hex;
} | https://gitee.com/openharmony/vendor_unionman.git | e46490fe56ba5859edcead4d5ec14668242b41cd | gitee |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanUtils.ets | arkts | generateOutputFileName | 生成压缩输出文件名 | static generateOutputFileName(originalPath: string, extension: string, prefix: string = 'luban'): string {
const nameWithoutExt = LubanUtils.getFileNameWithoutExtension(originalPath);
const timestamp = Date.now();
const random = Math.floor(Math.random() * 10000);
return `${nameWithoutExt}_${prefix}_$... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateOutputFileName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left originalPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left strin... | static generateOutputFileName(originalPath: string, extension: string, prefix: string = 'luban'): string {
const nameWithoutExt = LubanUtils.getFileNameWithoutExtension(originalPath);
const timestamp = Date.now();
const random = Math.floor(Math.random() * 10000);
return `${nameWithoutExt}_${prefix}_$... | https://github.com/kumaleap/ArkLuban | 9acf83263d575b6a7ccb74368dba62566d1ec44a | github |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/viewmodel/HomeViewModel.ets | arkts | checkCurrentDay | check is current day | public checkCurrentDay(): boolean {
return dateToStr(new Date()) === this.selectedDayInfo?.dateStr;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left checkCurrentDay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean A... | public checkCurrentDay(): boolean {
return dateToStr(new Date()) === this.selectedDayInfo?.dateStr;
} | https://gitee.com/harmonyos/codelabs.git | e6281731f206584902a722185f9af8d46bb7e7b8 | gitee |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test35_original_index.ets | arkts | testSplitJoin | --- String split + join --- | function testSplitJoin(): string {
let csv: string = 'one,two,three,four';
let parts: string[] = csv.split(',');
let joined: string = parts.join('-');
return String(parts.length) + ',' + joined;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testSplitJoin AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_ty... | function testSplitJoin(): string {
let csv: string = 'one,two,three,four';
let parts: string[] = csv.split(',');
let joined: string = parts.join('-');
return String(parts.length) + ',' + joined;
} | https://github.com/miaochiahao/ark-ghidra | c3368de8cc906fc557a1722cda75040f7e129c08 | github |
HarmonyOS_Samples/MusicHome | common/musicbasic/src/main/ets/util/WindowUtil.ets | arkts | syncWindowInsetsVp | Recalculates status bar and home-indicator offsets in vp from avoid areas and UIContext. | private syncWindowInsetsVp(): void {
const ctx = this.uiContext;
const info = this.mainWindowInfo;
if (ctx === undefined) {
info.statusBarTopVp = 0;
info.navigationBarBottomVp = 0;
return;
}
const sys = info.avoidSystem;
if (sys !== undefined) {
info.statusBarTopVp = ct... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left syncWindowInsetsVp 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 A... | private syncWindowInsetsVp(): void {
const ctx = this.uiContext;
const info = this.mainWindowInfo;
if (ctx === undefined) {
info.statusBarTopVp = 0;
info.navigationBarBottomVp = 0;
return;
}
const sys = info.avoidSystem;
if (sys !== undefined) {
info.statusBarTopVp = ct... | https://gitcode.com/HarmonyOS_Samples/MusicHome | ee83af69dd8945b94f4c13db6dd84f29dfc8f778 | gitcode |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | handleCapturedAudio | ============================================================
内部数据流处理
============================================================
处理麦克风采集的 PCM 数据 → Rust 层一体化发送(G.711 编码 + RTP 打包 + 发送)
旧路径:ETS AudioEncoder.encodeSamples() → onEncodedFrame → sendEncodedAudioFrame(2次 NAPI)
新路径:单次 sendPcmAudio NAPI 调用,Rust 内部完成 G.711 + RTP... | private handleCapturedAudio(pcmData: ArrayBuffer): void {
const timestamp: number = this.audioTimestamp;
// 每次采集一帧: sampleRate * 0.02 = 采样数 (20ms)
this.audioTimestamp += Math.floor(this.audioClockRate * 0.02);
WebRTC.sendPcmAudio(this.audioTrackId, new Uint8Array(pcmData), timestamp);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleCapturedAudio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pcmData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | private handleCapturedAudio(pcmData: ArrayBuffer): void {
const timestamp: number = this.audioTimestamp;
// 每次采集一帧: sampleRate * 0.02 = 采样数 (20ms)
this.audioTimestamp += Math.floor(this.audioClockRate * 0.02);
WebRTC.sendPcmAudio(this.audioTrackId, new Uint8Array(pcmData), timestamp);
} | https://github.com/tdcare/tdwebrtc | 4ab6011533a8ea06a48e6fd563322eada8bf579b | github |
LZZLHY/hlib | entry/src/main/ets/utils/PublicDownloadDir.ets | arkts | needsPicker | 手机端(非平板静默)须经 DocumentViewPicker DOWNLOAD 模式获取公共目录。 | static needsPicker(): boolean {
return !PublicDownloadDir.isTabletSilent();
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left needsPicker 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#b... | static needsPicker(): boolean {
return !PublicDownloadDir.isTabletSilent();
} | https://github.com/LZZLHY/hlib | 6973fb5fc530d5ecb4e5aa1261ff1944ea089617 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Byte.ets | arkts | isLessThan | Checks if this instance value is less than value of provided instance
@param { Byte } other Right hand side of the comparison
@returns { boolean }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isLessThan(other: Byte): boolean {
return this.value < other.toByte();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isLessThan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Byte AST#identifier#... | public isLessThan(other: Byte): boolean {
return this.value < other.toByte();
} | https://gitcode.com/iop123123/arkts-static-skills | 4d8c4df68843e6b59b44cc3e2220e556ae560d95 | gitcode |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets | arkts | setInt8 | Sets a signed byte.
@param byteOffset The byte offset.
@param value The value. | setInt8(byteOffset: number, value: number): void {
this.dataView?.setInt8(byteOffset, value)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setInt8 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#Rig... | setInt8(byteOffset: number, value: number): void {
this.dataView?.setInt8(byteOffset, value)
} | https://gitee.com/openharmony-sig/flutter_engine.git | 6838a5d1c74e0f01b2798c129c5b691a693272a0 | gitee |
LongLiveY96/chatcube | entry/src/main/ets/services/DatabaseService.ets | arkts | getImageGenerationStats | 生图总览:总张数 / 文生图张数 / 改图张数 / 使用过的独立模型数
口径说明:generated_media 一行=一张图(无批次字段),统计的是"张数"而非"生成次数" | async getImageGenerationStats(rangeStartMs: number = 0): Promise<ImageGenerationStats> {
await this.waitForInitialization()
const result: ImageGenerationStats = {
total: 0,
generateCount: 0,
editCount: 0,
distinctModelCount: 0
}
if (this.rdbStore === null) {
return result... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getImageGenerationStats AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier... | async getImageGenerationStats(rangeStartMs: number = 0): Promise<ImageGenerationStats> {
await this.waitForInitialization()
const result: ImageGenerationStats = {
total: 0,
generateCount: 0,
editCount: 0,
distinctModelCount: 0
}
if (this.rdbStore === null) {
return result... | https://github.com/LongLiveY96/chatcube | b2bcbc037ba911a6ca194253aab046222f92e46a | github |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/datasource/cs/CustomerServiceNetworkDataSourceImpl.ets | arkts | getSessionDetail | 获取会话详情
@returns {Promise<NetworkResponse<CsSession>>} 会话详情 | async getSessionDetail(): Promise<NetworkResponse<CsSession>> {
const resp: AxiosResponse<NetworkResponse<CsSession>> =
await NetworkClient.http.get("cs/session/detail");
return resp.data;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSessionDetail 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#gen... | async getSessionDetail(): Promise<NetworkResponse<CsSession>> {
const resp: AxiosResponse<NetworkResponse<CsSession>> =
await NetworkClient.http.get("cs/session/detail");
return resp.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS | c081c6b47bc343b708bd77b25b226758a743cb40 | github |
2763981847/Accounting-app | entry/src/main/ets/common/database/tables/AccountTable.ets | arkts | deleteData | 删除单条账目数据 | deleteData(account: Account, callback: Function) {
// 调用批量删除方法,传入包含单条账目数据的数组
this.batchDelete([account], callback)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left deleteData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left account AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Account AST#identifier#Righ... | deleteData(account: Account, callback: Function) {
// 调用批量删除方法,传入包含单条账目数据的数组
this.batchDelete([account], callback)
} | https://github.com/2763981847/Accounting-app | a4b7394672bac40a15b631d2030504f50472ef72 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | getSessionCount | Get count of active sessions | static getSessionCount(): number {
return GlobalSessionManager.sessions.size;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getSessionCount 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... | static getSessionCount(): number {
return GlobalSessionManager.sessions.size;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 240ea4281a55d8920cf68406bccd5f4a81c00e9c | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/equal/equal_int.ets | arkts | main | ---
desc: check equality of two integers
--- | function main(): void {
const a: int = {{v.left}}
const b: int = {{v.right}}
assert (a == b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: int = {{v.left}}
const b: int = {{v.right}}
assert (a == b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 5d85120852c346a66f22863b6ae003488e0e671f | gitee |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/view/LrcView.ets | arkts | getOffset | Cumulative vertical offset in px to align the given line index under lyricTopPosition. | getOffset(line: number): number {
let offsetY = 0;
switch (this.lyricTopPosition) {
case LyricTopPosition.Top:
for (let entryIndex = 0; entryIndex <= line && entryIndex < this.mLrcEntryList.length; entryIndex++) {
if (entryIndex === line) {
offsetY += this.getLineHeight(thi... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left line AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)... | getOffset(line: number): number {
let offsetY = 0;
switch (this.lyricTopPosition) {
case LyricTopPosition.Top:
for (let entryIndex = 0; entryIndex <= line && entryIndex < this.mLrcEntryList.length; entryIndex++) {
if (entryIndex === line) {
offsetY += this.getLineHeight(thi... | https://gitcode.com/HarmonyOS_Samples/MusicHome | 8245e5037771f5c053c31f083d891a53933b93fb | gitcode |
zmuxuny/ai-guardian-star | entry/src/main/ets/common/WenxinService.ets | arkts | chat | 发送聊天消息并获取 AI 回复
@param userMessage 用户输入的消息
@param history 历史对话(最多传最近10轮)
@returns AI 回复文本,失败时返回错误提示 | public async chat(userMessage: string, history: ChatMessage[]): Promise<string> {
const context = this.buildHealthContext();
const req: ChatRequest = {
message: userMessage,
history: history.slice(-20), // 最多10轮,防止 payload 太大
context: context,
};
const httpRequest = http.createHtt... | 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 chat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left userMessage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:... | public async chat(userMessage: string, history: ChatMessage[]): Promise<string> {
const context = this.buildHealthContext();
const req: ChatRequest = {
message: userMessage,
history: history.slice(-20), // 最多10轮,防止 payload 太大
context: context,
};
const httpRequest = http.createHtt... | https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/common/WenxinService.ets#L54-L90 | b5c2b9df426783d2041ea18e18f00ef6f71e7b2b | github |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/manager/ThemeManager.ets | arkts | getWindowStage | 异步获取 WindowStage | async getWindowStage() {
const context: Context = new UIContext().getHostContext() as Context
if (this.windowStage) {
return this.windowStage
} else {
return await window.getLastWindow(context)
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getWindowStage AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{... | async getWindowStage() {
const context: Context = new UIContext().getHostContext() as Context
if (this.windowStage) {
return this.windowStage
} else {
return await window.getLastWindow(context)
}
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 9c98432996a30d9d9051e0eeebf76ffb8ae4a1ee | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | filter | Creates a new `Array` instance and populates it with
portion of a given array, filtered down to just the elements from the
given array that pass the test implemented by the provided function.
@param fn test function, applied to each element of an array.
@returns New `Array` instance constructed from `this` with element... | public filter(fn: (v: T) => boolean): Array<T> {
let res = this.filterArray(fn);
return new Array<T>(res);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left filter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R... | public filter(fn: (v: T) => boolean): Array<T> {
let res = this.filterArray(fn);
return new Array<T>(res);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 5db94ee684847661b7e211f765a4b71409a9f1cb | gitee |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnComponentsViewModel.ets | arkts | navigateTo | 导航到指定路由
@param route 目标路由路径
@returns {void} 无返回值 | private navigateTo(route: string): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(route);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left navigateTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left route AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s... | private navigateTo(route: string): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(route);
} | https://github.com/codelably/tuniao-ui | a07ab2d7d055a29d61125a7de44477fcf28ef2cc | github |
CLMC2025/Vignette | entry/src/main/ets/manager/SessionPlanner.ets | arkts | isValid | 验证配置是否有效 | isValid(): boolean {
const total = this.storyRatio + this.clozeRatio + this.choiceRatio +
this.collocationRatio + this.pronunciationRatio;
return Math.abs(total - 1.0) < 0.01;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isValid 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... | isValid(): boolean {
const total = this.storyRatio + this.clozeRatio + this.choiceRatio +
this.collocationRatio + this.pronunciationRatio;
return Math.abs(total - 1.0) < 0.01;
} | https://github.com/CLMC2025/Vignette | e2df41ceea6f9d1bbdbec381e2b0eb1a49950c84 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/WebDAVService.ets | arkts | encodePathSegments | 路径分段编码,保留 / 分隔符,处理中文 / 空格 / 特殊字符 | private encodePathSegments(path: string): string {
if (path.length === 0) {
return ''
}
const segments = path.split('/')
const encoded: string[] = []
for (let i = 0; i < segments.length; i++) {
const segment = segments[i]
if (segment.length > 0) {
encoded.push(encodeURICo... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left encodePathSegments AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | private encodePathSegments(path: string): string {
if (path.length === 0) {
return ''
}
const segments = path.split('/')
const encoded: string[] = []
for (let i = 0; i < segments.length; i++) {
const segment = segments[i]
if (segment.length > 0) {
encoded.push(encodeURICo... | https://github.com/LongLiveY96/chatcube | 210b315610a9b2a09d9f3a2e8f667aeeec7a3c59 | github |
openharmony/codelabs | ETSUI/MemoTime/entry/src/main/ets/service/DataService.ets | arkts | getRemindersByScheduleId | 获取日程的所有提醒 | async getRemindersByScheduleId(scheduleId: string): Promise<Reminder[]> {
if (!this.rdbStore) {
return []
}
try {
const predicates = new relationalStore.RdbPredicates(AppConstants.TABLE_REMINDER)
predicates.equalTo('scheduleId', scheduleId)
const resultSet = await this.rdbStore.qu... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getRemindersByScheduleId AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left scheduleId AST#ident... | async getRemindersByScheduleId(scheduleId: string): Promise<Reminder[]> {
if (!this.rdbStore) {
return []
}
try {
const predicates = new relationalStore.RdbPredicates(AppConstants.TABLE_REMINDER)
predicates.equalTo('scheduleId', scheduleId)
const resultSet = await this.rdbStore.qu... | https://gitcode.com/openharmony/codelabs | f050d50b11564ef5a7a8e45973a8d631592ccf9e | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/query/WhereCondition.ets | arkts | and | 设置逻辑连接符为 AND
@returns 当前实例 | and(): WhereCondition {
this.logicalOperator = LogicalOperator.AND
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left and 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 WhereCondition AST#identifier#Right AST#ERROR#Right AST#st... | and(): WhereCondition {
this.logicalOperator = LogicalOperator.AND
return this
} | https://github.com/offlinecat-dev/OCNetORM | 95a4b59e6c9bd94849a010715c0add91d33188fc | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/utils/ClipboardManager.ets | arkts | startLocalClipboardMonitoring | Start monitoring local clipboard changes | private startLocalClipboardMonitoring(): void {
try {
const systemPasteboard = pasteboard.getSystemPasteboard();
// Create observer
this.pasteboardObserver = {
callback: () => {
this.onLocalClipboardChanged();
}
};
// Register observer
sy... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left startLocalClipboardMonitoring 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#... | private startLocalClipboardMonitoring(): void {
try {
const systemPasteboard = pasteboard.getSystemPasteboard();
// Create observer
this.pasteboardObserver = {
callback: () => {
this.onLocalClipboardChanged();
}
};
// Register observer
sy... | https://github.com/tangwengang-del/freerdp-harmonyos | 9acf96bb6989404f12230971292024a1e4e0b8f1 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | recalculatePath | 重新规划路径
@param currentPos 当前位置
@param originalDest 原始目的地(可选) | public async recalculatePath(
currentPos: Position3D,
originalDest?: Position3D
): Promise<NavigationPath | null> {
if (!originalDest) {
console.warn('[PathPlanner] recalculatePath需要终点信息');
return null;
}
try {
return await this.calculatePath(currentPos, originalDest);
} c... | 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 recalculatePath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left currentPos AST#identifier#Right AST#:#Le... | public async recalculatePath(
currentPos: Position3D,
originalDest?: Position3D
): Promise<NavigationPath | null> {
if (!originalDest) {
console.warn('[PathPlanner] recalculatePath需要终点信息');
return null;
}
try {
return await this.calculatePath(currentPos, originalDest);
} c... | https://github.com/LJ666-ui/harmony-health-care | 0a5b244faa7c5d6072f2ba3647bf8e1f57d46d6d | github |
openharmony/codelabs | ETSUI/ContactManager/entry/src/main/ets/pages/ContactListPage.ets | arkts | filterContacts | 过滤联系人的方法 | filterContacts(): void {
if (!this.searchText || this.searchText.trim() === '') {
this.filteredContactList = this.contactList
} else {
const keyword = this.searchText.toLowerCase().trim()
this.filteredContactList = this.contactList.filter((contact: Contact): boolean => {
const nameMa... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left filterContacts AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#... | filterContacts(): void {
if (!this.searchText || this.searchText.trim() === '') {
this.filteredContactList = this.contactList
} else {
const keyword = this.searchText.toLowerCase().trim()
this.filteredContactList = this.contactList.filter((contact: Contact): boolean => {
const nameMa... | https://gitcode.com/openharmony/codelabs | 0237696d0037a900158c0d8b899f1794b741d3d0 | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/DataCollector.ets | arkts | isRunning | 检查是否正在采集 | public isRunning(): boolean {
return this.isCollecting;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isRunning 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#boo... | public isRunning(): boolean {
return this.isCollecting;
} | https://github.com/LJ666-ui/harmony-health-care | 1f16ad0f1dde8c67e1a004cd37198f85d7cfc2cc | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/TypeShelfManager.ets | arkts | shelfContentTypeToContentType | 将ShelfContentType转换为ContentType | shelfContentTypeToContentType(shelfContentType: ShelfContentType): ContentType {
switch (shelfContentType) {
case ShelfContentType.MANGA:
return ContentType.MANGA;
case ShelfContentType.EBOOK:
return ContentType.EBOOK;
case ShelfContentType.NOVEL:
return ContentType.NOVEL... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left shelfContentTypeToContentType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left shelfContentType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ShelfContentTy... | shelfContentTypeToContentType(shelfContentType: ShelfContentType): ContentType {
switch (shelfContentType) {
case ShelfContentType.MANGA:
return ContentType.MANGA;
case ShelfContentType.EBOOK:
return ContentType.EBOOK;
case ShelfContentType.NOVEL:
return ContentType.NOVEL... | https://github.com/DaLongZhuaZi/manxia | a59b9bfdc5c5a482de9f3f818f8a6ca427cb78ed | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | of | Returns a new array from a set of elements.
@param { FixedArray<short> } items - a set of elements to include in the new array object.
@returns { Uint8ClampedArray } - a new Uint8ClampedArray
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static of(...items: FixedArray<short>): Uint8ClampedArray {
let res = new Uint8ClampedArray(items.length.toInt())
res.ofShort(stub.toValueArray(items))
return res
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR... | public static of(...items: FixedArray<short>): Uint8ClampedArray {
let res = new Uint8ClampedArray(items.length.toInt())
res.ofShort(stub.toValueArray(items))
return res
} | https://gitcode.com/iop123123/arkts-static-skills | 211bb5e0074e3f20b45f8b5c7f4d0499e712c9a9 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/PrivacyModeManager.ets | arkts | clearListeners | 清除所有监听器 | public clearListeners(): void {
this.listeners.clear();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearListeners AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#express... | public clearListeners(): void {
this.listeners.clear();
} | https://github.com/DaLongZhuaZi/manxia | 4fd4a1f4e9c3b19694d2c3ba506ea41ce555fd07 | github |
openharmony-tpc/arouter-api-onActivityResult | entry/src/main/ets/pages/Index.ets | arkts | onPageShow | 页面显示时 | onPageShow(){
this.index = returnData.data
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | onPageShow(){
this.index = returnData.data
} | https://gitee.com/openharmony-tpc/arouter-api-onActivityResult.git | 8b03c553cfdb53324957c5d26749fbb6c8d5c91d | gitee |
apap6628114/nga_oh | entry/src/main/ets/service/api/ThreadApi.ets | arkts | getForceHtmlMode | ============== 调试开关 ==============
调试开关:true 时 getThread 强制走 HTML 解析模式,跳过 JSON API | function getForceHtmlMode(): boolean {
const stored: boolean = AppStorage.get<boolean>(KEY_FORCE_HTML_MODE) ?? false
return stored
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getForceHtmlMode 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 getForceHtmlMode(): boolean {
const stored: boolean = AppStorage.get<boolean>(KEY_FORCE_HTML_MODE) ?? false
return stored
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/service/api/ThreadApi.ets#L29-L32 | 1e170e6d5a06e0fa3fa71f34cf0bc71d53daacfc | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/utils/ClipboardManager.ets | arkts | isClipboardEnabled | Check if clipboard sync is enabled | isClipboardEnabled(): boolean {
return this.isEnabled;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isClipboardEnabled 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#... | isClipboardEnabled(): boolean {
return this.isEnabled;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 871e18cb6ed1757ef28bc2c31144c9712929e5c1 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/modules/ModuleFeedback.ets | arkts | handleFeedbackUrl | -- Overlay callbacks --
Called from CountlyFeedbackOverlay.onLoadIntercept. Returns true if the
SDK handled the URL (close / action=link / cly_x_int=1) and the webview
should block navigation. | public handleFeedbackUrl(url: string): boolean {
if (Utils.isNullOrEmpty(url)) return false;
const isCommand: boolean = url.startsWith(ACTION_BASE_URL);
const isExternalMarker: boolean = url.indexOf(EXTERNAL_LINK_MARKER) !== -1;
if (!isCommand && !isExternalMarker) return false;
const params: Rec... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left handleFeedbackUrl 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... | public handleFeedbackUrl(url: string): boolean {
if (Utils.isNullOrEmpty(url)) return false;
const isCommand: boolean = url.startsWith(ACTION_BASE_URL);
const isExternalMarker: boolean = url.indexOf(EXTERNAL_LINK_MARKER) !== -1;
if (!isCommand && !isExternalMarker) return false;
const params: Rec... | https://github.com/Countly/countly-sdk-hos | bf44fe8f43ae28b5d2d2fa8ce693cc0feb20f1a2 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelTxtTocRuleManager.ets | arkts | getCombinedPattern | 获取合并的正则表达式(所有启用规则的组合) | getCombinedPattern(): RegExp | null {
const enabledRules = this.getEnabledRules();
if (enabledRules.length === 0) {
return null;
}
const patterns = enabledRules.map(rule => `(${rule.rule})`);
try {
return new RegExp(patterns.join('|'), 'gm');
} catch (error) {
logger.error(T... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getCombinedPattern 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#id... | getCombinedPattern(): RegExp | null {
const enabledRules = this.getEnabledRules();
if (enabledRules.length === 0) {
return null;
}
const patterns = enabledRules.map(rule => `(${rule.rule})`);
try {
return new RegExp(patterns.join('|'), 'gm');
} catch (error) {
logger.error(T... | https://github.com/DaLongZhuaZi/manxia | 17afcd9ce86d972261622a035d372176723f8499 | github |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets | arkts | getOnTouchListener | Returns an instance of the currently active touch listener.
@return
@ts-ignore 泛型 | public getOnTouchListener(): ChartTouchListener {
return this.mChartTouchListener;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getOnTouchListener 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 Cha... | public getOnTouchListener(): ChartTouchListener {
return this.mChartTouchListener;
} | https://gitee.com/openharmony/developtools_profiler.git | 7db33a3b92d28cfadf5c8d5ec3dfd459d91e1aff | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/NetworkManager.ets | arkts | getReconnectAttempts | Get current reconnect attempt count | static getReconnectAttempts(): number {
return reconnectAttempts;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getReconnectAttempts 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... | static getReconnectAttempts(): number {
return reconnectAttempts;
} | https://github.com/tangwengang-del/freerdp-harmonyos | e18d05da37acdabb98464e9ffce6852ea41a9a3a | github |
erosTeam/NextE | shared/src/main/ets/state/CustomProfilesState.ets | arkts | findByUuid | The profile with this uuid, or null. | findByUuid(uuid: string): CustomProfile | null {
for (let i = 0; i < this.profiles.length; i++) {
if (this.profiles[i].uuid === uuid) {
return this.profiles[i]
}
}
return null
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left findByUuid AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uuid AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left str... | findByUuid(uuid: string): CustomProfile | null {
for (let i = 0; i < this.profiles.length; i++) {
if (this.profiles[i].uuid === uuid) {
return this.profiles[i]
}
}
return null
} | https://github.com/erosTeam/NextE | 284cb68a5ebc9fa466f183a05d0ae078a5f90501 | github |
OHPG/FinSdk | jellyfin/src/main/ets/config/Configuration.ets | arkts | isJsonMime | Check if the given MIME is a JSON MIME.
JSON MIME examples:
application/json
application/json; charset=UTF8
APPLICATION/JSON
application/vnd.company+json
@param mime - MIME (Multipurpose Internet Mail Extensions)
@return True if the given MIME is JSON, false otherwise. | public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isJsonMime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mime AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin... | public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
} | https://github.com/OHPG/FinSdk | 7139e34bd9df9d7edcf173299dfcd92dd6aa8b86 | github |
axiomaster/bonio | harmonyos/entry/src/main/ets/node/JpegSizeLimiter.ets | arkts | compressToLimit | Iteratively compress a JPEG to fit within maxBytes by reducing quality and resolution.
@param imageSource - The original image source to compress
@param startQuality - Initial JPEG quality (0-100)
@param maxBytes - Maximum allowed byte size
@param minQuality - Minimum JPEG quality to try (default 20)
@param minSize - M... | static async compressToLimit(
imageSource: image.ImageSource,
startQuality: number,
maxBytes: number,
minQuality: number = 20,
minSize: number = 256,
scaleStep: number = 0.85,
maxScaleAttempts: number = 6,
maxQualityAttempts: number = 6
): Promise<JpegSizeLimiterResult> {
const i... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left compressToLimit AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AS... | static async compressToLimit(
imageSource: image.ImageSource,
startQuality: number,
maxBytes: number,
minQuality: number = 20,
minSize: number = 256,
scaleStep: number = 0.85,
maxScaleAttempts: number = 6,
maxQualityAttempts: number = 6
): Promise<JpegSizeLimiterResult> {
const i... | https://github.com/axiomaster/bonio | cb8fd7a224cc43986d9ddb2269e159a2f98250fe | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/SourceUpdateManager.ets | arkts | hasSourceUpdate | 是否有更新 | public hasSourceUpdate(): boolean {
return this.hasUpdate;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hasSourceUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean A... | public hasSourceUpdate(): boolean {
return this.hasUpdate;
} | https://github.com/DaLongZhuaZi/manxia | be128982cda5773a4b8b6d319e0e983680119a91 | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/WebDavClient.ets | arkts | list | 读取目录下的所有文件夹
filter: 0: 不过滤,1: 只返回文件夹,2: 只返回文件
@param path
@returns | public async list(path: string = '/', filter: number = 0, queryChildrenCount: boolean = false): Promise<ResultInfo> {
const body = `<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:">
<d:prop>
<d:resourcetype/>
<d:displayname/>
<d:getcontentlength/>
<d:getlastmo... | 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 list AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right ... | public async list(path: string = '/', filter: number = 0, queryChildrenCount: boolean = false): Promise<ResultInfo> {
const body = `<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:">
<d:prop>
<d:resourcetype/>
<d:displayname/>
<d:getcontentlength/>
<d:getlastmo... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/WebDavClient.ets#L224-L266 | 5c5c5428e75a4aa4afd8aef3cfa8b73c12c7c8a2 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/NvHttp.ets | arkts | getClientName | 获取客户端名称(使用设备名称)
参考 Android: Settings.Global.getString(getContentResolver(), "device_name") | private getClientName(): string {
// 1. 如果已缓存,直接返回
if (NvHttp.cachedClientName) {
return NvHttp.cachedClientName;
}
// 2. 尝试获取设备名称
try {
// 优先使用 marketName(如 "HUAWEI Mate 60 Pro")
// 如果没有,则使用 productModel(如 "ALN-AL00")
const name = deviceInfo.marketName || deviceInfo.produ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getClientName 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 AS... | private getClientName(): string {
// 1. 如果已缓存,直接返回
if (NvHttp.cachedClientName) {
return NvHttp.cachedClientName;
}
// 2. 尝试获取设备名称
try {
// 优先使用 marketName(如 "HUAWEI Mate 60 Pro")
// 如果没有,则使用 productModel(如 "ALN-AL00")
const name = deviceInfo.marketName || deviceInfo.produ... | https://github.com/AlkaidLab/moonlight-harmony | 6de07e2f19a05d04d336342f86986c86a476259c | github |
LongLiveY96/chatcube | entry/src/main/ets/services/ThemeService.ets | arkts | reloadTheme | 重新从偏好设置加载主题(导入后刷新用) | async reloadTheme(): Promise<void> {
const savedTheme = await getPreferencesService().getString(PREF_KEY_COLOR_THEME, ColorTheme.DEFAULT)
const renamedTheme = getRenamedTheme(savedTheme)
if (renamedTheme !== null) {
console.info('ThemeService', `Reload migrated renamed theme '${savedTheme}' to '${r... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left reloadTheme AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_... | async reloadTheme(): Promise<void> {
const savedTheme = await getPreferencesService().getString(PREF_KEY_COLOR_THEME, ColorTheme.DEFAULT)
const renamedTheme = getRenamedTheme(savedTheme)
if (renamedTheme !== null) {
console.info('ThemeService', `Reload migrated renamed theme '${savedTheme}' to '${r... | https://github.com/LongLiveY96/chatcube | ee068b406459ff0197d2bfb752fa7eb79c5a82d2 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | greaterThan | Return true if the value of this Decimal is greater than the value of `n`, otherwise return false.
@param { Value } n {double | string | Decimal}
@returns { boolean } the boolean type | public greaterThan(n: Value): boolean {
return this.comparedTo(n) > 0;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left greaterThan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Value A... | public greaterThan(n: Value): boolean {
return this.comparedTo(n) > 0;
} | https://gitcode.com/iop123123/arkts-static-skills | e09723a1b4f3581051b24970df3a67bdbdfaee57 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/mapping/EntityData.ets | arkts | hasProperty | 检查属性是否存在
@param propertyName 属性名
@returns 是否存在 | hasProperty(propertyName: string): boolean {
return this.propertyMap.has(propertyName)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasProperty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST... | hasProperty(propertyName: string): boolean {
return this.propertyMap.has(propertyName)
} | https://github.com/offlinecat-dev/OCNetORM | 6dd5ca33b8e5ce28c056af5bbc703d3db1aa558e | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets | arkts | writeUint8Array | Writes the next array of unsigned bytes.
@param value The value. | writeUint8Array(value: Uint8Array): void {
this.checkWriteCapacity(value.byteLength)
this.setUint8Array(this.mByteOffset, value)
this.mByteOffset += value.byteLength
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left writeUint8Array AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uint8Array AST#identifier#Right AST#)#L... | writeUint8Array(value: Uint8Array): void {
this.checkWriteCapacity(value.byteLength)
this.setUint8Array(this.mByteOffset, value)
this.mByteOffset += value.byteLength
} | https://gitee.com/openharmony-sig/flutter_engine.git | 6e9feb3ceb022279f84b4f6db13b9bc0558e5e70 | gitee |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/messagebus/PreloadedDataService.ets | arkts | setLongPollingBaseUrlFromApi | 从 /site.json 的 client_settings 提取到 long_polling_base_url 时调用(绕开 CF HTML challenge) | setLongPollingBaseUrlFromApi(baseUrl: string): void {
const normalized: string | null = this.normalizePollingBaseUrl(baseUrl);
if (normalized === null) return;
if (normalized === this.longPollingBaseUrl) return;
this.longPollingBaseUrl = normalized;
try {
MessageBusService.getInstance().conf... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setLongPollingBaseUrlFromApi AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left baseUrl AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#... | setLongPollingBaseUrlFromApi(baseUrl: string): void {
const normalized: string | null = this.normalizePollingBaseUrl(baseUrl);
if (normalized === null) return;
if (normalized === this.longPollingBaseUrl) return;
this.longPollingBaseUrl = normalized;
try {
MessageBusService.getInstance().conf... | https://github.com/Amaz1ny/HarmonyDO-public | a1d6c07db2af9f035bcbc0d7fa062d88defb7a7c | github |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnLoadingViewModel.ets | arkts | toggleLoading | 切换加载显示状态 | toggleLoading(): void {
this.showLoading = !this.showLoading;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleLoading AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | toggleLoading(): void {
this.showLoading = !this.showLoading;
} | https://github.com/codelably/tuniao-ui | 10e742829f573b12f4817b04d9acb5b270a5fda2 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/ScraperManager.ets | arkts | getDetailByUnifiedId | 根据统一ID获取详情
@param unifiedId 统一ID(格式:source_externalId) | public async getDetailByUnifiedId(unifiedId: string): Promise<ScraperDetailResult> {
const parts = unifiedId.split('_');
if (parts.length < 2) {
return {
success: false,
source: ScraperSource.BANGUMI,
errorMessage: '无效的统一ID格式'
};
}
const sourceStr = parts[0];
c... | 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 getDetailByUnifiedId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left unifiedId AST#identifier#Right AST#ERROR#Left AST#... | public async getDetailByUnifiedId(unifiedId: string): Promise<ScraperDetailResult> {
const parts = unifiedId.split('_');
if (parts.length < 2) {
return {
success: false,
source: ScraperSource.BANGUMI,
errorMessage: '无效的统一ID格式'
};
}
const sourceStr = parts[0];
c... | https://github.com/DaLongZhuaZi/manxia | bde686718620011f10a8b42fee3cfd968fd22f32 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/common/accessibility/AccessibilityConfig.ets | arkts | applySettings | 应用配置到全局样式(AppStorage) | private applySettings(): void {
// 计算实际字体大小
let fontSize = this.settings.baseFontSize;
if (this.settings.elderlyMode) {
fontSize = 20; // 老年模式使用20sp
} else if (this.settings.largeFontMode) {
fontSize = 18; // 大字体模式使用18sp
}
// 计算实际触控区域大小
let minTouchTarget = this.settings.m... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applySettings 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#vo... | private applySettings(): void {
// 计算实际字体大小
let fontSize = this.settings.baseFontSize;
if (this.settings.elderlyMode) {
fontSize = 20; // 老年模式使用20sp
} else if (this.settings.largeFontMode) {
fontSize = 18; // 大字体模式使用18sp
}
// 计算实际触控区域大小
let minTouchTarget = this.settings.m... | https://github.com/LJ666-ui/harmony-health-care | 80592e28e1172c339341deb0830026d1287fdcd6 | github |
Joker-x-dev/CoolMallArkTS | core/ui/src/main/ets/component/refresh/RefreshLayout.ets | arkts | build | 渲染刷新布局
@returns {void} 无返回值 | build() {
IBestPullRefresh({
loading: this.loading,
scroller: this.scroller,
isEnableSlideUp: this.isEnableSlideUp,
defaultContent: (): void => {
if (this.content) {
this.content();
}
},
onRefresh: (direction: "pull" | "slideUp"): void => this.onRefres... | 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() {
IBestPullRefresh({
loading: this.loading,
scroller: this.scroller,
isEnableSlideUp: this.isEnableSlideUp,
defaultContent: (): void => {
if (this.content) {
this.content();
}
},
onRefresh: (direction: "pull" | "slideUp"): void => this.onRefres... | https://github.com/Joker-x-dev/CoolMallArkTS | 1e9f53882b53d753e2eb0ed947864e2918e6adde | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/PackLibrary.ets | arkts | paletteEntry | V0.6.5 — PackLibrary composes the three pack source layers (builtin /
global / family) into a single Pack[]. Override priority:
family > global > builtin on identical pack id.
Scene fallback (spec §5.4):
1. own non-empty scene -> keep
2. else look up same-id builtin's scene
3. else hash(id) % FALLBACK_PALETTE.length
Th... | function paletteEntry(bgPrimary: string, bgAccent: string, bossName: string): SceneMetadata {
const s: SceneMetadata = new SceneMetadata();
s.bgPrimary = bgPrimary;
s.bgAccent = bgAccent;
s.bossName = bossName;
return s;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left paletteEntry AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bgPrimary AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function paletteEntry(bgPrimary: string, bgAccent: string, bossName: string): SceneMetadata {
const s: SceneMetadata = new SceneMetadata();
s.bgPrimary = bgPrimary;
s.bgAccent = bgAccent;
s.bossName = bossName;
return s;
} | https://github.com/terryma2024/happyword | 8de6560d649f7e71c35575ec3195e7087c2a758b | github |
SMAT-Lab/Homecheck-Sec2026 | test/unittest/sample/NoInvalidThisCheck/ets/NoInvalidThisCheck.ets | arkts | foo | @this Obj | /** @this Obj */ function foo() {
console.log(this);
z(x => console.log(x, this));
} | AST#program#Left AST#comment#Left /** @this Obj */ AST#comment#Right AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left foo AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left ... | /** @this Obj */ function foo() {
console.log(this);
z(x => console.log(x, this));
} | https://github.com/SMAT-Lab/Homecheck-Sec2026 | 3aea663001e8e233a20e9fb4b90d3de05fc648d1 | github |
HarmonyOS_Samples/guide-snippets | ArkGraphics3D/entry/src/main/ets/material/material_cullmode.ets | arkts | setCullBack | Cull back faces (default mode) | setCullBack(): void {
if (this.material) {
this.material.cullMode = CullMode.BACK;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCullBack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Lef... | setCullBack(): void {
if (this.material) {
this.material.cullMode = CullMode.BACK;
}
} | https://gitcode.com/HarmonyOS_Samples/guide-snippets | c000287311631f22acb6892b2660a770cbeb8b64 | gitcode |
huaiminqin/TankWar-Master-with-Many-Tasks | game/src/main/ets/mission/MissionFactory.ets | arkts | createEscortMission | 创建护送任务 - 护送补给车到达目的地 | static createEscortMission(level: number): Mission {
const mission = new Mission(
`护送任务 ${level}`,
'护送补给车安全到达目的地'
);
mission.addObjective({
type: MissionType.ESCORT_SUPPLY_TRUCK,
description: '护送补给车到达终点',
progress: 0,
target: 100, // 100% 路程
status: MissionSt... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createEscortMission AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | static createEscortMission(level: number): Mission {
const mission = new Mission(
`护送任务 ${level}`,
'护送补给车安全到达目的地'
);
mission.addObjective({
type: MissionType.ESCORT_SUPPLY_TRUCK,
description: '护送补给车到达终点',
progress: 0,
target: 100, // 100% 路程
status: MissionSt... | https://github.com/huaiminqin/TankWar-Master-with-Many-Tasks | d12f353cd27603f5c326409005d7c0cbc8ffbb61 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/SmartWardInitializer.ets | arkts | stopTimeChecker | 停止时间检测 | public stopTimeChecker(): void {
console.log('SmartWardInitializer: Time checker stop pending (checker not yet integrated)');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left stopTimeChecker 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#expres... | public stopTimeChecker(): void {
console.log('SmartWardInitializer: Time checker stop pending (checker not yet integrated)');
} | https://github.com/LJ666-ui/harmony-health-care | 00c7dc2c9793df8f0968930ba3cbf7703f07348a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/Node.ets | arkts | innerText | 获取内部文本(同 rawText) | get innerText(): string {
return this.rawText;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left innerText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right A... | get innerText(): string {
return this.rawText;
} | https://github.com/DaLongZhuaZi/manxia | 48130c181fc5dc3a520c13425397f338d9f88412 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | getAxisMinLabels | The minimum number of labels on the axis | public getAxisMinLabels(): number {
return this.mAxisMinLabels;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAxisMinLabels 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 AS... | public getAxisMinLabels(): number {
return this.mAxisMinLabels;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 7d7b90dfe14d8867f5b1be946c3a389869bae4fc | gitee |
pangpang20/antennaPodHM | entry/src/main/ets/pages/SettingsPage.ets | arkts | showAppDetailInfo | 显示应用详情 | showAppDetailInfo(): void {
const buttons: ButtonOptions[] = [
new ButtonOptions('确定', '#007AFF')
];
UIUtils.showDialog(new DialogOptions(
'AntennaPodHM',
'AntennaPod for HarmonyOS\n\n名称来源:\n• AntennaPod - 知名的开源播客应用\n• HM - HarmonyOS(鸿蒙)的缩写\n\n这是一款基于 HarmonyOS ArkTS 开发的播客应用,致敬经典的 Antenna... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showAppDetailInfo 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_... | showAppDetailInfo(): void {
const buttons: ButtonOptions[] = [
new ButtonOptions('确定', '#007AFF')
];
UIUtils.showDialog(new DialogOptions(
'AntennaPodHM',
'AntennaPod for HarmonyOS\n\n名称来源:\n• AntennaPod - 知名的开源播客应用\n• HM - HarmonyOS(鸿蒙)的缩写\n\n这是一款基于 HarmonyOS ArkTS 开发的播客应用,致敬经典的 Antenna... | https://github.com/pangpang20/antennaPodHM | d57f31ab6ad607f6fdbc61e214d9f5c51de3d23d | github |
HarmonyOS_Samples/HMRouter | entry/src/main/ets/component/product/ProductContent.ets | arkts | build | [StartExclude hm_router]
[StartExclude hm_router_get_current_param] | build() {
Column() {
Scroll() {
Column() {
ProductPicture()
.margin({ bottom: 70 });
ProductInfo({ product: this.product });
};
}
.edgeEffect(EdgeEffect.Spring)
.scrollBar(BarState.Off)
.layoutWeight(1);
ProductUtilView({ product... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
Scroll() {
Column() {
ProductPicture()
.margin({ bottom: 70 });
ProductInfo({ product: this.product });
};
}
.edgeEffect(EdgeEffect.Spring)
.scrollBar(BarState.Off)
.layoutWeight(1);
ProductUtilView({ product... | https://gitcode.com/HarmonyOS_Samples/HMRouter | e1a8d0bc4cfe07e1bd687d272754467d39b1bfc4 | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/StoragePaths.ets | arkts | getStorageStats | 获取存储使用统计 | static async getStorageStats(): Promise<StorageStatsResult> {
const stats: StorageStatsResult = {
vmsSize: 0,
isosSize: 0,
sharedSize: 0,
totalSize: 0
}
// 计算 VMs 目录大小
try {
const vmDirs = await fs.listFile(StoragePaths.VMS_DIR)
for (const vmDir of vmDirs) {
... | 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 getStorageStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | static async getStorageStats(): Promise<StorageStatsResult> {
const stats: StorageStatsResult = {
vmsSize: 0,
isosSize: 0,
sharedSize: 0,
totalSize: 0
}
// 计算 VMs 目录大小
try {
const vmDirs = await fs.listFile(StoragePaths.VMS_DIR)
for (const vmDir of vmDirs) {
... | https://github.com/AetheriumSimulator/qemu-hmos | 015184d0e035225807b0b05c3ecee78b6580a285 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | of | Creates a new Uint16Array using initializer
@param data initializer
@returns a new Uint16Array from data | public of(data: Object[]): Uint16Array {
throw new Error("Uint16Array.of: not implemented")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left of AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public of(data: Object[]): Uint16Array {
throw new Error("Uint16Array.of: not implemented")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 3c15a08746cfc4e71f869584dc7ab482246d28ba | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/BookshelfCategoryManager.ets | arkts | getUncategorizedItemKey | 获取未分类的内容(属于默认分类或未设置分类) | getUncategorizedItemKey(itemId: string, contentType: ContentType): boolean {
const key = `${contentType}_${itemId}`;
const item = this.itemCategoryMap.get(key);
return !item || item.categoryId === 'default';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUncategorizedItemKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left itemId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AS... | getUncategorizedItemKey(itemId: string, contentType: ContentType): boolean {
const key = `${contentType}_${itemId}`;
const item = this.itemCategoryMap.get(key);
return !item || item.categoryId === 'default';
} | https://github.com/DaLongZhuaZi/manxia | 23a96072864a6a62687b6fc1b3c953d415bd2d43 | github |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/SVGXMLChecker.ets | arkts | _readCharData | 读取字符数据
@see https://www.w3.org/TR/xml/ 2.4节 [14] CharData
@return 返回是否读取到了字符数据 | private _readCharData(): boolean{
let _svgStringReader=this._svgStringReader!;
let charData = _svgStringReader.readUntilMatch(RegexConstants.REGEX_SPECIAL_MARK);
if (!charData) {
return false;
}
this._validateChars(charData);
if (_svgStringReader.peek() === XMLConstants.XML_SINGLE_SQUARE... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left _readCharData 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 ... | private _readCharData(): boolean{
let _svgStringReader=this._svgStringReader!;
let charData = _svgStringReader.readUntilMatch(RegexConstants.REGEX_SPECIAL_MARK);
if (!charData) {
return false;
}
this._validateChars(charData);
if (_svgStringReader.peek() === XMLConstants.XML_SINGLE_SQUARE... | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | 87167ec11dd1884a5e898336551d37e230bd0a09 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/Logger.ets | arkts | setEnableTimestamp | 设置是否在日志中显示时间戳
@param enable - 是否启用时间戳 | public setEnableTimestamp(enable: boolean): void {
this.enableTimestamp = enable;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setEnableTimestamp 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#... | public setEnableTimestamp(enable: boolean): void {
this.enableTimestamp = enable;
} | https://github.com/DaLongZhuaZi/manxia | 9bb18996dd7970dc4006ad53ae506962c2d12b73 | github |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/BattleEngine.ets | arkts | applySpellLetterPenalty | V0.8.4 — Spell letter-pool wrong tap: -1 player HP without advancing
the question or totalAnswers. Returns damage dealt (always 1). | applySpellLetterPenalty(): number {
if (this.state_.status !== BattleStatus.Playing) {
return 0;
}
const damage: number = 1;
this.state_.playerHp -= damage;
if (this.state_.playerHp <= 0) {
this.state_.playerHp = 0;
this.state_.status = BattleStatus.Lost;
this.state_.curren... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left applySpellLetterPenalty 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 AS... | applySpellLetterPenalty(): number {
if (this.state_.status !== BattleStatus.Playing) {
return 0;
}
const damage: number = 1;
this.state_.playerHp -= damage;
if (this.state_.playerHp <= 0) {
this.state_.playerHp = 0;
this.state_.status = BattleStatus.Lost;
this.state_.curren... | https://github.com/terryma2024/happyword | 4da9b4918aadc015fd9d0f046ebfdd2322962f65 | github |
HarmonyOS_Samples/MultiPictureBeautification | multipicturecommon/src/main/ets/utils/WindowUtil.ets | arkts | setWindowOrientation | Set window orientation (portrait, landscape, auto) | setWindowOrientation(orientation: window.Orientation): void {
if (!this.mainWindow) {
return;
}
this.mainWindow.setPreferredOrientation(orientation)
.then(() => {
Logger.info(LogConstants.LOG_TAG_WINDOW_UTIL, 'Succeeded in setting window orientation.');
this.mainWindowInfo.orie... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setWindowOrientation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left orientation AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left window AST#identi... | setWindowOrientation(orientation: window.Orientation): void {
if (!this.mainWindow) {
return;
}
this.mainWindow.setPreferredOrientation(orientation)
.then(() => {
Logger.info(LogConstants.LOG_TAG_WINDOW_UTIL, 'Succeeded in setting window orientation.');
this.mainWindowInfo.orie... | https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification | c0241c39b502f7de607ce0ebbfb9bb8da3d97574 | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | random | Returns a new Decimal with a random value equal to or greater than 0 and less than 1.
@returns { Decimal } the Decimal type
@throws { BusinessError } 10200061 - Crypto unavailable | static random(): Decimal {
return Utils.random();
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left random 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 Decimal AST#ide... | static random(): Decimal {
return Utils.random();
} | https://gitcode.com/iop123123/arkts-static-skills | e69b5ec615d804b64d4e1a3c2b8abfaf2265cd2d | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/services/TypeDefined.ets | arkts | isMoveItem | 判断是否是需要移动的条目
@param itemId 条目或分组ID
@returns 是否需要移动 | public isMoveItem(itemId: string): boolean {
if (this.entryIds.includes(itemId)) return true;
if (this.groupIds.includes(itemId)) return true;
return false;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isMoveItem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left itemId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left str... | public isMoveItem(itemId: string): boolean {
if (this.entryIds.includes(itemId)) return true;
if (this.groupIds.includes(itemId)) return true;
return false;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/TypeDefined.ets#L438-L442 | e5e68333237b83a3c89921dfbb64d4cb00815181 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | set | Assigns val as element on insertPos.
@description Added to avoid (un)packing a single value into array to use overloaded set(number[], insertPos)
@param val value to set
@param insertPos index to change | public set(insertPos: number, val: number): void {
this.set(insertPos as int, val as number)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left insertPos AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#... | public set(insertPos: number, val: number): void {
this.set(insertPos as int, val as number)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | c860ae3e33b56c0f86a5ded8550d0b6e9a224a7e | gitee |
Xiwei753/xiezuoruanjian | apps/harmony/entry/src/main/ets/bridge/MockWriterCoreBridge.ets | arkts | getLocalSettings | Settings methods | async getLocalSettings(): Promise<ResultEnvelope<LocalSettings>> {
await this.delay(100)
const copy: LocalSettings = {
themeMode: this.mockSettings.themeMode,
locale: this.mockSettings.locale,
autoSaveEnabled: this.mockSettings.autoSaveEnabled,
editorFontSize: this.mockSettings.editorF... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getLocalSettings 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#gen... | async getLocalSettings(): Promise<ResultEnvelope<LocalSettings>> {
await this.delay(100)
const copy: LocalSettings = {
themeMode: this.mockSettings.themeMode,
locale: this.mockSettings.locale,
autoSaveEnabled: this.mockSettings.autoSaveEnabled,
editorFontSize: this.mockSettings.editorF... | https://github.com/Xiwei753/xiezuoruanjian | 2d98d5a84f1cbecd30ca2187eddd20598a8594ea | github |
openharmony/vendor_unionman | unionpi_tiger/sample_api11/app/gpioled_app/entry/src/main/ets/pages/Index.ets | arkts | syncButtonStatus | 同步按钮开关状态 | syncButtonStatus() {
gpioLed.getLedStatus(this.pin).then((result) => {
this.isOn = Boolean(result)
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left syncButtonStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L... | syncButtonStatus() {
gpioLed.getLedStatus(this.pin).then((result) => {
this.isOn = Boolean(result)
})
} | https://gitee.com/openharmony/vendor_unionman.git | 548a4070268e3dab2bd76527ccb4f2c53ef6a66e | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.