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 |
|---|---|---|---|---|---|---|---|---|---|---|
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Debug/HidebugPerformanceCollector.ets | arkts | collectGcInfoSync | 同步收集GC信息 | private collectGcInfoSync(): HidebugGcInfo {
const gcInfo: HidebugGcInfo = {
vmRuntimeStats: null,
gcCount: 0,
gcTime: 0,
gcBytesAllocated: 0,
gcBytesFreed: 0,
fullgcLongtimeCount: 0
};
try {
// 获取VM运行时统计信息
gcInfo.vmRuntimeStats = hidebug.getVMRuntimeStats(... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left collectGcInfoSync 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 H... | private collectGcInfoSync(): HidebugGcInfo {
const gcInfo: HidebugGcInfo = {
vmRuntimeStats: null,
gcCount: 0,
gcTime: 0,
gcBytesAllocated: 0,
gcBytesFreed: 0,
fullgcLongtimeCount: 0
};
try {
// 获取VM运行时统计信息
gcInfo.vmRuntimeStats = hidebug.getVMRuntimeStats(... | https://github.com/DaLongZhuaZi/manxia | dae196cb15a3526f8fd6755f5ed9bbf3d4d59ad9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsEngine.ets | arkts | setJsLib | 设置JS库(书源的jsLib字段) | setJsLib(jsLib: string): void {
this.jsLib = jsLib || '';
if (jsLib && jsLib.length > 0) {
logger.debug(TAG, `已设置jsLib (${jsLib.length}字符)`);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setJsLib AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left jsLib AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)... | setJsLib(jsLib: string): void {
this.jsLib = jsLib || '';
if (jsLib && jsLib.length > 0) {
logger.debug(TAG, `已设置jsLib (${jsLib.length}字符)`);
}
} | https://github.com/DaLongZhuaZi/manxia | 64b0d490bd7f0bd6c0d2ca955b0a4ac016a595f8 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | determineWaypointType | 确定途经点类型
@param node 当前节点
@param prevNode 前一节点 | private determineWaypointType(
node: GraphNode,
prevNode: GraphNode | null
): WaypointType {
if (!prevNode) return WaypointType.GO_STRAIGHT;
// 根据节点类型
if (
node.type === WaypointType.TAKE_ELEVATOR ||
node.type === WaypointType.TAKE_STAIRS
) {
return node.type;
}
/... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left determineWaypointType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left node AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | private determineWaypointType(
node: GraphNode,
prevNode: GraphNode | null
): WaypointType {
if (!prevNode) return WaypointType.GO_STRAIGHT;
// 根据节点类型
if (
node.type === WaypointType.TAKE_ELEVATOR ||
node.type === WaypointType.TAKE_STAIRS
) {
return node.type;
}
/... | https://github.com/LJ666-ui/harmony-health-care | c2743d7f987b8e1d57e68ea52a017900d01d829f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | restoreMangaSources | 恢复漫画书源(完整字段) | private async restoreMangaSources(items: MangaSourceBackup[]): Promise<void> {
logger.info(TAG, `Restoring manga sources: ${items.length} items`);
const failures: string[] = [];
for (const item of items) {
try {
const now = Date.now();
const sql = `INSERT OR REPLACE INTO comic_sourc... | 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 restoreMangaSources AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left items AST#identifier#Right AST#:#... | private async restoreMangaSources(items: MangaSourceBackup[]): Promise<void> {
logger.info(TAG, `Restoring manga sources: ${items.length} items`);
const failures: string[] = [];
for (const item of items) {
try {
const now = Date.now();
const sql = `INSERT OR REPLACE INTO comic_sourc... | https://github.com/DaLongZhuaZi/manxia | 529f7d4df9d18a6d40517ab66ecb3ac89bb97041 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewSourceManager.ets | arkts | releaseMangaEngine | 释放MangaSourceEngine实例
【重构】支持按sourceName或sourceId释放 | releaseMangaEngine(sourceIdOrName: number | string): void {
if (typeof sourceIdOrName === 'string') {
// 按sourceName释放
if (this.mangaEngines.has(sourceIdOrName)) {
logger.info(TAG, `释放MangaSourceEngine: "${sourceIdOrName}"`);
this.mangaEngines.delete(sourceIdOrName);
}
} else... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left releaseMangaEngine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left sourceIdOrName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Ri... | releaseMangaEngine(sourceIdOrName: number | string): void {
if (typeof sourceIdOrName === 'string') {
// 按sourceName释放
if (this.mangaEngines.has(sourceIdOrName)) {
logger.info(TAG, `释放MangaSourceEngine: "${sourceIdOrName}"`);
this.mangaEngines.delete(sourceIdOrName);
}
} else... | https://github.com/DaLongZhuaZi/manxia | 2a017548a3db0cf1aa3edaca692a7e5d064a07b3 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | moveItemToShelf | 执行移动到书架 | private async moveItemToShelf(shelfId: string): Promise<void> {
if (!this.moveState.toShelfItemId) return;
await this.typeShelfManager.moveItemToShelf(
this.moveState.toShelfItemId,
this.moveState.toShelfContentType,
shelfId
);
// 刷新书架列表
this.typeShelves = this.typeShelfManager... | 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 moveItemToShelf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left shelfId AST#identifier#Right AST#ERROR#Left AST#:#Le... | private async moveItemToShelf(shelfId: string): Promise<void> {
if (!this.moveState.toShelfItemId) return;
await this.typeShelfManager.moveItemToShelf(
this.moveState.toShelfItemId,
this.moveState.toShelfContentType,
shelfId
);
// 刷新书架列表
this.typeShelves = this.typeShelfManager... | https://github.com/DaLongZhuaZi/manxia | 3584c4b6d8ea8365a7251994948c7e34dea8f14d | github |
somnio-software/my-bot-pal | entry/src/main/ets/utils/VibratorManager.ets | arkts | stopVibration | Stop all ongoing vibrations | static async stopVibration(): Promise<void> {
return new Promise((resolve, reject) => {
try {
vibrator.stopVibration((error: BusinessError) => {
if (error) {
reject(error);
} else {
resolve();
}
});
} catch (err) {
reject(er... | 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 stopVibration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#... | static async stopVibration(): Promise<void> {
return new Promise((resolve, reject) => {
try {
vibrator.stopVibration((error: BusinessError) => {
if (error) {
reject(error);
} else {
resolve();
}
});
} catch (err) {
reject(er... | https://github.com/somnio-software/my-bot-pal | 1082d7782f640d7dffbd9716372201b4d864f32d | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/ErrorUtils.ets | arkts | toError | * 构建异常类 * @param code 编码 * @returns 结果 | export class ErrorUtils { | AST#program#Left AST#export_statement#Left AST#export#Left export AST#export#Right AST#class_declaration#Left AST#class#Left class AST#class#Right AST#type_identifier#Left ErrorUtils AST#type_identifier#Right AST#class_body#Left AST#{#Left { AST#{#Right AST#}#Left AST#}#Right AST#class_body#Right AST#class_declaration#... | export class ErrorUtils { | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ErrorUtils.ets#L1-L1 | 0f5b0b402f05f054e2dd0ffcef8846c7f998194a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Editor/FileEditorService.ets | arkts | savePageState | 保存页面实例快照 | public savePageState(state: FileEditorPageState): void {
if (state.instanceId.length === 0) {
return;
}
this.pageStates.set(state.instanceId, this.clonePageState(state));
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left savePageState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left F... | public savePageState(state: FileEditorPageState): void {
if (state.instanceId.length === 0) {
return;
}
this.pageStates.set(state.instanceId, this.clonePageState(state));
} | https://github.com/DaLongZhuaZi/manxia | f3bfc2fbd9f8fcf9be49f973efac9eae23937f5b | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | findNearestNode | ==================== 辅助方法 ====================
查找最近的图节点
@param position 位置 | private findNearestNode(position: Position3D): GraphNode | null {
let nearest: GraphNode | null = null;
let minDistance = Infinity;
for (const node of this.graph.values()) {
const distance = this.getDistance(position, node.position);
if (distance < minDistance) {
minDistance = distanc... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left findNearestNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left position AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie... | private findNearestNode(position: Position3D): GraphNode | null {
let nearest: GraphNode | null = null;
let minDistance = Infinity;
for (const node of this.graph.values()) {
const distance = this.getDistance(position, node.position);
if (distance < minDistance) {
minDistance = distanc... | https://github.com/LJ666-ui/harmony-health-care | 910a09d6a02352f3e3a65f2a3e17b27baf866155 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | of | Returns a new array from a set of elements.
@returns { Int16Array } - a new Int16Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static of(): Int16Array {
return new Int16Array(0)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | public static of(): Int16Array {
return new Int16Array(0)
} | https://gitcode.com/iop123123/arkts-static-skills | d78cd4d4c09d10ec6484e759e68387cb72d6920b | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | skipBalanced | 跳过平衡的括号 | private skipBalanced(open: string, close: string): void {
let depth = 1;
this.pos++; // 跳过开始括号
while (this.pos < this.queue.length && depth > 0) {
const c = this.queue[this.pos];
if (c === open) {
depth++;
} else if (c === close) {
depth--;
} else if (c === '"'... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left skipBalanced AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left open AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | private skipBalanced(open: string, close: string): void {
let depth = 1;
this.pos++; // 跳过开始括号
while (this.pos < this.queue.length && depth > 0) {
const c = this.queue[this.pos];
if (c === open) {
depth++;
} else if (c === close) {
depth--;
} else if (c === '"'... | https://github.com/DaLongZhuaZi/manxia | 7cf739ffeffc7d797cd71008da26abcff5be6e09 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets | arkts | addDictRule | 添加字典规则 | async addDictRule(rule: DictRule): Promise<void> {
this.dictRules.push(rule);
await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.DICT_RULES, this.dictRules);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left addDictRule AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left... | async addDictRule(rule: DictRule): Promise<void> {
this.dictRules.push(rule);
await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.DICT_RULES, this.dictRules);
} | https://github.com/DaLongZhuaZi/manxia | d345c5b13805895b975b30f213a5b4f005e09750 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/UserThemeConfig.ets | arkts | syncToAppStorage | 同步配置到AppStorage(用于声明式UI绑定) | private syncToAppStorage(): void {
try {
const profile = this.currentProfile;
// 透明度配置
AppStorage.setOrCreate<number>(USER_THEME_KEYS.CARD_OPACITY, profile.transparency.card);
AppStorage.setOrCreate<number>(USER_THEME_KEYS.NAV_BAR_OPACITY, profile.transparency.navigationBar);
AppStor... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left syncToAppStorage 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... | private syncToAppStorage(): void {
try {
const profile = this.currentProfile;
// 透明度配置
AppStorage.setOrCreate<number>(USER_THEME_KEYS.CARD_OPACITY, profile.transparency.card);
AppStorage.setOrCreate<number>(USER_THEME_KEYS.NAV_BAR_OPACITY, profile.transparency.navigationBar);
AppStor... | https://github.com/DaLongZhuaZi/manxia | 09ee790f75f7eeb44fe773b179a6b178177c19bf | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets | arkts | setLongTermView | 设置视图模式 | public async setLongTermView(isLongTerm: boolean): Promise<void> {
this.settings.isLongTermView = isLongTerm;
await this.saveSettings();
logger.info(TAG, `视图模式已设置为: ${isLongTerm ? '长期视图' : '日视图'}`);
} | 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 setLongTermView AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isLongTerm AST#identifier#Right AST#ERROR#Left AST#:#Le... | public async setLongTermView(isLongTerm: boolean): Promise<void> {
this.settings.isLongTermView = isLongTerm;
await this.saveSettings();
logger.info(TAG, `视图模式已设置为: ${isLongTerm ? '长期视图' : '日视图'}`);
} | https://github.com/DaLongZhuaZi/manxia | ef150c99bcc2bcd15dab9696dfecec72cf43d4cc | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/UserThemeConfig.ets | arkts | setTransparency | 设置透明度配置 | public async setTransparency(transparency: Partial<TransparencyConfig>): Promise<void> {
this.currentProfile.transparency = mergeTransparency(this.currentProfile.transparency, transparency);
await this.saveCurrentProfile();
this.notifyChange();
} | 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 setTransparency AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left transparency AST#iden... | public async setTransparency(transparency: Partial<TransparencyConfig>): Promise<void> {
this.currentProfile.transparency = mergeTransparency(this.currentProfile.transparency, transparency);
await this.saveCurrentProfile();
this.notifyChange();
} | https://github.com/DaLongZhuaZi/manxia | df9af35b55c9c9ad4e88e9dd82c9973c9ba05cb3 | github |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/pages/FloatBall.ets | arkts | aboutToAppear | 单击事件ID | aboutToAppear() {
ProfilerTask.getInstance().initModule()
ProfilerTask.getInstance().taskInit()
console.log('cm-floatBall-CreateTitleWindow1')
globalThis.CreateTitleWindow()
console.log('cm-floatBall-CreateTitleWindow2')
globalThis.task_status = TaskStatus.task_init
console.log('cm-floatBa... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
ProfilerTask.getInstance().initModule()
ProfilerTask.getInstance().taskInit()
console.log('cm-floatBall-CreateTitleWindow1')
globalThis.CreateTitleWindow()
console.log('cm-floatBall-CreateTitleWindow2')
globalThis.task_status = TaskStatus.task_init
console.log('cm-floatBa... | https://gitee.com/openharmony/developtools_profiler.git | 3477a4f9224c3e6d5510d88a5a9fb9f9aeb8c9f9 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | getSourceConfigByName | 按名称查找图源配置(用于图源ID失效后的降级查找)
[新增] 支持按图源名称查找,实现更灵活的图源管理 | async getSourceConfigByName(sourceName: string): Promise<SourceConfigResult | null> {
try {
const sql = 'SELECT * FROM comic_source WHERE name = ? LIMIT 1';
const result = await this.databaseManager.querySql(sql, [sourceName]);
if (result && result.length > 0) {
const row: ESObjec... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSourceConfigByName AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceName AST#identifier#Right AST#type_annotation#Left ... | async getSourceConfigByName(sourceName: string): Promise<SourceConfigResult | null> {
try {
const sql = 'SELECT * FROM comic_source WHERE name = ? LIMIT 1';
const result = await this.databaseManager.querySql(sql, [sourceName]);
if (result && result.length > 0) {
const row: ESObjec... | https://github.com/DaLongZhuaZi/manxia | 45fa51df00247725bb0a0ec8d7d4f231d50b2702 | github |
openharmony/xts_tools | sample/AppSampleD/entry/src/ohosTest/ets/test/Index.test.ets | arkts | checkAndClickByText | 根据text拿到组件并点击
@param text | async function checkAndClickByText(text: string, log: string) {
hilog.info(DOMAIN, TAG, BUNDLE + `${log} text:${text}`);
await driver.assertComponentExist(ON.text(text));
let res = await driver.findComponent(ON.text(text));
await res.click();
} | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left checkAndClickByText AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left text AST#identifier#Right AST... | async function checkAndClickByText(text: string, log: string) {
hilog.info(DOMAIN, TAG, BUNDLE + `${log} text:${text}`);
await driver.assertComponentExist(ON.text(text));
let res = await driver.findComponent(ON.text(text));
await res.click();
} | https://gitee.com/openharmony/xts_tools.git | ff7399215a9a5bee2a3d62903c755c9e48ba199c | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/DataService.ets | arkts | deleteRecord | 删除测试记录 | public async deleteRecord(id: string): Promise<void> {
try {
if (this.testRecords) {
this.testRecords.delete(id);
}
logger.debug(TAG, `删除测试记录: ${id}`);
} catch (error) {
logger.error(TAG, '删除测试记录失败' + String(error));
throw error as Error;
}
} | 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 deleteRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#... | public async deleteRecord(id: string): Promise<void> {
try {
if (this.testRecords) {
this.testRecords.delete(id);
}
logger.debug(TAG, `删除测试记录: ${id}`);
} catch (error) {
logger.error(TAG, '删除测试记录失败' + String(error));
throw error as Error;
}
} | https://github.com/DaLongZhuaZi/manxia | 403e4c0592dd4be2806a616a289db96b2723d2db | github |
honjow/Next2V | shared/src/main/ets/settings/CloudSyncSettings.ets | arkts | enabledFeatureKeys | The CloudSyncFeature keys that are currently on, in display order. | static enabledFeatureKeys(): string[] {
const keys: string[] = []
CLOUD_SYNC_FEATURES.forEach((def: CloudSyncFeatureDef) => {
if (CloudSyncSettings.isFeatureEnabled(def.key)) {
keys.push(def.key)
}
})
return keys
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left enabledFeatureKeys 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 str... | static enabledFeatureKeys(): string[] {
const keys: string[] = []
CLOUD_SYNC_FEATURES.forEach((def: CloudSyncFeatureDef) => {
if (CloudSyncSettings.isFeatureEnabled(def.key)) {
keys.push(def.key)
}
})
return keys
} | https://github.com/honjow/Next2V | 7102eb0465a9175c793f5e42173f88964fd7e3e0 | github |
SummerKaze/HMOS-AppBundleNameForShared | entry/src/main/ets/utils/UrlUtils.ets | arkts | extractPackageName | 从华为应用商店URL中提取应用包名
@param url 华为应用商店的完整URL字符串
@returns 应用包名,如果提取失败返回空字符串
示例:
输入: "https://appgallery.huawei.com/app/detail?id=yylx.danmaku.bili&channelId=SHARE"
输出: "yylx.danmaku.bili" | static extractPackageName(url: string): string {
try {
// 判断是否为华为应用商店URL
if (!UrlUtils.isValidAppGalleryUrl(url)) {
return '';
}
// 使用正则表达式匹配id参数的值
const regex = /[?&]id=([^&]*)/;
const match = url.match(regex);
if (match && match[1]) {
// 对URL编码的字符进行解码
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left extractPackageName 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#Lef... | static extractPackageName(url: string): string {
try {
// 判断是否为华为应用商店URL
if (!UrlUtils.isValidAppGalleryUrl(url)) {
return '';
}
// 使用正则表达式匹配id参数的值
const regex = /[?&]id=([^&]*)/;
const match = url.match(regex);
if (match && match[1]) {
// 对URL编码的字符进行解码
... | https://github.com/SummerKaze/HMOS-AppBundleNameForShared | 1ff88c52f9d153a2f3a2799d0b8055ee29d682b2 | github |
richshaw2015/nds | ohos/entry/src/test/NativeSync.test.ets | arkts | batchSetSettingsConfig | 批量设置配置值
Requirements: 13.5 | batchSetSettingsConfig(configs: Record<string, SettingsConfigValue>): boolean {
this.batchCallCount++;
if (this.simulateFailure) {
this.lastError = 'Simulated batch sync failure';
return false;
}
// 先验证所有配置值
for (const [key, value] of Object.entries(configs)) {
if (!this.valida... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left batchSetSettingsConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left configs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#L... | batchSetSettingsConfig(configs: Record<string, SettingsConfigValue>): boolean {
this.batchCallCount++;
if (this.simulateFailure) {
this.lastError = 'Simulated batch sync failure';
return false;
}
// 先验证所有配置值
for (const [key, value] of Object.entries(configs)) {
if (!this.valida... | https://github.com/richshaw2015/nds | be983a074bb9e1e72c7ff8175f114f6dc6986c90 | github |
LZZLHY/hlib | entry/src/main/ets/viewmodel/DownloadVM.ets | arkts | handleStreamFailure | 流式下载失败处理:
- `retryable=true` 时(5xx / 网络错误)触发自动镜像漂移;
- 否则直接 markFailed。
- 用户主动 cancel 不触发重试。 | private static handleStreamFailure(dt: DownloadTask, detail: string, retryable: boolean): void {
if (DownloadVM.cancelled.has(dt.bookId)) {
DownloadVM.cancelled.delete(dt.bookId);
DownloadVM.retryCtxs.delete(dt.bookId);
// cancel 已经从列表移除,无需 markFailed
return;
}
if (retryable) {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left handleStreamFailure AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dt AST#identifier#Right AST#:#Le... | private static handleStreamFailure(dt: DownloadTask, detail: string, retryable: boolean): void {
if (DownloadVM.cancelled.has(dt.bookId)) {
DownloadVM.cancelled.delete(dt.bookId);
DownloadVM.retryCtxs.delete(dt.bookId);
// cancel 已经从列表移除,无需 markFailed
return;
}
if (retryable) {
... | https://github.com/LZZLHY/hlib | 8076315f38297e2d7968ca10a7f47b32256959df | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SourceRepositoryManager.ets | arkts | getRepositorySources | 获取仓库中的所有图源 | async getRepositorySources(): Promise<SourceRepositoryEntry[]> {
const index = await this.readIndexFile();
return index.sources;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getRepositorySources AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | async getRepositorySources(): Promise<SourceRepositoryEntry[]> {
const index = await this.readIndexFile();
return index.sources;
} | https://github.com/DaLongZhuaZi/manxia | 44caf92e62fbdbd3935f9b2836eb067833d381d5 | github |
openharmony-sig/fluttertpc_camerawesome | ohos/ohos/src/main/ets/components/cameraX/CameraState.ets | arkts | initCamera | 初始化相机
@param sensor 相机位置
@param aspectRatio 纵横比
@param zoom 缩放比
@param mirrorFrontCamera 是否镜像拍照
@param enablePhysicalButton 是否支持物理按钮
@param flashMode 闪光灯模式
@param captureMode 捕捉模式
@param enableImageStream 启用图像流
@param exifPreferences 是否保存GPS信息
@returns | async initCamera(): Promise<boolean> {
return this.lock_.lockAsync(async () => {
await this.releaseCamera()
// 获取相机管理器实例
this.cameraManager = this.getCameraManagerFn();
if (this.cameraManager === undefined) {
Logger.error(TAG, 'cameraManager i... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left initCamera 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_t... | async initCamera(): Promise<boolean> {
return this.lock_.lockAsync(async () => {
await this.releaseCamera()
// 获取相机管理器实例
this.cameraManager = this.getCameraManagerFn();
if (this.cameraManager === undefined) {
Logger.error(TAG, 'cameraManager i... | https://gitee.com/openharmony-sig/fluttertpc_camerawesome.git | 1ada5b650de3e9a419d8eb72d9d8979690e31eb3 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/ClipboardUtils.ets | arkts | copyAutoClear | 复制文本到剪贴板,并自动清理
@param text 文本
@param timeoutClear 自动清理时间,单位秒, 小于等于0则不进行清理 | public static copyAutoClear(text: string) {
SettingsService.get(SettingsService.KEY_SECURITY_CLEAR_PASTEBOARD_TIME, SettingsService.KEY_SECURITY_CLEAR_PASTEBOARD_TIME_DEFAULT, (value) => {
ClipboardUtils.copy(text, value);
});
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left copyAutoClear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AS... | public static copyAutoClear(text: string) {
SettingsService.get(SettingsService.KEY_SECURITY_CLEAR_PASTEBOARD_TIME, SettingsService.KEY_SECURITY_CLEAR_PASTEBOARD_TIME_DEFAULT, (value) => {
ClipboardUtils.copy(text, value);
});
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ClipboardUtils.ets#L17-L21 | 19d3a19c45cc025b4c3ac110c63e9a261682df5a | github |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | finishTrailingReasoningPart | 标记当前最后一个 reasoning part 为已完成(被工具调用 / 最终文本打断),
便于 UI 显示总用时并让后续新的 reasoning 独立分段。 | private finishTrailingReasoningPart(aiMessage: ChatMessage): void {
for (let i = aiMessage.parts.length - 1; i >= 0; i--) {
const p = aiMessage.parts[i]
if (p.kind === MessagePartKind.REASONING) {
if (p.reasoningFinishedAt === 0) {
p.reasoningFinishedAt = Date.now()
}
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left finishTrailingReasoningPart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left aiMessage AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right ... | private finishTrailingReasoningPart(aiMessage: ChatMessage): void {
for (let i = aiMessage.parts.length - 1; i >= 0; i--) {
const p = aiMessage.parts[i]
if (p.kind === MessagePartKind.REASONING) {
if (p.reasoningFinishedAt === 0) {
p.reasoningFinishedAt = Date.now()
}
... | https://github.com/LongLiveY96/chatcube | e3603f5da11cea95c432a04ef22cb8403661491b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | updateSourcePreloadSettings | 更新图源预加载设置 | async updateSourcePreloadSettings(
sourceId: number,
preloadCurrentChapter: boolean,
preloadCurrentPages: number,
preloadNextChapter: boolean,
preloadNextPages: number
): Promise<void> {
try {
const sql = `UPDATE comic_source SET
preloadCurrentChapter = ?,
preloadCurr... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateSourcePreloadSettings AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#L... | async updateSourcePreloadSettings(
sourceId: number,
preloadCurrentChapter: boolean,
preloadCurrentPages: number,
preloadNextChapter: boolean,
preloadNextPages: number
): Promise<void> {
try {
const sql = `UPDATE comic_source SET
preloadCurrentChapter = ?,
preloadCurr... | https://github.com/DaLongZhuaZi/manxia | 4bbaf762d27d7fcb984478a4f7357ee00b746e07 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | saveOnlineComicFromSource | 兼容API:保存在线漫画(包装原有方法) | async saveOnlineComicFromSource(sourceId: number, comicData: OnlineComicSourceSaveInput, externalId?: string): Promise<string> {
return await this.saveComicFromSource(sourceId, comicData, externalId);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveOnlineComicFromSource AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Lef... | async saveOnlineComicFromSource(sourceId: number, comicData: OnlineComicSourceSaveInput, externalId?: string): Promise<string> {
return await this.saveComicFromSource(sourceId, comicData, externalId);
} | https://github.com/DaLongZhuaZi/manxia | 8a59286b66246d9f9987027fe094adcd307de19a | github |
Tencent-RTC/TUIKit_Harmony | atomic_x/src/main/ets/messagelist/config/MessageListConfig.ets | arkts | isSupportTranslate | Disable translate in merged detail view | get isSupportTranslate(): boolean {
return false;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left isSupportTranslate 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... | get isSupportTranslate(): boolean {
return false;
} | https://github.com/Tencent-RTC/TUIKit_Harmony | 9268379a54d054e886069797a4395854a42ec678 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets | arkts | buildBasicMangaFromComicInfo | 构建基本Manga对象(不含章节) | private buildBasicMangaFromComicInfo(comicInfo: ComicInfo, isLocal: boolean): Manga {
const metadata: MangaMetadata = {
authors: comicInfo.author ? [comicInfo.author] : [],
artists: [],
genres: comicInfo.tags || [],
themes: [],
demographics: []
};
return {
id: comi... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildBasicMangaFromComicInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left comicInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right... | private buildBasicMangaFromComicInfo(comicInfo: ComicInfo, isLocal: boolean): Manga {
const metadata: MangaMetadata = {
authors: comicInfo.author ? [comicInfo.author] : [],
artists: [],
genres: comicInfo.tags || [],
themes: [],
demographics: []
};
return {
id: comi... | https://github.com/DaLongZhuaZi/manxia | fd11b431ff56cc6e5ec7f2994944e10405b5bb7f | github |
openharmony/codelabs | Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets | arkts | nextVideo | Next video. | nextVideo() {
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
this.playerModel.playSpeed = PlayConstants.PLAY_SPEED;
let globalVideoList = GlobalContext.getContext().getObject('globalVideoList') as VideoItem... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left nextVideo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AST... | nextVideo() {
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
this.playerModel.playSpeed = PlayConstants.PLAY_SPEED;
let globalVideoList = GlobalContext.getContext().getObject('globalVideoList') as VideoItem... | https://gitee.com/openharmony/codelabs.git | 51e952c82103639701f1e19cd8ee781f27d70b16 | gitee |
PollenWang6/HiXD | entry/src/main/ets/utils/HttpUtil.ets | arkts | restoreDomainsFromClone | 从快照中恢复指定域名的 cookie(不受字符串序列化丢数据影响) | restoreDomainsFromClone(clone: Record<string, Record<string, string>>, domains: string[]): void {
for (let i: number = 0; i < domains.length; i++) {
const domain: string = domains[i];
this.cookieStore[domain] = {};
if (clone[domain]) {
for (const name of Object.keys(clone[domain])) {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left restoreDomainsFromClone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left clone AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Le... | restoreDomainsFromClone(clone: Record<string, Record<string, string>>, domains: string[]): void {
for (let i: number = 0; i < domains.length; i++) {
const domain: string = domains[i];
this.cookieStore[domain] = {};
if (clone[domain]) {
for (const name of Object.keys(clone[domain])) {
... | https://github.com/PollenWang6/HiXD | 0b62b869747e4ee6706cea18cf0412193b63f02d | github |
OMGCA/sakipay | sakipay_hmos/main/src/main/ets/models/EarningsCalculator.ets | arkts | calculateTodayEarnings | @param voluntaryOvertimeTotalSeconds Pre-computed total OT seconds for the current session
(accumulated from prior sessions today + elapsed in current session). When > 0, the
calculator returns VOLUNTARY_OVERTIME with earnings at the normal secondRate.
Pass 0 when no voluntary OT session is active. | public calculateTodayEarnings(date: Date = new Date(),
voluntaryOvertimeTotalSeconds: number = 0): TodayEarnings {
const result = new TodayEarnings()
result.totalWorkSeconds = this.totalWorkSeconds
if (this.isDayOff(date)) {
result.status = WorkStatus.DAY_OFF
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left calculateTodayEarnings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignmen... | public calculateTodayEarnings(date: Date = new Date(),
voluntaryOvertimeTotalSeconds: number = 0): TodayEarnings {
const result = new TodayEarnings()
result.totalWorkSeconds = this.totalWorkSeconds
if (this.isDayOff(date)) {
result.status = WorkStatus.DAY_OFF
... | https://github.com/OMGCA/sakipay | fe50b0241d6b8c1062749f544690c6ec6fd2b3db | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | slice | Creates a slice of current Uint8ClampedArray using range [begin, this.lengthInt].
@param { int } begin - start index to be taken into slice.
@returns { Uint8ClampedArray } - a new Uint8ClampedArray with elements of
current Uint8ClampedArray[begin, this.lengthInt].
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public slice(begin: int): Uint8ClampedArray {
return this.sliceFromTo(begin, this.lengthInt)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id... | public slice(begin: int): Uint8ClampedArray {
return this.sliceFromTo(begin, this.lengthInt)
} | https://gitcode.com/iop123123/arkts-static-skills | 7e71700ac407e5c0721fac58e0b85fac1ce0c315 | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets | arkts | getAuthorizationUrl | 获取授权URL
@return string 授权URL | public getAuthorizationUrl(): string {
const params: string[] = [];
params.push(`client_id=${encodeURIComponent(this.config.clientId)}`);
params.push(`redirect_uri=${encodeURIComponent(this.config.redirectUri)}`);
params.push(`response_type=code`);
if (this.config.scope) {
params.push(`scop... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAuthorizationUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string... | public getAuthorizationUrl(): string {
const params: string[] = [];
params.push(`client_id=${encodeURIComponent(this.config.clientId)}`);
params.push(`redirect_uri=${encodeURIComponent(this.config.redirectUri)}`);
params.push(`response_type=code`);
if (this.config.scope) {
params.push(`scop... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/oauth2/BaseOAuth2Provider.ets#L37-L62 | cc5f677624588b2423a2fface471c98ac56d4a90 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/AutoPageTurnController.ets | arkts | start | 启动自动翻页 | public start(): void {
if (this.config.interval <= 0) {
logger.warn(TAG, '自动翻页间隔为0,无法启动');
return;
}
if (this.state === AutoPageTurnState.RUNNING) {
logger.warn(TAG, '自动翻页已在运行中');
return;
}
this.state = AutoPageTurnState.RUNNING;
logger.info(TAG, `启动自动翻页,间隔=${this.con... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Rig... | public start(): void {
if (this.config.interval <= 0) {
logger.warn(TAG, '自动翻页间隔为0,无法启动');
return;
}
if (this.state === AutoPageTurnState.RUNNING) {
logger.warn(TAG, '自动翻页已在运行中');
return;
}
this.state = AutoPageTurnState.RUNNING;
logger.info(TAG, `启动自动翻页,间隔=${this.con... | https://github.com/DaLongZhuaZi/manxia | b99e48cec7e4505210f0bcfa1cce1e0e94819c97 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/viewmodel/AppViewModel.ets | arkts | updateFilteredApps | 更新过滤后的列表
注意:保持服务端返回的原始顺序,不进行排序 | updateFilteredApps(): void {
// 搜索过滤
if (this.searchKeyword.trim()) {
const keyword = this.searchKeyword.toLowerCase().trim();
this.filteredApps = this.apps.filter(app =>
app.name.toLowerCase().includes(keyword)
);
} else {
// 创建新数组以触发 UI 更新
this.filteredApps = [...t... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateFilteredApps 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#object_pattern#Left AST#{... | updateFilteredApps(): void {
// 搜索过滤
if (this.searchKeyword.trim()) {
const keyword = this.searchKeyword.toLowerCase().trim();
this.filteredApps = this.apps.filter(app =>
app.name.toLowerCase().includes(keyword)
);
} else {
// 创建新数组以触发 UI 更新
this.filteredApps = [...t... | https://github.com/AlkaidLab/moonlight-harmony | 1498a092dfa01e6d6f02e4fbda33551b1fa0eb18 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/FinancialHealth.ets | arkts | calculateSpendingStructureFromBills | 从账单计算消费结构评分
@param bills 账单列表
@param userId 用户ID
@param essentialCategoryIds 必要消费分类ID列表
@param month 指定月份(YYYY-MM格式),为空则使用所有数据 | static calculateSpendingStructureFromBills(
bills: Bill[],
userId: number,
essentialCategoryIds: number[],
month: string = ''
): DimensionScore {
let essentialExpense = 0;
let totalExpense = 0;
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId =... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateSpendingStructureFromBills AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bills AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right... | static calculateSpendingStructureFromBills(
bills: Bill[],
userId: number,
essentialCategoryIds: number[],
month: string = ''
): DimensionScore {
let essentialExpense = 0;
let totalExpense = 0;
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId =... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 05e85c64f2f8260590d26661513b8cf4cf5a4a02 | github |
YDYm233/EasyRandom_HarmonyNextApp | common/VitalUI/src/main/ets/components/ColorPickerComponent/ColorPickerDialog.ets | arkts | build | ─── Build ────────────────────────────────────────────────────── | build() {
Column({ space: 0 }) {
this.TitleBar()
Column({ space: 4 }) {
// 三列布局:2D 色块 | 色相条 | 透明度条
Row({ space: 8 }) {
Column({ space: 4 }) {
Column() {
this.ColorBlock()
}
.layoutWeight(1).width('100%').height('100%')
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c... | build() {
Column({ space: 0 }) {
this.TitleBar()
Column({ space: 4 }) {
// 三列布局:2D 色块 | 色相条 | 透明度条
Row({ space: 8 }) {
Column({ space: 4 }) {
Column() {
this.ColorBlock()
}
.layoutWeight(1).width('100%').height('100%')
... | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 1ee296fca1c8ea5f3787e08cbfd17aab7e09cb4d | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | constructor | Creates an Int8Array with respect to length.
@param { int } length - Number of elements
@throws { RangeError } - If the length is outside the bounds of the buffer, throw an exception
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(length: int) {
this(length.toDouble())
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left length AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier... | public constructor(length: int) {
this(length.toDouble())
} | https://gitcode.com/iop123123/arkts-static-skills | 1f29acf604c9b4ce77d66746278b61cb1bed8a24 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Float.ets | arkts | isInteger | Checks if the underlying float is similar to an integer value
@returns true if the underlying float is similar to an integer value | public isInteger(): boolean {
return Float.isInteger(this.value);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isInteger 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 isInteger(): boolean {
return Float.isInteger(this.value);
} | https://gitcode.com/iop123123/arkts-static-skills | 9a937b4993c8acdf4b28544d1a01943c2e2c128e | gitcode |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/calculator/SimpleSunshineCalculator.ets | arkts | calculateHouseSunshine | 计算房屋日照模型 - 模仿C#实现
@param houseInput 房屋输入参数
@param minutesStep 计算步长(分钟),默认1分钟
@returns 房屋日照结果 | calculateHouseSunshine(houseInput: HouseInputModel, minutesStep: number = 1): HouseSunshineModel {
// 确保步长不小于最小值
if (minutesStep < this.MIN_MINUTES_STEP) {
minutesStep = this.MIN_MINUTES_STEP;
}
// 计算遮挡角度 (转换为度,因为sunPosition.altitude返回的是度)
const tan = (houseInput.blockLevel * houseInput.blo... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateHouseSunshine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left houseInput AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left HouseInputModel AST#identif... | calculateHouseSunshine(houseInput: HouseInputModel, minutesStep: number = 1): HouseSunshineModel {
// 确保步长不小于最小值
if (minutesStep < this.MIN_MINUTES_STEP) {
minutesStep = this.MIN_MINUTES_STEP;
}
// 计算遮挡角度 (转换为度,因为sunPosition.altitude返回的是度)
const tan = (houseInput.blockLevel * houseInput.blo... | https://github.com/qiuhaotc/Sunshine_HarmonyOS | 9468b73787d1abd66941930ab96cacace9983bc7 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Parsers/EBookParser.ets | arkts | getFileNameFromPath | 从文件路径获取文件名 | protected getFileNameFromPath(filePath: string): string {
const parts = filePath.split('/');
const encodedFileName = parts[parts.length - 1] || 'unknown_file';
// 解码URL编码的文件名(如 %E7%AC%AC -> 第)
try {
return decodeURIComponent(encodedFileName);
} catch (error) {
logger.warn(TAG, `UR... | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left getFileNameFromPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left str... | protected getFileNameFromPath(filePath: string): string {
const parts = filePath.split('/');
const encodedFileName = parts[parts.length - 1] || 'unknown_file';
// 解码URL编码的文件名(如 %E7%AC%AC -> 第)
try {
return decodeURIComponent(encodedFileName);
} catch (error) {
logger.warn(TAG, `UR... | https://github.com/DaLongZhuaZi/manxia | 50967bc2142941381e99563cd8068659dd39fb21 | github |
harmonyos/codelabs | ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | getSwiperImages | Get swiper image data.
@return {Array<Resource>} swiperImages. | getSwiperImages(): Array<Resource> {
let swiperImages: Resource[] = [
$r('app.media.fig1'),
$r('app.media.fig2'),
$r('app.media.fig3'),
$r('app.media.fig4')
];
return swiperImages;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getSwiperImages 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#:#L... | getSwiperImages(): Array<Resource> {
let swiperImages: Resource[] = [
$r('app.media.fig1'),
$r('app.media.fig2'),
$r('app.media.fig3'),
$r('app.media.fig4')
];
return swiperImages;
} | https://gitee.com/harmonyos/codelabs.git | 245d43fa37e51b72fdc8b184d8b371f5c0f4d54a | gitee |
openharmony-sig/applications_clock | common/src/main/ets/utils/CommonUtil.ets | arkts | isDevicePhone | Check whether the current device is a mobile phone.
@return Whether the current device is a mobile phone. | static isDevicePhone(): boolean {
return deviceInfo.deviceType === DEVICE_TYPE_PHONE;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isDevicePhone 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... | static isDevicePhone(): boolean {
return deviceInfo.deviceType === DEVICE_TYPE_PHONE;
} | https://gitee.com/openharmony-sig/applications_clock.git | bfdeaac72aaab04b9bd64a0c992614bf5a711e13 | gitee |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/commons/utils/src/main/ets/utils/CommonUtil.ets | arkts | transNumberOverOneThousand | Replace count with plus sign when the count number over one thousand
@param count | public static transNumberOverOneThousand(count: number): string {
return CommonUtil.formatNumToMaxText(count, 999, '+');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left transNumberOverOneThousand AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left count AST#identifier#Right A... | public static transNumberOverOneThousand(count: number): string {
return CommonUtil.formatNumToMaxText(count, 999, '+');
} | https://gitcode.com/HarmonyOS_Samples/hmosworld | bf2cfcdb4789720c082ea91a952ac59db2ce090c | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getPendingCommands | 获取待处理命令 | static async getPendingCommands(limit: number = 100): Promise<Command[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(Command.tableName);
predicates.in('status', [COMMAND_STAT... | 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 getPendingCommands AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left limit AST#identifier#Right AST#:#Left... | static async getPendingCommands(limit: number = 100): Promise<Command[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(Command.tableName);
predicates.in('status', [COMMAND_STAT... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 6894fcc2ece803c07fac555b4717ce624bd4abc9 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/AudioFocusManager.ets | arkts | isHoldingFocus | Check if audio focus is held | static isHoldingFocus(): boolean {
return isAudioFocusHeld;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isHoldingFocus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AS... | static isHoldingFocus(): boolean {
return isAudioFocusHeld;
} | https://github.com/tangwengang-del/freerdp-harmonyos | b06318e27d606fc5b5c70ff30d8762daced888c0 | github |
HarmonyOS_Samples/MusicHome | common/musicbasic/src/main/ets/util/MusicDbApi.ets | arkts | rowToHeroCardApiDto | Maps a hero {@link RecommendFeedRow} to {@link HeroCardApiDto}. | private rowToHeroCardApiDto(feedRow: RecommendFeedRow): HeroCardApiDto {
const dto = new HeroCardApiDto();
if (feedRow.heroBadge !== undefined) {
dto.badge = feedRow.heroBadge;
}
if (feedRow.heroTitle !== undefined) {
dto.title = feedRow.heroTitle;
}
if (feedRow.heroSubLine !== und... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left rowToHeroCardApiDto AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left feedRow AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | private rowToHeroCardApiDto(feedRow: RecommendFeedRow): HeroCardApiDto {
const dto = new HeroCardApiDto();
if (feedRow.heroBadge !== undefined) {
dto.badge = feedRow.heroBadge;
}
if (feedRow.heroTitle !== undefined) {
dto.title = feedRow.heroTitle;
}
if (feedRow.heroSubLine !== und... | https://gitcode.com/HarmonyOS_Samples/MusicHome | f782e8bd0a37a320f31cb45d9a0636f1340b5ea3 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Task/BackgroundTaskHelper.ets | arkts | isRunning | 当前是否存在后台长时任务在运行 | static isRunning(): boolean {
return BackgroundTaskHelper.taskRunning;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#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... | static isRunning(): boolean {
return BackgroundTaskHelper.taskRunning;
} | https://github.com/DaLongZhuaZi/manxia | c5ef918c1f696d4669dd324198feb4700e1604ce | github |
RedRackham-R/WanAndroidHarmoney | entry/src/main/ets/net/wanAPI/WanHttpClient.ets | arkts | deleteSharedArticle | 删除自己分享的文章
https://wanandroid.com/lg/user_article/delete/{id}/json
请求:POST
参数:文章id,拼接在链接上
@returns | public deleteSharedArticle(id: number): Promise<AxiosResponse<IWanCommonResponse<any>>> {
return this.postRequest(
"/lg/user_article/delete/" + id + "/json"
)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left deleteSharedArticle 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#Lef... | public deleteSharedArticle(id: number): Promise<AxiosResponse<IWanCommonResponse<any>>> {
return this.postRequest(
"/lg/user_article/delete/" + id + "/json"
)
} | https://github.com/RedRackham-R/WanAndroidHarmoney | 88d65c4a088f37b6f396b6bb605a60913c884ed7 | github |
HarmonyOS_Samples/BestPracticeSnippets | ComponentReuse/entry/src/main/ets/view/LessEmbeddedComponent.ets | arkts | build | There is no need to assign aboutToReuse values to variables modified with @ Prop, as these variables are passed from the parent component to the child component. If these variables are reassigned in sub components, it will cause the content of the reused component to trigger a state refresh, thereby reducing the reuse ... | build() {
// Nesting custom components within reusable components
Row() {
}
} | 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#object#Left AST#{#Left { AST#{#Right AST#comment#Le... | build() {
// Nesting custom components within reusable components
Row() {
}
} | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 28e9546cf4e478adcc0bbeb61075ddb7b3e72a14 | gitcode |
cheinlu/HarmonyOS-groundhog-charging-system | TbsChargeHarmonyOs/common/src/main/ets/utils/WindowModel.ets | arkts | setMainWindowImmersive | 当前主窗口是否开启沉浸模式
@param enable 是否开启
@returns {void} | setMainWindowImmersive(enable: boolean, properties?: window.SystemBarProperties): void {
if (this.windowStage === undefined) {
console.error('windowStage is undefined.');
return;
}
// 1.获取应用主窗口。
let windowClass: window.Window | null = null;
this.windowStage.getMainWindow((err: Business... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setMainWindowImmersive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AS... | setMainWindowImmersive(enable: boolean, properties?: window.SystemBarProperties): void {
if (this.windowStage === undefined) {
console.error('windowStage is undefined.');
return;
}
// 1.获取应用主窗口。
let windowClass: window.Window | null = null;
this.windowStage.getMainWindow((err: Business... | https://github.com/cheinlu/HarmonyOS-groundhog-charging-system | 4585e74acae6f1214f217bc52ee86277f478fe25 | github |
webabcd/HarmonyDemo | entry/src/main/ets/pages/ui/StyleDemo.ets | arkts | myExtend1 | @Extend 用于定义通用属性和通用事件,以及指定组件的私有属性和私有事件(仅支持在全局定义)
@Extend(Text) 的意思就是可以定义 Text 的私有属性和私有事件 | @Extend(Text) function myExtend1() {
.width("100%")
.height(50)
.fontSize(24)
.fontColor(Color.White)
.backgroundColor(Color.Orange)
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R... | @Extend(Text) function myExtend1() {
.width("100%")
.height(50)
.fontSize(24)
.fontColor(Color.White)
.backgroundColor(Color.Orange)
} | https://github.com/webabcd/HarmonyDemo | 1ddcab72a5e783155cbcf6c0a348f9152de2f159 | github |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Writer.ets | arkts | fixed64 | Write fixed64 little-endian | fixed64(v: bigint): Writer { const ab = new ArrayBuffer(8); const dv = new DataView(ab); const lo = Number(v & 0xFFFFFFFFn); const hi = Number((v >> 32n) & 0xFFFFFFFFn); dv.setUint32(0, lo >>> 0, true); dv.setUint32(4, hi >>> 0, true); const u = new Uint8Array(ab); for (let i = 0; i < 8; i++) this.push(u[i]); return ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left fixed64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left bigint AST#identifier#Right AST#)#Left ) AST#)#Righ... | fixed64(v: bigint): Writer { const ab = new ArrayBuffer(8); const dv = new DataView(ab); const lo = Number(v & 0xFFFFFFFFn); const hi = Number((v >> 32n) & 0xFFFFFFFFn); dv.setUint32(0, lo >>> 0, true); dv.setUint32(4, hi >>> 0, true); const u = new Uint8Array(ab); for (let i = 0; i < 8; i++) this.push(u[i]); return ... | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | 43a76e0b1952d29252e7dc4e2eed5f6a8ef82c70 | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/formatter/DefaultValueFormatter.ets | arkts | setup | Sets up the formatter with a given number of decimal digits.
@param digits | public setup(digits: number): void {
this.mDecimalDigits = digits;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left setup AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left digits AST#identifier#Right AST#:#Left : AST#:#Right AST#E... | public setup(digits: number): void {
this.mDecimalDigits = digits;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | cd873b98a6d288ba611694ecb63e4bfd03b5f6f3 | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.buffer.ets | arkts | readUInt32BE | Reads an unsigned 32-bit integer from the buffer at the specified offset using big-endian format
@param {int} [offset=0] - Number of bytes to skip before reading
@returns {long} The read value | public readUInt32BE(offset: int = 0): long {
let lengthOffset: int = this.length - 4;
if (offset < 0 || offset > lengthOffset) {
throw createBusinessError(OutOfBoundsErrorCodeId, `The value of "offset" is out of range. ` +
`It must be >= 0 and <= ${len... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left readUInt32BE AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left offset AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expres... | public readUInt32BE(offset: int = 0): long {
let lengthOffset: int = this.length - 4;
if (offset < 0 || offset > lengthOffset) {
throw createBusinessError(OutOfBoundsErrorCodeId, `The value of "offset" is out of range. ` +
`It must be >= 0 and <= ${len... | https://gitcode.com/iop123123/arkts-static-skills | e7a34876e2b885bcfaa81883b20faa22da5dea76 | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPPerformanceManager.ets | arkts | startPerformanceMonitoring | 开始性能监控 | private startPerformanceMonitoring(): void {
this.performanceMonitorInterval = setInterval(() => {
this.updatePerformanceStats()
}, 1000) as unknown as number // 每秒更新一次
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left startPerformanceMonitoring 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#Ri... | private startPerformanceMonitoring(): void {
this.performanceMonitorInterval = setInterval(() => {
this.updatePerformanceStats()
}, 1000) as unknown as number // 每秒更新一次
} | https://github.com/AetheriumSimulator/qemu-hmos | 4669e2f571a0a186b16248cdb2d8bd54ed13006b | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/CrashLogService.ets | arkts | readCrashLog | 读取崩溃日志内容 | public async readCrashLog(filePath: string): Promise<string> {
try {
const file = fileIo.openSync(filePath, fileIo.OpenMode.READ_ONLY);
const stat = fileIo.statSync(filePath);
const bufferSize = stat.size;
const buffer = new ArrayBuffer(bufferSize);
fileIo.readSync(file.fd, buffer);
... | 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 readCrashLog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : ... | public async readCrashLog(filePath: string): Promise<string> {
try {
const file = fileIo.openSync(filePath, fileIo.OpenMode.READ_ONLY);
const stat = fileIo.statSync(filePath);
const bufferSize = stat.size;
const buffer = new ArrayBuffer(bufferSize);
fileIo.readSync(file.fd, buffer);
... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/CrashLogService.ets#L468-L484 | 8e6e73fa13b06bf0077c9d9d6b68d5b492ccb23b | github |
openharmony/applications_call | entry/src/main/ets/common/utils/Clone.ets | arkts | cloneSymbo | clone symbol
@param { any } target | private cloneSymbo(target) {
return Object(Symbol.prototype.valueOf.call(target));
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cloneSymbo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#E... | private cloneSymbo(target) {
return Object(Symbol.prototype.valueOf.call(target));
} | https://gitee.com/openharmony/applications_call.git | e10b19cd9fb34deec757927de014db718fe6e596 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/xiaoyi/XiaoyiSkillManager.ets | arkts | declareMCPCapabilities | 声明MCP能力(向小艺平台注册所有可用工具) | async declareMCPCapabilities(): Promise<void> {
const capabilities = this.getMCPCapabilities();
console.info(`[Xiaoyi-MCP] 声明能力:`);
console.info(` - 工具数量: ${capabilities.tools.length}`);
console.info(` - 资源数量: ${capabilities.resources.length}`);
console.info(` - 提示词数量: ${capabilities.prompts.l... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left declareMCPCapabilities 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 A... | async declareMCPCapabilities(): Promise<void> {
const capabilities = this.getMCPCapabilities();
console.info(`[Xiaoyi-MCP] 声明能力:`);
console.info(` - 工具数量: ${capabilities.tools.length}`);
console.info(` - 资源数量: ${capabilities.resources.length}`);
console.info(` - 提示词数量: ${capabilities.prompts.l... | https://github.com/LJ666-ui/harmony-health-care | 443a6dd7d876f99e54989dede056a24d42dd7472 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Boolean.ets | arkts | toString | Converts this object to a string
@returns { String } The string representation of this Boolean object
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override toString(): String {
if (this.value) {
return 'true';
}
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 toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le... | public override toString(): String {
if (this.value) {
return 'true';
}
return 'false';
} | https://gitcode.com/iop123123/arkts-static-skills | f7ef7c757e6ae7ffcbba4e7aaf11d5aec874b194 | gitcode |
richshaw2015/nds | ohos/entry/src/main/ets/utils/PersistedUriManager.ets | arkts | savePersistedUris | 保存 URI 到存储 | private async savePersistedUris(): Promise<void> {
if (!this.dataPreferences) return;
try {
await this.dataPreferences.put(KEY_FILE_URIS, JSON.stringify(this.fileUris));
await this.dataPreferences.flush();
console.info(`${TAG} Saved ${this.fileUris.length} files`);
} catch (err) {
... | 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 savePersistedUris AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | private async savePersistedUris(): Promise<void> {
if (!this.dataPreferences) return;
try {
await this.dataPreferences.put(KEY_FILE_URIS, JSON.stringify(this.fileUris));
await this.dataPreferences.flush();
console.info(`${TAG} Saved ${this.fileUris.length} files`);
} catch (err) {
... | https://github.com/richshaw2015/nds | cffef8deb2e1212f412931ae63478cd79b3bf202 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | delete | 删除读模型 | static async delete(modelType: string, userId: number): Promise<boolean> {
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ReadModel.tableName);
predicates.equalTo('model_type', modelType);
predicates.equalTo('user_id', userId);
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#delete#Left delete AST#delete#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left modelType AST#identifier#Right AST#type_annotation#Left AST#:... | static async delete(modelType: string, userId: number): Promise<boolean> {
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ReadModel.tableName);
predicates.equalTo('model_type', modelType);
predicates.equalTo('user_id', userId);
... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 099bfb0c57040b4ac975f856dfa6cdf53a6198e2 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectStaticField.ets | arkts | setValue | Writes value into a static field.
@param { Any } value value to write.
@throws { TypeError } if there is an incompatible value.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public setValue(value: Any): void {
if (this.isReadonly()) {
throw new TypeError("setValue to a readonly field")
}
super.setValue(undefined, value)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Any AST#identifier#Rig... | public setValue(value: Any): void {
if (this.isReadonly()) {
throw new TypeError("setValue to a readonly field")
}
super.setValue(undefined, value)
} | https://gitcode.com/iop123123/arkts-static-skills | 02d6b3776e4266a941b46154fc1f7da67ca429a0 | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/CryptoUtil.ets | arkts | generateRandomBytes | 生成随机字节数组(使用加密安全的随机数) | static generateRandomBytes(length: number): Uint8Array {
const random = cryptoFramework.createRandom();
const dataBlob = random.generateRandomSync(length);
return new Uint8Array(dataBlob.data);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateRandomBytes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left length AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | static generateRandomBytes(length: number): Uint8Array {
const random = cryptoFramework.createRandom();
const dataBlob = random.generateRandomSync(length);
return new Uint8Array(dataBlob.data);
} | https://github.com/AlkaidLab/moonlight-harmony | 47cf63dbb4c3c0f6eb35c47628b726f4e67f95dc | github |
openharmony/applications_app_samples | code/BasicFeature/Ability/AbilityRuntime/entry/src/main/ets/abilitylifecyclecallback/AbilityLifecycleCallback.ets | arkts | onAbilityWillCreate | 注册监听应用上下文的生命周期后,在UIAbility的[onCreate]触发前回调。 | onAbilityWillCreate(ability) {
hilog.info(DOMAIN, TAG, 'AbilityLifecycleCallback onAbilityWillCreate');
}, | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onAbilityWillCreate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ability AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right ... | onAbilityWillCreate(ability) {
hilog.info(DOMAIN, TAG, 'AbilityLifecycleCallback onAbilityWillCreate');
}, | https://github.com/openharmony/applications_app_samples | 857a98af2422161560579fd282861290760b5616 | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/CategoryManager.ets | arkts | buildDefaultCategories | 构建默认分类列表,用于新用户首次建库时写入初始化数据。 | private static buildDefaultCategories(): CategoryBean[] {
const expenseDefaults: CategorySeed[] = [
new CategorySeed('餐饮', 'fork_knife'),
new CategorySeed('交通', 'car'),
new CategorySeed('购物', 'cart'),
new CategorySeed('娱乐', 'gamecontroller'),
new CategorySeed('住房', 'house'),
ne... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left buildDefaultCategories AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | private static buildDefaultCategories(): CategoryBean[] {
const expenseDefaults: CategorySeed[] = [
new CategorySeed('餐饮', 'fork_knife'),
new CategorySeed('交通', 'car'),
new CategorySeed('购物', 'cart'),
new CategorySeed('娱乐', 'gamecontroller'),
new CategorySeed('住房', 'house'),
ne... | https://github.com/ZestBox-18/kitebook-frontend | 07d6d2d063b207acbc6d0ceb361e555cb5f72892 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/userdata/keyshortcuts/classes/meowKeyBind.ets | arkts | toString | To string for pure demonstration.
@returns A string representing the keybind. | toString() {
if (this.keys.length > 0) {
return `${modifiersToStrings(this.keys).join(' + ')} [${keyDisplay(valueToString(this.value))}]`;
}
return `[${keyDisplay(valueToString(this.value))}]`;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toString 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#if_statement#Left AST#if#Lef... | toString() {
if (this.keys.length > 0) {
return `${modifiersToStrings(this.keys).join(' + ')} [${keyDisplay(valueToString(this.value))}]`;
}
return `[${keyDisplay(valueToString(this.value))}]`;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 551f85b289a7d6e2f0412de94b2fc818c9233c99 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | subarray | Creates a Uint16Array with the same ArrayBuffer
@param begin start index, inclusive
@returns new Uint16Array with the same ArrayBuffer | public subarray(begin: number): Uint16Array {
return this.subarray(begin as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left subarray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left begin AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number... | public subarray(begin: number): Uint16Array {
return this.subarray(begin as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | b07efeb2f60f3ab2215c13dcf2741e30eecedd83 | gitee |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/utils/lunar.ets | arkts | getDay | 获取农历日期数字
@returns 农历日期(1-30) | getDay(): number {
return this.lunarDay;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_block... | getDay(): number {
return this.lunarDay;
} | https://github.com/codelably/tuniao-ui | 1a1d2c87a2cf88de9dbf87d694e035685ba9baf8 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets | arkts | make | Make an instance of LambdaType
@returns {Object} LambdaType instance
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public make(): Object {
return TypeAPI.getDeclaringClassImpl(this)!.createInstance()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left make AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ... | public make(): Object {
return TypeAPI.getDeclaringClassImpl(this)!.createInstance()
} | https://gitcode.com/iop123123/arkts-static-skills | 209922718af58bb3f66d1be7b334676a066c8213 | gitcode |
ZestBox-18/kitebook-frontend | commons/base/src/main/ets/utils/DebounceManager.ets | arkts | cancel | 取消指定方法的防抖定时器
@param methodName 方法名称 | public cancel(methodName: string): void {
const existingTimer = DebounceManager.debounceTimers.get(methodName);
if (existingTimer) {
clearTimeout(existingTimer.timerId);
DebounceManager.debounceTimers.delete(methodName);
console.info(`[DebounceManager] ${methodName}方法的防抖定时器已被取消`);
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left cancel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left methodName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right... | public cancel(methodName: string): void {
const existingTimer = DebounceManager.debounceTimers.get(methodName);
if (existingTimer) {
clearTimeout(existingTimer.timerId);
DebounceManager.debounceTimers.delete(methodName);
console.info(`[DebounceManager] ${methodName}方法的防抖定时器已被取消`);
}
} | https://github.com/ZestBox-18/kitebook-frontend | c47de52edd965282620a48124a174872968c4684 | github |
openharmony-sig/flutter_packages | packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/HttpAuthHandlerFlutterApiImpl.ets | arkts | constructor | Constructs a {@link HttpAuthHandlerFlutterApiImpl}.
@param binaryMessenger used to communicate with Dart over asynchronous messages
@param instanceManager maintains instances stored to communicate with attached Dart objects | constructor(binaryMessenger: BinaryMessenger, instanceManager: InstanceManager) {
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
this.api = new HttpAuthHandlerFlutterApi(binaryMessenger);
} | 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 binaryMessenger AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BinaryMessenger AS... | constructor(binaryMessenger: BinaryMessenger, instanceManager: InstanceManager) {
this.binaryMessenger = binaryMessenger;
this.instanceManager = instanceManager;
this.api = new HttpAuthHandlerFlutterApi(binaryMessenger);
} | https://gitee.com/openharmony-sig/flutter_packages.git | 7aa0872d5850dcf14ef0063f0637ceba9329b7fb | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/ThemeAware.ets | arkts | getShadowColor | 快捷方法:获取阴影颜色
@param elevation 阴影高度 (0-24) | public static getShadowColor(elevation: number = 4): string {
return AppColors.getShadowColor(elevation);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getShadowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left elevation AST#identifier#Right AST#:#Lef... | public static getShadowColor(elevation: number = 4): string {
return AppColors.getShadowColor(elevation);
} | https://github.com/DaLongZhuaZi/manxia | 9f2d9a77e1bf483eee1cb34755ca4723114bc9f5 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieChartModel.ets | arkts | getXAxis | This will throw an exception, PieChart has no XAxis object.
@return
@Deprecated
@Override | public getXAxis(): XAxis {
throw new Error("PieChart has no XAxis");
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getXAxis 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 XAxis AST#ide... | public getXAxis(): XAxis {
throw new Error("PieChart has no XAxis");
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 23ef21f65e0bcd894528d8f1f4da5630438fcc57 | gitee |
Cool_foolisher1/ArkTSRepository | ArkTSDemo/products/entry/src/main/ets/MyDemoOld/manager/WindowManager.ets | arkts | enableFullScreen | 开启沉浸式显示模式 | static async enableFullScreen(): Promise<void> {
// 获取应用上下文
const uiContext = new UIContext()
const context = uiContext.getHostContext() as Context
let win: window.Window | undefined = undefined
try {
win = await window.getLastWindow(context)
} catch (error) {
}
win?.setWindowLay... | 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 enableFullScreen AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | static async enableFullScreen(): Promise<void> {
// 获取应用上下文
const uiContext = new UIContext()
const context = uiContext.getHostContext() as Context
let win: window.Window | undefined = undefined
try {
win = await window.getLastWindow(context)
} catch (error) {
}
win?.setWindowLay... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 34709466dad0e24f2f329811aaa4242d22e22c13 | gitcode |
openharmony-sig/ohos_easyui | entry/src/main/ets/pages/TestNavBar.ets | arkts | rightClickEvent | 右边文本按钮点击事件 | rightClickEvent(){
console.log("rightClickEvent")
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left rightClickEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le... | rightClickEvent(){
console.log("rightClickEvent")
} | https://gitee.com/openharmony-sig/ohos_easyui.git | 5eb22140feb27310a7890130ce2b22972d16b0c2 | gitee |
harmonyos/codelabs | AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets | arkts | set | Set data in PreferencesHandler.
@param key string
@param value any | public async set(key: string, value: string) {
if (this.preferences != null) {
await this.preferences.put(key, value);
await this.preferences.flush();
}
} | 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 set AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AS... | public async set(key: string, value: string) {
if (this.preferences != null) {
await this.preferences.put(key, value);
await this.preferences.flush();
}
} | https://gitee.com/harmonyos/codelabs.git | 59d79bb1aefd926423ee268978ed8b5961946d80 | gitee |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeView.ets | arkts | getNewNodeParam | get node param by node id
@param nodeId node id
@returns node param | public getNewNodeParam(nodeId: number): NodeParam {
let parent: NodeItem = new NodeItem(emptyNodeInfo);
if (this.nodeIdNodeItemMap.has(nodeId)) {
parent = this.nodeIdNodeItemMap.get(nodeId) as NodeItem;
}
let newNodeParam: NodeParam = emptyNodeInfo;
if (parent) {
let nodeInfo: NodeInfo... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNewNodeParam AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left nodeId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public getNewNodeParam(nodeId: number): NodeParam {
let parent: NodeItem = new NodeItem(emptyNodeInfo);
if (this.nodeIdNodeItemMap.has(nodeId)) {
parent = this.nodeIdNodeItemMap.get(nodeId) as NodeItem;
}
let newNodeParam: NodeParam = emptyNodeInfo;
if (parent) {
let nodeInfo: NodeInfo... | https://gitcode.com/openharmony/arkui_ace_engine | 39b97196bcb95834d0105ffd64ff445eaaec4574 | gitcode |
1055235342/Wpixelgram-for-HarmonyOS | entry/src/main/ets/common/service/TdlibService.ets | arkts | cancelDownloadFile | 暂停/取消正在下载的文件(退出视频时调用)
@param fileId 要暂停的文件ID | public cancelDownloadFile(fileId: number): void {
const request: CancelDownloadFileRequest = {
'@type': 'cancelDownloadFile',
file_id: fileId,
only_if_pending: false
};
this.sendRequest(request);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left cancelDownloadFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left fileId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | public cancelDownloadFile(fileId: number): void {
const request: CancelDownloadFileRequest = {
'@type': 'cancelDownloadFile',
file_id: fileId,
only_if_pending: false
};
this.sendRequest(request);
} | https://github.com/1055235342/Wpixelgram-for-HarmonyOS | 85863ea6fff27bc671e4cb3c9c4787dcfbdb622b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Plugin/HSPPluginManager.ets | arkts | compareVersions | 比较版本号 | private compareVersions(version1: string, version2: string): number {
const v1Parts = version1.split('.').map(Number);
const v2Parts = version2.split('.').map(Number);
const maxLength = Math.max(v1Parts.length, v2Parts.length);
for (let i = 0; i < maxLength; i++) {
const v1Part = v1Par... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left compareVersions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left version1 AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | private compareVersions(version1: string, version2: string): number {
const v1Parts = version1.split('.').map(Number);
const v2Parts = version2.split('.').map(Number);
const maxLength = Math.max(v1Parts.length, v2Parts.length);
for (let i = 0; i < maxLength; i++) {
const v1Part = v1Par... | https://github.com/DaLongZhuaZi/manxia | e8a835d979a9d42ef0499b554fcf7fea06603b19 | github |
751496032/ZRouter | RouterApi/src/main/ets/model/NavDestBuilder.ets | arkts | listenPopResultOnRootView | 如果在Navigation根视图中push需要监听返回数据,则需要设置listenPopResultOnRootView为true
如果开启了,需要与popToRootWithResult()方法搭配使用
@returns | public listenPopResultOnRootView(): NavDestBuilder<T> {
this.optionsImpl.listenPopResultOnRootView = true;
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left listenPopResultOnRootView 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 ... | public listenPopResultOnRootView(): NavDestBuilder<T> {
this.optionsImpl.listenPopResultOnRootView = true;
return this;
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/model/NavDestBuilder.ets#L135-L138 | ae1f4d5f97786a810f19bd4478c143a72fbd3d94 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | abs | Return a new Decimal whose value is the absolute value of `n`.
@param { Value } n {double | string | Decimal}
@returns { Decimal } the Decimal type | static abs(n: Value): Decimal {
return new Decimal(n).abs();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left abs AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Ri... | static abs(n: Value): Decimal {
return new Decimal(n).abs();
} | https://gitcode.com/iop123123/arkts-static-skills | 471cc41f0d2bf1be8e4082128176ef7dd0a3b4ad | gitcode |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/model/CityModel.ets | arkts | dmsToDecimal | 将度分秒格式转换为十进制
@param dms 度分秒字符串,格式如 "116°24'48.18"" 或 "116-24-48.18"
@returns 十进制度数 | static dmsToDecimal(dms: string): number {
// 支持多种分隔符:° ' " 或 - 或空格
const parts = dms.replace(/[°'"]/g, '-').split('-').map(p => p.trim()).filter(p => p);
if (parts.length < 1) {
return 0;
}
const degrees = parseFloat(parts[0]) || 0;
const minutes = parts.length > 1 ? parseFloat(pa... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left dmsToDecimal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dms AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | static dmsToDecimal(dms: string): number {
// 支持多种分隔符:° ' " 或 - 或空格
const parts = dms.replace(/[°'"]/g, '-').split('-').map(p => p.trim()).filter(p => p);
if (parts.length < 1) {
return 0;
}
const degrees = parseFloat(parts[0]) || 0;
const minutes = parts.length > 1 ? parseFloat(pa... | https://github.com/qiuhaotc/Sunshine_HarmonyOS | 7d11a1157b6ab67995d2dfde1be4328a9db77746 | github |
terryma2024/happyword | harmonyos/entry/src/ohosTest/ets/test/ParentAdminFlow.ui.test.ets | arkts | exitParentAdminPage | Inverse of navigateToParentAdminPage: ParentAdminBack → ConfigPage →
pressBack → HomePage. ConfigPage's outer Scroll is reset to the top
on some devices, but may keep the parent-admin row's scroll position
on others. Accept either the top title or the admin row as the
ConfigPage-ready signal, and also accept a direct H... | async function exitParentAdminPage(driver: Driver): Promise<void> {
try {
// The page may have been scrolled down to expose publishCard during
// the test body. Scroll back up so the back button at the top is
// visible to the matcher.
await scrollParentAdminToTop(driver);
await clickByIdShared(dr... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left exitParentAdminPage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left driver AST#identifier#Right A... | async function exitParentAdminPage(driver: Driver): Promise<void> {
try {
// The page may have been scrolled down to expose publishCard during
// the test body. Scroll back up so the back button at the top is
// visible to the matcher.
await scrollParentAdminToTop(driver);
await clickByIdShared(dr... | https://github.com/terryma2024/happyword | b33c79adb74cce4e9294d71845a6352b4094be1b | github |
XHXYT/Pixark | entry/src/main/ets/common/utils/HoldingHandleUtil.ets | arkts | stop | 停止握持检测 | stop(): void {
if (!this.isCapabilityAvailable) {
return;
}
try {
if (canIUse("SystemCapability.MultimodalAwareness.Motion")) {
motion.off('holdingHandChanged');
hilog.info(0x4514, TAG, `握持检测已停止`);
}
} catch (error) {
hilog.error(0x4514, TAG, `关闭握持事件失败: ${JSON.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stop AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left AS... | stop(): void {
if (!this.isCapabilityAvailable) {
return;
}
try {
if (canIUse("SystemCapability.MultimodalAwareness.Motion")) {
motion.off('holdingHandChanged');
hilog.info(0x4514, TAG, `握持检测已停止`);
}
} catch (error) {
hilog.error(0x4514, TAG, `关闭握持事件失败: ${JSON.... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/HoldingHandleUtil.ets#L59-L75 | 492412a12f6fac380cee5ed5921bd138d9a5ec95 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/AppColors.ets | arkts | outline | ==================== 边框和分割线 ==================== | static get outline(): string { return getColorForCurrentTheme(ColorRole.OUTLINE); } | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left outline AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : A... | static get outline(): string { return getColorForCurrentTheme(ColorRole.OUTLINE); } | https://github.com/DaLongZhuaZi/manxia | ed72b2ae84ec97ecf06cb2702ac56f6c85e762c6 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarChartModel.ets | arkts | setHighlightFullBarEnabled | Set this to true to make the highlight operation full-bar oriented, false to make it highlight single values (relevant
only for stacked). If enabled, highlighting operations will highlight the whole bar, even if only a single stack entry
was tapped.
Default: false
@param enabled | public setHighlightFullBarEnabled(enabled: boolean): void {
this.mHighlightFullBarEnabled = enabled;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setHighlightFullBarEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id... | public setHighlightFullBarEnabled(enabled: boolean): void {
this.mHighlightFullBarEnabled = enabled;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 7999f622d459aa9f08ef1ce60fce627d3858aa75 | gitee |
CLMC2025/Vignette | entry/src/main/ets/algorithm/Algorithm.ets | arkts | getLastReviewTime | Get last review timestamp | private getLastReviewTime(word: WordItem): number {
const count = word.history.getReviewCount();
if (count > 0) {
return word.history.items[count - 1].timestamp;
}
return 0;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getLastReviewTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left word AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private getLastReviewTime(word: WordItem): number {
const count = word.history.getReviewCount();
if (count > 0) {
return word.history.items[count - 1].timestamp;
}
return 0;
} | https://github.com/CLMC2025/Vignette | 8a2baeaf3435364604dbc925855004208c53d872 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/PageLifecycleManager.ets | arkts | removeEventListener | 移除事件监听器
@param target 目标对象
@param event 事件名称
@param handler 处理函数 | removeEventListener(target: ESObject, event: string, handler: Function): void {
const index = this.listeners.findIndex(
l => l.target === target && l.event === event && l.handler === handler
);
if (index !== -1) {
const listener = this.listeners[index];
if (listener.target && typeof... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeEventListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left target AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ESObject AST#identifier#Right AST#... | removeEventListener(target: ESObject, event: string, handler: Function): void {
const index = this.listeners.findIndex(
l => l.target === target && l.event === event && l.handler === handler
);
if (index !== -1) {
const listener = this.listeners[index];
if (listener.target && typeof... | https://github.com/DaLongZhuaZi/manxia | 599b879ccf633c68a690e58ca8e15d3d896d1bec | github |
HarmonyOS_Samples/paymentkit-samplecode-uxcodeproject-arkts | entry/src/main/ets/ui/CashierComponent.ets | arkts | select | Central: Select payment event | select(PaymentType: PaymentType) {
this.selectedPaymentType = PaymentType;
this.selectedPayTypeSerialNo = PaymentType.payTypeSerialNo || '';
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left select AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left PaymentType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PaymentType AST#identifier#... | select(PaymentType: PaymentType) {
this.selectedPaymentType = PaymentType;
this.selectedPayTypeSerialNo = PaymentType.payTypeSerialNo || '';
} | https://gitcode.com/HarmonyOS_Samples/paymentkit-samplecode-uxcodeproject-arkts | a3a9bdf1f1dc4ca3b327f7486e816e786a6b99c2 | gitcode |
XJTUWYD/ArkDiff | entry/src/main/ets/services/BinaryFileHandler.ets | arkts | isBinaryByContent | 通过内容启发式判断是否为二进制
委托给 FilterRuleEngine(避免循环引用,内联实现) | static isBinaryByContent(content: string): boolean {
const sample = content.substring(0, Math.min(8000, content.length));
let controlCount = 0;
for (let i = 0; i < sample.length; i++) {
const code = sample.charCodeAt(i);
if (code === 0) return true; // null 字节 → 确定是二进制
if (code < 32 && c... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isBinaryByContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left content AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | static isBinaryByContent(content: string): boolean {
const sample = content.substring(0, Math.min(8000, content.length));
let controlCount = 0;
for (let i = 0; i < sample.length; i++) {
const code = sample.charCodeAt(i);
if (code === 0) return true; // null 字节 → 确定是二进制
if (code < 32 && c... | https://github.com/XJTUWYD/ArkDiff | ef42454cdf817cfcbfd3581a502e3178a0b13267 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/CheatManager.ets | arkts | fetchOnlineCheats | ========================================================================
在线获取
========================================================================
从 CDN 获取在线金手指,永久缓存到本地。
如果本地缓存已存在则直接读取,不再请求网络。 | async fetchOnlineCheats(gameCode: string, checksum: string): Promise<GameCheats | null> {
if (!gameCode || !checksum) return null;
if (!this.ensureCheatsDir()) return null;
const cachePath = this.getOnlineCachePath(gameCode, checksum);
// 检查本地缓存
try {
if (fileIo.accessSync(cachePath)) {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left fetchOnlineCheats AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left gameCode AST#identifier#Rig... | async fetchOnlineCheats(gameCode: string, checksum: string): Promise<GameCheats | null> {
if (!gameCode || !checksum) return null;
if (!this.ensureCheatsDir()) return null;
const cachePath = this.getOnlineCachePath(gameCode, checksum);
// 检查本地缓存
try {
if (fileIo.accessSync(cachePath)) {
... | https://github.com/richshaw2015/nds | 16073653f8dac7c9fe1d35b7aa093d21b16c57d1 | github |
Countly/countly-sdk-hos | library/src/main/ets/CountlyInstance.ets | arkts | onContentOverlayLoadTimedOut | @internal, called by the exported overlay component on WebView load timeout. | public onContentOverlayLoadTimedOut(): void {
this.config.logger.w('onContentOverlayLoadTimedOut, content module is disabled, no-op');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onContentOverlayLoadTimedOut 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#Rig... | public onContentOverlayLoadTimedOut(): void {
this.config.logger.w('onContentOverlayLoadTimedOut, content module is disabled, no-op');
} | https://github.com/Countly/countly-sdk-hos | b4caaca60e04d62b88d3762a4c0f885fa56e9f76 | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/AccountManager.ets | arkts | updateAccount | 更新账户基础信息;当账户名称变更时,同步历史账单中的来源与目标账户名称。 | static async updateAccount(
id: number,
name: string,
balance: number,
type: string,
icon: string
): Promise<number> {
const originalAccount: AccountBean | null = await AccountManager.getAccountById(id);
if (originalAccount === null) {
return -1;
}
const predicates = new r... | 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 updateAccount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:... | static async updateAccount(
id: number,
name: string,
balance: number,
type: string,
icon: string
): Promise<number> {
const originalAccount: AccountBean | null = await AccountManager.getAccountById(id);
if (originalAccount === null) {
return -1;
}
const predicates = new r... | https://github.com/ZestBox-18/kitebook-frontend | 9ea6705a345870ca8398ea5447da026c7efb2ee8 | github |
darcycui/DarcyHarmonyNext | entry/src/main/ets/pages/entry/list/ListA1.ets | arkts | change | constructor() {
this.arrA.push(new ClassA(1), new ClassA(2));
} | change() {
this.arrA[Math.floor(this.arrA.length / 2)].c += 10;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left change 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#... | change() {
this.arrA[Math.floor(this.arrA.length / 2)].c += 10;
} | https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/list/ListA1.ets#L92-L94 | 7e45218655aa6ea56e9e7b96ccecfe407b13c2f0 | github |
openharmony/codelabs | ETSUI/HarmonyPhotoAlbum/entry/src/main/ets/common/utils/Logger.ets | arkts | showError | 弹出错误提示,对用户友好展示 | showError(message: string) {
prompt.showToast({
message: message,
duration: 3000
});
this.error(message);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Le... | showError(message: string) {
prompt.showToast({
message: message,
duration: 3000
});
this.error(message);
} | https://gitcode.com/openharmony/codelabs | d227e9d80fcf69dc2d89579616413dcbde0472ce | gitcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.