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 |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony-tpc/openharmony_tpc_samples | OhosVideoCache/library/src/main/ets/HttpProxyCacheServerBuilder.ets | arkts | maxCacheSize | Sets max cache size in bytes.
<p>
All files that exceeds limit will be deleted using LRU strategy.
Default value is 512 Mb.
</p>
Note this method overrides result of calling {@link #maxCacheFilesCount(int)}
@param maxSize max cache size in bytes.
@return a builder. | public maxCacheSize(maxSize: number): HttpProxyCacheServerBuilder {
this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left maxCacheSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left maxSize AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Ri... | public maxCacheSize(maxSize: number): HttpProxyCacheServerBuilder {
this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
return this;
} | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | 8eb6ccc7124b19a40afa6deaf3d7b7ecbb6d0044 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/RhinoWasmExecutor.ets | arkts | startStatusCheck | 启动状态检查 | private startStatusCheck(): void {
if (this.statusCheckInterval !== null) {
return;
}
// 每5秒检查一次任务结果
this.statusCheckInterval = setInterval(() => {
this.checkPendingTasks();
}, 1000) as number;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left startStatusCheck 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#ex... | private startStatusCheck(): void {
if (this.statusCheckInterval !== null) {
return;
}
// 每5秒检查一次任务结果
this.statusCheckInterval = setInterval(() => {
this.checkPendingTasks();
}, 1000) as number;
} | https://github.com/DaLongZhuaZi/manxia | fc0ccc4fed8375eb1696d57caba952dd6960f2c6 | github |
arkui-x/samples | CodeLab/Cases/feature/chatwithexpression/src/main/ets/model/Message.ets | arkts | constructor | Span、ImageSpan 信息列表 | constructor(self: boolean, userName: string, profilePicture: string, maxWidth: number) {
this.isSelf = self;
this.userName = userName;
this.profilePicture = profilePicture;
this.maxWidth = maxWidth;
} | 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 self AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right ... | constructor(self: boolean, userName: string, profilePicture: string, maxWidth: number) {
this.isSelf = self;
this.userName = userName;
this.profilePicture = profilePicture;
this.maxWidth = maxWidth;
} | https://gitcode.com/arkui-x/samples | 5ba22d944bd78e4a5914eab6daec6a0773b8d874 | gitcode |
openharmony/applications_mms | entry/src/main/ets/workers/WorkFactory.ets | arkts | getTask | Get the Task for worker
@param workerPort ThreadWorkerGlobalScope
@param message worker message data
@return WorkerTask for the message | static getTask(workerPort: ThreadWorkerGlobalScope, message: MessageEvents): WorkerTask {
let data = <WorkerMessage> message.data;
let type = data.type;
HiLog.i(TAG, `getTask in ${WorkerType[type]}.`)
let task: WorkerTask = null;
if (type == WorkerType.DataWorker) {
HiLog.w(TAG, 'getTask ' +... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left workerPort AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Th... | static getTask(workerPort: ThreadWorkerGlobalScope, message: MessageEvents): WorkerTask {
let data = <WorkerMessage> message.data;
let type = data.type;
HiLog.i(TAG, `getTask in ${WorkerType[type]}.`)
let task: WorkerTask = null;
if (type == WorkerType.DataWorker) {
HiLog.w(TAG, 'getTask ' +... | https://gitee.com/openharmony/applications_mms.git | 56b533f9c1162744ff64bdb4e2f2395df034f26e | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | subarray | Creates a BigUint64Array with the same ArrayBuffer
@param begin start index, inclusive
@returns new BigUint64Array with the same ArrayBuffer | public subarray(begin: number): BigUint64Array {
return this.subarray(begin as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left subarray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left begin AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number... | public subarray(begin: number): BigUint64Array {
return this.subarray(begin as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e762332295828a97e759cb7000b392d2be935f92 | gitee |
Joker-x-dev/CoolMallArkTS | feature/main/src/main/ets/viewmodel/MeViewModel.ets | arkts | isFootprintSectionVisible | 是否显示足迹区域
@returns {boolean} 是否显示 | isFootprintSectionVisible(): boolean {
return this.recentFootprints.length > 0;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isFootprintSectionVisible AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Rig... | isFootprintSectionVisible(): boolean {
return this.recentFootprints.length > 0;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 3a3cbb9683be82ee3ffd0e54ff5fbd01dfc34f4c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Task/BackgroundTaskHelper.ets | arkts | handleAutoRefresh | 自动续期处理 | private static async handleAutoRefresh(): Promise<void> {
if (BackgroundTaskHelper.activeOwners.size === 0 || BackgroundTaskHelper.currentContext === null) {
logger.warn(TAG, '自动续期时发现没有有效持有者或上下文,已停止续期');
BackgroundTaskHelper.stopAutoRefresh();
return;
}
if (!BackgroundTaskHelper.taskRun... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left handleAutoRefresh AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arg... | private static async handleAutoRefresh(): Promise<void> {
if (BackgroundTaskHelper.activeOwners.size === 0 || BackgroundTaskHelper.currentContext === null) {
logger.warn(TAG, '自动续期时发现没有有效持有者或上下文,已停止续期');
BackgroundTaskHelper.stopAutoRefresh();
return;
}
if (!BackgroundTaskHelper.taskRun... | https://github.com/DaLongZhuaZi/manxia | 6eae96379314e6b71568362f43caa153c17ee327 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets | arkts | requireNodeElement | Reads an element from a node and throws when an invariant violation is detected.
This keeps internal corruption visible instead of relying on unchecked non-null assertions.
@param { ListNode<T> } node The node that should carry an element.
@returns { T } The element stored in the node.
@syscap SystemCapability.Utils.La... | private requireNodeElement(node: ListNode<T>): T {
const element = node.element;
if (element === undefined) {
throw new Error("LinkedConcurrentQueue:: missing first element");
}
return element;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left requireNodeElement AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left node AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiat... | private requireNodeElement(node: ListNode<T>): T {
const element = node.element;
if (element === undefined) {
throw new Error("LinkedConcurrentQueue:: missing first element");
}
return element;
} | https://gitcode.com/iop123123/arkts-static-skills | 811269c3a48ef3985d165e816fd279e05ad39a30 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncArrayConcurrentQueue.ets | arkts | size | Returns the size of an ArrayConcurrentQueue.
@returns { int } size
@syscap SystemCapability.Utils.Lang | public override get size(): int {
ConcurrencyHelpers.mutexLock(this.mutex);
try {
let size: int = 0;
if (this.curTailIdx >= this.curHeadIdx && !this.isQueueFull) {
size = this.curTailIdx - this.curHeadIdx;
} else {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#get#Left get AST#get#Right AST#identifier#Left size AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) ... | public override get size(): int {
ConcurrencyHelpers.mutexLock(this.mutex);
try {
let size: int = 0;
if (this.curTailIdx >= this.curHeadIdx && !this.isQueueFull) {
size = this.curTailIdx - this.curHeadIdx;
} else {
... | https://gitcode.com/iop123123/arkts-static-skills | 1c5e94bf52050aac9d7910974de24eaef7c8a483 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/SnapshotCapture.ets | arkts | delay | 延迟工具方法 | private delay(ms: number): 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 delay AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ms AST#i... | private delay(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
} | https://github.com/DaLongZhuaZi/manxia | 85ac179f6c7bb75e1addcec3ba00f2cb21fbab1d | github |
LongLiveY96/chatcube | entry/src/main/ets/services/WebDAVSyncService.ets | arkts | previewLocal | 预览本地 zip(在下载之后调用) | async previewLocal(localPath: string): Promise<ImportPreview> {
return await ImportExportService.getInstance().previewImport(localPath)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left previewLocal AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left localPath AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async previewLocal(localPath: string): Promise<ImportPreview> {
return await ImportExportService.getInstance().previewImport(localPath)
} | https://github.com/LongLiveY96/chatcube | 3971f15d1c357dddcb07d55fcec1dbb6c3c62fee | github |
openharmony/codelabs | ETSUI/PassNote/entry/src/main/ets/pages/NumberPassPage.ets | arkts | handleClear | 事件处理: handleClear
描述: 处理清空按钮点击事件。
逻辑: 将 password 重置为空字符串。
清空输入 | handleClear() {
this.password = '';
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleClear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | handleClear() {
this.password = '';
} | https://gitcode.com/openharmony/codelabs | 86778638abf012e7b9a007aa07a720253c71ab90 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | getMilliseconds | Returns the milliseconds in the specified date according to local time.
@returns { int }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getMilliseconds(): int {
let localTime = this.ms - this.TZOffset * 60 * msPerSecond;
return ecmaMsFromTime(localTime);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMilliseconds 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 int AS... | public getMilliseconds(): int {
let localTime = this.ms - this.TZOffset * 60 * msPerSecond;
return ecmaMsFromTime(localTime);
} | https://gitcode.com/iop123123/arkts-static-skills | 997fa8a9b8bac7d4027819b942ae3c3b28d9b670 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/UnifiedDownloadManager.ets | arkts | cancelTask | 取消/删除下载任务 | public async cancelTask(taskId: string): Promise<boolean> {
const task = this.unifiedTasks.get(taskId);
if (!task) {
logger.warn(TAG, `任务不存在: ${taskId}`);
return false;
}
try {
if (task.type === UnifiedDownloadType.MANGA) {
await this.mangaDownloadManager.deleteTask(task... | 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 cancelTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifier#Right AST#:#Left : AST#... | public async cancelTask(taskId: string): Promise<boolean> {
const task = this.unifiedTasks.get(taskId);
if (!task) {
logger.warn(TAG, `任务不存在: ${taskId}`);
return false;
}
try {
if (task.type === UnifiedDownloadType.MANGA) {
await this.mangaDownloadManager.deleteTask(task... | https://github.com/DaLongZhuaZi/manxia | 74f718c0f988f57175bfd562587472d536cc4adf | github |
LongLiveY96/chatcube | entry/src/main/ets/services/ImportExportService.ets | arkts | previewImport | ============ 导入功能 ============ | async previewImport(zipPath: string): Promise<ImportPreview> {
if (this.context === null) {
throw new Error('Service not initialized')
}
try {
console.info('ImportExportService', `Starting preview import from: ${zipPath}`)
const tempDir = `${this.context.cacheDir}/import_preview_${Date... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left previewImport AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left zipPath AST#identifier#Right AS... | async previewImport(zipPath: string): Promise<ImportPreview> {
if (this.context === null) {
throw new Error('Service not initialized')
}
try {
console.info('ImportExportService', `Starting preview import from: ${zipPath}`)
const tempDir = `${this.context.cacheDir}/import_preview_${Date... | https://github.com/LongLiveY96/chatcube | a2e38689b4c63be4eca680da9136644386c4c136 | github |
openharmony/applications_mms | entry/src/main/ets/utils/MmsPreferences.ets | arkts | getValueOfAutoDeleteInfoSwitch | Obtains the value of the automatic deletion notification switch. | public getValueOfAutoDeleteInfoSwitch(): string {
return <string> this.getValueFromMap(common.string.KEY_OF_AUTO_DELETE_INFO_SWITCH, common.bool.FALSE);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getValueOfAutoDeleteInfoSwitch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#... | public getValueOfAutoDeleteInfoSwitch(): string {
return <string> this.getValueFromMap(common.string.KEY_OF_AUTO_DELETE_INFO_SWITCH, common.bool.FALSE);
} | https://gitee.com/openharmony/applications_mms.git | df546169290fa6c646c832f51b728827151daf8e | gitee |
openharmony-sig/applications_calculator | common/src/main/ets/util/CommonUtil.ets | arkts | checkIfDeviceIsPC | Check whether the current device is a pc.
@return {boolean} Whether the current device is a pc. | static checkIfDeviceIsPC(): boolean {
return deviceInfo.deviceType === DEVICE_TYPE_PC;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkIfDeviceIsPC AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean... | static checkIfDeviceIsPC(): boolean {
return deviceInfo.deviceType === DEVICE_TYPE_PC;
} | https://gitee.com/openharmony-sig/applications_calculator.git | 3c91802265ac24bb8e9f83bedeef3e09f170056e | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/EBookDataManager.ets | arkts | getReadingSettings | 获取阅读设置(包含纯文本阅读器专用设置) | private async getReadingSettings(bookId: string): Promise<EBookReadingSettings | null> {
// 确保表结构完整
await this.ensureSettingsColumns();
try {
// 使用显式字段名查询(SELECT * 可能不返回通过 ALTER TABLE 或 UPDATE 添加的字段)
const sql = `SELECT
bookId, userId, fontSize, fontFamily, fontPath, fontWeight, ... | 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 getReadingSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bookId AST#identifier#Right AST#:#... | private async getReadingSettings(bookId: string): Promise<EBookReadingSettings | null> {
// 确保表结构完整
await this.ensureSettingsColumns();
try {
// 使用显式字段名查询(SELECT * 可能不返回通过 ALTER TABLE 或 UPDATE 添加的字段)
const sql = `SELECT
bookId, userId, fontSize, fontFamily, fontPath, fontWeight, ... | https://github.com/DaLongZhuaZi/manxia | 296234de3a646065ebd90cd8e8bc3985ebb23735 | github |
cduestc-course/ArkLearn | entry/src/main/ets/pages/06/6.2.6.ets | arkts | getToken | 读取仓库中字段 | static getToken(content:Context, storeName:string=PreferencesClass.defaultStore){
const store = preferences.getPreferencesSync(content,{name:storeName})
return store.getSync(PreferencesClass.tokenKey,'')
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getToken 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#identifier#Left Context AST#identifi... | static getToken(content:Context, storeName:string=PreferencesClass.defaultStore){
const store = preferences.getPreferencesSync(content,{name:storeName})
return store.getSync(PreferencesClass.tokenKey,'')
} | https://github.com/cduestc-course/ArkLearn | 83211ad86dbec74b7c457806d9c0b10a36571d2c | github |
openharmony/applications_calendar_data | datamanager/src/main/ets/processor/alerts/AlertsObserver.ets | arkts | startTimerAfterFiveSeconds | 开启一个定时器,并记录定时器ID和触发时间到 AlertsObserver 中去,该定时器会在5s后到期
@Param alertsObserver 表示 AlertsObserver 的实例 | function startTimerAfterFiveSeconds(alertsObserver: AlertsObserver, timerId: number) {
Log.debug(TAG, `start Timer begin`);
Log.debug(TAG, "A Timer has been created and Timer ID is:" + timerId);
let currentTime = new Date().getTime();
let triggerTime = currentTime + WAITING_DELAY_TIME;
Log.debug(TAG, "timer s... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left startTimerAfterFiveSeconds AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alertsObserver AST#identifier#Right AST#type_annotation#Lef... | function startTimerAfterFiveSeconds(alertsObserver: AlertsObserver, timerId: number) {
Log.debug(TAG, `start Timer begin`);
Log.debug(TAG, "A Timer has been created and Timer ID is:" + timerId);
let currentTime = new Date().getTime();
let triggerTime = currentTime + WAITING_DELAY_TIME;
Log.debug(TAG, "timer s... | https://gitee.com/openharmony/applications_calendar_data.git | 4df2584c55fae06ee31e587628898a79ae95eee0 | gitee |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/userdata/history/classes/meowHistoryIndexFileBundle.ets | arkts | init | Reads the index file and generate the map of keys to index data positins. | async init() {
// Read the index file.
const indexFileBundle = await readArrayBufferConcurrent(this.indexFilePath);
if (!indexFileBundle) {
meow(`Failed to read index file ${this.indexFilePath}`, 'meowHistoryIndexFileBundle', meowLevel.ERROR);
return;
}
// Read and parse
try {
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left init AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST... | async init() {
// Read the index file.
const indexFileBundle = await readArrayBufferConcurrent(this.indexFilePath);
if (!indexFileBundle) {
meow(`Failed to read index file ${this.indexFilePath}`, 'meowHistoryIndexFileBundle', meowLevel.ERROR);
return;
}
// Read and parse
try {
... | https://github.com/awaLiny2333/LinysBrowser_NEXT | a18173d2ae483e738c4e681fb7e6ab9eecd1ac5b | github |
openharmony/codelabs | Media/SimpleVideo/entry/src/main/ets/view/VideoPlayer.ets | arkts | prepared | video component prepared callback | prepared(duration: number) {
this.durationTime = duration;
let second: number = duration % COMMON_NUM_MINUTE;
let min: number = Number.parseInt((duration / COMMON_NUM_MINUTE).toString());
let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min;
let end = second < COMMON_NUM_DOUBLE ? `${ZERO... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left prepared AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left duration AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Le... | prepared(duration: number) {
this.durationTime = duration;
let second: number = duration % COMMON_NUM_MINUTE;
let min: number = Number.parseInt((duration / COMMON_NUM_MINUTE).toString());
let head = min < COMMON_NUM_DOUBLE ? `${ZERO_STR}${min}` : min;
let end = second < COMMON_NUM_DOUBLE ? `${ZERO... | https://gitee.com/openharmony/codelabs.git | 3ba21211d57d232566b18a0c6b004b07e59c7a13 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Workflow/WorkflowCapabilities.ets | arkts | createContext | 创建工作流上下文 | createContext(
sourceId: number,
sourceConfig: Record<string, Object>,
variables?: Record<string, string>
): WorkflowContext {
const capabilities = this.initializeCapabilities(sourceConfig);
const context: WorkflowContext = {
sourceId: sourceId,
variables: variables || {},
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createContext 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#,... | createContext(
sourceId: number,
sourceConfig: Record<string, Object>,
variables?: Record<string, string>
): WorkflowContext {
const capabilities = this.initializeCapabilities(sourceConfig);
const context: WorkflowContext = {
sourceId: sourceId,
variables: variables || {},
... | https://github.com/DaLongZhuaZi/manxia | 55555baf52b3dc57271ac9b0e51a8c6f11365445 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | setUTCSeconds | Sets the seconds for a specified date according to universal time.
@param { int } value new seconds
@param { int } ms
@returns { long }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public setUTCSeconds(value: int, ms: int): long {
this.setUTCSeconds(value);
this.setUTCMilliseconds(ms);
return this.ms;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setUTCSeconds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifie... | public setUTCSeconds(value: int, ms: int): long {
this.setUTCSeconds(value);
this.setUTCMilliseconds(ms);
return this.ms;
} | https://gitcode.com/iop123123/arkts-static-skills | 5fb20be5ba1e7a4f76b7ed661ba6cdb5522b9ea8 | gitcode |
cduestc-course/ArkLearn | entry/src/main/ets/pages/06/6.1.2re-provide-consume-2.ets | arkts | build | @Consume themeColor:string | build() {
Column({ space: 10 }) {
Text('我是二级组件')
.fontSize(22)
.fontWeight(900)
SonSonComponent()
}
.backgroundColor(this.inThemeColor)
.alignItems(HorizontalAlign.Center)
.width('90%')
.margin({ top: 10 })
.padding(10)
.borderWidth(2)
.borderRadius(10)... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c... | build() {
Column({ space: 10 }) {
Text('我是二级组件')
.fontSize(22)
.fontWeight(900)
SonSonComponent()
}
.backgroundColor(this.inThemeColor)
.alignItems(HorizontalAlign.Center)
.width('90%')
.margin({ top: 10 })
.padding(10)
.borderWidth(2)
.borderRadius(10)... | https://github.com/cduestc-course/ArkLearn | 4d63ceb6d1b57c89f5d22b414ac9c4f225ea269f | github |
openharmony/arkui_ace_engine | advanced_ui_component/treeviewv2/source/treeviewv2.ets | arkts | onceNodeModify | Node modify event registration and processing (once).
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 26 | public onceNodeModify(callback: OnChangedCallback): void {
this.nodeModifyOnceEvents.push(callback);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onceNodeModify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | public onceNodeModify(callback: OnChangedCallback): void {
this.nodeModifyOnceEvents.push(callback);
} | https://gitcode.com/openharmony/arkui_ace_engine | e476a1e699f8dd5b36df1d6338e687189a2a9e08 | gitcode |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanUtils.ets | arkts | calculateCompressionRatio | 计算压缩比
@param originalSize 原文件大小
@param compressedSize 压缩后文件大小
@returns 压缩比百分比 | static calculateCompressionRatio(originalSize: number, compressedSize: number): number {
if (originalSize === 0) {
return 0;
}
const ratio = ((originalSize - compressedSize) / originalSize) * 100;
return Math.round(ratio * 100) / 100;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateCompressionRatio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left originalSize AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left nu... | static calculateCompressionRatio(originalSize: number, compressedSize: number): number {
if (originalSize === 0) {
return 0;
}
const ratio = ((originalSize - compressedSize) / originalSize) * 100;
return Math.round(ratio * 100) / 100;
} | https://github.com/kumaleap/ArkLuban | 18c7d0425d10a248f053023a3ec57b3b2c183c6d | github |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/data/api/ApiClient.ets | arkts | request | 通用请求方法 | async request<T>(options: RequestOptions): Promise<ApiResponse<T>> {
const config = this.config
const token = this.getToken()
// 构建完整URL
const fullUrl = options.url?.startsWith('http') ? options.url : `${config.baseUrl}${options.url}`
// 创建HTTP请求
const httpRequest = http.createHttp()
//... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#ERROR#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type_identifier#Right AST#type_parameter#Right AST#>#Left > AST#>#... | async request<T>(options: RequestOptions): Promise<ApiResponse<T>> {
const config = this.config
const token = this.getToken()
// 构建完整URL
const fullUrl = options.url?.startsWith('http') ? options.url : `${config.baseUrl}${options.url}`
// 创建HTTP请求
const httpRequest = http.createHttp()
//... | https://github.com/David8Idira/AI-OA | fcaf6ac3246037d8a9f771dd7b8497d41d811696 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/customkey/CustomKeyTypes.ets | arkts | buildWheelPadPresets | 构建轮盘菜单预设列表 | function buildWheelPadPresets(): KeyPreset[] {
const seg1: WheelPadSegment = { label: '1', action: { type: 'keyboard', vk: 0x31 } as KeyboardAction };
const seg2: WheelPadSegment = { label: '2', action: { type: 'keyboard', vk: 0x32 } as KeyboardAction };
const seg3: WheelPadSegment = { label: '3', action: { type:... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left buildWheelPadPresets AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#array_... | function buildWheelPadPresets(): KeyPreset[] {
const seg1: WheelPadSegment = { label: '1', action: { type: 'keyboard', vk: 0x31 } as KeyboardAction };
const seg2: WheelPadSegment = { label: '2', action: { type: 'keyboard', vk: 0x32 } as KeyboardAction };
const seg3: WheelPadSegment = { label: '3', action: { type:... | https://github.com/AlkaidLab/moonlight-harmony | 55f78b445ac25c00a93d1e96ee22d2a160776a2b | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/KdbxUtils.ets | arkts | getTotpUrl | 从条目中获取TOTP URL
@param itemEntry 条目
@returns TOTP URL数组 | public static getTotpUrl(itemEntry: KdbxEntry): Array<string> {
if (!itemEntry) {
return [];
}
// 使用兼容层管理器提取 OTP URL
return OtpCompatibilityManager.getInstance().extractOtpUrls(itemEntry);
} | 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 getTotpUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left itemEntry AST#identifier#Right AST#:#Left : ... | public static getTotpUrl(itemEntry: KdbxEntry): Array<string> {
if (!itemEntry) {
return [];
}
// 使用兼容层管理器提取 OTP URL
return OtpCompatibilityManager.getInstance().extractOtpUrls(itemEntry);
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/KdbxUtils.ets#L632-L638 | b0a525036e93006095b023a5e3d24cfa0c164db5 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | valueOf | Return a string representing the value of this Decimal.
Unlike `toString`, negative zero will include the minus sign.
@returns { string } the string type | public valueOf(): string {
let str = this.finiteToString(this.exponent <= Decimal.toExpNeg || this.exponent >= Decimal.toExpPos);
return this.isNegative() ? '-' + str : str;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left valueOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#... | public valueOf(): string {
let str = this.finiteToString(this.exponent <= Decimal.toExpNeg || this.exponent >= Decimal.toExpPos);
return this.isNegative() ? '-' + str : str;
} | https://gitcode.com/iop123123/arkts-static-skills | 896c4bde14aced6d0b5a6c3b0e5a62f96a98307e | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/database/CacheManager.ets | arkts | get | 获取缓存数据
@param key 缓存键
@returns 缓存的值,如果不存在或已过期则返回 null
功能:
- 自动检查过期时间
- 过期数据自动删除
- 返回有效数据或 null | static get<T>(key: string): T | null {
const entry = CacheManager.cache.get(key);
if (!entry) {
console.log(`[CacheManager] 缓存未命中: ${key}`);
return null;
}
// 检查是否过期
const now = Date.now();
if (now > entry.expireAt) {
console.log(`[CacheManager] 缓存已过期: ${key}`);
C... | AST#program#Left AST#ERROR#Left AST#binary_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_param... | static get<T>(key: string): T | null {
const entry = CacheManager.cache.get(key);
if (!entry) {
console.log(`[CacheManager] 缓存未命中: ${key}`);
return null;
}
// 检查是否过期
const now = Date.now();
if (now > entry.expireAt) {
console.log(`[CacheManager] 缓存已过期: ${key}`);
C... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 662437d2bc8ae485ba4f98eb14ec2ab2b4081abd | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | of | Creates a new Uint16Array using initializer
@param { FixedArray<number> } data - initializer
@returns { Uint16Array } - a new Uint16Array from data
@throws { Error } - function not implemented
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public of(...data: FixedArray<number>): Uint16Array {
throw new Error("Uint16Array.of: not implemented")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left of AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left data A... | public of(...data: FixedArray<number>): Uint16Array {
throw new Error("Uint16Array.of: not implemented")
} | https://gitcode.com/iop123123/arkts-static-skills | ab988874b1eaa28a0e2a4033ece0f4a7105d5734 | gitcode |
erosTeam/NextE | shared/src/main/ets/model/EhGallery.ets | arkts | shortTitle | Cleaned title for a "similar" search (eros_fe `shortTitle`): strip [..]/(..)/{..} groups,
trim, and keep only the part before the first `|`. Used as `title:"<shortTitle>"`. | shortTitle(): string {
let s: string = this.title()
s = s.replace(/\[[^\]]*\]/g, '')
s = s.replace(/\([^)]*\)/g, '')
s = s.replace(/\{[^}]*\}/g, '')
s = s.trim()
const bar: number = s.indexOf('|')
if (bar >= 0) {
s = s.substring(0, bar)
}
return s.trim()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left shortTitle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statement_b... | shortTitle(): string {
let s: string = this.title()
s = s.replace(/\[[^\]]*\]/g, '')
s = s.replace(/\([^)]*\)/g, '')
s = s.replace(/\{[^}]*\}/g, '')
s = s.trim()
const bar: number = s.indexOf('|')
if (bar >= 0) {
s = s.substring(0, bar)
}
return s.trim()
} | https://github.com/erosTeam/NextE | 254d22064ee2ba2589129d14d98e219f0ff553f3 | github |
tdcare/tdwebrtc | src/main/ets/SignalingClient.ets | arkts | getCurrentCallType | 获取当前通话类型 | public getCurrentCallType(): CallType {
return this.currentCallType;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getCurrentCallType 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 Cal... | public getCurrentCallType(): CallType {
return this.currentCallType;
} | https://github.com/tdcare/tdwebrtc | 36ab4dd3256ae8588880078e3ad0aed36a4c3b2d | github |
RoooyHe/toona-ohos | toona/src/main/ets/pages/components/MessageBubble.ets | arkts | stopPlayAnimation | 停止播放动画,恢复满格静止状态 | stopPlayAnimation() {
if (this.animationInterval !== -1) {
clearInterval(this.animationInterval);
this.animationInterval = -1;
}
this.waveIndex = 3; // 停止时恢复显示完整声波
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left stopPlayAnimation 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#... | stopPlayAnimation() {
if (this.animationInterval !== -1) {
clearInterval(this.animationInterval);
this.animationInterval = -1;
}
this.waveIndex = 3; // 停止时恢复显示完整声波
} | https://github.com/RoooyHe/toona-ohos | 4c57bd47edc4f14241e7e5dccb255d80971f4b12 | github |
webabcd/HarmonyHttpServer | entry/src/main/ets/pages/AsyncDemo.ets | arkts | requestDemo2 | 通过 post 请求 http server,并获取服务端响应的 ArrayBuffer 数据 | requestDemo2() {
if (this.port == -1) {
this.message += '本地 http server 未启动\n'
return
}
// 构造本地请求的 url 地址
let url = `http://127.0.0.1:${this.port}/api?${Math.random()}`
let httpRequest = http.createHttp()
httpRequest.request(
url,
{
method: http.RequestMethod.... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left requestDemo2 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ... | requestDemo2() {
if (this.port == -1) {
this.message += '本地 http server 未启动\n'
return
}
// 构造本地请求的 url 地址
let url = `http://127.0.0.1:${this.port}/api?${Math.random()}`
let httpRequest = http.createHttp()
httpRequest.request(
url,
{
method: http.RequestMethod.... | https://github.com/webabcd/HarmonyHttpServer | 139732e40a9a6efed35e833e1c0397fd681f6b5a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Image/AvifDecoder.ets | arkts | createPixelMapFromRgba | 从RGBA像素数据创建PixelMap | private async createPixelMapFromRgba(pixels: Uint8Array, width: number, height: number): Promise<image.PixelMap | null> {
try {
// 创建ImageSource的初始化选项
const initOptions: image.InitializationOptions = {
size: { width, height },
pixelFormat: image.PixelMapFormat.RGBA_8888,
alphaT... | 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 createPixelMapFromRgba AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pixels AST#identifier#Right AS... | private async createPixelMapFromRgba(pixels: Uint8Array, width: number, height: number): Promise<image.PixelMap | null> {
try {
// 创建ImageSource的初始化选项
const initOptions: image.InitializationOptions = {
size: { width, height },
pixelFormat: image.PixelMapFormat.RGBA_8888,
alphaT... | https://github.com/DaLongZhuaZi/manxia | 47bb060bf06775b5bc5883606fe83427ba148e02 | github |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/JsonEncodingVisitor.ets | arkts | visitMapStringInt64 | 访问 map<string, int64> 字段
JSON: object with string values (避免精度丢失) | visitMapStringInt64(value: Map<string, bigint>, fieldNumber: number): void {
const fieldName = this.getFieldName(fieldNumber)
const obj: Record<string, Object> = {}
value.forEach((v, k) => {
obj[k] = v.toString() as Object
})
this.json[fieldName] = obj as Object
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitMapStringInt64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Map AST#identifie... | visitMapStringInt64(value: Map<string, bigint>, fieldNumber: number): void {
const fieldName = this.getFieldName(fieldNumber)
const obj: Record<string, Object> = {}
value.forEach((v, k) => {
obj[k] = v.toString() as Object
})
this.json[fieldName] = obj as Object
} | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | b039aae96a89c198518235a5ba65743f50fbb28f | gitcode |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | createNewSession | 创建新会话 | async createNewSession(
title: string = '',
assistantId: string = 'default',
modelIdSeed: string = '',
providerIdSeed: string = ''
): Promise<ChatSession> {
const session = await this.sessionStore.createNewSession(title, assistantId, modelIdSeed, providerIdSeed)
this.currentSession =... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createNewSession AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left title AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async createNewSession(
title: string = '',
assistantId: string = 'default',
modelIdSeed: string = '',
providerIdSeed: string = ''
): Promise<ChatSession> {
const session = await this.sessionStore.createNewSession(title, assistantId, modelIdSeed, providerIdSeed)
this.currentSession =... | https://github.com/LongLiveY96/chatcube | 7e29670f983893c9f731957b907259eb964e21cd | github |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/view/PrivacyDialogComponent.ets | arkts | dialogButtonStyle | 按钮公共样式 | @Extend(Text)
function dialogButtonStyle() {
.fontSize(16)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.layoutWeight(CommonConstants.COMMON_LAYOUT_WEIGHT)
.height(40)
.borderRadius(20)
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R... | @Extend(Text)
function dialogButtonStyle() {
.fontSize(16)
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Medium)
.layoutWeight(CommonConstants.COMMON_LAYOUT_WEIGHT)
.height(40)
.borderRadius(20)
} | https://github.com/qiuhaotc/Sunshine_HarmonyOS | 4e8f124bb816be5179958f0267d2317c0c37b77d | github |
YDYm233/EasyRandom_HarmonyNextApp | common/VitalUI/src/main/ets/components/ColorPickerComponent/ColorPickerDialog.ets | arkts | aboutToAppear | ─── Lifecycle ────────────────────────────────────────────────── | aboutToAppear(): void {
this.resetToColor(this.initialColor)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.resetToColor(this.initialColor)
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | bab3a5c38b93ac60c916c77292b2e7dcc941a90f | github |
pangpang20/antennaPodHM | entry/src/main/ets/service/SettingsService.ets | arkts | setEnableNotifications | 设置启用通知 | async setEnableNotifications(enabled: boolean): Promise<void> {
this.settings.enableNotifications = enabled;
await this.saveSettings();
} | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setEnableNotifications AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#requir... | async setEnableNotifications(enabled: boolean): Promise<void> {
this.settings.enableNotifications = enabled;
await this.saveSettings();
} | https://github.com/pangpang20/antennaPodHM | fb31c69b109548217580091ea19b8cb59d78974e | github |
the-wwyang/kids-learning-app | src/main/ets/storage/AchievementManager.ets | arkts | getUserAchievements | 获取用户的所有成就 | public async getUserAchievements(): Promise<Achievement[]> {
const currentUser = appStorage.getCurrentUser();
if (this.dataPreferences === null || currentUser === null) {
return this.allAchievements.slice();
}
try {
const username = currentUser.username;
const key = `${AchievementMa... | 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 getUserAchievements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | public async getUserAchievements(): Promise<Achievement[]> {
const currentUser = appStorage.getCurrentUser();
if (this.dataPreferences === null || currentUser === null) {
return this.allAchievements.slice();
}
try {
const username = currentUser.username;
const key = `${AchievementMa... | https://github.com/the-wwyang/kids-learning-app | 200ae88e61e6ca82f4881dc6ec549abe68745d80 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/UnifiedDownloadManager.ets | arkts | getTasksByStatus | 获取指定状态的下载任务 | public getTasksByStatus(status: UnifiedTaskStatus): UnifiedDownloadTask[] {
return this.getIndexedTasks(this.taskIdsByStatus.get(status));
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTasksByStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left status AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | public getTasksByStatus(status: UnifiedTaskStatus): UnifiedDownloadTask[] {
return this.getIndexedTasks(this.taskIdsByStatus.get(status));
} | https://github.com/DaLongZhuaZi/manxia | 8a19b8bec4d451f46476b588ce11c977a8261d1f | github |
LongLiveY96/chatcube | entry/src/main/ets/services/AIApiService.ets | arkts | sendChatRequest | 发送聊天请求 | async sendChatRequest(
config: AIApiConfig,
messages: RequestMessage[],
model: string,
temperature?: number,
maxTokens?: number,
reasoningLevel: ReasoningLevel = ReasoningLevel.OFF
): Promise<AIApiResult> {
const url = this.buildChatUrl(config, model)
const requestBody = this.buildRe... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left sendChatRequest AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left config AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async sendChatRequest(
config: AIApiConfig,
messages: RequestMessage[],
model: string,
temperature?: number,
maxTokens?: number,
reasoningLevel: ReasoningLevel = ReasoningLevel.OFF
): Promise<AIApiResult> {
const url = this.buildChatUrl(config, model)
const requestBody = this.buildRe... | https://github.com/LongLiveY96/chatcube | 27aa3dc4f481499576d0e2215229491422d2135b | github |
openharmony/codelabs | ETSUI/MemoTime/entry/src/main/ets/model/Tag.ets | arkts | fromDbObject | 从数据库对象创建 Tag 实例 | static fromDbObject(obj: relationalStore.ValuesBucket): Tag {
const tag = new Tag()
tag.id = obj['id'] as string
tag.name = obj['name'] as string
tag.color = obj['color'] as string
tag.icon = obj['icon'] as string
tag.scheduleCount = obj['scheduleCount'] as number
tag.createdAt = obj['crea... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left fromDbObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Le... | static fromDbObject(obj: relationalStore.ValuesBucket): Tag {
const tag = new Tag()
tag.id = obj['id'] as string
tag.name = obj['name'] as string
tag.color = obj['color'] as string
tag.icon = obj['icon'] as string
tag.scheduleCount = obj['scheduleCount'] as number
tag.createdAt = obj['crea... | https://gitcode.com/openharmony/codelabs | deef6046cf36160622db96647d7c07c31450d29b | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/VariableReplacer.ets | arkts | getNestedValue | 获取嵌套属性值 | private static getNestedValue(obj: Record<string, Object | undefined>, path: string): string | number | boolean | undefined {
const keys = path.split('.');
let current: Object | undefined = obj;
for (const key of keys) {
if (current === null || current === undefined) {
return undefined;
... | 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 getNestedValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left :... | private static getNestedValue(obj: Record<string, Object | undefined>, path: string): string | number | boolean | undefined {
const keys = path.split('.');
let current: Object | undefined = obj;
for (const key of keys) {
if (current === null || current === undefined) {
return undefined;
... | https://github.com/DaLongZhuaZi/manxia | 154684f2062e62d1ca1007ddfcf628fd05c85a64 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/unary_minus/unary_minus_ulong.ets | arkts | main | ---
desc: check unary minus operation for unsigned long integer operand
--- | function main(): void {
const value: ulong = {{v.value}}
assert -(value) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const value: ulong = {{v.value}}
assert -(value) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 86f7e764e08d8671f6451904edda7acfbe3dd12c | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | getHighestVisibleX | Returns the highest x-index (value on the x-axis) that is still visible
on the chart.
@return | public getHighestVisibleX(): number {
let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT);
if (transformer) {
transformer.getValuesByTouchPoint(this.mViewPortHandler.contentRight(),
this.mViewPortHandler.contentBottom(), this.posForGetHighestVisibleX);
}
let r... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHighestVisibleX AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number ... | public getHighestVisibleX(): number {
let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT);
if (transformer) {
transformer.getValuesByTouchPoint(this.mViewPortHandler.contentRight(),
this.mViewPortHandler.contentBottom(), this.posForGetHighestVisibleX);
}
let r... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 211e5d0cb18887b8a871c64847afdcf31fa82fb6 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ai/AIOrchestrator.ets | arkts | isComplexMedicalQuery | 判断是否为复杂医疗查询 | private isComplexMedicalQuery(query: string): boolean {
const complexKeywords = [
'专科', '专家会诊', '手术方案', '详细诊断',
'眼科', '康复', '神经科', '心血管'
];
return complexKeywords.some(keyword => query.includes(keyword));
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isComplexMedicalQuery AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | private isComplexMedicalQuery(query: string): boolean {
const complexKeywords = [
'专科', '专家会诊', '手术方案', '详细诊断',
'眼科', '康复', '神经科', '心血管'
];
return complexKeywords.some(keyword => query.includes(keyword));
} | https://github.com/LJ666-ui/harmony-health-care | b21707f281d137a517959e7c3b11590d4491bdbe | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets | arkts | toString | The toString() method of Intl.Locale instances returns this Locale's full locale identifier string.
@return The locale's Unicode locale identifier string. | public override toString() : BCP47LanguageTag {
return this.tag
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le... | public override toString() : BCP47LanguageTag {
return this.tag
} | https://gitcode.com/iop123123/arkts-static-skills | 8659e7a1a40727ec1708d2416471f147c937623b | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPAuthManager.ets | arkts | connect | 连接到 VM | public async connect(vmName: string): Promise<RDPSession | null> {
const credential = this.credentials.get(vmName);
if (!credential) {
console.error(`[RDPAuthManager] No credential found for ${vmName}`);
this.callbacks.onAuthenticationRequired?.(vmName);
return null;
}
// 创建会话
c... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left connect AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left vmName AST#identifier#Right AST#:#Left : AST#:#R... | public async connect(vmName: string): Promise<RDPSession | null> {
const credential = this.credentials.get(vmName);
if (!credential) {
console.error(`[RDPAuthManager] No credential found for ${vmName}`);
this.callbacks.onAuthenticationRequired?.(vmName);
return null;
}
// 创建会话
c... | https://github.com/AetheriumSimulator/qemu-hmos | 756fb186ea3f1fe4589fdc5d72bbecc4d4a849d1 | github |
Cool_foolisher1/ArkTSRepository | GraphicalCode/features/settings/src/main/ets/viewmodel/AboutViewModel.ets | arkts | sendEvent | 发送事件
@param event 事件 | sendEvent(event: BaseVMEventViewModel) {
if (event instanceof CheckVersionEventViewModel) {
this.checkUpdate()
} else if (event instanceof UpdateVersionEventViewModel) {
this.updateVersion()
} else if (event instanceof ViewRegistrationInfoEventViewModel) {
const uiContext: UIContext = Ap... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left sendEvent 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#identifier#Left BaseVMEventViewModel AST#ident... | sendEvent(event: BaseVMEventViewModel) {
if (event instanceof CheckVersionEventViewModel) {
this.checkUpdate()
} else if (event instanceof UpdateVersionEventViewModel) {
this.updateVersion()
} else if (event instanceof ViewRegistrationInfoEventViewModel) {
const uiContext: UIContext = Ap... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 6fc33aa083493d17e07a4882640b354c8e571f09 | gitcode |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/utils/DataManager.ets | arkts | saveHealthRecord | 保存健康记录 | async saveHealthRecord(record: HealthRecord): Promise<boolean> {
try {
const records = await this.getAllHealthRecords();
const index = records.findIndex(r => r.id === record.id);
if (index >= 0) {
records[index] = record;
} else {
records.push(record);
}
await... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveHealthRecord AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left record AST#identifier#Right AST#type_annotation#Left AST#:#Lef... | async saveHealthRecord(record: HealthRecord): Promise<boolean> {
try {
const records = await this.getAllHealthRecords();
const index = records.findIndex(r => r.id === record.id);
if (index >= 0) {
records[index] = record;
} else {
records.push(record);
}
await... | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | 2d41ae1e426da0d7ccc052cdf3c63eae66d54228 | github |
IoTAccessControl/ArkTSAnalysis | TestApps/AccountKit-QuickLogin/entry/src/main/ets/pages/QuickLoginPage.ets | arkts | onBackPress | Processing logic returned after a gesture operation is executed. | onBackPress(): boolean | void {
if (this.pageInfos && this.pageInfos.size() > 0) {
this.pageInfos.pop();
return true;
}
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left onBackPress 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#boolean#L... | onBackPress(): boolean | void {
if (this.pageInfos && this.pageInfos.size() > 0) {
this.pageInfos.pop();
return true;
}
} | https://github.com/IoTAccessControl/ArkTSAnalysis | 781461f9b70035eb4df085486dfc443da20d9bb3 | github |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | setMaxConnectCount | Set the maximum number of connections
@param count
@return BleManager | public setMaxConnectCount(count: number): BleManager {
if (count > BleManager.DEFAULT_MAX_MULTIPLE_DEVICE)
count = BleManager.DEFAULT_MAX_MULTIPLE_DEVICE;
this.maxConnectCount = count;
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMaxConnectCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left count AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | public setMaxConnectCount(count: number): BleManager {
if (count > BleManager.DEFAULT_MAX_MULTIPLE_DEVICE)
count = BleManager.DEFAULT_MAX_MULTIPLE_DEVICE;
this.maxConnectCount = count;
return this;
} | https://gitee.com/openharmony-sig/FastBle.git | 1b479cf84841d9799c6509f9a372fc97aa5c0c51 | gitee |
Jack-TCN/richEditor | src/main/ets/utils/ImageUtils.ets | arkts | mergeImage | [End get_snapshot_area]
Merge image area array into long screenshots
@param {image.PositionArea[]} areaArray - screenshot area
@param {number} lastOffsetY - The offset Y of the last screenshot
@param {number} listWidth - List component width
@param {number} listHeight - List component height
@returns {PixelMap} Long im... | static async mergeImage(areaArray: image.PositionArea[], lastOffsetY: number, listWidth: number,
listHeight: number): Promise<PixelMap> {
// Create a long screenshot PixelMap
let opts: image.InitializationOptions = {
editable: true,
pixelFormat: 4,
size: {
width: vp2px(listWidth)... | 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 mergeImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#subscript_expression#Left AST#member_expression#Left AST#identifier#Left are... | static async mergeImage(areaArray: image.PositionArea[], lastOffsetY: number, listWidth: number,
listHeight: number): Promise<PixelMap> {
// Create a long screenshot PixelMap
let opts: image.InitializationOptions = {
editable: true,
pixelFormat: 4,
size: {
width: vp2px(listWidth)... | https://github.com/Jack-TCN/richEditor | 119bf2b91dd7dfdfb32bb629af33627110231c85 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Theme/AppColors.ets | arkts | glassHero | ==================== Glass Tokens ==================== | static get glassHero(): string { return AppColors.getGlassToken(GlassLevel.HERO).backgroundColor; } | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left glassHero AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left :... | static get glassHero(): string { return AppColors.getGlassToken(GlassLevel.HERO).backgroundColor; } | https://github.com/DaLongZhuaZi/manxia | 00f5b7f51aa23a175961b4ebb4b8eeb7b3c43ecc | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | set | Assigns val as element on insertPos.
@description Added to avoid (un)packing a single value into array to use overloaded set(float[], insertPos)
@param val value to set
@param insertPos index to change | public set(insertPos: number, val: number): void {
this.set(insertPos as int, val as double as int as float)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left insertPos AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#... | public set(insertPos: number, val: number): void {
this.set(insertPos as int, val as double as int as float)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 0f48318bff5a887d66f3ea5e950fcb38f019c9a8 | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | shouldSuppressGraphics | Check if graphics should be suppressed (background or locked) | shouldSuppressGraphics(): boolean {
return this.isInBackground || this.isScreenLocked;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left shouldSuppressGraphics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right ... | shouldSuppressGraphics(): boolean {
return this.isInBackground || this.isScreenLocked;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 3a02ad1bbf223737538643c3103deb6fd44fff70 | github |
codelably/tuniao-ui | packages/main/src/main/ets/view/StylePage.ets | arkts | build | 构建样式展示页面
@returns {void} 无返回值 | build() {
AppNavDestination({
title: "样式",
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset,
}
}) {
this.StyleContent();
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statement#Left AST#c... | build() {
AppNavDestination({
title: "样式",
viewModel: this.vm,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset,
}
}) {
this.StyleContent();
}
} | https://github.com/codelably/tuniao-ui | 60437c4a554ad01cf5b3777730df283af25557e9 | github |
richshaw2015/nds | ohos/entry/src/main/ets/pages/settings/DSiWareManager.ets | arkts | fileTypeName | 文件类型名称 - 对齐 Android DSiWareTitleFileType.fileName | function fileTypeName(fileType: DSiWareTitleFileType): string {
const names: string[] = ['public.sav', 'private.sav', 'banner.sav'];
return names[fileType];
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left fileTypeName AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left fileType AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function fileTypeName(fileType: DSiWareTitleFileType): string {
const names: string[] = ['public.sav', 'private.sav', 'banner.sav'];
return names[fileType];
} | https://github.com/richshaw2015/nds | caec896935564b31fbc09f72e06a1c5911001853 | github |
openharmony/arkui_ace_engine | examples/DrawableDescriptor/entry/src/main/ets/pages/DrawableDescriptorReleaseTest.ets | arkts | MemTest002 | MEM_002: 批量创建 AnimatedDrawableDescriptor → release → PSS 下降 | MemTest002() {
const id = 'MEM_002'
const COUNT = 500
try {
let pssBefore = Number(hidebug.getPss())
this.AppendLog(`[${id}] 基线 PSS: ${pssBefore} KB`)
let drawables: AnimatedDrawableDescriptor[] = []
for (let i = 0; i < COUNT; i++) {
drawables.push(this.CreateAnimatedDrawa... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left MemTest002 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | MemTest002() {
const id = 'MEM_002'
const COUNT = 500
try {
let pssBefore = Number(hidebug.getPss())
this.AppendLog(`[${id}] 基线 PSS: ${pssBefore} KB`)
let drawables: AnimatedDrawableDescriptor[] = []
for (let i = 0; i < COUNT; i++) {
drawables.push(this.CreateAnimatedDrawa... | https://gitcode.com/openharmony/arkui_ace_engine | 7bc54adca21af6165ab3c54098036de7b8588bd6 | gitcode |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageCreate | WindowStage创建时的回调
加载主页面 | onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/Index', (err) => {
if (err.code) {
hilog.error(DOMAIN, 'testTag',... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onWindowStageCreate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left window AST#identif... | onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/Index', (err) => {
if (err.code) {
hilog.error(DOMAIN, 'testTag',... | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | 1a9c9c1340f8299f8616b316d426f40cbd0744cb | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/StoragePaths.ets | arkts | getVmDir | 获取指定 VM 的目录路径 | static getVmDir(vmName: string): string {
return `${StoragePaths.VMS_DIR}/${vmName}`
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getVmDir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left vmName AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin... | static getVmDir(vmName: string): string {
return `${StoragePaths.VMS_DIR}/${vmName}`
} | https://github.com/AetheriumSimulator/qemu-hmos | 2ca240fb41aae10e784daec49a1c5cc0c33a52cc | github |
ibestservices/ibest-ui | library/src/main/ets/components/switch/index.ets | arkts | getActiveColor | 获取激活的颜色 | getActiveColor() {
return this.activeColor || this.baseStyle.primary
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getActiveColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef... | getActiveColor() {
return this.activeColor || this.baseStyle.primary
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/switch/index.ets#L145-L147 | 84ed605fe942ec0c14e733294bedc66875b551db | github |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/utils/FileUtils.ets | arkts | setSandboxBaseDir | Set the sandbox base directory for resolving relative paths.
Must be called during app initialization with context.filesDir. | static setSandboxBaseDir(baseDir: string): void {
sandboxBaseDir = baseDir;
logger.info(TAG, '沙箱基础目录已设置: ' + baseDir);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setSandboxBaseDir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left baseDir AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | static setSandboxBaseDir(baseDir: string): void {
sandboxBaseDir = baseDir;
logger.info(TAG, '沙箱基础目录已设置: ' + baseDir);
} | https://github.com/DaLongZhuaZi/NGF | bbcea1909173fc99e163e8c289ed18df6ef953e1 | github |
picklerick422/zju-learning-assistant-OH | entry/src/main/ets/services/CredentialService.ets | arkts | remove | 删除凭据(退出登录 / 取消记住)。not-found 静默忽略。 | static remove(): void {
const query: asset.AssetMap = new Map();
query.set(asset.Tag.ALIAS, strToU8(ALIAS));
try {
asset.removeSync(query);
} catch (err) {
const e = err as BusinessError;
if (e.code !== 24000002) {
hilog.warn(DOMAIN, TAG, 'asset remove failed: code=%{public}d... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left remove 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_stat... | static remove(): void {
const query: asset.AssetMap = new Map();
query.set(asset.Tag.ALIAS, strToU8(ALIAS));
try {
asset.removeSync(query);
} catch (err) {
const e = err as BusinessError;
if (e.code !== 24000002) {
hilog.warn(DOMAIN, TAG, 'asset remove failed: code=%{public}d... | https://github.com/picklerick422/zju-learning-assistant-OH | 5b7d9eadb5ce41f8fe743811e159149d5d4c4b3c | github |
aimilin6688/KeePassHO | entry/src/main/ets/storage/onedrive/OneDriveClient.ets | arkts | list | 列出目录内容
@param path 目录路径(相对路径)
@param filter 过滤器:0-不过滤,1-只返回文件夹,2-只返回文件
@returns Promise<HttpResponse> 结果信息 | public async list(path: string = '', filter: number = 0): Promise<HttpResponse> {
if (!this.axiosInstance) {
throw new Error('Axios instance not initialized');
}
try {
const apiPath = this.normalizePath(path, OneDrivePathType.CHILDREN);
hilog.info(DOMAIN, TAG, `list: path=${path}, apiPat... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left list AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right ... | public async list(path: string = '', filter: number = 0): Promise<HttpResponse> {
if (!this.axiosInstance) {
throw new Error('Axios instance not initialized');
}
try {
const apiPath = this.normalizePath(path, OneDrivePathType.CHILDREN);
hilog.info(DOMAIN, TAG, `list: path=${path}, apiPat... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/onedrive/OneDriveClient.ets#L551-L568 | 4bbd13ebf309e69baa37440d3b41647a7c7c916b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/SessionManager.ets | arkts | isSessionExpired | 检查会话是否过期 | async isSessionExpired(sourceId: number, indicators: ExpiryIndicator[]): Promise<boolean> {
if (!indicators || indicators.length === 0) {
return false;
}
for (const indicator of indicators) {
switch (indicator.type) {
case 'cookie':
const hasCookie = await this.checkCookieEx... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left isSessionExpired AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Righ... | async isSessionExpired(sourceId: number, indicators: ExpiryIndicator[]): Promise<boolean> {
if (!indicators || indicators.length === 0) {
return false;
}
for (const indicator of indicators) {
switch (indicator.type) {
case 'cookie':
const hasCookie = await this.checkCookieEx... | https://github.com/DaLongZhuaZi/manxia | 077459ed98a1855986e0449e7e2948803646357c | github |
wuba/omni-ui | omni_component/src/main/ets/components/guide/model/HighLightInfoOfComponent.ets | arkts | getRound | 获取圆角矩形的圆角弧度,仅当shape = HighLightShape.ROUND_RECTANGLE 时调用此方法
@returns 圆角矩形的圆角弧度 | getRound(): number {
return this.round;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getRound AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_blo... | getRound(): number {
return this.round;
} | https://github.com/wuba/omni-ui | 1262c3fd467ad7ef007fa2ef2c2198973ec95e74 | github |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/calculator/AdvancedSunshineCalculator.ets | arkts | calculateUnitSunshine | 计算特定单元的全年日照时间
@param buildings 所有建筑物
@param targetBuilding 目标建筑物
@param floorIndex 楼层索引(从1开始)
@param unitIndex 单元索引(从1开始,从右到左)
@param latitude 纬度
@param longitude 经度
@param scaleMetersPerCell 每格代表的米数
@param minutesStep 计算步长(分钟)
@returns 日照结果对象 | calculateUnitSunshine(
buildings: BuildingModel[],
targetBuilding: BuildingModel,
floorIndex: number,
unitIndex: number,
latitude: number,
longitude: number,
scaleMetersPerCell: number = 10,
minutesStep: number = 5
): UnitSunshineResult {
// 计算层中心高度
const pointZ = (floorIndex... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateUnitSunshine AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buildings AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left... | calculateUnitSunshine(
buildings: BuildingModel[],
targetBuilding: BuildingModel,
floorIndex: number,
unitIndex: number,
latitude: number,
longitude: number,
scaleMetersPerCell: number = 10,
minutesStep: number = 5
): UnitSunshineResult {
// 计算层中心高度
const pointZ = (floorIndex... | https://github.com/qiuhaotc/Sunshine_HarmonyOS | bd741a09927dc2961b8e5e3b0b6a0340f373bd0b | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInternals.ets | arkts | isLongType | Checks if the given Class object represents a long type (including boxed and primitive types).
@static
@param { Class } type The Class object to be checked.
@returns { boolean } Returns true if it's a long type; otherwise returns false.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static isLongType(type: Class): boolean {
return type === Types.BOXED_LONG || type === Class.PRIMITIVE_LONG
} | 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 isLongType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:... | public static isLongType(type: Class): boolean {
return type === Types.BOXED_LONG || type === Class.PRIMITIVE_LONG
} | https://gitcode.com/iop123123/arkts-static-skills | bf6bf591096efb75d8a2198d57e4f0e40325fd5e | gitcode |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/features/topic/src/main/ets/model/TopicModel.ets | arkts | updateFollowedTopics | Update the theme of the settings. | updateFollowedTopics(followedIds: string[]): Promise<void> {
return new Promise((resolve: Function, reject: Function) => {
this.funNetwork.editTopicsFollowed(AppStorage.get<string>('userId') as string, followedIds.join(',')).then(() => {
this.totalTopicList.forEach((topic: Topic) => {
topi... | AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left updateFollowedTopics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left followedIds AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left... | updateFollowedTopics(followedIds: string[]): Promise<void> {
return new Promise((resolve: Function, reject: Function) => {
this.funNetwork.editTopicsFollowed(AppStorage.get<string>('userId') as string, followedIds.join(',')).then(() => {
this.totalTopicList.forEach((topic: Topic) => {
topi... | https://gitcode.com/HarmonyOS_Samples/hmosworld | 135c1a78367bf99de1aea73b4d4159289cf5ef7e | gitcode |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | trunc | Return a new Decimal whose value is the value of this Decimal truncated to a whole number.
@returns { Decimal } the Decimal type | public trunc(): Decimal {
return Utils.finalise(new Decimal(this), this.exponent + 1, Decimal.ROUND_DOWN);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left trunc 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 trunc(): Decimal {
return Utils.finalise(new Decimal(this), this.exponent + 1, Decimal.ROUND_DOWN);
} | https://gitcode.com/iop123123/arkts-static-skills | c7ad22d4795254e37f064ceacff93b6068825334 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/DiskCacheManager.ets | arkts | generateCacheKey | 生成缓存键(URL的MD5哈希) | private async generateCacheKey(url: string): Promise<string> {
try {
const md5 = cryptoFramework.createMd('MD5');
const encoder = new util.TextEncoder();
const urlBytes = encoder.encodeInto(url);
await md5.update({ data: new Uint8Array(urlBytes) });
const hashResult = await md5.diges... | 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 generateCacheKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left ... | private async generateCacheKey(url: string): Promise<string> {
try {
const md5 = cryptoFramework.createMd('MD5');
const encoder = new util.TextEncoder();
const urlBytes = encoder.encodeInto(url);
await md5.update({ data: new Uint8Array(urlBytes) });
const hashResult = await md5.diges... | https://github.com/DaLongZhuaZi/manxia | c24eb175cca4829711e45ece6977563f5fa469c4 | github |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Writer.ets | arkts | sint32 | Write sint32 (zigzag) | sint32(v: number): Writer { return this.uint32(((v << 1) ^ (v >> 31)) >>> 0) } | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left sint32 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#Right... | sint32(v: number): Writer { return this.uint32(((v << 1) ^ (v >> 31)) >>> 0) } | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | e7540ee800c47de279588a37a0fe39916c54bc0c | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Authentication/LoginManager.ets | arkts | logout | 清除登录状态 | async logout(sourceId: number): Promise<void> {
await this.cookieManager.clearCookies(sourceId);
logger.info(TAG, `已清除登录状态: sourceId=${sourceId}`);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left logout AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | async logout(sourceId: number): Promise<void> {
await this.cookieManager.clearCookies(sourceId);
logger.info(TAG, `已清除登录状态: sourceId=${sourceId}`);
} | https://github.com/DaLongZhuaZi/manxia | 65b057b196e54ba787b4d265a9334ee58cc4e8de | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test29_original_index.ets | arkts | findEven | === Round 29: Array.find with predicate, Array.every/some callbacks,
String.fromCharCode range, Number.toString radix, charCodeAt chains,
class-based enum with reverse lookup, switch expression emulation,
String.concat method, Array.join with object conversion,
compound logical expressions, bitwise flag patterns ===
--... | function findEven(arr: number[]): number {
for (let i: number = 0; i < arr.length; i++) {
let mod: number = arr[i] % 2;
if (mod === 0) {
return arr[i];
}
}
return -1;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left findEven AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AS... | function findEven(arr: number[]): number {
for (let i: number = 0; i < arr.length; i++) {
let mod: number = arr[i] % 2;
if (mod === 0) {
return arr[i];
}
}
return -1;
} | https://github.com/miaochiahao/ark-ghidra | 964b40cf44d78cc38622c795908db4d7683dab45 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | padEnd | The padEnd() method pads the current string with a given string (repeated, if needed)
so that the resulting string reaches a given length.
The padding is applied from the end of the current string.
@param { int } end int
@param { String } str string
@returns { String } string with the padString applied at the end of th... | public padEnd(end: int, ch: char): String {
if (this.getLength() >= end) {
return this;
}
let arr : ValueArray<char> = new ValueArray<char>(end)
for (let i: int = 0; i < this.getLength(); i++) {
arr[i] = this.charAt(i)
}
for(let i = this.getLen... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left padEnd AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left end AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left int AST#id... | public padEnd(end: int, ch: char): String {
if (this.getLength() >= end) {
return this;
}
let arr : ValueArray<char> = new ValueArray<char>(end)
for (let i: int = 0; i < this.getLength(); i++) {
arr[i] = this.charAt(i)
}
for(let i = this.getLen... | https://gitcode.com/iop123123/arkts-static-skills | 58dcdde2e2133d4761772922b016ba572805d236 | gitcode |
CPF-ApplicationTPC/openharmony_tpc_samples | SwipeMenuListView/library/src/main/ets/utils/SwipeStateController.ets | arkts | setConfigUpdateCallback | 设置配置更新回调函数 | public setConfigUpdateCallback(callback: (config: TouchConfig) => void): void {
this._configUpdateCallback = callback;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left setConfigUpdateCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Le... | public setConfigUpdateCallback(callback: (config: TouchConfig) => void): void {
this._configUpdateCallback = callback;
} | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | 209fad509b93a34163072f25e9c64f880031d039 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/core/HooksProcessor.ets | arkts | hasBeforeDeleteHook | 检查实体是否有 beforeDelete 钩子
@param entityName 实体名称
@returns 是否有 beforeDelete 钩子 | hasBeforeDeleteHook(entityName: string): boolean {
return this.hasHook(entityName, 'beforeDelete')
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasBeforeDeleteHook AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left... | hasBeforeDeleteHook(entityName: string): boolean {
return this.hasHook(entityName, 'beforeDelete')
} | https://github.com/offlinecat-dev/OCNetORM | fcac90a32a6d45725bf5df8df3f7847493708d35 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/NotificationManager.ets | arkts | cancelAllNotifications | 取消所有通知 | public async cancelAllNotifications(): Promise<void> {
try {
await notificationManager.cancelAll();
logger.info(TAG, '所有通知已取消');
} catch (error) {
const err = error as BusinessError;
logger.error(TAG, `取消所有通知失败: ${err.code}, ${err.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 cancelAllNotifications AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Rig... | public async cancelAllNotifications(): Promise<void> {
try {
await notificationManager.cancelAll();
logger.info(TAG, '所有通知已取消');
} catch (error) {
const err = error as BusinessError;
logger.error(TAG, `取消所有通知失败: ${err.code}, ${err.message}`);
}
} | https://github.com/DaLongZhuaZi/manxia | 481fffce7edd1e9478477368910beaf4214d514d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Compress/ComicArchiveManager.ets | arkts | copyImagesToTemp | 复制图片文件到临时目录 | private async copyImagesToTemp(pages: ComicPageInfo[], tempDir: string): Promise<void> {
try {
// 按页面索引排序
const sortedPages = pages.sort((a, b) => a.pageIndex - b.pageIndex);
for (const page of sortedPages) {
// 检查源文件是否存在
if (!await this.sandboxManager.exists(page.filePath... | 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 copyImagesToTemp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pages AST#identifier#Right AST#:#Lef... | private async copyImagesToTemp(pages: ComicPageInfo[], tempDir: string): Promise<void> {
try {
// 按页面索引排序
const sortedPages = pages.sort((a, b) => a.pageIndex - b.pageIndex);
for (const page of sortedPages) {
// 检查源文件是否存在
if (!await this.sandboxManager.exists(page.filePath... | https://github.com/DaLongZhuaZi/manxia | 42989beb5172b98f0bf565c0851b30fef0c6d7ff | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/calculator/Evaluator.ets | arkts | addKeyboardValue | To deal with pValue
@param { string } pValue
@param { Function } callBack | private addKeyboardValue(callBack: Function, pValue: string): boolean {
let leftAndRightExp: string[] = this.getLeftAndRightExp();
let leftExp: string = leftAndRightExp[0];
let rightExp: string = leftAndRightExp[1];
if (this.calculatorState === CalculatorState.ANIMATE || pValue === 'error') {
Co... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left addKeyboardValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callBack AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi... | private addKeyboardValue(callBack: Function, pValue: string): boolean {
let leftAndRightExp: string[] = this.getLeftAndRightExp();
let leftExp: string = leftAndRightExp[0];
let rightExp: string = leftAndRightExp[1];
if (this.calculatorState === CalculatorState.ANIMATE || pValue === 'error') {
Co... | https://gitee.com/openharmony-sig/applications_calculator.git | 45f8cdf8a48365498bbc8cc48ce0cc9fdcac7a79 | gitee |
heeh02/superconnect | harmony/entry/src/main/ets/input/KeyboardHandler.ets | arkts | onCommit | 3rd-party IME commit via onChange (skip while still composing a preview). | onCommit(value: string, preview?: PreviewText): void {
if (preview !== undefined && preview.value.length > 0) { return; }
if (value.length > 0) { this.sender.sendText(value); }
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onCommit 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 string AST#identifier#Right AST#,#Left , AST#,... | onCommit(value: string, preview?: PreviewText): void {
if (preview !== undefined && preview.value.length > 0) { return; }
if (value.length > 0) { this.sender.sendText(value); }
} | https://github.com/heeh02/superconnect | 34e2d214e732f49689b5cb2ddf4cdf9686cdff9f | github |
openharmony/arkui_ace_engine | advanced_ui_component/treeviewv2/source/treeviewv2.ets | arkts | alterDragNode | Alter the current node location to a needful position.
1.Create an array named 'dragNodeParam' to store dragging node information.
2.Delete the dragging node from the tree.
3.Add the dragging node to the tree. | public alterDragNode(rearParentNodeId: number, rearCurrentNodeId: number,
dragParentNodeId: number, dragCurrentNodeId: number, frontNodeInfoItem: NodeInfo): void {
let dragNodeParam: DragNodeParam[] = [];
let parentNodeId: number = rearParentNodeId;
let currentNodeId: number = dragCurrentNodeId;
l... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left alterDragNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left rearParentNodeId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST... | public alterDragNode(rearParentNodeId: number, rearCurrentNodeId: number,
dragParentNodeId: number, dragCurrentNodeId: number, frontNodeInfoItem: NodeInfo): void {
let dragNodeParam: DragNodeParam[] = [];
let parentNodeId: number = rearParentNodeId;
let currentNodeId: number = dragCurrentNodeId;
l... | https://gitcode.com/openharmony/arkui_ace_engine | 39dd2e7d5e91401d5857e5d0bc341ab803246982 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets | arkts | matchAll | Returns an iterator that iterates over all matches in the string.
@param { String } str The string to match.
@returns {IterableIterator<RegExpMatchArray>} An iterator that iterates over all match results.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public matchAll(str: String): IterableIterator<RegExpMatchArray> {
let matcher = new RegExp(this)
matcher.lastIndex = this.lastIndex
if (matcher.global) {
let results = matcher.matchAllNativeImpl(matcher.pattern_, matcher.flags_, str, matcher.pattern_.length,
str.... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left matchAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left String A... | public matchAll(str: String): IterableIterator<RegExpMatchArray> {
let matcher = new RegExp(this)
matcher.lastIndex = this.lastIndex
if (matcher.global) {
let results = matcher.matchAllNativeImpl(matcher.pattern_, matcher.flags_, str, matcher.pattern_.length,
str.... | https://gitcode.com/iop123123/arkts-static-skills | 0119ea80305a928dd64fd88500baf1225f31f064 | gitcode |
mybricks/comlib-harmony-normal | packages/rt-arkts/comlib/src/main/ets/AiMusic/model/AppMusicMediaPlayer.ets | arkts | setAudioList | 设置歌曲列表 | static setAudioList(audioList: WorksItemWithLabelsModel[]) {
MediaPlayer.audioList = audioList
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setAudioList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left audioList AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expr... | static setAudioList(audioList: WorksItemWithLabelsModel[]) {
MediaPlayer.audioList = audioList
} | https://github.com/mybricks/comlib-harmony-normal | 25c9383e80fbac0d81c125a28f61fb18daa330fe | github |
Zhiyilang074811/enterprise-ai-assistant | harmony_app/entry/src/main/ets/pages/Chat.ets | arkts | addWelcomeMessage | 添加欢迎消息 | addWelcomeMessage(): void {
const welcomeText = this.appConfig?.welcome_message || '您好!我是您的智能助手,有什么可以帮您的吗?';
const welcomeMsg = Message.createAssistantMessage(welcomeText);
this.messages = [welcomeMsg];
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addWelcomeMessage 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_... | addWelcomeMessage(): void {
const welcomeText = this.appConfig?.welcome_message || '您好!我是您的智能助手,有什么可以帮您的吗?';
const welcomeMsg = Message.createAssistantMessage(welcomeText);
this.messages = [welcomeMsg];
} | https://github.com/Zhiyilang074811/enterprise-ai-assistant | ba856f22c612336b40d25fd91ff6154ceeb8f0c4 | github |
openharmony-sig/applications_inputmethod | entry/src/main/ets/model/InputHandler.ets | arkts | sendKeyFunction | 发送按钮点击事情方法 | public sendKeyFunction() {
this.addLog('sendKeyFunction')
this.selStr = ''
this.curFenciPy = ''
this.getChineseText()
// if (this.selStr.length == 0) {
// let defaultText: [string] = ['我','你','在','这','不','一','是','好','今天','他','就','那','嗯','也','我们','有']
// AppStorage.SetOrCreate(... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left sendKeyFunction 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... | public sendKeyFunction() {
this.addLog('sendKeyFunction')
this.selStr = ''
this.curFenciPy = ''
this.getChineseText()
// if (this.selStr.length == 0) {
// let defaultText: [string] = ['我','你','在','这','不','一','是','好','今天','他','就','那','嗯','也','我们','有']
// AppStorage.SetOrCreate(... | https://gitee.com/openharmony-sig/applications_inputmethod.git | 476e570bb646540fedc13a4060e7a036f10cd838 | gitee |
LZZLHY/hlib | entry/src/main/ets/utils/PublicDownloadDir.ets | arkts | requestDownloadPerm | 平板:申请下载目录读写权限(已授权不再弹窗)。 | private static async requestDownloadPerm(ctx: common.UIAbilityContext): Promise<boolean> {
try {
const atm: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
const res = await atm.requestPermissionsFromUser(ctx, [PERM]);
const results: number[] = res.authResults;
return re... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left requestDownloadPerm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#... | private static async requestDownloadPerm(ctx: common.UIAbilityContext): Promise<boolean> {
try {
const atm: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
const res = await atm.requestPermissionsFromUser(ctx, [PERM]);
const results: number[] = res.authResults;
return re... | https://github.com/LZZLHY/hlib | f6b055be0c556da04bf1350395f7b4702ab6051a | github |
Joker-x-dev/CoolMallArkTS | core/util/src/main/ets/image/ImageUtil.ets | arkts | packingFromPixelMap | 图片打包
@param {image.PixelMap} source 图像的PixelMap对象
@param {image.PackingOption} options 图像打包参数
@returns {Promise<ArrayBuffer>} ArrayBuffer 返回图像数据 | static packingFromPixelMap(source: image.PixelMap, options: image.PackingOption): Promise<ArrayBuffer> {
const imagePacker: image.ImagePacker = image.createImagePacker();
return imagePacker.packToData(source, options).finally(() => {
imagePacker.release();
});
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left packingFromPixelMap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_exp... | static packingFromPixelMap(source: image.PixelMap, options: image.PackingOption): Promise<ArrayBuffer> {
const imagePacker: image.ImagePacker = image.createImagePacker();
return imagePacker.packToData(source, options).finally(() => {
imagePacker.release();
});
} | https://github.com/Joker-x-dev/CoolMallArkTS | f433f59a0ba9279190b46865d822fc9f5099b2ee | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInternals.ets | arkts | isShortType | Checks if the given Class object represents a short type (including boxed and primitive types).
@static
@param { Class } type The Class object to be checked.
@returns { boolean } Returns true if it's a short type; otherwise returns false.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static isShortType(type: Class): boolean {
return type === Types.BOXED_SHORT || type === Class.PRIMITIVE_SHORT
} | 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 isShortType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#... | public static isShortType(type: Class): boolean {
return type === Types.BOXED_SHORT || type === Class.PRIMITIVE_SHORT
} | https://gitcode.com/iop123123/arkts-static-skills | eb8d2b5636e16975ae2f4687f87e51758bf4204a | gitcode |
erosTeam/NextE | shared/src/main/ets/settings/LanguageSettings.ets | arkts | resolveLocale | setAppPreferredLanguage cannot clear a previous pin with 'default', so follow-system resolves the live
system language explicitly. | private static resolveLocale(mode: string): string {
if (mode !== LanguageSettings.MODE_SYSTEM) {
return mode
}
try {
return i18n.System.getSystemLanguage()
} catch (_e) {
return ''
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left resolveLocale AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left :... | private static resolveLocale(mode: string): string {
if (mode !== LanguageSettings.MODE_SYSTEM) {
return mode
}
try {
return i18n.System.getSystemLanguage()
} catch (_e) {
return ''
}
} | https://github.com/erosTeam/NextE | 087361c23373666c2010bf8784df02f677f1efb1 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets | arkts | createTemplateFromEntry | 将普通条目转换为模板条目 | createTemplateFromEntry(entry: KdbxEntry, templateGroup: KdbxGroup, meta?: KdbxMeta): KdbxEntry {
// 创建新条目 - 优先使用传入的meta,否则从FileService获取
let entryMeta = meta;
if (!entryMeta) {
const dbParam = FileService.getInstance().getDbFileParam();
entryMeta = dbParam?.database?.meta;
}
const te... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createTemplateFromEntry AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left KdbxEntry AST#identifier#Right ... | createTemplateFromEntry(entry: KdbxEntry, templateGroup: KdbxGroup, meta?: KdbxMeta): KdbxEntry {
// 创建新条目 - 优先使用传入的meta,否则从FileService获取
let entryMeta = meta;
if (!entryMeta) {
const dbParam = FileService.getInstance().getDbFileParam();
entryMeta = dbParam?.database?.meta;
}
const te... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/strategies/UserTemplateStrategy.ets#L336-L372 | a8cd46e786137d45545859808ede75144abf13a9 | github |
openharmony-sig/ohos_danmaku_flame_master | library/src/main/ets/components/common/master/flame/danmaku/danmaku/model/ohos/DanmakuFactory.ets | arkts | fillAlphaData | Initial alpha data of the special danmaku
@param item
@param beginAlpha
@param endAlpha
@param alphaDuraion | public fillAlphaData(item: BaseDanmaku, beginAlpha: number, endAlpha: number,
alphaDuraion: number) {
if (item.getType() != BaseDanmaku.TYPE_SPECIAL) {
return;
}
(item as SpecialDanmaku).setAlphaData(beginAlpha, endAlpha, alphaDuraion);
this.updateSpecicalDanmakuDuration(i... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left fillAlphaData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Ba... | public fillAlphaData(item: BaseDanmaku, beginAlpha: number, endAlpha: number,
alphaDuraion: number) {
if (item.getType() != BaseDanmaku.TYPE_SPECIAL) {
return;
}
(item as SpecialDanmaku).setAlphaData(beginAlpha, endAlpha, alphaDuraion);
this.updateSpecicalDanmakuDuration(i... | https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git | 40ef42a51e672ade57a0559a3c645b63caa69c52 | gitee |
Joker-x-dev/CoolMallArkTS | feature/main/src/main/ets/viewmodel/CartViewModel.ets | arkts | toggleEditMode | 切换编辑模式
@returns {void} 无返回值 | toggleEditMode(): void {
// 清空选择状态
this.selectedSpecIds = new Set();
// 切换编辑模式
this.isEditing = !this.isEditing;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleEditMode 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... | toggleEditMode(): void {
// 清空选择状态
this.selectedSpecIds = new Set();
// 切换编辑模式
this.isEditing = !this.isEditing;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 821ae930b56310025cd0874fe93427d3e67242af | github |
tdcare/tdwebrtc | src/main/ets/VideoDecoderVP8.ets | arkts | decodeFrame | 解码视频帧
@param encodedData VP8 帧数据
@param timestamp 时间戳(微秒)
@param isKeyFrame 是否为关键帧
@param renderAfterDecode 解码后是否立即渲染到 Surface(默认 true)
批量解码时只最后一帧设为 true,前面帧设为 false | public async decodeFrame(
encodedData: ArrayBuffer,
timestamp: number,
isKeyFrame: boolean = false,
renderAfterDecode: boolean = true
): Promise<boolean> {
if (!this.isRunning || this.vp8Decoder === null) {
return false;
}
this.decodeAttemptCount++;
try {
const uint8Arr... | 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 decodeFrame AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left encodedData AST#identifier#Right AST#:#Left ... | public async decodeFrame(
encodedData: ArrayBuffer,
timestamp: number,
isKeyFrame: boolean = false,
renderAfterDecode: boolean = true
): Promise<boolean> {
if (!this.isRunning || this.vp8Decoder === null) {
return false;
}
this.decodeAttemptCount++;
try {
const uint8Arr... | https://github.com/tdcare/tdwebrtc | 5c9e59b4e1f018218703afb8da0b06ecfd8e1cd4 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.