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/Data/DataManager.ets | arkts | removeChapterPages | 删除指定章节的所有页面记录 | public async removeChapterPages(chapterId: string): Promise<void> {
try {
await this.databaseManager.executeSql('DELETE FROM page WHERE chapterId = ?', [chapterId]);
logger.debug(TAG, `删除章节页面记录: ${chapterId}`);
} catch (error) {
const message: string = error instanceof Error ? error.message ... | 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 removeChapterPages AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chapterId AST#identifier#Right AST#ERROR#Left AST#:#... | public async removeChapterPages(chapterId: string): Promise<void> {
try {
await this.databaseManager.executeSql('DELETE FROM page WHERE chapterId = ?', [chapterId]);
logger.debug(TAG, `删除章节页面记录: ${chapterId}`);
} catch (error) {
const message: string = error instanceof Error ? error.message ... | https://github.com/DaLongZhuaZi/manxia | 8c1738b6bb17c3f13da24ca18105517d930978e0 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/CrashLogService.ets | arkts | subscribeCrashEvent | 订阅崩溃事件 | private subscribeCrashEvent(): void {
try {
// 创建崩溃事件观察者
this.watcher = {
name: WATCHER_NAME,
appEventFilters: [
{
domain: hiAppEvent.domain.OS,
names: [hiAppEvent.event.APP_CRASH]
}
],
onReceive: (domain: string, appEventGrou... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left subscribeCrashEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST... | private subscribeCrashEvent(): void {
try {
// 创建崩溃事件观察者
this.watcher = {
name: WATCHER_NAME,
appEventFilters: [
{
domain: hiAppEvent.domain.OS,
names: [hiAppEvent.event.APP_CRASH]
}
],
onReceive: (domain: string, appEventGrou... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/CrashLogService.ets#L119-L142 | 79ae93a301a6aa91b3b236063afa5af329ecf3b2 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/entryability/EntryAbility.ets | arkts | initializeSessionManager | Initialize the RDP session manager and all subsystems | private async initializeSessionManager(): Promise<void> {
hilog.info(DOMAIN, TAG, 'Initializing session manager...');
try {
sessionManager = new RdpSessionManager(this.context);
const success = await sessionManager.initialize();
if (success) {
hilog.info(DOMAIN, TAG, 'Ses... | 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 initializeSessionManager AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressio... | private async initializeSessionManager(): Promise<void> {
hilog.info(DOMAIN, TAG, 'Initializing session manager...');
try {
sessionManager = new RdpSessionManager(this.context);
const success = await sessionManager.initialize();
if (success) {
hilog.info(DOMAIN, TAG, 'Ses... | https://github.com/tangwengang-del/freerdp-harmonyos | a715645eab447b168dfb6ed7f6c223d0897ceb86 | github |
AGenUI/AGenUI | platforms/harmony/agenui/src/main/ets/agenui/AGenEngineUI.ets | arkts | registerFunction | MARK: - Skill / FunctionCall
Registers a function backed by IFunctionCall | static registerFunction(func: IFunctionCall): void {
FunctionManager.getInstance().registerFunction(func);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left registerFunction AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left func AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | static registerFunction(func: IFunctionCall): void {
FunctionManager.getInstance().registerFunction(func);
} | https://github.com/AGenUI/AGenUI | 8bd7a1f8994b6432a92dd2a8473b053afd7e8b0f | github |
Joker-x-dev/CoolMallArkTS | core/designsystem/src/main/ets/component/Column.ets | arkts | build | 构建通用 Column 布局
@returns {void} 无返回值
@example
ColumnBase({ fillMaxSize: true }) { Text("Hi"); } | build(): void {
Column(this.options) {
if (this.content) {
this.content();
}
}
.justifyContent(this.justifyContent)
.alignItems(this.alignItems)
.attributeModifier(this.buildCommonModifier());
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
Column(this.options) {
if (this.content) {
this.content();
}
}
.justifyContent(this.justifyContent)
.alignItems(this.alignItems)
.attributeModifier(this.buildCommonModifier());
} | https://github.com/Joker-x-dev/CoolMallArkTS | d30805fd89db7bc1d03c6f43d665f34d8acdbbb0 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/NativeHidController.ets | arkts | convertNativeButtons | 转换原生按钮标志到 Moonlight 格式 | private convertNativeButtons(nativeButtons: number): number {
let flags = 0;
// 方向键
if (nativeButtons & NativeButtonFlags.UP) flags |= ButtonFlags.UP_FLAG;
if (nativeButtons & NativeButtonFlags.DOWN) flags |= ButtonFlags.DOWN_FLAG;
if (nativeButtons & NativeButtonFlags.LEFT) flags |= ButtonFlags.... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertNativeButtons AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left nativeButtons AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left num... | private convertNativeButtons(nativeButtons: number): number {
let flags = 0;
// 方向键
if (nativeButtons & NativeButtonFlags.UP) flags |= ButtonFlags.UP_FLAG;
if (nativeButtons & NativeButtonFlags.DOWN) flags |= ButtonFlags.DOWN_FLAG;
if (nativeButtons & NativeButtonFlags.LEFT) flags |= ButtonFlags.... | https://github.com/AlkaidLab/moonlight-harmony | a352fd37f68720cfb6f219597ca4b416bc41ee42 | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/notify/TnNotify.ets | arkts | hide | 关闭消息通知 | public hide(): void {
this.clearTimer();
if (this.contentNode !== null && this.uiContext !== null) {
const node: ComponentContent<TnNotifyParams> = this.contentNode;
try {
this.uiContext.getPromptAction().closeCustomDialog(node);
} catch (_e) {
// 对话框可能已关闭
this.isShow... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left hide 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 hide(): void {
this.clearTimer();
if (this.contentNode !== null && this.uiContext !== null) {
const node: ComponentContent<TnNotifyParams> = this.contentNode;
try {
this.uiContext.getPromptAction().closeCustomDialog(node);
} catch (_e) {
// 对话框可能已关闭
this.isShow... | https://github.com/codelably/tuniao-ui | 3a9711e8ec4767fd7482cfa6e7a8c629a2be035d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Workflow/WorkflowExecutor.ets | arkts | cleanup | 清理工作流资源 | cleanup(sourceId: number): void {
this.capabilities.cleanup(sourceId);
logger.info(TAG, `清理工作流资源: sourceId=${sourceId}`);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cleanup AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#Right... | cleanup(sourceId: number): void {
this.capabilities.cleanup(sourceId);
logger.info(TAG, `清理工作流资源: sourceId=${sourceId}`);
} | https://github.com/DaLongZhuaZi/manxia | 39ac35ac3fd13baf10c5ca6897cc0fa578daee54 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets | arkts | isSetIterator | Check whether the entered value is the iterator type of set.
@param { Object } value - A Set iterator value
@returns { boolean } Returns true if the value is an iterator returned for a built-in Set instance.
Since the current interface cannot be correctly determined, it returns false by default | isSetIterator(value: Object): boolean {
return value instanceof SetIterator
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isSetIterator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Object AST#identifier#Right AST#)#Left ) ... | isSetIterator(value: Object): boolean {
return value instanceof SetIterator
} | https://gitcode.com/iop123123/arkts-static-skills | a66f18e8ed5c826fd09296d76e17bedf1eb01f36 | gitcode |
Countly/countly-sdk-hos | library/src/main/ets/internal/ModuleBase.ets | arkts | onEnterBackground | Called when "background" transition detected (counter: 1 → 0). | public onEnterBackground(): void { } | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onEnterBackground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expr... | public onEnterBackground(): void { } | https://github.com/Countly/countly-sdk-hos | 3deb99387faac9961b7000d7d8361b30f9d1e65d | github |
CLMC2025/Vignette | entry/src/main/ets/manager/UserStateManager.ets | arkts | setUserLevel | 设置用户级别 | setUserLevel(level: UserLevel): void {
this.currentUserLevel = level;
console.log(`[UserStateManager] User level set to: ${level}`);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setUserLevel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left UserLevel AST#identifier#Right AST#)#Left ... | setUserLevel(level: UserLevel): void {
this.currentUserLevel = level;
console.log(`[UserStateManager] User level set to: ${level}`);
} | https://github.com/CLMC2025/Vignette | 39d23c3bb81b50f1bc02419c1db7d376e1fcf990 | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/model/ExpressionsDataSource.ets | arkts | shown | 页面可见时的逻辑 | public shown(): void {
if (this.dateUtil.isLocalChange()) {
this.dateUtil.refreshLocalStr();
if (this.expList.length > 0) {
this.buildExpList(this.expList);
this.notifyDataReload();
}
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left shown 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 shown(): void {
if (this.dateUtil.isLocalChange()) {
this.dateUtil.refreshLocalStr();
if (this.expList.length > 0) {
this.buildExpList(this.expList);
this.notifyDataReload();
}
}
} | https://gitee.com/openharmony-sig/applications_calculator.git | fc2c5146e12fdb77db37096684122b9162b8e5b0 | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/database/BatchQueryHelper.ets | arkts | bulkUpdate | 执行批量更新操作
@param tableName 表名
@param updates 更新数据数组,每项包含 id 和要更新的字段
@param idColumnName ID 列名
@returns 更新成功的记录数 | static async bulkUpdate(
tableName: string,
updates: Array<UpdateItem>,
idColumnName?: string
): Promise<number> {
if (!updates || updates.length === 0) {
console.log('[BatchQueryHelper] 没有数据需要更新');
return 0;
}
const store = DatabaseManager.getDatabase();
const idColumn = id... | 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 bulkUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tableName AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | static async bulkUpdate(
tableName: string,
updates: Array<UpdateItem>,
idColumnName?: string
): Promise<number> {
if (!updates || updates.length === 0) {
console.log('[BatchQueryHelper] 没有数据需要更新');
return 0;
}
const store = DatabaseManager.getDatabase();
const idColumn = id... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 308e8666a810c1b80a3cd42d33e1b4dede48a474 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelLoginManager.ets | arkts | saveLoginFormData | 保存登录表单数据
@param sourceId 书源ID
@param formData 表单数据 | async saveLoginFormData(sourceId: string, formData: Record<string, string>): Promise<void> {
this.loginFormDataStore.set(sourceId, formData);
await this.savePersistedData();
logger.debug(TAG, `保存了书源 ${sourceId} 的登录表单数据`);
} | 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 saveLoginFormData AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_paramete... | async saveLoginFormData(sourceId: string, formData: Record<string, string>): Promise<void> {
this.loginFormDataStore.set(sourceId, formData);
await this.savePersistedData();
logger.debug(TAG, `保存了书源 ${sourceId} 的登录表单数据`);
} | https://github.com/DaLongZhuaZi/manxia | 59ea6e441f8d0529cc182db1fbededc6a3e2f329 | github |
751496032/ZRouter | RouterApi/src/main/ets/api/RouterMgr.ets | arkts | getBottomPathName | 获取栈底元素名称
@returns | private getBottomPathName(): string | null {
const allPaths = this.getAllPathName()
if (allPaths.length > 0) {
return allPaths[0] // 栈底元素索引为0
}
return null
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getBottomPathName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression... | private getBottomPathName(): string | null {
const allPaths = this.getAllPathName()
if (allPaths.length > 0) {
return allPaths[0] // 栈底元素索引为0
}
return null
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/RouterMgr.ets#L637-L643 | eab89ff887be9f92d6a4819e381bf2b44cb92af5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoWebViewExecutor.ets | arkts | loadHtml | 加载HTML内容 | private async loadHtml(options: WebViewOptions): Promise<WebViewResult> {
if (!this.webviewController) {
throw new Error('WebView控制器未设置');
}
return new Promise((resolve, reject) => {
try {
const baseUrl = options.url || 'about:blank';
// 设置页面加载完成回调
this.pageLo... | 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 loadHtml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left options AST#identifier#Right AST#:#Left : AS... | private async loadHtml(options: WebViewOptions): Promise<WebViewResult> {
if (!this.webviewController) {
throw new Error('WebView控制器未设置');
}
return new Promise((resolve, reject) => {
try {
const baseUrl = options.url || 'about:blank';
// 设置页面加载完成回调
this.pageLo... | https://github.com/DaLongZhuaZi/manxia | ce8186e807fe5e9d143d0829d82295986900cb82 | github |
XHXYT/Pixark | entry/src/main/ets/services/MockData.ets | arkts | delay | 模拟网络延迟,检查 Loading 效果 | private static delay(ms: number = 300): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
} | AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left delay AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#R... | private static delay(ms: number = 300): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/services/MockData.ets#L10-L12 | 67d76da98fb1deec42207e584305961b9ea6ec24 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/ChartModel.ets | arkts | setDescription | Sets a new Description object for the chart.
@param desc | public setDescription(desc: Description) {
this.mDescription = desc;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left desc AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left D... | public setDescription(desc: Description) {
this.mDescription = desc;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | a3753e7554e886b96482a9a89459d3ec7bad2c63 | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/storage/cache/CacheConstants.ets | arkts | setOnlyCache | 设置是否仅使用本地缓存
@param onlyCache 是否仅使用缓存 | static setOnlyCache(onlyCache: boolean): void {
AppStorage.setOrCreate(CacheConstants.ONLY_CACHE_KEY, onlyCache);
hilog.debug(DOMAIN, TAG, `Set only cache: ${onlyCache}`);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setOnlyCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left onlyCache AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boole... | static setOnlyCache(onlyCache: boolean): void {
AppStorage.setOrCreate(CacheConstants.ONLY_CACHE_KEY, onlyCache);
hilog.debug(DOMAIN, TAG, `Set only cache: ${onlyCache}`);
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/cache/CacheConstants.ets#L153-L156 | 0d5ef8812b92ee3cdbde902664779d185cfdbec4 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/TagDAO.ets | arkts | hardDelete | 真删除标签(慎用)- 使用 DAOHelper 统一事务处理
@param userId 用户ID
@param tagId 标签ID | static async hardDelete(userId: number, tagId: number): Promise<void> {
await DAOHelper.transaction(async () => {
const store = DatabaseManager.getDatabase();
// 先删除关联记录
await store.executeSql(`DELETE FROM bill_tags WHERE tag_id = ?`, [tagId]);
// 再删除标签
await store.executeSql(`DELETE... | 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 hardDelete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST#... | static async hardDelete(userId: number, tagId: number): Promise<void> {
await DAOHelper.transaction(async () => {
const store = DatabaseManager.getDatabase();
// 先删除关联记录
await store.executeSql(`DELETE FROM bill_tags WHERE tag_id = ?`, [tagId]);
// 再删除标签
await store.executeSql(`DELETE... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 1952918aa53a8cdfabb314305d866b85ae6490d8 | github |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanUtils.ets | arkts | isUri | 检查是否为 URI 格式
@param path 路径字符串
@returns 是否为 URI | static isUri(path: string): boolean {
if (!path) {
return false;
}
return path.startsWith('file://') || path.startsWith('content://') || path.startsWith('datashare://');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left isUri AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR... | static isUri(path: string): boolean {
if (!path) {
return false;
}
return path.startsWith('file://') || path.startsWith('content://') || path.startsWith('datashare://');
} | https://github.com/kumaleap/ArkLuban | 4fa7e3c103796a4bbd7808832e200cae18b6ed0c | github |
XJTUWYD/ArkDiff | entry/src/main/ets/services/ExternalFileOpener.ets | arkts | getFileName | 获取文件名(不含路径) | static getFileName(filePath: string): string {
return filePath.split('/').pop() || 'unknown';
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getFileName 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 string AST#string#Ri... | static getFileName(filePath: string): string {
return filePath.split('/').pop() || 'unknown';
} | https://github.com/XJTUWYD/ArkDiff | d6773287b1e6ff0126fc3c05308caaebdd351230 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets | arkts | forEach | Executes a provided function once per each key/value pair in the Map, in insertion order
@param callbackfn to apply | override forEach(callbackfn: (v: V, k: K, map: Map<K, V>) => void): void {
let curData = this.data
this.buckets.chgItersCounter(+1)
// NOTE(nkholiavin): need to use try/finally for decrement the counter back, but it costs too much (issue 31274)
for (let curAt = getAtZero(); isInside... | AST#program#Left AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left forEach AST#identifier#Right AST#ERROR#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right ... | override forEach(callbackfn: (v: V, k: K, map: Map<K, V>) => void): void {
let curData = this.data
this.buckets.chgItersCounter(+1)
// NOTE(nkholiavin): need to use try/finally for decrement the counter back, but it costs too much (issue 31274)
for (let curAt = getAtZero(); isInside... | https://gitcode.com/iop123123/arkts-static-skills | 9c52eb423a7926980012d41a11772561fc400376 | gitcode |
openharmony/codelabs | Security/StringCipherArkTS/entry/src/main/ets/common/utils/DataTransformUtil.ets | arkts | uint8ArrayToString | Converting uint8Array bytes to stream strings.
@param content Uint8Array data.
@returns Converted string. | uint8ArrayToString(content: Uint8Array): string {
let arrayString = '';
for (let i = 0; i < content.length; i++) {
arrayString += String.fromCharCode(content[i]);
}
return arrayString;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left uint8ArrayToString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left content AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uint8Array AST#identifier#Right AS... | uint8ArrayToString(content: Uint8Array): string {
let arrayString = '';
for (let i = 0; i < content.length; i++) {
arrayString += String.fromCharCode(content[i]);
}
return arrayString;
} | https://gitee.com/openharmony/codelabs.git | 2326cfa4624663362be8cf39ffa1b167f104b788 | gitee |
Goway-Hui/harmonyos-next-dev | harmonyos-next-dev/assets/modal-sheet-template.ets | arkts | showPromptDialog | ==================== 带输入的对话框 ==================== | showPromptDialog(): void {
// ArkUI 暂未原生支持输入对话框
// 可通过自定义弹窗或 bindSheet 实现
AlertDialog.show({
title: '请输入',
message: '当前版本请使用底部 Sheet 实现输入',
confirm: {
value: '好的'
}
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showPromptDialog 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_b... | showPromptDialog(): void {
// ArkUI 暂未原生支持输入对话框
// 可通过自定义弹窗或 bindSheet 实现
AlertDialog.show({
title: '请输入',
message: '当前版本请使用底部 Sheet 实现输入',
confirm: {
value: '好的'
}
});
} | https://github.com/Goway-Hui/harmonyos-next-dev | 63fc1ecc333f8561128e153cbd0f3adc6977ec30 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/skill/utils/SkillTestTool.ets | arkts | testDeviceControl | 测试设备管理意图 | private async testDeviceControl(): Promise<void> {
const testName = '设备管理';
try {
const result = await this.skill.handleQuickCommand('连接设备');
const passed = result.ttsText.includes('设备') || result.ttsText.includes('连接');
this.addResult(testName, '连接设备', passed, result);
} cat... | 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 testDeviceControl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | private async testDeviceControl(): Promise<void> {
const testName = '设备管理';
try {
const result = await this.skill.handleQuickCommand('连接设备');
const passed = result.ttsText.includes('设备') || result.ttsText.includes('连接');
this.addResult(testName, '连接设备', passed, result);
} cat... | https://github.com/LJ666-ui/harmony-health-care | 71bda15b888c49dcba04a7b137a45b1b707f0cde | github |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/charts/Chart.ets | arkts | setHighlighter | Sets a custom highligher object for the chart that handles / processes
all highlight touch events performed on the chart-view.
@param highlighter
@ts-ignore 泛型问题 | public setHighlighter(highlighter: ChartHighlighter) {
this.mHighlighter = highlighter;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setHighlighter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left highlighter AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | public setHighlighter(highlighter: ChartHighlighter) {
this.mHighlighter = highlighter;
} | https://gitee.com/openharmony/developtools_profiler.git | 5be59a0382686419a96f6f32ec5164905c85ba96 | gitee |
PollenWang6/HiXD | entry/src/main/ets/services/ExperimentService.ets | arkts | getCasTgc | ===== CAS TGC 获取 ===== | async getCasTgc(): Promise<string> {
try {
const serviceUrl = SYSJ_BASE + '/xidian/test';
const casLoginUrl = 'https://cas.xidian.edu.cn/authserver/login?service=' +
encodeURIComponent(serviceUrl);
console.info(TAG, 'getCasTgc: GET ' + casLoginUrl.substring(0, 80));
const loginPag... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCasTgc AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_ty... | async getCasTgc(): Promise<string> {
try {
const serviceUrl = SYSJ_BASE + '/xidian/test';
const casLoginUrl = 'https://cas.xidian.edu.cn/authserver/login?service=' +
encodeURIComponent(serviceUrl);
console.info(TAG, 'getCasTgc: GET ' + casLoginUrl.substring(0, 80));
const loginPag... | https://github.com/PollenWang6/HiXD | 8874f7f753c2c1400f1c86f099c935cf65409600 | github |
HarmonyOS_Samples/BestPracticeSnippets | TaskPoolPractice/entry/src/main/ets/pages/sample7/LightArt.ets | arkts | fromJson | [StartExclude LightArt]
[EndExclude LightArt] | public fromJson(jsonObj: object) {
// [StartExclude LightArt]
// [EndExclude LightArt]
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left fromJson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left jsonObj AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#object#Left object AST#object#Right ... | public fromJson(jsonObj: object) {
// [StartExclude LightArt]
// [EndExclude LightArt]
} | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | ea4a9c852f81702dbbade7eed6602454fca13532 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebDAV/WebDAVClient.ets | arkts | tryParseJson | 尝试解析JSON | private tryParseJson(data: string): Object[] | null {
if (!data.startsWith('[') && !data.startsWith('{')) {
return null;
}
try {
const result: Object = SafeUtils.parseObj(data);
if (Array.isArray(result)) {
return result as Object[];
}
return null;
} catch {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left tryParseJson AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | private tryParseJson(data: string): Object[] | null {
if (!data.startsWith('[') && !data.startsWith('{')) {
return null;
}
try {
const result: Object = SafeUtils.parseObj(data);
if (Array.isArray(result)) {
return result as Object[];
}
return null;
} catch {
... | https://github.com/DaLongZhuaZi/manxia | 7601173520d772582d6efaca573a822f2ba34beb | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Diagnostics/StartupController.ets | arkts | reset | 重置控制器状态 | reset(): void {
this.status = StartupStatus.NOT_STARTED;
this.currentPhase = null;
this.startTime = 0;
this.executionResults = [];
this.recoveryAttempts = 0;
logger.info('StartupController', '🔄 启动控制器已重置');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reset 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 A... | reset(): void {
this.status = StartupStatus.NOT_STARTED;
this.currentPhase = null;
this.startTime = 0;
this.executionResults = [];
this.recoveryAttempts = 0;
logger.info('StartupController', '🔄 启动控制器已重置');
} | https://github.com/DaLongZhuaZi/manxia | cd26e72d6312836fcc598fc0894976d4decbdc8c | github |
HarmonyOS_Samples/guide-snippets | Ability/StartAbility/entry/src/ohosTest/ets/test/Ability.test.ets | arkts | getStringFromResource | Helper function to get string from resource | async function getStringFromResource(resource: Resource): Promise<string> {
try {
const abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
const manager = abilityDelegator.getAppContext().resourceManager;
return await manager.getStringValue(resource);
} catch (error) {
logger.error('... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left getStringFromResource AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left resource AST#identifier#Rig... | async function getStringFromResource(resource: Resource): Promise<string> {
try {
const abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
const manager = abilityDelegator.getAppContext().resourceManager;
return await manager.getStringValue(resource);
} catch (error) {
logger.error('... | https://gitcode.com/HarmonyOS_Samples/guide-snippets | da8ce44e82c792d7fb6238a271ba72e172aaced9 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/DataView.ets | arkts | setInt8 | Sets bytes as they represent given type
@param { int } byteOffset zero index to write (big endian)
@param { int } value
@throws { RangeError } - Input parameter error.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public setInt8(byteOffset: int, value: int): void {
this.setInt8Big(byteOffset, value)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setInt8 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier... | public setInt8(byteOffset: int, value: int): void {
this.setInt8Big(byteOffset, value)
} | https://gitcode.com/iop123123/arkts-static-skills | f2a0e417cc27dee6f3001a1652b15051ca18299f | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Console.ets | arkts | time | @section Console methods for tabular data display.
Starts a timer with an optional label
Used to track execution time between time() and timeEnd() calls
@param {string} [label='default'] - Label to identify the timer
@returns {void}
@see timeEnd
@see timeLog | public time(label?: string): void {
const key = label ?? 'default'
Console.isNullCharacter(key);
if (this.timers.has(key)) {
this.warn("⚠️ Warning: Label 'default' already exists for console.time()")
return
}
const start = Date.now()
this.timer... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left time AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left label AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#L... | public time(label?: string): void {
const key = label ?? 'default'
Console.isNullCharacter(key);
if (this.timers.has(key)) {
this.warn("⚠️ Warning: Label 'default' already exists for console.time()")
return
}
const start = Date.now()
this.timer... | https://gitcode.com/iop123123/arkts-static-skills | f24a1a3f8dbc0aef33db9377ec8c68ba4f5e0155 | gitcode |
LongLiveY96/chatcube | entry/src/main/ets/services/ToolRegistry.ets | arkts | getToolIdByFunctionName | 通过函数名获取工具 ID | getToolIdByFunctionName(functionName: string): string | undefined {
let foundId: string | undefined = undefined
this.tools.forEach((tool, id) => {
if (tool.definition.function.name === functionName) {
foundId = id
}
})
return foundId
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getToolIdByFunctionName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left functionName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left st... | getToolIdByFunctionName(functionName: string): string | undefined {
let foundId: string | undefined = undefined
this.tools.forEach((tool, id) => {
if (tool.definition.function.name === functionName) {
foundId = id
}
})
return foundId
} | https://github.com/LongLiveY96/chatcube | 345e490182c2935f0e20d90406fe6c1a0ff67d08 | github |
arkui-x/samples | CodeLab/Cases/feature/handwritingtoimage/src/main/ets/view/HandWritingToImage.ets | arkts | build | 当前正在绘制的节点 | build() {
Column() {
// 画布
Row() {
// TODO:知识点:自定义节点容器组件NodeContainer,接收MyNodeController的实例,将自定义的渲染节点挂载到组件上,实现自定义绘制
NodeContainer(this.myNodeController)
.width('100%')
.height($r('app.integer.hand_writing_canvas_height'))
.onTouch((event: TouchEvent) => {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
// 画布
Row() {
// TODO:知识点:自定义节点容器组件NodeContainer,接收MyNodeController的实例,将自定义的渲染节点挂载到组件上,实现自定义绘制
NodeContainer(this.myNodeController)
.width('100%')
.height($r('app.integer.hand_writing_canvas_height'))
.onTouch((event: TouchEvent) => {
... | https://gitcode.com/arkui-x/samples | b1abb4cf23e28e74811088f09cc60f619fbc441f | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets | arkts | getGetterKeyValuePairsAll | @brief Returns values of `@JSONStringifyGetter`-annotated `get` accessor properties
across the class hierarchy.
A method is included only if it both carries the `@JSONStringifyGetter` annotation
AND has the `%%get-` bytecode name prefix (length 6) that identifies a `get` accessor.
The prefix is stripped to produce the ... | private static getGetterKeyValuePairsAll(cls: Class, obj: Object, useFieldsFilter: boolean,
fieldsFilterSet: Set<string>): Array<[string, Any]> {
const namesAndValues = new Array<[string, Any]>()
const getterMetadata = JSONWriter.getGetterMetadata(cls)
const getterMetadataLen = gett... | 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 getGetterKeyValuePairsAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cls AST#identifier#Right A... | private static getGetterKeyValuePairsAll(cls: Class, obj: Object, useFieldsFilter: boolean,
fieldsFilterSet: Set<string>): Array<[string, Any]> {
const namesAndValues = new Array<[string, Any]>()
const getterMetadata = JSONWriter.getGetterMetadata(cls)
const getterMetadataLen = gett... | https://gitcode.com/iop123123/arkts-static-skills | d1f9007dae265afe954679f400914ae2dc3c8d63 | gitcode |
honjow/Next2V | shared/src/main/ets/utils/FoldScreenUtil.ets | arkts | updateState | Update foldable screen state | private updateState(): void {
let newState = false
try {
const isFoldable = display.isFoldable()
if (isFoldable) {
const foldStatus = display.getFoldStatus()
const foldDisplayMode = display.getFoldDisplayMode()
// Only return true when folded + outer sc... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateState 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... | private updateState(): void {
let newState = false
try {
const isFoldable = display.isFoldable()
if (isFoldable) {
const foldStatus = display.getFoldStatus()
const foldDisplayMode = display.getFoldDisplayMode()
// Only return true when folded + outer sc... | https://github.com/honjow/Next2V | 7617e27cc50abb04c4ec2e8c4bc1d25bc3701922 | github |
tdcare/tdwebrtc | src/main/ets/utils/PermissionUtil.ets | arkts | getGrantSuccess | 判断是否授权成功 | public static getGrantSuccess(data: PermissionRequestResult | Array<abilityAccessCtrl.GrantStatus>): boolean {
let result: boolean = true; //鉴权结果
let grantStatus: Array<number> = Array.isArray(data) ? data : data.authResults;
for (let i = 0; i < grantStatus.length; i++) {
if (grantStatus[i] !== abil... | 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 getGrantSuccess AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : ... | public static getGrantSuccess(data: PermissionRequestResult | Array<abilityAccessCtrl.GrantStatus>): boolean {
let result: boolean = true; //鉴权结果
let grantStatus: Array<number> = Array.isArray(data) ? data : data.authResults;
for (let i = 0; i < grantStatus.length; i++) {
if (grantStatus[i] !== abil... | https://github.com/tdcare/tdwebrtc | 4a8abfdc5f5fca2a5daaa5236ba987316a4936f1 | github |
cheinlu/HarmonyOS-groundhog-charging-system | TbsChargeHarmonyOs/entry/src/main/ets/scan/ScanPage.ets | arkts | handlerScanResult | 扫码结果处理 | handlerScanResult(result: scanBarcode.ScanResult[]) {
if (this.isScanned) {
return
}
if (result.length > 0) {
this.stopScan()
this.isScanned = true
}
this.scanResults = result
if (result.length === 1) {
this.handlerQRCodeLogic(result[0])
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handlerScanResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left result AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#member_... | handlerScanResult(result: scanBarcode.ScanResult[]) {
if (this.isScanned) {
return
}
if (result.length > 0) {
this.stopScan()
this.isScanned = true
}
this.scanResults = result
if (result.length === 1) {
this.handlerQRCodeLogic(result[0])
}
} | https://github.com/cheinlu/HarmonyOS-groundhog-charging-system | a67a060119bd45724b1c3428b5ba5adb8ca5e118 | github |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/svggen/SVGSpecifiedFormat.ets | arkts | setElements | 设置节点的子节点(覆盖原有子节点值)
@param elements 子节点 | public setElements(elementsInfo: Object): void{
if (isArray(elementsInfo)) {
this._elements = elementsInfo;
} else {
this._elements = new Array()
this._elements.push(elementsInfo);
}
this._formatResultObj[SVGAttrConstants.ATTR_KEY_ELEMENTS] = this._elements;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setElements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left elementsInfo AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Object AST#i... | public setElements(elementsInfo: Object): void{
if (isArray(elementsInfo)) {
this._elements = elementsInfo;
} else {
this._elements = new Array()
this._elements.push(elementsInfo);
}
this._formatResultObj[SVGAttrConstants.ATTR_KEY_ELEMENTS] = this._elements;
} | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | bf53e347cbc113de86d327fb1ef51715026312f9 | gitee |
arkui-x/samples | CodeLab/Cases/feature/customscan/src/main/ets/model/ScanSize.ets | arkts | setScanXComponentSize | 计算当前相机预览流显示大小和偏移位置
@param isSupportRotation
@param windowSize | public setScanXComponentSize(isSupportRotation: boolean, windowSize: window.Size): void {
if (isSupportRotation) {
this.getOrientation();
}
if (windowSize) {
logger.info(`Start to set scan XComponent size. Width: ` + windowSize.width + `, height: ` + windowSize.height);
this.updateBreakp... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setScanXComponentSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isSupportRotation AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left ... | public setScanXComponentSize(isSupportRotation: boolean, windowSize: window.Size): void {
if (isSupportRotation) {
this.getOrientation();
}
if (windowSize) {
logger.info(`Start to set scan XComponent size. Width: ` + windowSize.width + `, height: ` + windowSize.height);
this.updateBreakp... | https://gitcode.com/arkui-x/samples | 6f12e7941df103b06332876878fe8d2f8ab6acb6 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets | arkts | getInteger | Gets an integer value from an object by key and ensures it is an integer.
@param {string} key - The key to look up
@returns {int} The integer value
@throws {JsonTypeError} If the value is not an integer or if this element is not an object
@throws {RangeError} If the key is not found | getInteger(key: string): int {
return this.getElement(key).asInteger()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getInteger AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)... | getInteger(key: string): int {
return this.getElement(key).asInteger()
} | https://gitcode.com/iop123123/arkts-static-skills | 5708ec88efc1303af036c4abfb9845cae9237624 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/AppColors.ets | arkts | getTransparency | ==================== 用户配置访问 ====================
获取用户配置的透明度
@param component 组件类型
@returns 透明度值 (0-1) | static getTransparency(component: 'navigationBar' | 'tabBar' | 'card' | 'dialog' | 'floatingBall' | 'menu' | 'sidebar'): number {
try {
const themeManager = ThemeManager.getInstance();
return themeManager.getComponentTransparency(component);
} catch {
return 1.0;
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTransparency AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left component AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expr... | static getTransparency(component: 'navigationBar' | 'tabBar' | 'card' | 'dialog' | 'floatingBall' | 'menu' | 'sidebar'): number {
try {
const themeManager = ThemeManager.getInstance();
return themeManager.getComponentTransparency(component);
} catch {
return 1.0;
}
} | https://github.com/DaLongZhuaZi/manxia | c1e75fd7fad2936588b7b9eb520c6593a8c7fedb | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | applyLowEndDeviceOptimizations | v26: 应用低端设备优化策略 | private applyLowEndDeviceOptimizations(): void {
// 1. 降低视频分辨率
if (this.config.video) {
const oldWidth = this.config.video.width;
const oldHeight = this.config.video.height;
const oldFrameRate = this.config.video.frameRate;
this.config.video.width = this.LOW_END_DEVICE_WIDTH;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applyLowEndDeviceOptimizations AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void... | private applyLowEndDeviceOptimizations(): void {
// 1. 降低视频分辨率
if (this.config.video) {
const oldWidth = this.config.video.width;
const oldHeight = this.config.video.height;
const oldFrameRate = this.config.video.frameRate;
this.config.video.width = this.LOW_END_DEVICE_WIDTH;
... | https://github.com/tdcare/tdwebrtc | c8cfa63e0a021ad893977c57ebeb693cfe2cb0aa | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelChapterCacheManager.ets | arkts | clearBookCache | 清理指定书籍的缓存(删除整个书籍目录) | async clearBookCache(bookId: string): Promise<void> {
try {
await this.ensureInitialized();
const bookDir = this.getBookCacheDir(bookId);
// 检查目录是否存在
if (await this.sandboxManager.exists(bookDir)) {
await this.sandboxManager.deleteDirectory(bookDir);
logger.info(TAG,... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearBookCache AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bookId AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async clearBookCache(bookId: string): Promise<void> {
try {
await this.ensureInitialized();
const bookDir = this.getBookCacheDir(bookId);
// 检查目录是否存在
if (await this.sandboxManager.exists(bookDir)) {
await this.sandboxManager.deleteDirectory(bookDir);
logger.info(TAG,... | https://github.com/DaLongZhuaZi/manxia | 6a81513dca7e9a40385cc894618552e30a43185e | github |
honjow/Next2V | shared/src/main/ets/settings/AccountMetaPublisher.ets | arkts | markDailyRedeemed | After a confirmed daily check-in performed by the hidden ArkWeb runner (which redeems through a real Web
engine and so NEVER touches the HTTP-layer accountMeta), flip the live holder's dailyMission to the
claimed state so the 我的 card + 账号 detail page show 已签到 immediately — without a forced re-fetch or
an app restart. O... | static markDailyRedeemed(cookie: string): void {
const clean = (cookie || '').trim()
if (!clean) {
return
}
const holder = connectAccountMeta()
if (!holder.ownerKey || holder.ownerCookieHash !== AccountMetaPublisher.cookieHash(clean)) {
return
}
const mission = holder.dailyMiss... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left markDailyRedeemed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cookie AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | static markDailyRedeemed(cookie: string): void {
const clean = (cookie || '').trim()
if (!clean) {
return
}
const holder = connectAccountMeta()
if (!holder.ownerKey || holder.ownerCookieHash !== AccountMetaPublisher.cookieHash(clean)) {
return
}
const mission = holder.dailyMiss... | https://github.com/honjow/Next2V | 26f137789d8d2fa83828998d5e217292fd9db123 | github |
openharmony/applications_contacts | entry/src/main/ets/model/ContactAbilityModel.ets | arkts | emailContact | Save the contact email information to the database.
@param {Object} addParams Contact Information
@param {string} DAHelper Database path
@param {number} result Contact ID
@param {string} uri Database address | emailContact(addParams: ContactInfo, DAHelper: dataShare.DataShareHelper, result: string, uri: string) {
if (addParams.emails != undefined && addParams.emails.length > 0) {
let index = 1;
addParams.emails.forEach(element => {
if (StringUtil.isEmpty(element.address)) {
return;
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left emailContact AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left addParams AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ContactInfo AST#identif... | emailContact(addParams: ContactInfo, DAHelper: dataShare.DataShareHelper, result: string, uri: string) {
if (addParams.emails != undefined && addParams.emails.length > 0) {
let index = 1;
addParams.emails.forEach(element => {
if (StringUtil.isEmpty(element.address)) {
return;
... | https://gitee.com/openharmony/applications_contacts.git | 7c7e775568b184df9b93931f23eee84ea0d0173a | gitee |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/common/utils/RouterManager.ets | arkts | pushBadgeDetail | 跳转到徽章详情 | static pushBadgeDetail(badgeId: number, badgeSlug: string = '', username: string = ''): void {
RouterManager.pushPath(
RouteConstants.PAGE_BADGE_DETAIL,
new BadgeDetailRouteParam(badgeId, badgeSlug, username) as Object
);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left pushBadgeDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left badgeId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number... | static pushBadgeDetail(badgeId: number, badgeSlug: string = '', username: string = ''): void {
RouterManager.pushPath(
RouteConstants.PAGE_BADGE_DETAIL,
new BadgeDetailRouteParam(badgeId, badgeSlug, username) as Object
);
} | https://github.com/Amaz1ny/HarmonyDO-public | f188fee6fb215f95ab47d5fab882114f68e3e112 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets | arkts | operatorAdd | Adds another BigInt to this one.
@param { BigInt } other The value to add.
@returns { BigInt } The result of the addition.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public operatorAdd(other: BigInt): BigInt {
let max_len = max(this.length(), other.length()) as int + 1
let lhs: ValueArray<int> = this.bytes
let rhs: ValueArray<int> = other.bytes
if (this.negative() != other.negative()) {
if (this.negative()) {
lhs = this.... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left operatorAdd AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Big... | public operatorAdd(other: BigInt): BigInt {
let max_len = max(this.length(), other.length()) as int + 1
let lhs: ValueArray<int> = this.bytes
let rhs: ValueArray<int> = other.bytes
if (this.negative() != other.negative()) {
if (this.negative()) {
lhs = this.... | https://gitcode.com/iop123123/arkts-static-skills | a7ac7c7e428d30b7790289e713cddaab6a336806 | gitcode |
LZZLHY/hlib | entry/src/main/ets/api/ZLibraryClient.ets | arkts | getUserSaved | ─── 用户图书馆 ───────────────────────────────────── | async getUserSaved(limit: number = 100): Promise<Book[]> {
const query: QueryParams = {};
query['limit'] = limit;
const json: BooksEnvelope = await this.http.get<BooksEnvelope>('/eapi/user/book/saved', query);
ZLibraryClient.assertOk(json);
return Book.fromJsonList(json.books as object[]);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getUserSaved AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left limit AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | async getUserSaved(limit: number = 100): Promise<Book[]> {
const query: QueryParams = {};
query['limit'] = limit;
const json: BooksEnvelope = await this.http.get<BooksEnvelope>('/eapi/user/book/saved', query);
ZLibraryClient.assertOk(json);
return Book.fromJsonList(json.books as object[]);
} | https://github.com/LZZLHY/hlib | 520c88f573d94b45fc8cec2242a5f307e4e3d30f | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/NetworkManager.ets | arkts | generateQemuNetdevArgs | 生成 QEMU 网络参数 | public generateQemuNetdevArgs(): string[] {
const args: string[] = [];
if (this.config.mode === 'user') {
let hostfwd = `user,id=n0`;
if (this.config.enableDHCP) {
hostfwd += `,dhcp=on`;
}
if (this.config.enableDNS) {
hostfwd += `,dns=on`;
}
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left generateQemuNetdevArgs 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... | public generateQemuNetdevArgs(): string[] {
const args: string[] = [];
if (this.config.mode === 'user') {
let hostfwd = `user,id=n0`;
if (this.config.enableDHCP) {
hostfwd += `,dhcp=on`;
}
if (this.config.enableDNS) {
hostfwd += `,dns=on`;
}
... | https://github.com/AetheriumSimulator/qemu-hmos | 9adec93cf1eea56b6ba56e3ffee1edd819040e4f | github |
who7708/harmonyos-codelabs | HmosWorld/features/discover/src/main/ets/model/DiscoverModel.ets | arkts | setViewsCount | Set view counts of feed or article by resourceId
@param resourceId | setViewsCount(resourceId: string): void {
this.hotFeedList.forEach((res: LearningResource) => {
if (res.id === resourceId) {
res.viewsCount += 1;
}
});
this.techArticleList.forEach((res: LearningResource) => {
if (res.id === resourceId) {
res.viewsCount += 1;
}
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setViewsCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left resourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST... | setViewsCount(resourceId: string): void {
this.hotFeedList.forEach((res: LearningResource) => {
if (res.id === resourceId) {
res.viewsCount += 1;
}
});
this.techArticleList.forEach((res: LearningResource) => {
if (res.id === resourceId) {
res.viewsCount += 1;
}
... | https://github.com/who7708/harmonyos-codelabs | 5201b83296becaaae938c4c2326b13f19727a8ff | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/DataView.ets | arkts | getBigUint64 | === Uint64 ===
Read bytes as they represent given type
@param byteOffset zero index to read
@returns read value (big endian) | public getBigUint64(byteOffset: number): Long {
return this.getBigUint64(byteOffset as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getBigUint64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number... | public getBigUint64(byteOffset: number): Long {
return this.getBigUint64(byteOffset as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | aa26e0c6741d1fd5aa2e91fcbccd1c5574fc89c9 | gitee |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/dao/EventDao.ets | arkts | eventToValueBucket | 将Event对象转换为数据库值对象 | private eventToValueBucket(event: CalendarEvent): relationalStore.ValuesBucket {
return {
id: event.id,
title: event.title,
description: event.description || '',
start_time: event.startTime,
end_time: event.endTime,
all_day: event.allDay ? 1 : 0,
location: event.location ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left eventToValueBucket AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie... | private eventToValueBucket(event: CalendarEvent): relationalStore.ValuesBucket {
return {
id: event.id,
title: event.title,
description: event.description || '',
start_time: event.startTime,
end_time: event.endTime,
all_day: event.allDay ? 1 : 0,
location: event.location ... | https://gitcode.com/openharmony/codelabs | 49e19e4d1ec8b791c01f8dd60f6a3dc9ac906887 | gitcode |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/ChartHighlighter.ets | arkts | getClosestHighlightByPixel | Returns the Highlight of the DataSet that contains the closest value on the
y-axis.
@param closestValues contains two Highlight objects per DataSet closest
to the selected x-position (determined by rounding up an down)
@param x
@param y
@param axis the closest axis
@param minSelectionDistance
@re... | public getClosestHighlightByPixel(
closestValues: JArrayList<Highlight>,
x: number,
y: number,
axis: AxisDependency,
minSelectionDistance: number
): Highlight {
var closest: Highlight = null;
var distance: number = minSelectionDistance;
for (var i... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getClosestHighlightByPixel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left closestValues AST#identifier#Right AST#ERROR#Left AST#:#L... | public getClosestHighlightByPixel(
closestValues: JArrayList<Highlight>,
x: number,
y: number,
axis: AxisDependency,
minSelectionDistance: number
): Highlight {
var closest: Highlight = null;
var distance: number = minSelectionDistance;
for (var i... | https://gitee.com/openharmony/developtools_profiler.git | d1c01495fba80daea48cd23bfd5cb837025375fd | gitee |
openharmony-sig/ohos_highlightguide | library/src/main/ets/highlightguide/core/Controller.ets | arkts | showPreviewPage | 显示上一个引导页 | public showPreviewPage(): void {
if (this.animationRunning) {
hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'The component animation is running, please wait a minute.');
return;
}
this.showPage(this.guidePageIndex - 1);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left showPreviewPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expres... | public showPreviewPage(): void {
if (this.animationRunning) {
hilog.info(0x0000, GlobalContext.HILOG_TAG, '%{public}s', 'The component animation is running, please wait a minute.');
return;
}
this.showPage(this.guidePageIndex - 1);
} | https://gitee.com/openharmony-sig/ohos_highlightguide.git | 729fca8e9bdaada9d40d4a4c0d3ec188283dade5 | gitee |
apap6628114/nga_oh | entry/src/main/ets/store/settings/domain/NoteSettings.ets | arkts | load | 从持久化对象加载便签列表(回填 FilterListManager) | load(saved: SettingsState): void {
if (saved.notes) {
this.ctx.state.notes = saved.notes
this.manager.init(saved.notes)
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left saved AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left SettingsState AST#identifier#Right AST#)#Left ) AS... | load(saved: SettingsState): void {
if (saved.notes) {
this.ctx.state.notes = saved.notes
this.manager.init(saved.notes)
}
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/settings/domain/NoteSettings.ets#L56-L61 | 7939057fcd3721b93a775b10a33da4885a9a92c7 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets | arkts | stringify | Converts an object to a JavaScript Object Notation (JSON) string.
@param obj: Object An object to be converted.
@param replacer An array with elements indicating names of the properties in the object
that should be included in the resulting JSON string
@param space A string or number that's used to insert white space
(... | public static stringify(obj: Any, replacer: FixedArray<double | string>, space?: int | string): string {
const filter : FixedArray<string> = new FixedArray<string>(replacer.length)
for (let i = 0; i < replacer.length; i++) {
filter[i] = `${replacer[i]}`
}
if (space insta... | 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 stringify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#R... | public static stringify(obj: Any, replacer: FixedArray<double | string>, space?: int | string): string {
const filter : FixedArray<string> = new FixedArray<string>(replacer.length)
for (let i = 0; i < replacer.length; i++) {
filter[i] = `${replacer[i]}`
}
if (space insta... | https://gitcode.com/iop123123/arkts-static-skills | c718b1af7283a6eeaa8f5be2a0eba2d083c7ba07 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/SmartCategory.ets | arkts | recommendFromBill | 从Bill对象推荐分类 | static recommendFromBill(
bill: Bill,
categories: Category[],
keywords: CategoryKeyword[],
habits: UserCategoryHabit[]
): SmartCategoryResult {
return SmartCategoryUtils.recommendCategory(
bill.note,
categories,
keywords,
habits,
bill.amount
);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left recommendFromBill AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bill AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | static recommendFromBill(
bill: Bill,
categories: Category[],
keywords: CategoryKeyword[],
habits: UserCategoryHabit[]
): SmartCategoryResult {
return SmartCategoryUtils.recommendCategory(
bill.note,
categories,
keywords,
habits,
bill.amount
);
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 94594172c8225ef6f1f5743695971888bf3ac010 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | setContent | 设置要解析的内容
对于大型HTML(>100KB),跳过DOM解析以避免ANR | setContent(content: string, baseUrl?: string, disableHtmlBridge: boolean = false): LegadoRuleAnalyzer {
this.content = content;
if (baseUrl) {
this.baseUrl = baseUrl;
}
this.isJSON = this.checkIsJSON(content);
this.htmlToTextCache.clear();
// HTML大小阈值:超过此大小不创建DOM桥接,使用字符串解析
// 增加... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setContent 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#string#Right AST#ERROR#Right AST#,#Left , AST#,#Rig... | setContent(content: string, baseUrl?: string, disableHtmlBridge: boolean = false): LegadoRuleAnalyzer {
this.content = content;
if (baseUrl) {
this.baseUrl = baseUrl;
}
this.isJSON = this.checkIsJSON(content);
this.htmlToTextCache.clear();
// HTML大小阈值:超过此大小不创建DOM桥接,使用字符串解析
// 增加... | https://github.com/DaLongZhuaZi/manxia | 75b6bdc99647355b6857b94450c51118e08fdf67 | github |
Joker-x-dev/HarmonyKit | core/data/src/main/ets/repository/DemoRepository.ets | arkts | getAll | 获取所有 Demo 记录,按更新时间倒序
@returns {Promise<DemoEntity[]>} Demo 列表 | async getAll(): Promise<DemoEntity[]> {
return this.demoLocalDataSource.getAllItems();
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAll 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_type#... | async getAll(): Promise<DemoEntity[]> {
return this.demoLocalDataSource.getAllItems();
} | https://github.com/Joker-x-dev/HarmonyKit | eecd49208e939bca4e13675f3843a569f48f9cbf | github |
ibestservices/ibest-ui | library/src/main/ets/components/carInput/index.ets | arkts | formatInputList | 格式化inputList | formatInputList(){
let value = this.value
if(value.length > this.maxLength){
this.value = value.slice(0, this.maxLength)
}else{
this.inputList = Array(this.maxLength).fill("").map((_: string, index: number) => new IBestCarInputModel(value[index] || ""))
this.currentFocusIndex = value.length
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left formatInputList 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... | formatInputList(){
let value = this.value
if(value.length > this.maxLength){
this.value = value.slice(0, this.maxLength)
}else{
this.inputList = Array(this.maxLength).fill("").map((_: string, index: number) => new IBestCarInputModel(value[index] || ""))
this.currentFocusIndex = value.length
}
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/carInput/index.ets#L136-L144 | 8223e884902b6b58b9b33c00af0d564aa2220a2b | github |
HunZiLei/ArkTS_PokePomodoro | entry/src/main/ets/pages/login.ets | arkts | login | 模拟网络登录 | login(){
this.loadingDialog.open()
setTimeout(()=>{
if (this.account == 'ldd' && this.password == '123456') {
prompt.showToast({message:'登录成功'})
this.infoStorage.setUserId('000001')
router.back()
}else{
prompt.showToast({message:'登录失败,账户或密码错误!'})
}
this.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left login 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... | login(){
this.loadingDialog.open()
setTimeout(()=>{
if (this.account == 'ldd' && this.password == '123456') {
prompt.showToast({message:'登录成功'})
this.infoStorage.setUserId('000001')
router.back()
}else{
prompt.showToast({message:'登录失败,账户或密码错误!'})
}
this.... | https://github.com/HunZiLei/ArkTS_PokePomodoro | ca74ea09c8f88a4b68a9a6ef4303a857c13b5431 | github |
cheinlu/HarmonyOS-groundhog-charging-system | TbsChargeHarmonyOs/common/src/main/ets/utils/WindowModel.ets | arkts | getInstance | 获取WindowModel单例实例
@returns {WindowModel} WindowModel | static getInstance(): WindowModel {
if (!WindowModel.instance) {
WindowModel.instance = new WindowModel();
}
return WindowModel.instance;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left WindowMode... | static getInstance(): WindowModel {
if (!WindowModel.instance) {
WindowModel.instance = new WindowModel();
}
return WindowModel.instance;
} | https://github.com/cheinlu/HarmonyOS-groundhog-charging-system | f64fc74b1dbd6940bada5a90765337fcaed160ba | github |
richshaw2015/nds | ohos/entry/src/main/ets/types/MelonDSNative.ets | arkts | setDSiPaths | 设置 DSi BIOS/NAND 路径
@param bios9Path DSi ARM9 BIOS 路径
@param bios7Path DSi ARM7 BIOS 路径
@param firmwarePath DSi 固件路径
@param nandPath DSi NAND 镜像路径
@param sdCardPath DSi SD 卡路径 (可选)
@returns 设置是否成功 | static setDSiPaths(bios9Path: string, bios7Path: string, firmwarePath: string,
nandPath: string, sdCardPath?: string): boolean {
return MelonDSNative.native.setDSiPaths(bios9Path, bios7Path, firmwarePath,
nandPath, sdCardPath ?? '');
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setDSiPaths AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left bios9Path AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#R... | static setDSiPaths(bios9Path: string, bios7Path: string, firmwarePath: string,
nandPath: string, sdCardPath?: string): boolean {
return MelonDSNative.native.setDSiPaths(bios9Path, bios7Path, firmwarePath,
nandPath, sdCardPath ?? '');
} | https://github.com/richshaw2015/nds | 4cf73ab477129666a51edee1c910d6ff5f29c734 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/entryformability/EntryFormAbility.ets | arkts | getDefaultData | 获取默认数据 | private getDefaultData(formId: string, dimension: number): FormUpdateData {
return {
formId: formId,
dimension: dimension,
mangaGoal: 0,
mangaRead: 0,
mangaProgress: 0,
ebookGoal: 0,
ebookRead: 0,
ebookProgress: 0,
novelGoal: 0,
novelRead: 0,
novel... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDefaultData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left formId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | private getDefaultData(formId: string, dimension: number): FormUpdateData {
return {
formId: formId,
dimension: dimension,
mangaGoal: 0,
mangaRead: 0,
mangaProgress: 0,
ebookGoal: 0,
ebookRead: 0,
ebookProgress: 0,
novelGoal: 0,
novelRead: 0,
novel... | https://github.com/DaLongZhuaZi/manxia | 7d6fbb59b3e4028108bb1628787b22ce96fa3c61 | github |
chenchl/GMLogger-HarmonyOS | gmlogger/src/main/ets/components/security/logger/Logger.ets | arkts | error | 记录错误级别的日志。
@param message - 要记录的消息内容,可以是字符串或对象。
@param tag - 可选的日志标签,用于标识日志的来源或类别。 | error(message: string | object, tag?: string) {
this.logLevel(hilog.LogLevel.ERROR, tag, message)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left error AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left strin... | error(message: string | object, tag?: string) {
this.logLevel(hilog.LogLevel.ERROR, tag, message)
} | https://github.com/chenchl/GMLogger-HarmonyOS | c5d665f6ec514f4cd36403e8b349556a223f79ee | github |
bhengubv/aether-protocol | harmonyos/teal/entry/src/main/ets/service/NearLinkTransportService.ets | arkts | startDiscovery | ── CLIENT ROLE: Discovery ─────────────────────────────────────────────── | async startDiscovery(onDeviceFound: (deviceAddress: string) => void): Promise<void> {
this.assertAvailable('startDiscovery');
if (this._isScanning) {
return;
}
const seen = new Set<string>();
scan.on('deviceFound', (results: Array<scan.ScanResults>) => {
for (const result of results) {... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left startDiscovery AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left onD... | async startDiscovery(onDeviceFound: (deviceAddress: string) => void): Promise<void> {
this.assertAvailable('startDiscovery');
if (this._isScanning) {
return;
}
const seen = new Set<string>();
scan.on('deviceFound', (results: Array<scan.ScanResults>) => {
for (const result of results) {... | https://github.com/bhengubv/aether-protocol | 631b46c0c249825e6c18d70f8425427e5040309b | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/Legend.ets | arkts | setYEntrySpace | sets the space between the legend entries on a vertical axis in pixels,
converts to dp internally
@param space | public setYEntrySpace(space: number): void {
this.mYEntrySpace = space;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setYEntrySpace AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left space AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public setYEntrySpace(space: number): void {
this.mYEntrySpace = space;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | a6360272376e5abde1fa66f36446a79ddeac0ba5 | gitee |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/ClipboardBridgeService.ets | arkts | hashText | 纯文本内容哈希 (djb2 — 轻量去重,不要求密码学强度) | private hashText(text: string): number {
if (text.length === 0) {
return 0;
}
let h: number = 5381;
for (let i: number = 0; i < text.length; i++) {
h = ((h << 5) + h) + text.charCodeAt(i);
h = h & 0x7fffffff; // 保持正数
}
return h;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left hashText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | private hashText(text: string): number {
if (text.length === 0) {
return 0;
}
let h: number = 5381;
for (let i: number = 0; i < text.length; i++) {
h = ((h << 5) + h) + text.charCodeAt(i);
h = h & 0x7fffffff; // 保持正数
}
return h;
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | bdcb14662c325bd9f50baba733adfabad1830f37 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/MoonBridge.ets | arkts | setXComponentFrameRate | ==========================================================================
XComponent 帧率设置
==========================================================================
设置 XComponent 期望帧率(通过 FrameNode → ArkUI_NodeHandle)
无需在 XComponent 上设置 libraryname,避免触摸事件丢失
@param frameNode XComponent 的 FrameNode 对象
@param fps 期望帧率 | setXComponentFrameRate(frameNode: object, fps: number): void {
nativeLib.setXComponentFrameRate(frameNode, fps);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setXComponentFrameRate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left frameNode AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#object#Left object AST#object#Right AST#ERROR#Right AST#,#Le... | setXComponentFrameRate(frameNode: object, fps: number): void {
nativeLib.setXComponentFrameRate(frameNode, fps);
} | https://github.com/AlkaidLab/moonlight-harmony | e4be2e621fdeba09872abcc1b669b963436d05c4 | github |
openharmony-sig/flutter_sqflite | sqflite/ohos/src/main/ets/io/flutter/plugins/sqflite/Database.ets | arkts | insert | / insert | public static insert(operation: Operation, db: relationalStore.RdbStore): void {
Database.doInsert(operation, db);
} | 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 insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left operation AST#identifier#Right AST#:#Left : AST#... | public static insert(operation: Operation, db: relationalStore.RdbStore): void {
Database.doInsert(operation, db);
} | https://gitee.com/openharmony-sig/flutter_sqflite.git | b0864a3368882b7a81a61eb116144cc7acb5a952 | gitee |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/manager/ThemeManager.ets | arkts | disableFullScreen | 禁用全屏模式 | disableFullScreen() {
this.getWindowStage()
.then((windowStage: window.Window) => {
windowStage.setWindowLayoutFullScreen(false)
AppStorage.setOrCreate('topHeight', 0)
AppStorage.setOrCreate('bottomHeight', 0)
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left disableFullScreen 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#... | disableFullScreen() {
this.getWindowStage()
.then((windowStage: window.Window) => {
windowStage.setWindowLayoutFullScreen(false)
AppStorage.setOrCreate('topHeight', 0)
AppStorage.setOrCreate('bottomHeight', 0)
})
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 54ecf300768c0c7a2d47f667707f5bec56f73b77 | gitcode |
2763981847/Clock-Alarm | entry/src/main/ets/viewmodel/AlarmClockViewModel.ets | arkts | disableExpiredReminders | 禁用已过期的提醒。 | disableExpiredReminders() {
this.reminderService.getValidReminders(
(remindRequests: Array<reminderAgentManager.ReminderRequest>) => {
let remindRequestIds = remindRequests.map(remindRequest => remindRequest.notificationId);
this.alarms
.filter(alarm =>!remindRequestIds.includes(al... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left disableExpiredReminders 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_... | disableExpiredReminders() {
this.reminderService.getValidReminders(
(remindRequests: Array<reminderAgentManager.ReminderRequest>) => {
let remindRequestIds = remindRequests.map(remindRequest => remindRequest.notificationId);
this.alarms
.filter(alarm =>!remindRequestIds.includes(al... | https://github.com/2763981847/Clock-Alarm | 8a5300216d0f30959a0a250b03b94e30dd904b64 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInstanceMethod.ets | arkts | isAsync | Checks if the method is an async method.
@returns { boolean } Returns true if the method is async, otherwise returns false.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isAsync(): boolean {
return (this.attributes & Attributes.ASYNC) != 0
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isAsync 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#boole... | public isAsync(): boolean {
return (this.attributes & Attributes.ASYNC) != 0
} | https://gitcode.com/iop123123/arkts-static-skills | 1a703b4dffa2a45d456b89fceb3d80ce2cb14f44 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Plugin/HSPPluginManager.ets | arkts | savePluginRegistry | 保存插件注册表 | private async savePluginRegistry(): Promise<void> {
try {
const registryPath = `${this.sandboxManager.getDirectory('plugins')}/registry.json`;
// 使用Array.from替代Object.fromEntries
const registryData: Record<string, PluginInfo> = {};
const registryEntries = Array.from(this.pluginRegistry.ent... | 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 savePluginRegistry AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async savePluginRegistry(): Promise<void> {
try {
const registryPath = `${this.sandboxManager.getDirectory('plugins')}/registry.json`;
// 使用Array.from替代Object.fromEntries
const registryData: Record<string, PluginInfo> = {};
const registryEntries = Array.from(this.pluginRegistry.ent... | https://github.com/DaLongZhuaZi/manxia | b346d2c1a3237eb9a22b2c496fb770bb0a47dfcf | github |
youlookwhat/HarmoryOS-learning | HarmonyOSLearning/entry/src/main/ets/pages/Basis.ets | arkts | myClickHandler | 使用组件的成员函数 | myClickHandler(): void {
this.message = "点击了Button2"
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left myClickHandler AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_blo... | myClickHandler(): void {
this.message = "点击了Button2"
} | https://github.com/youlookwhat/HarmoryOS-learning | caa390167925204b44eaee0dd25beb5f3fd930ea | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | from | Creates an array from an array of the same up to the signess type.
@param { Int16Array } arr - An array to convert to a new array.
@returns { Uint16Array } - A new Uint16Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arr: Int16Array): Uint16Array {
let result = new Uint16Array(arr.length)
result.set(arr)
return result
} | 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#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ... | public static from(arr: Int16Array): Uint16Array {
let result = new Uint16Array(arr.length)
result.set(arr)
return result
} | https://gitcode.com/iop123123/arkts-static-skills | 56307cf3f3332392518a0830848c19384a75744d | gitcode |
awaLiny2333/Spaceow | woof/src/main/ets/components/GridSpace.ets | arkts | layoutFolder | 假设 meowFile 和 gridSpacePosition 已定义
export class meowFile { ... }
class gridSpacePosition { ... }
将文件夹内的所有内容平铺在 resolution x resolution 的棋盘上
@param folder 保证是文件夹的 meowFile 对象
@param resolution 棋盘边长(整数)
@returns 每个内容对应的位置信息数组
@author DeepSeek Web @ Feb 18 2026, modified and adapted by awa_Liny! | function layoutFolder(folder: meowFile, resolution: number): gridSpacePosition[] {
meow(`layoutFolder ${folder.path}`, 'layoutFolder', meowLevel.WARN);
// 获取文件夹内容
const items = Array.from(folder.contents!);
if (!items || items.length === 0) {
return [];
}
// 计算总大小
const totalSize = folder.size;
// ... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left layoutFolder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left folder AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | function layoutFolder(folder: meowFile, resolution: number): gridSpacePosition[] {
meow(`layoutFolder ${folder.path}`, 'layoutFolder', meowLevel.WARN);
// 获取文件夹内容
const items = Array.from(folder.contents!);
if (!items || items.length === 0) {
return [];
}
// 计算总大小
const totalSize = folder.size;
// ... | https://github.com/awaLiny2333/Spaceow/blob/d256e91c0feb34459ecf81ce388c749d614c3bfa/woof/src/main/ets/components/GridSpace.ets#L297-L342 | d57d96aad6dc62b4c94173f2b5032c2066417d1b | github |
CLMC2025/Vignette | entry/src/main/ets/database/repositories/WordRepository.ets | arkts | getSupportWords | Get support words (words that are not the target word, preferably learned) | async getSupportWords(targetWord: string, limit: number): Promise<WordItem[]> {
this.ensureInitialized();
const predicates = new relationalStore.RdbPredicates(TABLE_WORDS);
predicates.notEqualTo(WordColumns.WORD, targetWord)
.and()
.notEqualTo(WordColumns.STATUS, WordStatus.NEW) // Prefer lea... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getSupportWords AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ta... | async getSupportWords(targetWord: string, limit: number): Promise<WordItem[]> {
this.ensureInitialized();
const predicates = new relationalStore.RdbPredicates(TABLE_WORDS);
predicates.notEqualTo(WordColumns.WORD, targetWord)
.and()
.notEqualTo(WordColumns.STATUS, WordStatus.NEW) // Prefer lea... | https://github.com/CLMC2025/Vignette | c8755b099382826ee17c56c3855b86a89e2c8010 | github |
Joker-x-dev/CoolMallArkTS | feature/main/src/main/ets/viewmodel/MainViewModel.ets | arkts | createLottieControllers | 创建 Lottie 控制器列表
@returns {Array<LottieController>} 控制器列表 | private createLottieControllers(): Array<LottieController> {
return this.tabItems.map(() => new LottieController());
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left createLottieControllers 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... | private createLottieControllers(): Array<LottieController> {
return this.tabItems.map(() => new LottieController());
} | https://github.com/Joker-x-dev/CoolMallArkTS | d13b2d09131bda3dd8aae5023913739d0518131a | github |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/GlobalDataManager.ets | arkts | getCurrentIndex | 获取当前播放索引 | getCurrentIndex(): number {
return this.audioManager.getCurrentIndex();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentIndex 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#statem... | getCurrentIndex(): number {
return this.audioManager.getCurrentIndex();
} | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 05aafd72545fe2c17a49682165109f44657f96a9 | github |
silence17/harmonydemo | entry/src/main/ets/util/BasicDataSource.ets | arkts | getData | 获取索引值对应的数据
@param index | getData(index: number): T {
throw undefined;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#... | getData(index: number): T {
throw undefined;
} | https://github.com/silence17/harmonydemo | 719cbe2fb7a1a3b235f47251d10420cca889d66a | github |
RedRackham-R/WanAndroidHarmoney | entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets | arkts | getLoginInfo | 获取当前用户的登录信息
@returns | getLoginInfo(): ILoginRegist | null {
return this.loginInfo;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLoginInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifi... | getLoginInfo(): ILoginRegist | null {
return this.loginInfo;
} | https://github.com/RedRackham-R/WanAndroidHarmoney | 64b504ccce9894b81b1e4631596c3922e4947c6c | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateFactory.ets | arkts | getPresetStrategy | 获取预置模板策略 | getPresetStrategy(): PresetTemplateStrategy {
return this.presetStrategy;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPresetStrategy 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 PresetTemplateStrategy AST#identifier#Right ... | getPresetStrategy(): PresetTemplateStrategy {
return this.presetStrategy;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateFactory.ets#L236-L238 | c24ff4c660c7a340463bec962f6d7c361ff0485b | github |
seagazer/cclyric | lib/src/main/ets/view/LrcLineView.ets | arkts | getLyric | Return the lyric data of this view.
@returns The lyric data {@link LyricLine}. | getLyric(): LrcLine {
return this.lyricLine
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLyric 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 LrcLine AST#identifier#Right AST#ERROR#Right AST#stat... | getLyric(): LrcLine {
return this.lyricLine
} | https://github.com/seagazer/cclyric | b58aba8d46bc5a651ee007f29f1dc78459ddf25c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | addOnlineChapterInfo | 添加在线章节信息(完整版,支持所有字段) | public async addOnlineChapterInfo(chapterInput: OnlineChapterInfoInput): Promise<string> {
try {
// [严格验证] 必须提供有效的externalId
if (!chapterInput.externalId || chapterInput.externalId.trim() === '') {
const errorMsg = `❌ 严重错误:章节 "${chapterInput.title}" 缺少externalId!\n` +
` - comicId: $... | 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 addOnlineChapterInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapterInput AST#identifier#Right A... | public async addOnlineChapterInfo(chapterInput: OnlineChapterInfoInput): Promise<string> {
try {
// [严格验证] 必须提供有效的externalId
if (!chapterInput.externalId || chapterInput.externalId.trim() === '') {
const errorMsg = `❌ 严重错误:章节 "${chapterInput.title}" 缺少externalId!\n` +
` - comicId: $... | https://github.com/DaLongZhuaZi/manxia | fde20b1d0bcc5855c42e12b2e4882e0bd2337581 | github |
openharmony/arkui_ace_engine | examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets | arkts | toUtf8ByteArray | Returns a new array of bytes representing the given string encoded in UTF-8. | private static toUtf8ByteArray(str: string): Array<byte> {
str = encodeURI(str);
let result: Array<byte> = [];
for (let i = 0; i < str.length; i++) {
if (str.charAt(i) != "%") {
result.push(str.charCodeAt(i));
} else {
result.push(parseInt(str.substr(i + 1, 2), ... | 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 toUtf8ByteArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left ... | private static toUtf8ByteArray(str: string): Array<byte> {
str = encodeURI(str);
let result: Array<byte> = [];
for (let i = 0; i < str.length; i++) {
if (str.charAt(i) != "%") {
result.push(str.charCodeAt(i));
} else {
result.push(parseInt(str.substr(i + 1, 2), ... | https://gitee.com/openharmony/arkui_ace_engine.git | 720354546c84d904ceb3d7a80d61ace2f8df03f4 | gitee |
richshaw2015/nds | ohos/entry/src/main/ets/pages/settings/KeyMappingSettings.ets | arkts | formatBindingName | 格式化绑定显示名称 (ppsspp 风格)
键盘: kbd.Z / kbd.Enter / kbd.Up
手柄: pad1.[A] / pad1.L1 / pad1.Left | function formatBindingName(keyCode: number, isGamepad: boolean): string {
if (isGamepad) {
const name = PAD_KEY_NAMES[keyCode]
return name ? `pad1.${name}` : `pad1.${keyCode}`
} else {
// D-Pad 方向键在键盘映射中也可能出现
if (isDpadKeyCode(keyCode)) {
const dpadNames: Record<number, string> = { 2012: 'Up',... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left formatBindingName AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyCode AST#identifier#Right AST#type_annotation#Left AST#:#Left : A... | function formatBindingName(keyCode: number, isGamepad: boolean): string {
if (isGamepad) {
const name = PAD_KEY_NAMES[keyCode]
return name ? `pad1.${name}` : `pad1.${keyCode}`
} else {
// D-Pad 方向键在键盘映射中也可能出现
if (isDpadKeyCode(keyCode)) {
const dpadNames: Record<number, string> = { 2012: 'Up',... | https://github.com/richshaw2015/nds | 7c4001420d5a0a92a0e993b9b760384c4bac2afe | github |
CLMC2025/Vignette | entry/src/main/ets/manager/UserStateManager.ets | arkts | initializeWordState | 智能初始化单词状态
根据用户级别、单词属性等因素智能设置初始状态 | initializeWordState(word: WordItem): UserWordState {
const wordText = word.word.toLowerCase();
// 1. 高频词默认进入复习
if (this.isHighFrequencyWord(wordText)) {
return UserWordState.REVIEW;
}
// 2. 根据用户级别设置不同策略
switch (this.currentUserLevel) {
case UserLevel.BEGINNER:
// ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left initializeWordState 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#Left WordItem AST#identifier#Right AST#)#... | initializeWordState(word: WordItem): UserWordState {
const wordText = word.word.toLowerCase();
// 1. 高频词默认进入复习
if (this.isHighFrequencyWord(wordText)) {
return UserWordState.REVIEW;
}
// 2. 根据用户级别设置不同策略
switch (this.currentUserLevel) {
case UserLevel.BEGINNER:
// ... | https://github.com/CLMC2025/Vignette | 06b7d65162c23bf984a8b695215c2d037cdae869 | github |
XHXYT/Pixark | entry/src/main/ets/viewmodel/IllustDetailViewModel.ets | arkts | followOrCancel | 关注/取消关注 (本地状态同步) | async followOrCancel(result: boolean, err?: string) {
this.isFollow = result;
if (this.detailData)
this.detailData.user.is_followed = result;
} | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left followOrCancel AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Le... | async followOrCancel(result: boolean, err?: string) {
this.isFollow = result;
if (this.detailData)
this.detailData.user.is_followed = result;
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/IllustDetailViewModel.ets#L231-L235 | b715e0a6bb225fd9896c3c4606257bb59f4458be | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/IFileStorage.ets | arkts | constructor | 文件内容信息
@param fileInfo 文件信息
@param content 数据库内容 | constructor(fileInfo: FileInfo, content: ArrayBuffer) {
this.name = fileInfo.name;
this.size = fileInfo.size;
this.modifiedTime = fileInfo.modifiedTime;
this.path = fileInfo.path;
this.content = content;
this.type = fileInfo.type;
this.childrenCount = fileInfo.childrenCount;
} | 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 fileInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left FileInfo AST#identifier#R... | constructor(fileInfo: FileInfo, content: ArrayBuffer) {
this.name = fileInfo.name;
this.size = fileInfo.size;
this.modifiedTime = fileInfo.modifiedTime;
this.path = fileInfo.path;
this.content = content;
this.type = fileInfo.type;
this.childrenCount = fileInfo.childrenCount;
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/IFileStorage.ets#L121-L129 | dcde9c14c93e3234147c0279d5eb7473b1391fda | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/Rect.ets | arkts | set | Set the rectangle's coordinates to the specified values. Note: no range
checking is performed, so it is up to the caller to ensure that
left <= right and top <= bottom.
@param left The X coordinate of the left side of the rectangle
@param top The Y coordinate of the top of the rectangle
@param right The X coordin... | public set(left: number, top: number, right: number, bottom: number) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left left AST#identifier#Right AST#:#Left : AST#:#... | public set(left: number, top: number, right: number, bottom: number) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 5df9a85a43687e1cfa17045b010188f0cf8338aa | gitee |
Joker-x-dev/CoolMallArkTS | core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets | arkts | toModel | 将数据库行数据转换为领域模型
@param {SearchHistoryRow} row 数据库行数据
@returns {SearchHistory} 领域模型 | private toModel(row: SearchHistoryRow): SearchHistory {
const history: SearchHistory = new SearchHistory();
history.keyword = row.keyword ?? "";
history.searchTime = Number(row.search_time ?? Date.now());
return history;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left toModel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left row AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Search... | private toModel(row: SearchHistoryRow): SearchHistory {
const history: SearchHistory = new SearchHistory();
history.keyword = row.keyword ?? "";
history.searchTime = Number(row.search_time ?? Date.now());
return history;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 5ba2d9c720e58857c6948bcfed07b07f87b54f08 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets | arkts | values | Returns the values of the fields of an object
@param o an object
@returns an array containing the given object's own string-keyed field values | public static values(o: Object): Any[] {
if (o instanceof Char ||
o instanceof Boolean ||
o instanceof Byte ||
o instanceof Short ||
o instanceof Int ||
o instanceof Long ||
o instanceof Float ||
o instanceof Double) {
... | 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 values AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right ... | public static values(o: Object): Any[] {
if (o instanceof Char ||
o instanceof Boolean ||
o instanceof Byte ||
o instanceof Short ||
o instanceof Int ||
o instanceof Long ||
o instanceof Float ||
o instanceof Double) {
... | https://gitcode.com/iop123123/arkts-static-skills | dd3fe8a23fc0c2fe370220df4240e18d6d84b70c | gitcode |
cpdd5201314/harmonyOS-music-app | products/phone/src/main/ets/pages/WYCrypto.ets | arkts | generateLinuxForwardForm | 生成网易云 linux forward 请求的 form 数据
@param method 目标接口的 HTTP 方法
@param url 目标接口的 URL
@param params 目标接口的参数
@returns form 数据字符串 | public static async generateLinuxForwardForm(
method: string,
url: string,
params: ESObject
): Promise<string> {
const requestObj: ESObject = {
method: method,
url: url,
params: params
};
const eparams = await WYCrypto.linuxapi(requestObj);
return `eparams=${eparams}`;... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left generateLinuxForwardForm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifie... | public static async generateLinuxForwardForm(
method: string,
url: string,
params: ESObject
): Promise<string> {
const requestObj: ESObject = {
method: method,
url: url,
params: params
};
const eparams = await WYCrypto.linuxapi(requestObj);
return `eparams=${eparams}`;... | https://github.com/cpdd5201314/harmonyOS-music-app | b41d600a2168f608155939fce4ece14f180c8e70 | github |
openharmony/codelabs | ETSUI/PositioningDemo/entry/src/main/ets/service/ReminderService.ets | arkts | clearReminderHistory | 清除提醒历史 | clearReminderHistory(): void {
this.reminderHistory = [];
this.state.activeReminders.clear();
console.log('提醒历史已清除');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearReminderHistory 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#stateme... | clearReminderHistory(): void {
this.reminderHistory = [];
this.state.activeReminders.clear();
console.log('提醒历史已清除');
} | https://gitcode.com/openharmony/codelabs | 10d41c66f2a5af8a5b66c339354e05776b32d00a | gitcode |
HarmonyOS_Samples/HarmonyOSComponentUXExamples | products/pc/src/main/ets/components/input/search/components/MixedStyleSearch.ets | arkts | TrailingButton | Extract common right icon button (Scan / Dot Grid) | @Builder
function TrailingButton() {
Button({ type: ButtonType.Circle, stateEffect: true }) {
SymbolGlyph($r('sys.symbol.dot_grid_2x2'))
.fontSize($r('sys.float.Title_M'))
.fontColor([$r('sys.color.icon_primary')])
}
.width(SizeToken.SIZE_NUM_40)
.height(SizeToken.SIZE_NUM_40)
.backgroundColor... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left TrailingButton AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#... | @Builder
function TrailingButton() {
Button({ type: ButtonType.Circle, stateEffect: true }) {
SymbolGlyph($r('sys.symbol.dot_grid_2x2'))
.fontSize($r('sys.float.Title_M'))
.fontColor([$r('sys.color.icon_primary')])
}
.width(SizeToken.SIZE_NUM_40)
.height(SizeToken.SIZE_NUM_40)
.backgroundColor... | https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples | cfe88645a0350d99e5fa73d8216110a820b8c328 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/query/SubQuery.ets | arkts | getConditions | 获取所有过滤条件
@returns 条件数组 | getConditions(): Array<WhereCondition> {
return this.conditions
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getConditions 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#:#Lef... | getConditions(): Array<WhereCondition> {
return this.conditions
} | https://github.com/offlinecat-dev/OCNetORM | 8b61b54992d4704399bfdf000d2a3b2f6b0ed39d | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.