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
erosTeam/NextE
feature/gallery/src/main/ets/viewmodel/GalleryDetailViewModel.ets
arkts
refresh
Pull-to-refresh for detail: keep the current header/tags/comments/previews rendered while the replacement detail request is in flight, then merge fresh data over the existing gallery.
async refresh(): Promise<void> { if (this.loading || this.gid.length === 0) { return } this.loading = true this.error = '' try { await this.fetchAndApply(this.gid, this.token, true) this.loaded = true DiagnosticLogger.info( 'gallery', 'detail_refresh_ok', ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left refresh AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#L...
async refresh(): Promise<void> { if (this.loading || this.gid.length === 0) { return } this.loading = true this.error = '' try { await this.fetchAndApply(this.gid, this.token, true) this.loaded = true DiagnosticLogger.info( 'gallery', 'detail_refresh_ok', ...
https://github.com/erosTeam/NextE
dcbce56d52484e1c418ffa262da92f56eb122987
github
LZZLHY/hlib
entry/src/main/ets/utils/SecretStore.ets
arkts
randomBytes
取强随机字节(GCM nonce)。HUKS 自身没暴露 random,借 cryptoFramework 的。
private static async randomBytes(len: number): Promise<Uint8Array> { try { const rand: cryptoFramework.Random = cryptoFramework.createRandom(); const blob: cryptoFramework.DataBlob = await rand.generateRandom(len); return blob.data; } catch (err) { const e: BusinessError = err as Busin...
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 randomBytes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left len...
private static async randomBytes(len: number): Promise<Uint8Array> { try { const rand: cryptoFramework.Random = cryptoFramework.createRandom(); const blob: cryptoFramework.DataBlob = await rand.generateRandom(len); return blob.data; } catch (err) { const e: BusinessError = err as Busin...
https://github.com/LZZLHY/hlib
b173c7978e00192b50e308030e19f60fe2f2b4b0
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Array.ets
arkts
shift
Removes the first element from an array and returns that removed element. This method changes the length of the array. @returns shifted element, i.e. that was at index zero
public shift(): T | null { if(this.data.length == 0) { return null } let obj = this.data[0] this.data = this.sliceArray(1, this.data.length) return obj }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left shift AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#ca...
public shift(): T | null { if(this.data.length == 0) { return null } let obj = this.data[0] this.data = this.sliceArray(1, this.data.length) return obj }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
309fe2ff66694aef38c2fe0bcc15b6048c3bbab1
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/SeasonalityDetectionService.ets
arkts
getPeriodType
获取周期类型
private static getPeriodType(period: number): string { if (period === 0) { return 'none'; } else if (period <= 2) { return 'monthly'; } else if (period <= 4) { return 'quarterly'; } else if (period <= 6) { return 'semi-annual'; } else { return 'yearly'; } }
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 getPeriodType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left period AST#identifier#Right AST#:#Left...
private static getPeriodType(period: number): string { if (period === 0) { return 'none'; } else if (period <= 2) { return 'monthly'; } else if (period <= 4) { return 'quarterly'; } else if (period <= 6) { return 'semi-annual'; } else { return 'yearly'; } }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f459018d2b8fc9f17c288fe294564b5a7da79779
github
aimilin6688/KeePassHO
entry/src/main/ets/services/kdbx/KdbxCsvService.ets
arkts
createFieldProtection
设值字段保护 @returns
private static createFieldProtection(): Map<string, boolean> { const fieldProtection = FileService.getDatabase().meta.memoryProtection; return new Map<string, boolean>([ [CsvTitle.Title, fieldProtection.title || false], [CsvTitle.Username, fieldProtection.userName || false], [CsvTitle.Passwo...
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 createFieldProtection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#...
private static createFieldProtection(): Map<string, boolean> { const fieldProtection = FileService.getDatabase().meta.memoryProtection; return new Map<string, boolean>([ [CsvTitle.Title, fieldProtection.title || false], [CsvTitle.Username, fieldProtection.userName || false], [CsvTitle.Passwo...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxCsvService.ets#L73-L86
5d6c3e3c84a728edb98085adf6e0acde37810797
github
openharmony/codelabs
Data/PersonalAssistantPro/entry/src/main/ets/view/calendar/WeekView.ets
arkts
prevWeek
切换到上一周
prevWeek() { const date = new Date(this.selectedTimestamp); date.setDate(date.getDate() - 7); this.selectedTimestamp = date.getTime(); // 由于是双向绑定,修改 selectedTimestamp 会自动触发 onSelectedDateChange -> refreshData this.onDateSelected(this.selectedTimestamp); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left prevWeek 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#lexical_declaration#Left AST...
prevWeek() { const date = new Date(this.selectedTimestamp); date.setDate(date.getDate() - 7); this.selectedTimestamp = date.getTime(); // 由于是双向绑定,修改 selectedTimestamp 会自动触发 onSelectedDateChange -> refreshData this.onDateSelected(this.selectedTimestamp); }
https://gitcode.com/openharmony/codelabs
e1022edada55de69f36fd30627d1d7bc5ff5c63b
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
getLatestReadHistoryMap
[性能优化] 批量获取多本漫画的最新阅读记录 使用 UNION ALL 合并本地与在线阅读历史,减少书库冷启动期间的逐条查询
public async getLatestReadHistoryMap(comicIds: string[], userId: string): Promise<Map<string, ReadHistory>> { const result: Map<string, ReadHistory> = new Map<string, ReadHistory>(); if (comicIds.length <= 0) { return result; } const uniqueComicIds: string[] = []; const seenComicIds: Set<st...
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 getLatestReadHistoryMap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicIds AST#identifier#Right AST#ERROR#Left AS...
public async getLatestReadHistoryMap(comicIds: string[], userId: string): Promise<Map<string, ReadHistory>> { const result: Map<string, ReadHistory> = new Map<string, ReadHistory>(); if (comicIds.length <= 0) { return result; } const uniqueComicIds: string[] = []; const seenComicIds: Set<st...
https://github.com/DaLongZhuaZi/manxia
e269241aa81a457b7e4f0f5b769f2fac5d508089
github
LongLiveY96/chatcube
entry/src/main/ets/state/AppSettingsStore.ets
arkts
getDefaultModel
============================================================================ DefaultModel —— 加载 / 读 / 写(Preferences 层) ============================================================================ 读内存中对应 role 的 default model 配置
getDefaultModel(role: ModelRole): DefaultModelConfig { const s = getAppSettingsState() if (role === ModelRole.CHAT) { return s.defaultChatModel } else if (role === ModelRole.TITLE) { return s.defaultTitleModel } else if (role === ModelRole.SUGGESTION) { return s.defaultSuggestionMode...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDefaultModel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left role AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ModelRole AST#identifier#Right AST#)#Lef...
getDefaultModel(role: ModelRole): DefaultModelConfig { const s = getAppSettingsState() if (role === ModelRole.CHAT) { return s.defaultChatModel } else if (role === ModelRole.TITLE) { return s.defaultTitleModel } else if (role === ModelRole.SUGGESTION) { return s.defaultSuggestionMode...
https://github.com/LongLiveY96/chatcube
667bb8f63e8874cb584148b630c91a6570bacc0f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
constructor
Creates an BigUint64Array with respect to data, byteOffset and length. @param { ArrayBuffer } buf - data initializer @param { Number | undefined } byteOffset - byte offset from begin of the buf @param { Number | undefined } length - size of elements of type long in newly created BigUint64Array @throws { RangeError } - ...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Array...
public constructor(buf: ArrayBuffer, byteOffset: Number | undefined, length: Number | undefined) { let intByteOffset: int = 0 if (byteOffset != undefined) { intByteOffset = byteOffset.toInt() if (intByteOffset < 0) { throw new RangeError("Range Error: byteOffs...
https://gitcode.com/iop123123/arkts-static-skills
55781a84c904cdba7e17a51bed70f90764bf1e92
gitcode
openharmony-sig/ohos_checksum
library/src/main/ets/md5.ets
arkts
rstr2any
Convert a raw string to an arbitrary string encoding
rstr2any(input: string, encoding: string) :string { let divisor: number = encoding.length; let i:number, j: number, q:number, x:number, quotient: number[]; /* Convert to an array of 16-bit big-endian values, forming the dividend */ let dividend: number[] = Array(Math.ceil(input.leng...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left rstr2any AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,...
rstr2any(input: string, encoding: string) :string { let divisor: number = encoding.length; let i:number, j: number, q:number, x:number, quotient: number[]; /* Convert to an array of 16-bit big-endian values, forming the dividend */ let dividend: number[] = Array(Math.ceil(input.leng...
https://gitee.com/openharmony-sig/ohos_checksum.git
eda171d276a0b27b8154224ccfaaa6f4bf181f97
gitee
honjow/Next2V
shared/src/main/ets/storage/LocalDataCloudSync.ets
arkts
refreshAfterDownload
After a sync round downloads cloud rows STRAIGHT into the RDB (the cloud-sync engine bypasses the app's own write methods that publish counts — saveNode → publishSavedNodeCount etc.), the in-memory LocalContentStats holder is stale, so Me-page counts don't move until the user re-enters a page and it re-queries. Recompu...
private static refreshAfterDownload( context: common.UIAbilityContext, progress: relationalStore.ProgressDetails, ): void { if (!LocalDataCloudSync.hasDownloads(progress)) { return } CollectionSettings.loadLocalContentStats(context).catch((_error: Error) => {}) LocalDataPublisher.touch...
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 refreshAfterDownload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AS...
private static refreshAfterDownload( context: common.UIAbilityContext, progress: relationalStore.ProgressDetails, ): void { if (!LocalDataCloudSync.hasDownloads(progress)) { return } CollectionSettings.loadLocalContentStats(context).catch((_error: Error) => {}) LocalDataPublisher.touch...
https://github.com/honjow/Next2V
9647448e94e9d72865272099ab4d58efe456a810
github
openharmony/arkcompiler_taihe_ffi_gen
test/ani_overload/user/main.ets
arkts
test_10param1
测试 10 param1
function test_10param1() { let instance: test_overload.OverloadInterface = test_overload.get_interface(); let arri8: byte[] = [1, 2, 3]; let mystruct: test_overload.Mystruct = { testNum: 2147483647, testStr: "path/to/source" }; let color = test_overload.Color.red; instanc...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left test_10param1 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_decla...
function test_10param1() { let instance: test_overload.OverloadInterface = test_overload.get_interface(); let arri8: byte[] = [1, 2, 3]; let mystruct: test_overload.Mystruct = { testNum: 2147483647, testStr: "path/to/source" }; let color = test_overload.Color.red; instanc...
https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen
6e8aaed051c423f5d405933a4cc513093d297c53
gitcode
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/models/DataSource.ets
arkts
pushArrayData
添加一组数据 @param data 原始数据 @param flag true头部追加 false底部追加 @param start 开始索引 @param end 结束索引
public pushArrayData(data: T[], flag: boolean, start: number, end: number) { if (flag) { this.DataArray.unshift(...this.slice(data, start, end)) } else { this.DataArray.push(...this.slice(data, start, end)) } this.notifyDataAdd(this.DataArray.length - 1) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left pushArrayData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left data AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#R...
public pushArrayData(data: T[], flag: boolean, start: number, end: number) { if (flag) { this.DataArray.unshift(...this.slice(data, start, end)) } else { this.DataArray.push(...this.slice(data, start, end)) } this.notifyDataAdd(this.DataArray.length - 1) }
https://github.com/SMAT-Lab/PhantomRendering
71d01ec3b036eae280c428780ebca17dbe2fb9a2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
setSourceCustomOrder
设置书源自定义排序 @param sourceId 书源ID @param order 排序顺序(越小越靠前)
async setSourceCustomOrder(sourceId: string, order: number): Promise<boolean> { const source = this.sources.get(sourceId); if (!source) { return false; } source.customOrder = order; try { const dataManager = getNovelDataManager(); await dataManager.saveSource(source); ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setSourceCustomOrder 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...
async setSourceCustomOrder(sourceId: string, order: number): Promise<boolean> { const source = this.sources.get(sourceId); if (!source) { return false; } source.customOrder = order; try { const dataManager = getNovelDataManager(); await dataManager.saveSource(source); ...
https://github.com/DaLongZhuaZi/manxia
3543dcda02a72679e641b081e86005794e14fafb
github
OpenHarmonyToolkitsPlaza/LocationKitDemo
entry/src/main/ets/pages/location/LocationKitPage.ets
arkts
getContinuousRequestInfo
获取连续定位参数 @returns 连续定位请求参数
getContinuousRequestInfo(): geoLocationManager.ContinuousLocationRequest { // interval: 上报位置信息时间间隔,单位为秒 // locationScenario: 表示定位的场景信息 const requestInfo: geoLocationManager.ContinuousLocationRequest = { interval: 1, locationScenario: this.locationScenario } return requestInfo }
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getContinuousRequestInfo 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 ...
getContinuousRequestInfo(): geoLocationManager.ContinuousLocationRequest { // interval: 上报位置信息时间间隔,单位为秒 // locationScenario: 表示定位的场景信息 const requestInfo: geoLocationManager.ContinuousLocationRequest = { interval: 1, locationScenario: this.locationScenario } return requestInfo }
https://gitcode.com/OpenHarmonyToolkitsPlaza/LocationKitDemo
267a93a58e003a1f37069f4053b5a8728fdf88bc
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/WebDAVSyncService.ets
arkts
validateConfig
校验配置是否完整
private validateConfig(config: WebDAVConfig): string | null { if (config.serverUrl.trim().length === 0) { return '请先配置 WebDAV 服务地址' } if (config.username.trim().length === 0) { return '请先配置 WebDAV 用户名' } if (config.password.length === 0) { return '请先配置 WebDAV 密码' } return...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
private validateConfig(config: WebDAVConfig): string | null { if (config.serverUrl.trim().length === 0) { return '请先配置 WebDAV 服务地址' } if (config.username.trim().length === 0) { return '请先配置 WebDAV 用户名' } if (config.password.length === 0) { return '请先配置 WebDAV 密码' } return...
https://github.com/LongLiveY96/chatcube
1b8bb1c59ae508e45fddf94370802af589bd78ab
github
Countly/countly-sdk-hos
library/src/main/ets/CountlyConfig.ets
arkts
enableOfflineMode
Start the SDK in offline mode. The queue accepts enqueues but nothing is sent until `disableOfflineMode(deviceId?)` is called on the instance.
public enableOfflineMode(): NetworkConfig { this.startInOfflineMode = true; return this; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left enableOfflineMode 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 Netw...
public enableOfflineMode(): NetworkConfig { this.startInOfflineMode = true; return this; }
https://github.com/Countly/countly-sdk-hos
23d8c75cf65b148b8bef846264eb4c4a459939bc
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Boolean.ets
arkts
xor
Does `xor` on this instance and provided instance @param other provided instance @returns value as a result of `xor`
public xor(other: Boolean): Boolean { return Boolean.valueOf(this.value ^ other.unboxed()) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left xor AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
public xor(other: Boolean): Boolean { return Boolean.valueOf(this.value ^ other.unboxed()) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
e82d8a0ef6c02bddc9be5c010e768e6ec3c0cb5f
gitee
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/IMService.ets
arkts
markAllRead
全部标记已读
async markAllRead(): Promise<ApiResponse<any>> { return this.client.post<any>('/api/v1/im/read-all', {}) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left markAllRead AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_...
async markAllRead(): Promise<ApiResponse<any>> { return this.client.post<any>('/api/v1/im/read-all', {}) }
https://github.com/David8Idira/AI-OA
0e1bf8ec8e915b0b834ab7609a2630aed0367bca
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/NvHttp.ets
arkts
doRequest
执行 HTTP 请求 @param url 请求URL @param options 请求超时和证书选项
private async doRequest(url: string, options?: NvHttpRequestOptions): Promise<string> { const transferTimeout = options?.transferTimeout ?? NvHttp.READ_TIMEOUT; const connectTimeout = options?.connectTimeout ?? NvHttp.CONNECTION_TIMEOUT; const useClientCert = options?.useClientCert ?? false; console.d...
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 doRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:...
private async doRequest(url: string, options?: NvHttpRequestOptions): Promise<string> { const transferTimeout = options?.transferTimeout ?? NvHttp.READ_TIMEOUT; const connectTimeout = options?.connectTimeout ?? NvHttp.CONNECTION_TIMEOUT; const useClientCert = options?.useClientCert ?? false; console.d...
https://github.com/AlkaidLab/moonlight-harmony
a178ab5b0eea880974ce169b048a60638cef6798
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
readUint8
Reads the next unsigned byte. @returns The value.
readUint8(): number { return this.getUint8(this.mByteOffset++) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left readUint8 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_bl...
readUint8(): number { return this.getUint8(this.mByteOffset++) }
https://gitee.com/openharmony-sig/flutter_engine.git
70f5cc740e913f9216957b7f1a99fb82922c0f60
gitee
openharmony-sig/applications_calculator
feature/calculation/src/main/ets/calculator/Evaluator.ets
arkts
isOperator
is operator @param operator operator
isOperator(operator: number): boolean { return operator === KeyCode.KEYCODE_ADD || operator === KeyCode.KEYCODE_SUBTRACT || operator === KeyCode.KEYCODE_MULTIPLY || operator === KeyCode.KEYCODE_DIVIDE; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isOperator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left operator AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#Ri...
isOperator(operator: number): boolean { return operator === KeyCode.KEYCODE_ADD || operator === KeyCode.KEYCODE_SUBTRACT || operator === KeyCode.KEYCODE_MULTIPLY || operator === KeyCode.KEYCODE_DIVIDE; }
https://gitee.com/openharmony-sig/applications_calculator.git
e5534bfeb2932c7a01bcc8718538e3d06563632b
gitee
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterEngineCache.ets
arkts
contains
返回engineId对应的FlutterEngine是否存在
contains(engineId: String) : boolean { return this.cachedEngines.has(engineId); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left contains AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left engineId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left String AST#identifier#Right AST#ERROR#Right AST#)#Left ) AS...
contains(engineId: String) : boolean { return this.cachedEngines.has(engineId); }
https://gitee.com/openharmony-sig/flutter_engine.git
5c4fcfe10249919b10ba7803b6b6c9f975523576
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
div
Return a new Decimal whose value is the value of this Decimal divided by `n`, rounded to `precision` significant digits using rounding mode `rounding`. @param { Value } n {double | string | Decimal} @returns { Decimal } the Decimal type
public div(n: Value): Decimal { return Utils.divide(this, new Decimal(n)); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left div AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Ri...
public div(n: Value): Decimal { return Utils.divide(this, new Decimal(n)); }
https://gitcode.com/iop123123/arkts-static-skills
df4b3c6b92110395b5578549d07e74a68a78e953
gitcode
openharmony-sig/knowledge_demo_travel
FA/WeatherForeCast/entry/src/main/ets/MainAbility/pages/Main.ets
arkts
getRequest
请求方式:GET
getRequest() { // 每一个httpRequest对应一个http请求任务,不可复用 let httpRequest = http.createHttp() let url = 'https://devapi.qweather.com/v7/weather/now?location=101010100&key=48fbadf80bbc43ce853ab9a92408373e' httpRequest.request(url, (err, data) => { if (!err) { if (data.responseCode == 200) { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getRequest 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...
getRequest() { // 每一个httpRequest对应一个http请求任务,不可复用 let httpRequest = http.createHttp() let url = 'https://devapi.qweather.com/v7/weather/now?location=101010100&key=48fbadf80bbc43ce853ab9a92408373e' httpRequest.request(url, (err, data) => { if (!err) { if (data.responseCode == 200) { ...
https://gitee.com/openharmony-sig/knowledge_demo_travel.git
6ca6ac7acf3373142c269ce80b7101b5620f3067
gitee
azhu0001/localsend-harmony
entry/src/main/ets/components/DeviceIcon.ets
arkts
getIcon
mobile | desktop | web | headless | server
getIcon(deviceType: string): Resource { switch (deviceType) { case 'mobile': return $r('app.media.ic_mobile') case 'desktop': return $r('app.media.ic_computer') case 'server': return $r('app.media.ic_storage') case 'headless': return $r('app.media.ic_cli') ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getIcon AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceType AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)#Rig...
getIcon(deviceType: string): Resource { switch (deviceType) { case 'mobile': return $r('app.media.ic_mobile') case 'desktop': return $r('app.media.ic_computer') case 'server': return $r('app.media.ic_storage') case 'headless': return $r('app.media.ic_cli') ...
https://gitcode.com/azhu0001/localsend-harmony
e452e31f97c66aa14ac1b630f0728bac37f90cc7
gitcode
Joker-x-dev/CoolMallArkTS
core/designsystem/src/main/ets/component/Scroll.ets
arkts
build
构建带中等内边距的水平滚动布局 @returns {void} 无返回值
build(): void { HorizontalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"),...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { HorizontalScroll({ scroller: this.scroller, fillMaxSize: this.fillMaxSize, fillMaxWidth: this.fillMaxWidth, widthValue: this.widthValue, heightValue: this.heightValue, scrollBarState: this.scrollBarState, paddingValue: $r("app.float.space_padding_medium"),...
https://github.com/Joker-x-dev/CoolMallArkTS
07daf813330d2674500009845db76a0a69810b3d
github
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/AudioManager.ets
arkts
initAudioPlayer
初始化音频播放器
private async initAudioPlayer(): Promise<void> { try { this.audioPlayer = await media.createAudioPlayer(); this.setupEventListeners(); } catch (error) { console.error('初始化音频播放器失败:', error); } }
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 initAudioPlayer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
private async initAudioPlayer(): Promise<void> { try { this.audioPlayer = await media.createAudioPlayer(); this.setupEventListeners(); } catch (error) { console.error('初始化音频播放器失败:', error); } }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
a323689efc55ce2aa645f4fde35a13d82a67a203
github
LongLiveY96/chatcube
entry/src/main/ets/services/ChatTaskOrchestratorService.ets
arkts
failOrphanedTasksForSession
终结指定 session 中所有未完成的 RUNNING 任务。 供 ChatPage.fixInconsistentState 在检测到"isSending=true 但无活跃请求"时调用, 确保 orchestrator 侧的任务计数同步下降。
failOrphanedTasksForSession(sessionId: string): void { if (sessionId === '') { return } const orphanedTaskIds: string[] = [] this.tasks.forEach((runtime: ChatTaskRuntime, key: string) => { if (runtime.info.sessionId === sessionId && runtime.info.status === ChatTaskStatus.RUNNING &&...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left failOrphanedTasksForSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sessionId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST...
failOrphanedTasksForSession(sessionId: string): void { if (sessionId === '') { return } const orphanedTaskIds: string[] = [] this.tasks.forEach((runtime: ChatTaskRuntime, key: string) => { if (runtime.info.sessionId === sessionId && runtime.info.status === ChatTaskStatus.RUNNING &&...
https://github.com/LongLiveY96/chatcube
ecd0965431b84a093cc614a906d5505d592ada28
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/common/VNCConnection.ets
arkts
parseServerVersion
解析VNC服务器版本响应
static parseServerVersion(data: ArrayBuffer): string { const view = new Uint8Array(data); let version = ''; for (let i = 0; i < view.length; i++) { version += String.fromCharCode(view[i]); } return version.trim(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left parseServerVersion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
static parseServerVersion(data: ArrayBuffer): string { const view = new Uint8Array(data); let version = ''; for (let i = 0; i < view.length; i++) { version += String.fromCharCode(view[i]); } return version.trim(); }
https://github.com/AetheriumSimulator/qemu-hmos
b2e7b7026e107b0a3d17f7772f247cad6daf2c75
github
harmonyos/codelabs
HarmonyOS_NEXT/DistributedContacts/entry/src/main/ets/entryability/EntryAbility.ets
arkts
permissions
Apply for the permission to exchange data between different devices.
permissions(): void { let atManager = abilityAccessCtrl.createAtManager(); try { atManager.requestPermissionsFromUser(this.context, ['ohos.permission.DISTRIBUTED_DATASYNC']).then((data) => { Logger.info(TAG, `Data permissions:${data.permissions}`); }); } catch (err) { Logger.info...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left permissions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#...
permissions(): void { let atManager = abilityAccessCtrl.createAtManager(); try { atManager.requestPermissionsFromUser(this.context, ['ohos.permission.DISTRIBUTED_DATASYNC']).then((data) => { Logger.info(TAG, `Data permissions:${data.permissions}`); }); } catch (err) { Logger.info...
https://gitee.com/harmonyos/codelabs.git
c872fd06b6380b0bbad549b68636eaddd3747bfd
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/highlight/Highlight.ets
arkts
getAxis
Returns the axis the highlighted value belongs to. @return
public getAxis(): AxisDependency | null { return this.axis; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAxis AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#ide...
public getAxis(): AxisDependency | null { return this.axis; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
72a589e5974021f54d97ed826c0c0e7a4f6da5bd
gitee
JackJiang2011/harmonychat
entry/src/main/ets/pages/model/MessagesProvider.ets
arkts
clear
清空所有消息。
clear(): void { this.messages = []; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left A...
clear(): void { this.messages = []; }
https://github.com/JackJiang2011/harmonychat
691088feebb46d9a76076aba50a428a7d2cda42e
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test11_original_index.ets
arkts
testStringChar
--- String charAt, charCodeAt, substring ---
function testStringChar(): string { let s: string = 'Hello'; let c: string = s.charAt(1); let code: number = s.charCodeAt(0); let sub: string = s.substring(1, 4); return c + ',' + String(code) + ',' + sub; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testStringChar 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_t...
function testStringChar(): string { let s: string = 'Hello'; let c: string = s.charAt(1); let code: number = s.charCodeAt(0); let sub: string = s.substring(1, 4); return c + ',' + String(code) + ',' + sub; }
https://github.com/miaochiahao/ark-ghidra
0cdf323e834664668fdd5796d5e3b530507c27b5
github
openharmony/arkui_ace_engine
advanced_ui_component/treeviewv2/source/treeviewv2.ets
arkts
onNodeMove
Node move event registration and processing. @syscap SystemCapability.ArkUI.ArkUI.Full @since 26
public onNodeMove(callback: OnChangedCallback): void { this.nodeMoveEvents.push(callback); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onNodeMove 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#Left O...
public onNodeMove(callback: OnChangedCallback): void { this.nodeMoveEvents.push(callback); }
https://gitcode.com/openharmony/arkui_ace_engine
119d2a7eba68226b4ec220e9db6680ef784771bc
gitcode
XJTUWYD/ArkDiff
entry/src/main/ets/engine/FilterRuleEngine.ets
arkts
getCommonIgnorePatterns
获取常用的忽略模式
static getCommonIgnorePatterns(): string[] { return [ 'node_modules/**', '.git/**', '*.log', '*.lock', '*.min.js', '*.min.css', 'dist/**', 'build/**', '.DS_Store', 'Thumbs.db', '__pycache__/**', '*.pyc', '.env', '*.swp', '*....
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCommonIgnorePatterns 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#Lef...
static getCommonIgnorePatterns(): string[] { return [ 'node_modules/**', '.git/**', '*.log', '*.lock', '*.min.js', '*.min.css', 'dist/**', 'build/**', '.DS_Store', 'Thumbs.db', '__pycache__/**', '*.pyc', '.env', '*.swp', '*....
https://github.com/XJTUWYD/ArkDiff
116bcf53adab0b1b78b72a53e76c76eceae66898
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadManager.ets
arkts
updateButtonState
更新按钮状态 @param state 状态对象 @param buttonFlag 按钮标志位 @param isPressed 是否按下
private updateButtonState(state: GamepadState, buttonFlag: number, isPressed: boolean): void { if (isPressed) { state.buttons |= buttonFlag; } else { state.buttons &= ~buttonFlag; } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateButtonState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
private updateButtonState(state: GamepadState, buttonFlag: number, isPressed: boolean): void { if (isPressed) { state.buttons |= buttonFlag; } else { state.buttons &= ~buttonFlag; } }
https://github.com/AlkaidLab/moonlight-harmony
1e8ad979061d387b6b9c1c5833471704f4f7a957
github
offlinecat-dev/OCNetORM
src/main/ets/query/SubQuery.ets
arkts
whereNotNull
添加 IS NOT NULL 条件 @param column 列名 @returns 当前实例(支持链式调用)
whereNotNull(column: string): SubQuery { const condition = WhereCondition.isNotNull(column) condition.logicalOperator = LogicalOperator.AND this.conditions.push(condition) return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left whereNotNull AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) ...
whereNotNull(column: string): SubQuery { const condition = WhereCondition.isNotNull(column) condition.logicalOperator = LogicalOperator.AND this.conditions.push(condition) return this }
https://github.com/offlinecat-dev/OCNetORM
95db49e89a590e1de6b9305589199f298306d7c7
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrShareService.ets
arkts
deserializeV3
从 v3 管道格式反序列化
function deserializeV3(data: string): [string, CustomKeyDef[]] | null { const lines = data.split('\n'); if (lines.length < 3 || lines[0] !== '3') return null; const profileName = lines[1]; const keys: CustomKeyDef[] = []; for (let i = 2; i < lines.length; i++) { const line = lines[i].trim(); if (line....
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left deserializeV3 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function deserializeV3(data: string): [string, CustomKeyDef[]] | null { const lines = data.split('\n'); if (lines.length < 3 || lines[0] !== '3') return null; const profileName = lines[1]; const keys: CustomKeyDef[] = []; for (let i = 2; i < lines.length; i++) { const line = lines[i].trim(); if (line....
https://github.com/AlkaidLab/moonlight-harmony
a512b9c46683f5df7ea7c1a35378090d1ad682bb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
from
Creates an array from an array-like or iterable object. @param { ArrayLike<number> } arrayLike - An array-like or iterable object to convert to an array. @returns { Float32Array } - A new Float32Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arrayLike: ArrayLike<number>): Float32Array { return Float32Array.from<number>(arrayLike, (x: number, k: number): number => x) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arrayLike AST#identifie...
public static from(arrayLike: ArrayLike<number>): Float32Array { return Float32Array.from<number>(arrayLike, (x: number, k: number): number => x) }
https://gitcode.com/iop123123/arkts-static-skills
6c652151e6e4c0b75d989dfefcb36efd6f115073
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/NeurologyAgent.ets
arkts
canHandle
判断是否能处理该问题 @param question 用户问题 @returns 是否能处理
canHandle(question: string): boolean { const keywords = [ '神经', '脑', '头痛', '头晕', '眩晕', '麻木', '震颤', '帕金森', '癫痫', '痴呆', '认知', '记忆', '中风', '脑梗', '脑出血', '脑血管', 'TIA', '偏头痛' ]; const lowerQuestion = question.toLowerCase(); return keywords.some(keyword => lowerQuestion.includes(keywo...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left canHandle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left question AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)#Rig...
canHandle(question: string): boolean { const keywords = [ '神经', '脑', '头痛', '头晕', '眩晕', '麻木', '震颤', '帕金森', '癫痫', '痴呆', '认知', '记忆', '中风', '脑梗', '脑出血', '脑血管', 'TIA', '偏头痛' ]; const lowerQuestion = question.toLowerCase(); return keywords.some(keyword => lowerQuestion.includes(keywo...
https://github.com/LJ666-ui/harmony-health-care
2310c7edb17884d10762ca674a0c337361ac032a
github
fbinba3955/Flymby
common/src/main/ets/utils/DateUtil.ets
arkts
getTimeDifferenceString
获取时间差的可读字符串 @param startTime 开始时间戳 @param endTime 结束时间戳,默认为当前时间 @returns 时间差字符串,如 "2分钟前"、"1小时前"
static getTimeDifferenceString(startTime: number, endTime: number = Date.now()): string { const diff = endTime - startTime; const seconds = Math.floor(diff / 1000); const minutes = Math.floor(seconds / 60); const hours = Math.floor(minutes / 60); const days = Math.floor(hours / 24); if (d...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTimeDifferenceString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left startTime AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number ...
static getTimeDifferenceString(startTime: number, endTime: number = Date.now()): string { const diff = endTime - startTime; const seconds = Math.floor(diff / 1000); const minutes = Math.floor(seconds / 60); const hours = Math.floor(minutes / 60); const days = Math.floor(hours / 24); if (d...
https://github.com/fbinba3955/Flymby
0c3abbc32117307b8ce6832889df0550809d242d
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getHoleRadius
Returns the size of the hole radius in percent of the total radius. @return
public getHoleRadius(): number { return this.mHoleRadiusPercent; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHoleRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#n...
public getHoleRadius(): number { return this.mHoleRadiusPercent; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
214f9fbc0ec7b4e72748881e23ac3af94969747d
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Services/DataService.ets
arkts
updateUserPreferences
更新用户偏好设置
public async updateUserPreferences(preferences: UserPreferencesPartial): Promise<void> { try { // 这里需要实现用户偏好设置的存储逻辑 logger.info(TAG, '更新用户偏好设置', String(preferences)); } catch (error) { logger.error(TAG, '更新用户偏好设置失败' + String(error)); throw error as Error; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left updateUserPreferences AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left preferences AST#identifier#Right A...
public async updateUserPreferences(preferences: UserPreferencesPartial): Promise<void> { try { // 这里需要实现用户偏好设置的存储逻辑 logger.info(TAG, '更新用户偏好设置', String(preferences)); } catch (error) { logger.error(TAG, '更新用户偏好设置失败' + String(error)); throw error as Error; } }
https://github.com/DaLongZhuaZi/manxia
4b46cc71908b4a0b5fac1b1c0d0de3aed5d77fff
github
ASweetBite/HarmonyPulse
entry/src/main/ets/type/GlobalMusic.ets
arkts
initData
初始化数据 (改为由外部传入数据库查询结果)
initData(list: SongItemType[]) { this.songList = [...list]; if (this.songList.length > 0 && this.currentID === "") { this.resetToMusic(0); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left list AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left So...
initData(list: SongItemType[]) { this.songList = [...list]; if (this.songList.length > 0 && this.currentID === "") { this.resetToMusic(0); } }
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/type/GlobalMusic.ets#L42-L47
5a12304e6607eb661647dafd24f90a23411d869d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Array.ets
arkts
constructor
Creates a new instance of Array with the specified initial length. @param { int } arrayLen The initial length of the array. @syscap SystemCapability.Utils.Lang @FaAndStageModel
private constructor(arrayLen: int) { this.buffer = new FixedArray<Any>(arrayLen) this.actualLength = arrayLen }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left arrayLen AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#ident...
private constructor(arrayLen: int) { this.buffer = new FixedArray<Any>(arrayLen) this.actualLength = arrayLen }
https://gitcode.com/iop123123/arkts-static-skills
975809de5dd37bb63f64ebdd3a047bcd32ee58d7
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/CryptoUtil.ets
arkts
asn1BitString
构造 ASN.1 BIT STRING
private static asn1BitString(data: Uint8Array): Uint8Array { const len = CryptoUtil.encodeAsn1Length(data.length + 1); const result = new Uint8Array(1 + len.length + 1 + data.length); result[0] = 0x03; // BIT STRING tag result.set(len, 1); result[1 + len.length] = 0; // unused bits result.set(...
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 asn1BitString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left :...
private static asn1BitString(data: Uint8Array): Uint8Array { const len = CryptoUtil.encodeAsn1Length(data.length + 1); const result = new Uint8Array(1 + len.length + 1 + data.length); result[0] = 0x03; // BIT STRING tag result.set(len, 1); result[1 + len.length] = 0; // unused bits result.set(...
https://github.com/AlkaidLab/moonlight-harmony
312329c2c69de238a76ab8c3328fd4782046b380
github
RedRackham-R/WanAndroidHarmoney
entry/src/main/ets/global/viewmodel/GlobalSettingViewModel.ets
arkts
getTheme
获取主题 @returns
public getTheme(): Wanthemes.IWanTheme { return this.currentTheme }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTheme 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#member_expression#Left AST#id...
public getTheme(): Wanthemes.IWanTheme { return this.currentTheme }
https://github.com/RedRackham-R/WanAndroidHarmoney
2e1ad0aae90b65f845e5b905e7ca854cd8461430
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/WebDavClient.ets
arkts
valid
验证服务器和验证方式是否可用 @returns
public async valid(): Promise<ResultInfo> { const req = new rcp.Request('/', "PROPFIND", { "Depth": "0" }); return await this.request(req); }
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 valid AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : A...
public async valid(): Promise<ResultInfo> { const req = new rcp.Request('/', "PROPFIND", { "Depth": "0" }); return await this.request(req); }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/WebDavClient.ets#L213-L216
6226e01434b4beda370c2488b82c4d8e8b83926d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets
arkts
tryAsString
Attempts to get a string value from an object by key. Returns undefined if the key is not found or if the value is not a string. @param {string} key - The key to look up @returns {string} The string value if found, undefined otherwise
tryAsString(): string | undefined { return this.jsonType == JsonType.JsonString ? this.maybeStringValue : undefined }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left tryAsString 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#string#Le...
tryAsString(): string | undefined { return this.jsonType == JsonType.JsonString ? this.maybeStringValue : undefined }
https://gitcode.com/iop123123/arkts-static-skills
e4789bee14fad959a44b5f0286fc74561e54382e
gitcode
openharmony-tpc/openharmony_tpc_samples
dialogs/library/src/main/ets/components/progress/base/LVBase.ets
arkts
getAnimIsRunning
获取动画是否在执行
getAnimIsRunning() { return this.animing }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAnimIsRunning AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L...
getAnimIsRunning() { return this.animing }
https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git
acf34b12319923cd265443af424d5bccc5550da6
gitee
openharmony/applications_calendar_data
datamanager/src/main/ets/processor/instances/InstanceQueryParams.ets
arkts
parseBeginEndFromQueryMap
try parse begin and end params from queryMap @param queryMap params map parsed from uri @param params the object to save parse result
function parseBeginEndFromQueryMap(queryMap: Map<string, string>, params: InstancesQueryParams): void { const beginStr = queryMap.get(KEY_RANGE_BEGIN) as string; const endStr = queryMap.get(KEY_RANGE_END) as string; if (isEmptyStr(beginStr) || isEmptyStr(endStr)) { Log.warn(TAG, 'parseBeginEndFromUri get inva...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left parseBeginEndFromQueryMap AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left queryMap AST#identifier#Right AST#type_annotation#Left AST#:...
function parseBeginEndFromQueryMap(queryMap: Map<string, string>, params: InstancesQueryParams): void { const beginStr = queryMap.get(KEY_RANGE_BEGIN) as string; const endStr = queryMap.get(KEY_RANGE_END) as string; if (isEmptyStr(beginStr) || isEmptyStr(endStr)) { Log.warn(TAG, 'parseBeginEndFromUri get inva...
https://gitee.com/openharmony/applications_calendar_data.git
c35b09528bc5821bb26fdc08d5f62d41ad6e1a93
gitee
openharmony/arkui_advanced_ui_component
atomicserviceweb/source/atomicserviceweb.ets
arkts
interceptOverrideUrlLoading
拦截url跳转
interceptOverrideUrlLoading(url: string): boolean { if (!url) { return false; } // 处理tel:协议 if (url.startsWith(TEL_PROTOCOL)) { this.openMakeCall(url); return false; } // 处理mailto:协议 if (url.startsWith(MAILTO_PROTOCOL)) { this.openSendMail(url); return false; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left interceptOverrideUrlLoading AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
interceptOverrideUrlLoading(url: string): boolean { if (!url) { return false; } // 处理tel:协议 if (url.startsWith(TEL_PROTOCOL)) { this.openMakeCall(url); return false; } // 处理mailto:协议 if (url.startsWith(MAILTO_PROTOCOL)) { this.openSendMail(url); return false; ...
https://gitee.com/openharmony/arkui_advanced_ui_component.git
d6c6dafd9123a10b1d2a4e38696604cec4a5fbc7
gitee
HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts
entry/src/main/ets/common/AvoidRepeatClick.ets
arkts
avoidRepeatClick
Record the time of the last repeated tap.
public static avoidRepeatClick(callback: VoidCallback, interval: number = 400) { const currentTime = Date.now(); if (Math.abs(currentTime - AvoidRepeatClick.lastClickTime) > interval) { AvoidRepeatClick.lastClickTime = currentTime; hilog.info(domainId, logTag, 'Effective click'); callback();...
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 avoidRepeatClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Le...
public static avoidRepeatClick(callback: VoidCallback, interval: number = 400) { const currentTime = Date.now(); if (Math.abs(currentTime - AvoidRepeatClick.lastClickTime) > interval) { AvoidRepeatClick.lastClickTime = currentTime; hilog.info(domainId, logTag, 'Effective click'); callback();...
https://gitcode.com/HarmonyOS_Samples/accountkit-samplecode-clientdemo-arkts
f28c4847dba4309bd09ff6c99f23b3fd58db8770
gitcode
Joker-x-dev/CoolMallArkTS
feature/auth/src/main/ets/viewmodel/RegisterViewModel.ets
arkts
updatePassword
更新密码 @param {string} value - 密码 @returns {void} 无返回值
updatePassword(value: string): void { }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updatePassword 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 )...
updatePassword(value: string): void { }
https://github.com/Joker-x-dev/CoolMallArkTS
7a0c9070020770a546e2445ea4d00d215717d9ed
github
electronicminer/Harmony-Markdown-Editor
entry/src/main/ets/pages/Editor.ets
arkts
onPageHide
#9 onPageHide 时刷新待保存内容
onPageHide(): void { if (this.typingTimer !== -1) { clearTimeout(this.typingTimer); this.typingTimer = -1; // 如果有未保存更改,立即刷新 if (this.hasUnsavedChanges && this.autoSave) { this.performAutoSave(); } } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onPageHide AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L...
onPageHide(): void { if (this.typingTimer !== -1) { clearTimeout(this.typingTimer); this.typingTimer = -1; // 如果有未保存更改,立即刷新 if (this.hasUnsavedChanges && this.autoSave) { this.performAutoSave(); } } }
https://github.com/electronicminer/Harmony-Markdown-Editor
6c3704114388bd517be1a0d4c7aedd6d326a5af3
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/NetworkManager.ets
arkts
clearSessionInfo
Clear session info
static clearSessionInfo(): void { currentSession = null; NetworkManager.cancelReconnect(); console.info(`${TAG}: Session info cleared`); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left clearSessionInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#vo...
static clearSessionInfo(): void { currentSession = null; NetworkManager.cancelReconnect(); console.info(`${TAG}: Session info cleared`); }
https://github.com/tangwengang-del/freerdp-harmonyos
4a9055b16244bf6e5f6d3299c92c432113c55cf0
github
HarmonyOS_Samples/guide-snippets
ArkGraphics2D/DisplaySoloist/entry/src/main/ets/pages/Index.ets
arkts
build
[EndExclude display_soloist_create_xcomponent] [StartExclude display_soloist_disappear]
build() { Column() { Row() { // [StartExclude display_soloist_create_xcomponent] Text('30fps') .fontWeight(FontWeight.Bold) .fontSize(12) .fontColor(Color.Red) .textAlign(TextAlign.End) .width(40) .height(30) // [EndExclude ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#object#Left AST#{#Left { AST#{#Right AST#method_def...
build() { Column() { Row() { // [StartExclude display_soloist_create_xcomponent] Text('30fps') .fontWeight(FontWeight.Bold) .fontSize(12) .fontColor(Color.Red) .textAlign(TextAlign.End) .width(40) .height(30) // [EndExclude ...
https://gitcode.com/HarmonyOS_Samples/guide-snippets
8c7f64adcc17b81527fc6f66c599429e66b3e48e
gitcode
tdcare/tdwebrtc
src/main/ets/MediaStream.ets
arkts
clearStaleVideoFrames
v27: 清空待解码队列中的旧帧,只保留最新关键帧 防止缓冲区累积导致延迟过高
private clearStaleVideoFrames(): void { if (this.pendingVideoFrames.length > 3) { // 队列超过 3 帧,丢弃所有旧帧,只保留最后 3 帧 const keepCount: number = Math.min(3, this.pendingVideoFrames.length); const dropCount: number = this.pendingVideoFrames.length - keepCount; this.pendingVideoFrames.splic...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left clearStaleVideoFrames 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 A...
private clearStaleVideoFrames(): void { if (this.pendingVideoFrames.length > 3) { // 队列超过 3 帧,丢弃所有旧帧,只保留最后 3 帧 const keepCount: number = Math.min(3, this.pendingVideoFrames.length); const dropCount: number = this.pendingVideoFrames.length - keepCount; this.pendingVideoFrames.splic...
https://github.com/tdcare/tdwebrtc
69b0eb10ba5372ffd1493ae1708b1b6396c5cbee
github
xufei5789651/HmWan
commons/utils/src/main/ets/manager/PreferenceManager.ets
arkts
setValue
将数据写入Preferences实例 @param key @param value @returns
async setValue<T>(context: Context, key: string, value: T): Promise<void> { this.initPreference(context, PREFERENCES_NAME); this.preferences!.put(key, JSON.stringify(value)).then(() => { this.saveUserData(); }) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setValue AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type...
async setValue<T>(context: Context, key: string, value: T): Promise<void> { this.initPreference(context, PREFERENCES_NAME); this.preferences!.put(key, JSON.stringify(value)).then(() => { this.saveUserData(); }) }
https://github.com/xufei5789651/HmWan
85b28f336bd34df038020678eb1c902732c35831
github
openharmony/applications_contacts
entry/src/main/ets/model/ContactAbilityModel.ets
arkts
dealParam
Convert the data to the database. @param {string} DAHelper Database path @param {Object} addParams Contact Information @param {boolean} isCard Indicates whether the information is a business card.
dealParam(daHelper: dataShare.DataShareHelper | null, addParams: ContactInfo, isCard: boolean, callBack: Function | undefined) { if (daHelper != null || daHelper != undefined) { let result = addParams.id; let uri = isCard ? PROFILE_CONTACT_DATA_URI : Data.CONTENT_URI; this.dataContact(addPa...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left dealParam AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left daHelper AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#member_expressio...
dealParam(daHelper: dataShare.DataShareHelper | null, addParams: ContactInfo, isCard: boolean, callBack: Function | undefined) { if (daHelper != null || daHelper != undefined) { let result = addParams.id; let uri = isCard ? PROFILE_CONTACT_DATA_URI : Data.CONTENT_URI; this.dataContact(addPa...
https://gitee.com/openharmony/applications_contacts.git
c3ed586702aaaf1c3c1fd9206179401d7c33fa1e
gitee
egavrin/arkts_agent_kit
examples/http-lite/src/tests/http.test.ets
arkts
testCookieMultiSet
---- Cookie tests ----
async function testCookieMultiSet(): Promise<void> { let c = new HttpClient() let opts = new HttpClientOptions() opts.timeout = 10000 let resp = await c.get(SERVER + "/cookie-set-multi", opts) await verifyResponse(resp, 200, "multi-ok", 1) let jar = c.getCookieJar() let cookies = jar.getCook...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left testCookieMultiSet AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left ...
async function testCookieMultiSet(): Promise<void> { let c = new HttpClient() let opts = new HttpClientOptions() opts.timeout = 10000 let resp = await c.get(SERVER + "/cookie-set-multi", opts) await verifyResponse(resp, 200, "multi-ok", 1) let jar = c.getCookieJar() let cookies = jar.getCook...
https://gitcode.com/egavrin/arkts_agent_kit
04e8a5817b91bb96d196a0db11e28ed9609c0763
gitcode
openharmony/security_privacy_center
entry/src/main/ets/common/utils/ResourceUtil.ets
arkts
getResourceString
Obtains the resource name @param resource Resource file @returns Resource File Name
getResourceString(context: object, resource: Resource, params?: Array<string | number>): string { let resourceString: string = ''; try { if (params && params.length) { resourceString = getContext(context).resourceManager.getStringSync(resource.id, ...params); } else { resourceStrin...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getResourceString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left context AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#object#Left object AST#object#Right AST#ERROR#Right AST#,#Left , AS...
getResourceString(context: object, resource: Resource, params?: Array<string | number>): string { let resourceString: string = ''; try { if (params && params.length) { resourceString = getContext(context).resourceManager.getStringSync(resource.id, ...params); } else { resourceStrin...
https://gitee.com/openharmony/security_privacy_center.git
49d04d938d8bf009a42874e756bb64e9030cdcc7
gitee
aimilin6688/KeePassHO
entry/src/main/ets/services/template/TemplateService.ets
arkts
getAllTemplates
==================== 模板获取 ==================== 获取所有可用模板(预置 + 用户)
getAllTemplates(kdbx: Kdbx): ITemplate[] { const templates: ITemplate[] = []; // 添加预置模板 const presetTemplates = this.getPresetTemplates(); for (let i = 0; i < presetTemplates.length; i++) { templates.push(presetTemplates[i]); } // 添加用户模板 if (kdbx) { const userTemplates = this...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAllTemplates AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left kdbx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Kdbx AST#identifier#Right...
getAllTemplates(kdbx: Kdbx): ITemplate[] { const templates: ITemplate[] = []; // 添加预置模板 const presetTemplates = this.getPresetTemplates(); for (let i = 0; i < presetTemplates.length; i++) { templates.push(presetTemplates[i]); } // 添加用户模板 if (kdbx) { const userTemplates = this...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateService.ets#L63-L81
bba8105687cb4ca923348154207d073d34b3419c
github
Xiwei753/xiezuoruanjian
apps/harmony/entry/src/main/ets/common/AdaptiveContext.ets
arkts
registerFoldStatusChange
========== 折叠状态变化监听 ==========
private registerFoldStatusChange(): void { try { display.on('foldStatusChange', (foldStatus: number) => { let newPosture: FoldPosture // display.FoldStatus 枚举值:FOLD_STATUS_EXPANDED=2, FOLD_STATUS_HALF_FOLDED=3, FOLD_STATUS_FOLDED=1 if (foldStatus === 2) { newPosture = FoldP...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerFoldStatusChange 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#Righ...
private registerFoldStatusChange(): void { try { display.on('foldStatusChange', (foldStatus: number) => { let newPosture: FoldPosture // display.FoldStatus 枚举值:FOLD_STATUS_EXPANDED=2, FOLD_STATUS_HALF_FOLDED=3, FOLD_STATUS_FOLDED=1 if (foldStatus === 2) { newPosture = FoldP...
https://github.com/Xiwei753/xiezuoruanjian
cd81314c0ff593491f793316dd1bead1e01507af
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets
arkts
uint8ArrayToHex
Uint8Array转十六进制字符串
private uint8ArrayToHex(arr: Uint8Array): string { let hex = ''; for (let i = 0; i < arr.length; i++) { hex += arr[i].toString(16).padStart(2, '0'); } return hex; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left uint8ArrayToHex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
private uint8ArrayToHex(arr: Uint8Array): string { let hex = ''; for (let i = 0; i < arr.length; i++) { hex += arr[i].toString(16).padStart(2, '0'); } return hex; }
https://github.com/DaLongZhuaZi/manxia
8791417589518aec5a2a15152e8bfbc383cc898e
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test19_original_index.ets
arkts
testReplaceAll
--- String.replaceAll ---
function testReplaceAll(): string { let s: string = 'aabbccaabb'; let result: string = s.replaceAll('aa', 'XX'); return result; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testReplaceAll 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_t...
function testReplaceAll(): string { let s: string = 'aabbccaabb'; let result: string = s.replaceAll('aa', 'XX'); return result; }
https://github.com/miaochiahao/ark-ghidra
30256ee6d9f1b26ee0d054a97833f70bf1a367d0
github
aimilin6688/KeePassHO
entry/src/main/ets/services/SettingsService.ets
arkts
init
初始化首选项存储 @param context UIAbilityContext
public async init(context: common.UIAbilityContext): Promise<void> { return new Promise(async (resolve, reject) => { try { this.preferences = await preferences.getPreferences(context, SettingsService.PREFERENCES_NAME); // 初始化主题 const themeMode = await this.getThemeMode(); awa...
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 init AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Rig...
public async init(context: common.UIAbilityContext): Promise<void> { return new Promise(async (resolve, reject) => { try { this.preferences = await preferences.getPreferences(context, SettingsService.PREFERENCES_NAME); // 初始化主题 const themeMode = await this.getThemeMode(); awa...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/SettingsService.ets#L89-L104
dff2a1eb570821a4add6fcf4d8b819728a8d0058
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/TypedEntityData.ets
arkts
setString
设置字符串类型的属性值(自动触发 UI 刷新) @param key 属性名 @param value 属性值
setString(key: string, value: string): void { this.data.set(key, value) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#...
setString(key: string, value: string): void { this.data.set(key, value) }
https://github.com/offlinecat-dev/OCNetORM
6eeacb1faa55ed888d2613d90cac8c31a0c0c03e
github
fbinba3955/Flymby
common/src/main/ets/utils/BrightnessUtil.ets
arkts
exitVideoPage
退出视频页面,恢复默认亮度
public static async exitVideoPage(): Promise<void> { await BrightnessUtil.setBrightness(BrightnessUtil.NAV_DESTINATION_DEFAULT, BrightnessUtil.SET_BRIGHTNESS_CLICK); LogUtil.info('BrightnessUtil 退出视频页面,恢复默认亮度'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left exitVideoPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#...
public static async exitVideoPage(): Promise<void> { await BrightnessUtil.setBrightness(BrightnessUtil.NAV_DESTINATION_DEFAULT, BrightnessUtil.SET_BRIGHTNESS_CLICK); LogUtil.info('BrightnessUtil 退出视频页面,恢复默认亮度'); }
https://github.com/fbinba3955/Flymby
06dd80b5f2a4b7309e060f7bd7ff92892737c1f8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
UTC
Returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. @param { Date } d to be converted to milliseconds. @returns { long } get new date value @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static UTC(d: Date): long { return d.ms; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left UTC AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identi...
public static UTC(d: Date): long { return d.ms; }
https://gitcode.com/iop123123/arkts-static-skills
0791c7c126ae948a2ff4201d2161c067d7d2505e
gitcode
Delsin-Yu/JustPDF
entry/src/main/ets/pages/pdfview/PDFAnnotationController.ets
arkts
schedulePersistDrawColorPreferences
自定义色在拾色器拖动时高频更新,合并写入偏好以避免频繁 flushSync。
private schedulePersistDrawColorPreferences(): void { this.cancelDrawColorPersistSchedule(); this.drawColorPersistTimer = setTimeout((): void => { this.drawColorPersistTimer = undefined; this.persistDrawColorPreferences(); }, 220); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left schedulePersistDrawColorPreferences 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...
private schedulePersistDrawColorPreferences(): void { this.cancelDrawColorPersistSchedule(); this.drawColorPersistTimer = setTimeout((): void => { this.drawColorPersistTimer = undefined; this.persistDrawColorPreferences(); }, 220); }
https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/pages/pdfview/PDFAnnotationController.ets#L182-L188
cdf7f899f557e9d846ac56e5009a774dd568b414
github
751496032/ZRouter
RouterApi/src/main/ets/model/NavDestBuilder.ets
arkts
pop
返回上一页 @param animated
public pop(animated: boolean = true): boolean { this.updateCurrentStackName() return this.routerMgr.pop(animated) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left pop AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left animated AST#identifier#Right AST#:#Left : AST#:#Right AST#E...
public pop(animated: boolean = true): boolean { this.updateCurrentStackName() return this.routerMgr.pop(animated) }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/model/NavDestBuilder.ets#L266-L269
55d7cf0109d96453adffa8970cf0f78d0d31fdaa
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/GoogleBooksScraper.ets
arkts
makeRequest
发送HTTP请求
private async makeRequest(url: string): Promise<string> { const httpRequest = http.createHttp(); try { const response = await httpRequest.request(url, { method: http.RequestMethod.GET, header: this.buildHeaders(), connectTimeout: this.config.timeout || 15000, readTim...
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 makeRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST...
private async makeRequest(url: string): Promise<string> { const httpRequest = http.createHttp(); try { const response = await httpRequest.request(url, { method: http.RequestMethod.GET, header: this.buildHeaders(), connectTimeout: this.config.timeout || 15000, readTim...
https://github.com/DaLongZhuaZi/manxia
3863de717cecfdaf973828b34f41192f82216dde
github
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/RemoteKeyDispatcher.ets
arkts
releaseAllHeldKeys
释放所有可能按下的修饰键 + 鼠标键
releaseAllHeldKeys(loader: ExtensionLoader, sessionId: number, toSource: SourceSpaceFn, cursorX: number, cursorY: number): void { try { loader.sendKey(sessionId, KEYCODE_CTRL_LEFT, false); loader.sendKey(sessionId, KEYCODE_CTRL_RIGHT, false); loader.sendKey(sessionId, KEYCODE_ALT_LEFT, false...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left releaseAllHeldKeys AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left loader AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ExtensionLoader AST#identifier#Righ...
releaseAllHeldKeys(loader: ExtensionLoader, sessionId: number, toSource: SourceSpaceFn, cursorX: number, cursorY: number): void { try { loader.sendKey(sessionId, KEYCODE_CTRL_LEFT, false); loader.sendKey(sessionId, KEYCODE_CTRL_RIGHT, false); loader.sendKey(sessionId, KEYCODE_ALT_LEFT, false...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
f21529ab6457b2f1eddfee57ba97ca911a7da8e2
github
openharmony/arkui_ace_engine
advanced_ui_component/treeviewv2/source/treeviewv2.ets
arkts
add
add new node @param initBuild whether is in initialization process
public add(initBuild: boolean): void { let clickNodeId: number = this.listNodeDataSource.getClickNodeId(); if (clickNodeId === this.listNodeDataSource.ROOT_NODE_ID || !this.listNodeDataSource.getIsFolder(clickNodeId)) { return; } let newNodeParam: NodeParamV2 = this.listNodeDataSource.getNewNode...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left add AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left initBuild AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#...
public add(initBuild: boolean): void { let clickNodeId: number = this.listNodeDataSource.getClickNodeId(); if (clickNodeId === this.listNodeDataSource.ROOT_NODE_ID || !this.listNodeDataSource.getIsFolder(clickNodeId)) { return; } let newNodeParam: NodeParamV2 = this.listNodeDataSource.getNewNode...
https://gitcode.com/openharmony/arkui_ace_engine
feb0e9c90b09adde950094caebf1b9ef5402c100
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/DeviceSensorService.ets
arkts
getDeviceRotation
获取设备屏幕旋转方向 用于在使用设备传感器时校正坐标轴 @returns 旋转角度 (0, 90, 180, 270)
private getDeviceRotation(): number { try { const defaultDisplay = display.getDefaultDisplaySync(); return defaultDisplay.rotation * 90; // rotation 是 0-3, 乘90转角度 } catch { return 0; } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDeviceRotation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left numbe...
private getDeviceRotation(): number { try { const defaultDisplay = display.getDefaultDisplaySync(); return defaultDisplay.rotation * 90; // rotation 是 0-3, 乘90转角度 } catch { return 0; } }
https://github.com/AlkaidLab/moonlight-harmony
a18835e2d8b0df89181df267675b60b8d75aa5b8
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
of
Creates a new Float32Array using initializer @param data initializer @returns a new Float32Array from data
public of(data: Object[]): Float32Array { throw new Error("Float32Array.of: not implemented") }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left of AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#...
public of(data: Object[]): Float32Array { throw new Error("Float32Array.of: not implemented") }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
a660aed9d7b3ccd54cfbc159dcffaf5833a9bb08
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Source/SuwayomiSourceExecutor.ets
arkts
getServerUrl
获取服务器地址
public getServerUrl(): string { return this.suwayomiSource.getServerUrl(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getServerUrl 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#st...
public getServerUrl(): string { return this.suwayomiSource.getServerUrl(); }
https://github.com/DaLongZhuaZi/manxia
e4960edcbf8246aa16cf78ddcc507009cae1fd63
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
updateTaskInDatabase
更新数据库中的任务 注意:在线漫画下载任务不更新download_task表
private async updateTaskInDatabase(task: DownloadTaskInfo): Promise<void> { // 在线漫画下载任务跳过download_task表操作 if (task.isOnlineManga) { logger.debug(TAG, `在线漫画下载任务跳过download_task表更新: ${task.id}, 状态: ${task.status},章节缓存状态由online_chapter维护`); return; } try { const updateData: Download...
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 updateTaskInDatabase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left task AST#identifier#Right AST#:#...
private async updateTaskInDatabase(task: DownloadTaskInfo): Promise<void> { // 在线漫画下载任务跳过download_task表操作 if (task.isOnlineManga) { logger.debug(TAG, `在线漫画下载任务跳过download_task表更新: ${task.id}, 状态: ${task.status},章节缓存状态由online_chapter维护`); return; } try { const updateData: Download...
https://github.com/DaLongZhuaZi/manxia
a4e19e1a4c87bcaa7ea47805505e115d70e1cedf
github
OHPG/FinSdk
jellyfin/src/main/ets/api/SessionApi.ets
arkts
removeUserFromSession
removeUserFromSession @summary Removes an additional user from a session. @param {SessionApiRemoveUserFromSessionRequest} requestParameters Request parameters. @throws {RequiredError} @memberof SessionApi
public async removeUserFromSession(requestParameters: SessionApiRemoveUserFromSessionRequest): Promise<void> { this.assertParam(requestParameters.sessionId) this.assertParam(requestParameters.userId) return this.apiClient.delete({path: `/Sessions/${requestParameters.sessionId}/User/${requestParameters.use...
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 removeUserFromSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#R...
public async removeUserFromSession(requestParameters: SessionApiRemoveUserFromSessionRequest): Promise<void> { this.assertParam(requestParameters.sessionId) this.assertParam(requestParameters.userId) return this.apiClient.delete({path: `/Sessions/${requestParameters.sessionId}/User/${requestParameters.use...
https://github.com/OHPG/FinSdk
ddf2809b57a3420bba194f745947766f54c6e8d9
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SharedLedgerDAO.ets
arkts
mapRowToActivity
映射数据库行到MemberActivity对象
private static mapRowToActivity(resultSet: relationalStore.ResultSet): MemberActivity { const username = DAOHelper.getString(resultSet, 'username'); const actionType = DAOHelper.getString(resultSet, 'action_type'); const createdAt = DAOHelper.getString(resultSet, 'created_at'); return new MemberActiv...
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 mapRowToActivity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#...
private static mapRowToActivity(resultSet: relationalStore.ResultSet): MemberActivity { const username = DAOHelper.getString(resultSet, 'username'); const actionType = DAOHelper.getString(resultSet, 'action_type'); const createdAt = DAOHelper.getString(resultSet, 'created_at'); return new MemberActiv...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f9686b92df0d7056ae6372c6c5341584caf7fd37
github
Harrisonls2004/WaterFlow
entry/src/main/ets/common/network/ApiService.ets
arkts
getResponseCode
从响应数据中获取响应码 优先使用服务器返回的 code 字段,否则使用 HTTP 状态码
function getResponseCode(data: Record<string, Object>, httpCode: number): number { if (data['code'] !== undefined && data['code'] !== null) { return data['code'] as number; } // 如果服务器没有返回 code 字段,使用 HTTP 状态码 return httpCode; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getResponseCode AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#...
function getResponseCode(data: Record<string, Object>, httpCode: number): number { if (data['code'] !== undefined && data['code'] !== null) { return data['code'] as number; } // 如果服务器没有返回 code 字段,使用 HTTP 状态码 return httpCode; }
https://github.com/Harrisonls2004/WaterFlow
3c33df7f9d745dce3144e9eb52a87ed1927fa0d2
github
zhubowen-bot/Bowen_ArkWeb_framework
entry/src/main/ets/delegate/IWebDownloadFile.ets
arkts
setupDelegateCallbacks
初始化委托回调
private setupDelegateCallbacks(delegate: webview.WebDownloadDelegate) { delegate.onBeforeDownload((item: webview.WebDownloadItem) => { this.webDownloadItem = item this.handleDownloadStart() }) delegate.onDownloadUpdated((item: webview.WebDownloadItem) => { this.downloadProgress = item.g...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left setupDelegateCallbacks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left delegate AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#me...
private setupDelegateCallbacks(delegate: webview.WebDownloadDelegate) { delegate.onBeforeDownload((item: webview.WebDownloadItem) => { this.webDownloadItem = item this.handleDownloadStart() }) delegate.onDownloadUpdated((item: webview.WebDownloadItem) => { this.downloadProgress = item.g...
https://github.com/zhubowen-bot/Bowen_ArkWeb_framework
c959b65314681848491487b01abf769463814072
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnFormViewModel.ets
arkts
setMaleInfo
设置男生信息 @param value 信息值
setMaleInfo(value: string): void { this.dynamicForm.maleInfo = value; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setMaleInfo 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 ) AS...
setMaleInfo(value: string): void { this.dynamicForm.maleInfo = value; }
https://github.com/codelably/tuniao-ui
fa44ff3bb70d197c4837c7a7b98f35f12f57f219
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/taskpool.ets
arkts
onEnqueued
Register a callback and call it when the task is enqueued @param { CallbackFunction } callback Callback to be registered and executed when the task is enqueued @throws Error if task is executed. It does not support the registration of listeners
onEnqueued(callback: CallbackFunction): void { this.throwIfCallbackCannotBeAdded(); InternalTask.of(this).onEnqueueCallback = callback; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onEnqueued 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#Left CallbackFunction AST#identifier#Right AST...
onEnqueued(callback: CallbackFunction): void { this.throwIfCallbackCannotBeAdded(); InternalTask.of(this).onEnqueueCallback = callback; }
https://gitcode.com/iop123123/arkts-static-skills
4ed5f0875066ce0a0df310b44e6c2f77a1d4da95
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SettingsManager.ets
arkts
getLifecycleMonitorFloatingBallEnabled
获取生命周期悬浮球是否启用
async getLifecycleMonitorFloatingBallEnabled(): Promise<boolean> { return this.getBoolean(SettingKeys.LIFECYCLE_FLOATING_BALL_ENABLED, false); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getLifecycleMonitorFloatingBallEnabled AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AS...
async getLifecycleMonitorFloatingBallEnabled(): Promise<boolean> { return this.getBoolean(SettingKeys.LIFECYCLE_FLOATING_BALL_ENABLED, false); }
https://github.com/DaLongZhuaZi/manxia
7f1aad87398ca17a4ee035eed7d865c70566c4d6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets
arkts
restoreMangaSourceCovers
恢复图源封面 从备份的covers/{pkg}/目录恢复到沙盒的covers/{pkg}/目录
private async restoreMangaSourceCovers(coversDir: string): Promise<void> { const filesDir = this.sandboxManager.getDirectory('files'); const targetCoversDir = `${filesDir}/covers`; if (!SafeFileUtils.accessSync(targetCoversDir)) { SafeFileUtils.mkdirSyncStrict(targetCoversDir, true); } ...
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 restoreMangaSourceCovers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left coversDir AST#identifier#Right AST#ERROR#Le...
private async restoreMangaSourceCovers(coversDir: string): Promise<void> { const filesDir = this.sandboxManager.getDirectory('files'); const targetCoversDir = `${filesDir}/covers`; if (!SafeFileUtils.accessSync(targetCoversDir)) { SafeFileUtils.mkdirSyncStrict(targetCoversDir, true); } ...
https://github.com/DaLongZhuaZi/manxia
8886556b1aaaa99085b10b6c39fdc53d9d681384
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadVibrationService.ets
arkts
triggerContinuousVibration
使用 continuous 长振实现持续震动 (API 18+)
private triggerContinuousVibration(lowIntensity: number, highIntensity: number): void { try { const builder = new vibrator.VibratorPatternBuilder(); const combinedIntensity = Math.min(100, Math.max(lowIntensity, highIntensity)); if (combinedIntensity < 5) return; // 根据低频/高频比例计算频率 l...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left triggerContinuousVibration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left lowIntensity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Lef...
private triggerContinuousVibration(lowIntensity: number, highIntensity: number): void { try { const builder = new vibrator.VibratorPatternBuilder(); const combinedIntensity = Math.min(100, Math.max(lowIntensity, highIntensity)); if (combinedIntensity < 5) return; // 根据低频/高频比例计算频率 l...
https://github.com/AlkaidLab/moonlight-harmony
254bcf3c1d30b83afcb6472de15dd0e671382393
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
toSorted
Creates a sorted copy @returns { Int16Array } - a sorted copy @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toSorted(): Int16Array { return new Int16Array(this).sort() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toSorted 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 Int16Array AS...
public toSorted(): Int16Array { return new Int16Array(this).sort() }
https://gitcode.com/iop123123/arkts-static-skills
cfd0d101be5938039a185438464db124f9630d37
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/ToolRegistry.ets
arkts
constructor
工具执行器
constructor( id: string, config: ToolConfig, definition: ToolDefinition, executor: ToolExecutor ) { this.id = id this.config = config this.definition = definition this.executor = executor }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST...
constructor( id: string, config: ToolConfig, definition: ToolDefinition, executor: ToolExecutor ) { this.id = id this.config = config this.definition = definition this.executor = executor }
https://github.com/LongLiveY96/chatcube
a03552a50925e803accce6a451279fefdaad076a
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadManager.ets
arkts
updateGCButton2313Action
更新 2313 兼容键动作 @param action 动作类型
updateGCButton2313Action(action: GCButton2313Action): void { this.gcButton2313Action = action; // 对于按键映射类型,更新 gcButtonMap switch (action) { case 'guide': gcButtonMap.set(2313, MoonlightButton.SPECIAL); // 映射为 Guide/Home/Mode break; case 'select': gcButtonMap.set(2313,...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateGCButton2313Action AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left GCButton2313Action AST#identi...
updateGCButton2313Action(action: GCButton2313Action): void { this.gcButton2313Action = action; // 对于按键映射类型,更新 gcButtonMap switch (action) { case 'guide': gcButtonMap.set(2313, MoonlightButton.SPECIAL); // 映射为 Guide/Home/Mode break; case 'select': gcButtonMap.set(2313,...
https://github.com/AlkaidLab/moonlight-harmony
c81f527543aee11b2b3550ca8e0aae5700fb776c
github
openharmony/xts_tools
sample/AppSampleD/entry/src/main/ets/component/SearchResultComponent.ets
arkts
aboutToAppear
综合、视频等title选择索引
aboutToAppear() { // 默认值 if (this.inputSearch === '') { this.inputSearch = MockInput.TEST_INPUT_CONTENT_1; } // 依据不同的搜索展示不同的模拟数据 Logger.info(TAG, `this.inputSearch: ${JSON.stringify(this.inputSearch)}`); if (this.inputSearch.indexOf(MockInput.TEST_INPUT_CONTENT_1) !== -1) { // 输入"黑...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left...
aboutToAppear() { // 默认值 if (this.inputSearch === '') { this.inputSearch = MockInput.TEST_INPUT_CONTENT_1; } // 依据不同的搜索展示不同的模拟数据 Logger.info(TAG, `this.inputSearch: ${JSON.stringify(this.inputSearch)}`); if (this.inputSearch.indexOf(MockInput.TEST_INPUT_CONTENT_1) !== -1) { // 输入"黑...
https://gitee.com/openharmony/xts_tools.git
34961ff8832849eaa2d5bdaa2e40a56d26213454
gitee
Countly/countly-sdk-hos
library/src/main/ets/internal/Network.ets
arkts
execute
Network request entry. Honors the UCM silencer (throws when `silenced=true`). Used by every callsite, including HC + SBS; those modules check `config.unknownConsentMode` themselves and skip calling here when the SDK is in UCM. On UCM exit `CountlyInstance.resolveUnknownConsent` unsilences first and then fires HC + SBS ...
public async execute(baseUrl: string, endpoint: string, data: string, usePost: boolean): Promise<HttpResult> { if (this.silenced) { // No HTTP issued. Throw is consistent with the underlying http // stack (which throws on transport errors); every caller already // wraps execute() in try/catch fo...
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 execute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left baseUrl AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#...
public async execute(baseUrl: string, endpoint: string, data: string, usePost: boolean): Promise<HttpResult> { if (this.silenced) { // No HTTP issued. Throw is consistent with the underlying http // stack (which throws on transport errors); every caller already // wraps execute() in try/catch fo...
https://github.com/Countly/countly-sdk-hos
deaa3d3a9bf246edbe15f68f404db97914bd3c17
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.collections.ets
arkts
flipBitByIndex
Flips the bit value by index in a bit vector.(Flip 0 to 1, flip 1 to 0) @param { int } index - The index in the bit vector. @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. @throws { BusinessError } 10200001 - The value of index ...
public flipBitByIndex(index: int): void { this.checkIndex(index); let bitIndex = this.computeElementIdAndBitId(index); this.buffer[bitIndex.elementId] = this.flipBits(this.buffer[bitIndex.elementId], bitIndex.index, bitIndex.index); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left flipBitByIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifi...
public flipBitByIndex(index: int): void { this.checkIndex(index); let bitIndex = this.computeElementIdAndBitId(index); this.buffer[bitIndex.elementId] = this.flipBits(this.buffer[bitIndex.elementId], bitIndex.index, bitIndex.index); }
https://gitcode.com/iop123123/arkts-static-skills
dee053761920f894a39570fc94cb97f3f21d5347
gitcode
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/Line.ets
arkts
constructor
Constructor. @param start @param end
constructor(start: Point, end: Point) { this.start = start; this.end = end; }
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 start AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Point AST#identifier#Right A...
constructor(start: Point, end: Point) { this.start = start; this.end = end; }
https://gitee.com/openharmony/codelabs.git
3bb1e5749a7c208a73d655e02627f552710c2039
gitee
arkui-x/samples
CodeLab/Cases/feature/customdrawtabbar/src/main/ets/components/tabsRaisedCircle/TabsRaisedCircle.ets
arkts
getSelectOffsetY
获取第一个图片的 y 轴偏移量
getSelectOffsetY() { let onLayoutComplete: () => void = (): void => { let modePosition = componentUtils.getRectangleById(`${this.selectImageId}0`) if (modePosition.size) { this.selectImageInfo = new RaisedSelectImageInfo(modePosition); this.selectImageListener?.off('draw') } ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getSelectOffsetY AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L...
getSelectOffsetY() { let onLayoutComplete: () => void = (): void => { let modePosition = componentUtils.getRectangleById(`${this.selectImageId}0`) if (modePosition.size) { this.selectImageInfo = new RaisedSelectImageInfo(modePosition); this.selectImageListener?.off('draw') } ...
https://gitcode.com/arkui-x/samples
d84f28693a17ee05d50b64053f8cedff018741b0
gitcode
openharmony-sig/applications_calculator
product/pc/src/main/ets/pages/main.ets
arkts
aboutToAppear
Initialization operations in the appearance phase.
aboutToAppear() { LogUtil.info(TAG, 'aboutToAppear: Main'); this.mDigitPanelController.setWorker(getWorker()); this.mDigitPanelController.getMemoryDisplay().then((flag)=>{ this.isMemoryDisplay = flag; }) window.getLastWindow(this.context, (err: BusinessError, data: window.Window) => { ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left...
aboutToAppear() { LogUtil.info(TAG, 'aboutToAppear: Main'); this.mDigitPanelController.setWorker(getWorker()); this.mDigitPanelController.getMemoryDisplay().then((flag)=>{ this.isMemoryDisplay = flag; }) window.getLastWindow(this.context, (err: BusinessError, data: window.Window) => { ...
https://gitee.com/openharmony-sig/applications_calculator.git
60e1ec99ef430ee398af248963cc9efcdf495c13
gitee
LZZLHY/hlib
entry/src/main/ets/utils/Format.ets
arkts
date
ISO 时间戳 → YYYY-MM-DD。空串返回空串。
static date(iso: string): string { if (iso.length === 0) { return ''; } return iso.slice(0, 10); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left iso AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR...
static date(iso: string): string { if (iso.length === 0) { return ''; } return iso.slice(0, 10); }
https://github.com/LZZLHY/hlib
9399f60b5003ae576bf47afeb12208b1cd509473
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets
arkts
isAnyArrayBuffer
Check whether the entered value is of arraybuffer type. @param { Object } value - A ArrayBuffer value @returns { boolean } Returns true if the value is a built-in ArrayBuffer instance.
isAnyArrayBuffer(value: Object): boolean { return this.isArrayBuffer(value); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAnyArrayBuffer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Object AST#identifier#Right AST#)#Left...
isAnyArrayBuffer(value: Object): boolean { return this.isArrayBuffer(value); }
https://gitcode.com/iop123123/arkts-static-skills
6b6d8492b66fe0e660c48103307daf0d9e528059
gitcode