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
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Console.ets
arkts
warn
Prints warn-level messages If first argument is a string it is treated as a format string @param {...Any[]} vals - Variable number of values to be logged @returns {void} @public
public warn(...vals: Any[]): void { this.printRest(LogLevel.WARN, ...vals) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left warn AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left vals...
public warn(...vals: Any[]): void { this.printRest(LogLevel.WARN, ...vals) }
https://gitcode.com/iop123123/arkts-static-skills
ef80012987f94bdc90e15bdc18eb333b518e12d3
gitcode
openharmony/applications_app_samples
code/BasicFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/PowerManagerUtil.ets
arkts
getPowerModeName
MODE_NORMAL 600 表示标准模式,默认值。 MODE_POWER_SAVE 601 表示省电模式。 MODE_PERFORMANCE 602 表示性能模式。 MODE_EXTREME_POWER_SAVE 603 表示超级省电模式。
static async getPowerModeName(): Promise<string> { let powerModeNames: Array<string> = await getStringArray($r('app.strarray.power_mode')) switch (power.getPowerMode()) { case powerModes[0]: return powerModeNames[0]; case powerModes[1]: return powerModeNames[1]; case powerMod...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getPowerModeName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
static async getPowerModeName(): Promise<string> { let powerModeNames: Array<string> = await getStringArray($r('app.strarray.power_mode')) switch (power.getPowerMode()) { case powerModes[0]: return powerModeNames[0]; case powerModes[1]: return powerModeNames[1]; case powerMod...
https://github.com/openharmony/applications_app_samples
e869d910f8ec2e7272ea1894b9e4b84e4308b553
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/NetworkManager.ets
arkts
uninitialize
Uninitialize network monitoring
static uninitialize(): void { console.info(`${TAG}: Uninitializing network manager`); if (netConnection) { try { netConnection.unregister((error: BusinessError) => { if (error) { console.error(`${TAG}: Failed to unregister network callback: ${error.message}`); } ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left uninitialize 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#expressio...
static uninitialize(): void { console.info(`${TAG}: Uninitializing network manager`); if (netConnection) { try { netConnection.unregister((error: BusinessError) => { if (error) { console.error(`${TAG}: Failed to unregister network callback: ${error.message}`); } ...
https://github.com/tangwengang-del/freerdp-harmonyos
b1a06ab73789ac493519095e9430f855b692ee78
github
2763981847/Clock-Alarm
entry/src/main/ets/viewmodel/WorldClockViewModel.ets
arkts
queryCitiesTasker
刷新城市任务。 @param callback (cities: Array<CityItem>) => void
public queryCitiesTasker(callback: (cities: Array<CityItem>) => void) { let that = this; that.queryDatabaseCities(callback); let preference = GlobalContext.getContext().getObject('preference') as PreferencesHandler; preference.addPreferencesListener({ onDataChanged() { that.queryDatabase...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left queryCitiesTasker AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( A...
public queryCitiesTasker(callback: (cities: Array<CityItem>) => void) { let that = this; that.queryDatabaseCities(callback); let preference = GlobalContext.getContext().getObject('preference') as PreferencesHandler; preference.addPreferencesListener({ onDataChanged() { that.queryDatabase...
https://github.com/2763981847/Clock-Alarm
cf6e61b0c7a6c54dfd9d0f54579890c9b6f6ff7a
github
XHXYT/Pixark
entry/src/main/ets/common/utils/ResourceUtil.ets
arkts
init
初始化工具类,必须在 初始化 中调用 @param context UIAbilityContext
init(context: common.UIAbilityContext) { this.context = context; }
AST#program#Left AST#expression_statement#Left 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#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left common...
init(context: common.UIAbilityContext) { this.context = context; }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/ResourceUtil.ets#L14-L16
93f8cf610000fca1b3753929e98512be21963aa4
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/basecomponent/language/LanguageState.ets
arkts
getSystemLanguage
Get current system language
private getSystemLanguage(): string { let language: string = Configuration.getLocale().language; const preferredLanguage: string = i18n.System.getAppPreferredLanguage(); if (preferredLanguage && preferredLanguage.length > 0) { language = preferredLanguage; } return language; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getSystemLanguage 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 strin...
private getSystemLanguage(): string { let language: string = Configuration.getLocale().language; const preferredLanguage: string = i18n.System.getAppPreferredLanguage(); if (preferredLanguage && preferredLanguage.length > 0) { language = preferredLanguage; } return language; }
https://github.com/Tencent-RTC/TUIKit_Harmony
256a2f543f4c4d26ebe4491dfbb7149a1342ddc9
github
openharmony-sig/flutter_sqflite
sqflite/ohos/src/main/ets/io/flutter/plugins/sqflite/SqflitePlugin.ets
arkts
handleBatchCall
/batch操作
async handleBatchCall(call: MethodCall, result: MethodResult): Promise<void> { let rdbStore = DatabaseHelper.getDatabaseOrError(call, result); if (rdbStore == null) { return; } Database.batch(call, result, rdbStore); }
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left handleBatchCall AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left call AST#identifier#Right AST#type_annotation#Left AST...
async handleBatchCall(call: MethodCall, result: MethodResult): Promise<void> { let rdbStore = DatabaseHelper.getDatabaseOrError(call, result); if (rdbStore == null) { return; } Database.batch(call, result, rdbStore); }
https://gitee.com/openharmony-sig/flutter_sqflite.git
0756b3299254b26d87039233e668ca5d96eb8650
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets
arkts
formatToParts
Returns an Array of objects representing the number string in parts that can be used for custom locale-aware formatting. @param value A number or BigInt to format @returns An Array of objects containing the formatted number in parts
public formatToParts(value: number | bigint): NumberFormatPart[] { if (value instanceof BigInt) { return this.formatToPartsDecStr(value.toString()); } return this.formatToPartsDouble(value); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left formatToParts 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#binary_expression...
public formatToParts(value: number | bigint): NumberFormatPart[] { if (value instanceof BigInt) { return this.formatToPartsDecStr(value.toString()); } return this.formatToPartsDouble(value); }
https://gitcode.com/iop123123/arkts-static-skills
19e1a522afdd5a85e408f636f1ffe7604ee72433
gitcode
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/RDPPerformanceManager.ets
arkts
updateFrameStats
更新帧率统计
private updateFrameStats(): void { const now = Date.now() this.frameCount++ if (this.lastFrameTime > 0) { const elapsed = now - this.lastFrameTime if (elapsed > 1000) { this.stats.frameRate = this.frameCount / (elapsed / 1000) this.frameCount = 0 this.lastFrameTime...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateFrameStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST...
private updateFrameStats(): void { const now = Date.now() this.frameCount++ if (this.lastFrameTime > 0) { const elapsed = now - this.lastFrameTime if (elapsed > 1000) { this.stats.frameRate = this.frameCount / (elapsed / 1000) this.frameCount = 0 this.lastFrameTime...
https://github.com/AetheriumSimulator/qemu-hmos
f0b703392397ea6dffd119efbd4167a170fb0849
github
darcycui/DarcyHarmonyNext
entry/src/main/ets/pages/entry/render_control/LazyForEachClassPage.ets
arkts
hashCode
TODO get方法
public get hashCode(): string { Log.log(`message=${this.message} hashCode=${this.hash}`) return this.hash }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left hashCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : ...
public get hashCode(): string { Log.log(`message=${this.message} hashCode=${this.hash}`) return this.hash }
https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/render_control/LazyForEachClassPage.ets#L18-L21
beef215c880605a985611cc1fbcf8285f0818008
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/messagelist/utils/TranslationDisplayManager.ets
arkts
isTranslating
Check if a message is currently being translated
isTranslating(messageID: string | undefined): boolean { if (!messageID || messageID.length === 0) { return false; } return this.translatingMessageIDs.has(messageID); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isTranslating AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left messageID AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ER...
isTranslating(messageID: string | undefined): boolean { if (!messageID || messageID.length === 0) { return false; } return this.translatingMessageIDs.has(messageID); }
https://github.com/Tencent-RTC/TUIKit_Harmony
7009d529c8d55f9bab0a788c36b8270b2e46f694
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
of
Returns a new array from a set of elements. @param { FixedArray<short> } items - a set of elements to include in the new array object. @returns { Int16Array } - a new Int16Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(...items: FixedArray<short>): Int16Array { let res = new Int16Array(items.length.toInt()) res.ofShort(stub.toValueArray(items)) return res }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR...
public static of(...items: FixedArray<short>): Int16Array { let res = new Int16Array(items.length.toInt()) res.ofShort(stub.toValueArray(items)) return res }
https://gitcode.com/iop123123/arkts-static-skills
53560c75961d1974516c2d02fa6e22b891474057
gitcode
openharmony-tpc/openharmony_tpc_samples
d3JsEasingDemo/entry/src/main/ets/pages/ballAnimate.ets
arkts
updateWHRadius
红方块 同时更新 width height borderRadius
updateWHRadius(normalizedTime: number) { const transFormWidth = this.widthEnd - this.widthBegin; const transFormHeight = this.heightEnd - this.heightBegin; const transFormRadius = this.radiusEnd - this.radiusBegin; const normalizedAttrChangeValue: number = Easing[this.currentEasingFunction](normalized...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateWHRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left normalizedTime AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Ri...
updateWHRadius(normalizedTime: number) { const transFormWidth = this.widthEnd - this.widthBegin; const transFormHeight = this.heightEnd - this.heightBegin; const transFormRadius = this.radiusEnd - this.radiusBegin; const normalizedAttrChangeValue: number = Easing[this.currentEasingFunction](normalized...
https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git
ee712b8a88c75f76ec55eebf7487c741ee09e4ea
gitee
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/utils/setting.ets
arkts
getAllLastRecord
获取所有人的最后的一条聊天记录的集合
getAllLastRecord() { const store = this.getStore() const arr: MessageInfoModel[] = [] const result = store.getAllSync() as object Object.keys(result).forEach(key => { if (key.includes(UserRecord_KEY)) { //key对应的value if (result[key]) { const list = JSON.parse(result[key...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAllLastRecord 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...
getAllLastRecord() { const store = this.getStore() const arr: MessageInfoModel[] = [] const result = store.getAllSync() as object Object.keys(result).forEach(key => { if (key.includes(UserRecord_KEY)) { //key对应的value if (result[key]) { const list = JSON.parse(result[key...
https://github.com/SMAT-Lab/PhantomRendering
11282f3eaa8ba9007188784a831eecc0bb4c0b3f
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets
arkts
encodeURI
==================== 工具函数 ==================== URL编码
encodeURI(str: string): string { try { return encodeURIComponent(str); } catch (e) { return str; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left encodeURI AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#...
encodeURI(str: string): string { try { return encodeURIComponent(str); } catch (e) { return str; } }
https://github.com/DaLongZhuaZi/manxia
54bef7f9ae56399ac92415bbca3b4783c89a8d8a
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.collections.ets
arkts
length
Gets the element number of the BitVector. This is a number one higher than the highest index in the bit vector. It can be changed by resize().
public get length(): int { return this._length; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left length AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS...
public get length(): int { return this._length; }
https://gitcode.com/iop123123/arkts-static-skills
40afeed15fd18a76a20d0678f7e26553eb146deb
gitcode
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
updateSessionModelSelection
仅更新会话当前模型选择(不修改 updated_at,避免切模型时打乱会话排序)
async updateSessionModelSelection(sessionId: string, modelId: string, providerId: string): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null || sessionId === '') { return } const valueBucket: relationalStore.ValuesBucket = { model_id: modelId, provider_id:...
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 updateSessionModelSelection AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identi...
async updateSessionModelSelection(sessionId: string, modelId: string, providerId: string): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null || sessionId === '') { return } const valueBucket: relationalStore.ValuesBucket = { model_id: modelId, provider_id:...
https://github.com/LongLiveY96/chatcube
1088a875481317e027827954db5f1d7dd0edce6c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
clearAll
清除所有书源(同时清除数据库)
async clearAll(): Promise<void> { // 从数据库删除所有书源 try { const dataManager = getNovelDataManager(); const allSources = this.getAllSources(); for (const source of allSources) { const fullSource = this.sources.get(source.id) || null; await dataManager.deleteSource(source.id); ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearAll 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_typ...
async clearAll(): Promise<void> { // 从数据库删除所有书源 try { const dataManager = getNovelDataManager(); const allSources = this.getAllSources(); for (const source of allSources) { const fullSource = this.sources.get(source.id) || null; await dataManager.deleteSource(source.id); ...
https://github.com/DaLongZhuaZi/manxia
79a626d205f831513ebc58a3e6cf39a9e4a1df2b
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/FinalizationRegistry.ets
arkts
constructor
Create FinalizationRegistry object with the specific callback function. One can register an object and after reclamation of the object the callback function will be called. @param callback_value callback function which will be called after registered object reclamation.
public constructor(callback: (value: T) => void | Promise<void>) { this.callback = callback; this.workerId = FinalizationRegistry.getWorkerId(); this.workerDomain = FinalizationRegistry.getWorkerDomain(); this.buckets = new FixedArray<FinRegNode<T> | undefined>(FinalizationRegistry.I...
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#binary_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Lef...
public constructor(callback: (value: T) => void | Promise<void>) { this.callback = callback; this.workerId = FinalizationRegistry.getWorkerId(); this.workerDomain = FinalizationRegistry.getWorkerDomain(); this.buckets = new FixedArray<FinRegNode<T> | undefined>(FinalizationRegistry.I...
https://gitcode.com/iop123123/arkts-static-skills
f248693eb9b6bad8a3136ed0e3df644e24d7c23e
gitcode
Xiwei753/xiezuoruanjian
apps/harmony/entry/src/main/ets/common/AdaptiveContext.ets
arkts
registerAvoidAreaChange
========== 避让区域变化监听 ==========
private registerAvoidAreaChange(): void { if (this.isAvoidAreaListening || !this.mainWindow) { return } try { this.mainWindow.on('avoidAreaChange', (data: window.AvoidAreaOptions) => { if (!this.mainWindow) { return } const displayInfo = display.getDefaultDisp...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerAvoidAreaChange 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 v...
private registerAvoidAreaChange(): void { if (this.isAvoidAreaListening || !this.mainWindow) { return } try { this.mainWindow.on('avoidAreaChange', (data: window.AvoidAreaOptions) => { if (!this.mainWindow) { return } const displayInfo = display.getDefaultDisp...
https://github.com/Xiwei753/xiezuoruanjian
88ae76b42f5135e7e6aebd349e385c9bf66a8b10
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
of
Creates a new Float32Array using initializer @param { FixedArray<Object> } data - initializer @returns { Float32Array } - a new Float32Array @throws { Error } - function not implemented @syscap SystemCapability.Utils.Lang @FaAndStageModel
public of(data: FixedArray<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: FixedArray<Object>): Float32Array { throw new Error("Float32Array.of: not implemented") }
https://gitcode.com/iop123123/arkts-static-skills
bb790da351639b697414d91f655c212462ba29e3
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
getGCThreadHold
获取绘制多少次后调用垃圾回收的阈值 @returns
public getGCThreadHold(): number { return GCUtil.gcThreshold; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getGCThreadHold 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...
public getGCThreadHold(): number { return GCUtil.gcThreshold; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
9f515ea4fa5a7f7d9851fe70af5cbf037316765c
gitee
XJTUWYD/ArkDiff
entry/src/main/ets/services/ExternalFileOpener.ets
arkts
getContext
==================== 内部方法 ==================== 获取应用上下文
private static getContext(): common.UIAbilityContext { // HarmonyOS 中通过全局 globalThis 或 getContext 获取 const ctx = getContext() as common.UIAbilityContext; return ctx; }
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 getContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:...
private static getContext(): common.UIAbilityContext { // HarmonyOS 中通过全局 globalThis 或 getContext 获取 const ctx = getContext() as common.UIAbilityContext; return ctx; }
https://github.com/XJTUWYD/ArkDiff
6619ed1243eb0382ae9cad1000267030a9392f50
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/MoonBridge.ets
arkts
nativeMicPause
暂停 native 麦克风采集
nativeMicPause(): void { nativeLib.nativeMicPause(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left nativeMicPause AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_blo...
nativeMicPause(): void { nativeLib.nativeMicPause(); }
https://github.com/AlkaidLab/moonlight-harmony
ec18db0fe726a36d27ee171c341c7384d8f03116
github
harmonyos/codelabs
HarmonyOS_NEXT/TargetManagement/entry/src/main/ets/view/TargetList.ets
arkts
operateTextStyle
Custom text button style.
@Extend(Text) function operateTextStyle(color: Resource) { .fontSize($r('app.float.text_button_font')) .fontColor(color) .lineHeight($r('app.float.text_line_height')) .fontWeight(CommonConstants.FONT_WEIGHT) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
@Extend(Text) function operateTextStyle(color: Resource) { .fontSize($r('app.float.text_button_font')) .fontColor(color) .lineHeight($r('app.float.text_line_height')) .fontWeight(CommonConstants.FONT_WEIGHT) }
https://gitee.com/harmonyos/codelabs.git
786fd4a92a1ecb280d6b0fb41c1ba1496c806def
gitee
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/ExtensionLoader.ets
arkts
connect
====== 协议连接 ======
connect(config: SessionConfig): number { try { this.currentSessionId = rdpnapi.connect(config) as number; return this.currentSessionId; } catch (err) { hilog.error(DOMAIN, TAG, '[ExtensionLoader] connect: code=' + ((err as Record<string, Object>)['code'] || 'ERR') + ' msg=' + JSON.stringify(...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left connect 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#Left SessionConfig AST#identifier#Right AST#)#Left ...
connect(config: SessionConfig): number { try { this.currentSessionId = rdpnapi.connect(config) as number; return this.currentSessionId; } catch (err) { hilog.error(DOMAIN, TAG, '[ExtensionLoader] connect: code=' + ((err as Record<string, Object>)['code'] || 'ERR') + ' msg=' + JSON.stringify(...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
5f1da7eb05bf85bee20ca06589b3816c353a4ccd
github
openharmony/arkui_advanced_ui_component
atomicservicenavigation/source/atomicservicenavigation.ets
arkts
drawGradientCanvasTowards
双色渐变的一种实现,从矩形左上角颜色渐变到右下角 @param context 画布上下文 @param primaryColor 第一种颜色 @param secondaryColor 第二种颜色
drawGradientCanvasTowards(context: CanvasRenderingContext2D, primaryColor: ResourceColor, secondaryColor: ResourceColor): void { let height = this.navigationHeight * COLOR_RATIO_THIRTY_PERCENT; let grad = context.createLinearGradient(0, 0, this.navigationWidth, height); grad.addColorStop(0, this.resou...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left drawGradientCanvasTowards AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CanvasRenderingContext2D AS...
drawGradientCanvasTowards(context: CanvasRenderingContext2D, primaryColor: ResourceColor, secondaryColor: ResourceColor): void { let height = this.navigationHeight * COLOR_RATIO_THIRTY_PERCENT; let grad = context.createLinearGradient(0, 0, this.navigationWidth, height); grad.addColorStop(0, this.resou...
https://gitee.com/openharmony/arkui_advanced_ui_component.git
0f4f2931734f43d6a619db7ed832d59bf1017240
gitee
ASweetBite/HarmonyPulse
entry/src/main/ets/utils/managers/RdbManager.ets
arkts
addSongToPlaylist
向指定歌单中添加一首歌曲 @param playlistId 歌单 ID @param songId 歌曲 ID
async addSongToPlaylist(playlistId: number, songId: string): Promise<boolean> { if (!this.rdbStore) return false; try { const mapValue: relationalStore.ValuesBucket = { playlist_id: playlistId, song_id: songId }; const rowId = await this.rdbStore.insert( this.tableN...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left addSongToPlaylist AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left playlistId AST#identifier#R...
async addSongToPlaylist(playlistId: number, songId: string): Promise<boolean> { if (!this.rdbStore) return false; try { const mapValue: relationalStore.ValuesBucket = { playlist_id: playlistId, song_id: songId }; const rowId = await this.rdbStore.insert( this.tableN...
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/utils/managers/RdbManager.ets#L300-L320
443c94d71a2e102ebca2a69624a2ea94f4dbad36
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
convertRawToSource
将原始对象转换为书源对象
private convertRawToSource(obj: Record<string, ESObject>): LegadoBookSource | null { try { if (!obj['bookSourceUrl'] || !obj['bookSourceName']) { return null; } const parser = new LegadoSourceParser(); return parser.parseFromJSON(JSON.stringify(obj)); } catch (error) { l...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertRawToSource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiati...
private convertRawToSource(obj: Record<string, ESObject>): LegadoBookSource | null { try { if (!obj['bookSourceUrl'] || !obj['bookSourceName']) { return null; } const parser = new LegadoSourceParser(); return parser.parseFromJSON(JSON.stringify(obj)); } catch (error) { l...
https://github.com/DaLongZhuaZi/manxia
567f797be548acfee89bf59039c45e5cdb0779f0
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/HttpClient.ets
arkts
disposeAllSessions
关闭所有 session 池中的连接(应用退出时调用)
static disposeAllSessions(): void { RcpSessionPool.disposeAll(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left disposeAllSessions 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#exp...
static disposeAllSessions(): void { RcpSessionPool.disposeAll(); }
https://github.com/AlkaidLab/moonlight-harmony
eef546b54f0a7fbfccfffd7ce77a275f8535e956
github
wuba/omni-ui
omni_component/src/main/ets/components/guide/model/HighLightOptionsBuilder.ets
arkts
setOnClickListener
高亮点击事件 @param listener 点击事件回调 @returns 额外配置构建类
public setOnClickListener(listener: OnClickListener | null): HighLightOptionsBuilder { this.options.onClickListener = listener; return this; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setOnClickListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_ex...
public setOnClickListener(listener: OnClickListener | null): HighLightOptionsBuilder { this.options.onClickListener = listener; return this; }
https://github.com/wuba/omni-ui
636b8ce61dc95c3a1211a9c7ebfb90df5958b37b
github
ZestBox-18/kitebook-frontend
features/home/src/main/ets/components/IncomeExpenseCardComponent.ets
arkts
VerticalDivider
构建收支指标之间的竖向分隔线。
private VerticalDivider() { Column() .width(1) .height(this.compactLayout ? 72 : 84) .backgroundColor('#ECE2D3') }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left VerticalDivider 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#{#L...
private VerticalDivider() { Column() .width(1) .height(this.compactLayout ? 72 : 84) .backgroundColor('#ECE2D3') }
https://github.com/ZestBox-18/kitebook-frontend
747d933df41d39908f6ce18948fbd076f11dcca6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewContainerPage.ets
arkts
clearAllWebViews
清理所有WebView
clearAllWebViews(): void { this.webViewItems = []; this.manager.clearAll(); logger.info(TAG, '清理所有WebView实例'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearAllWebViews AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b...
clearAllWebViews(): void { this.webViewItems = []; this.manager.clearAll(); logger.info(TAG, '清理所有WebView实例'); }
https://github.com/DaLongZhuaZi/manxia
142d33191c63f14de45ca2ef69acb2d8eefe2a88
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
constructor
Creates an Uint8Array with respect to buf. @param buf data initializer
public constructor(buf: ArrayBuffer) { this(buf, 0, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right 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 buf AST#identifier#Right AST#:#Left : AST#:#R...
public constructor(buf: ArrayBuffer) { this(buf, 0, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
878b7ec8e4f3d8a1d3a9ecfef98c4cb8e55dc0e4
gitee
JackJiang2011/harmonychat
entry/src/main/ets/pages/model/MessagesProvider.ets
arkts
putMessage
加入一条新消息。 @param m 消息对象
putMessage(m: Message): void { // 以下代码用于判断并实现仿微信的只显示2分钟内聊天消息的时间标识(参考资料:http://www.52im.net/thread-3008-1-1.html#40) let previousMessage: Message | undefined = undefined; let messagesSize: number = this.messages.length; if (messagesSize > 0) { previousMessage = this.messages[messagesSize - 1]; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left putMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left m AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Message AST#identifier#Right AST#)#Left ) AST#)#...
putMessage(m: Message): void { // 以下代码用于判断并实现仿微信的只显示2分钟内聊天消息的时间标识(参考资料:http://www.52im.net/thread-3008-1-1.html#40) let previousMessage: Message | undefined = undefined; let messagesSize: number = this.messages.length; if (messagesSize > 0) { previousMessage = this.messages[messagesSize - 1]; ...
https://github.com/JackJiang2011/harmonychat
404ac4b9396a4b5aeac98df03f23f8193265106d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Preload/ChapterPreloadManager.ets
arkts
executeTask
执行预加载任务
private async executeTask(task: PreloadTask): Promise<void> { task.status = PreloadStatus.LOADING; task.startTime = Date.now(); logger.info(TAG, `开始预加载章节: ${task.chapterTitle}`); try { // 1. 获取页面列表(【关键】必须传递sourceName) if (!this.currentSourceName) { throw new 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 executeTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left task AST#identifier#Right AST#:#Left : AS...
private async executeTask(task: PreloadTask): Promise<void> { task.status = PreloadStatus.LOADING; task.startTime = Date.now(); logger.info(TAG, `开始预加载章节: ${task.chapterTitle}`); try { // 1. 获取页面列表(【关键】必须传递sourceName) if (!this.currentSourceName) { throw new Error(`图源名称为空...
https://github.com/DaLongZhuaZi/manxia
c05b931508678fb61ecd28d34bb6b06e7a99645e
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/ComponentBase.ets
arkts
setYOffset
Sets the used y-axis offset for the labels on this axis. For the legend, higher offset means the legend as a whole will be placed further away from the top. @param yOffset
public setYOffset(yOffset: number): void { this.mYOffset = Utils.handleDataValues(yOffset); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setYOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left yOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Righ...
public setYOffset(yOffset: number): void { this.mYOffset = Utils.handleDataValues(yOffset); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1f8e9921a7f7b15f6b546880f661654bb7aa3ec2
gitee
honjow/Next2V
shared/src/main/ets/services/AutoDailyCheckinService.ets
arkts
requestWebRedeem
Ask the nav-shell hidden Web runner to perform the redeem for the current account (whose cookie the runner restores into the Web cookie jar). Fire-and-forget — the result returns via handleWebResult().
private static requestWebRedeem(): void { const runner = connectWebCheckinRunner() runner.baseUrl = HttpClient.getInstance().getBaseUrl() runner.requestId = runner.requestId + 1 }
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 requestWebRedeem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right...
private static requestWebRedeem(): void { const runner = connectWebCheckinRunner() runner.baseUrl = HttpClient.getInstance().getBaseUrl() runner.requestId = runner.requestId + 1 }
https://github.com/honjow/Next2V
bbfde97a86cb56760adddb0e91b6ff88adba7e06
github
openharmony/multimedia_camera_framework
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/common/utils/DateTimeUtil.ets
arkts
concatTime
时分秒格式修饰 @param hours @param minutes @param seconds
concatTime(hours: number, minutes: number, seconds: number): string { return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}`; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left concatTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left hours AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST...
concatTime(hours: number, minutes: number, seconds: number): string { return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}`; }
https://gitee.com/openharmony/multimedia_camera_framework.git
fcc235a5837643d83e42a5fedd3f7875ef1faef3
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/utils/SettingsUtil.ets
arkts
clearNurseAuth
清除护士认证信息
async clearNurseAuth(): Promise<void> { if (this.dataPreferences === null) { return; } try { await this.dataPreferences.delete('nurse_token'); await this.dataPreferences.delete('nurse_info'); await this.dataPreferences.flush(); } catch (e) { console.error('SettingsUtil - ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left clearNurseAuth AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left ...
async clearNurseAuth(): Promise<void> { if (this.dataPreferences === null) { return; } try { await this.dataPreferences.delete('nurse_token'); await this.dataPreferences.delete('nurse_info'); await this.dataPreferences.flush(); } catch (e) { console.error('SettingsUtil - ...
https://github.com/LJ666-ui/harmony-health-care
56cf1316dc0e09ca30ff3cd4f7f874532ac51a0b
github
Joker-x-dev/CoolMallArkTS
entry/src/main/ets/adapter/WindowAdapter.ets
arkts
getDisplayId
获取当前窗口的 displayId @returns {number | undefined} displayId
private getDisplayId(): number | undefined { return this.windowClass?.getWindowProperties().displayId; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDisplayId 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...
private getDisplayId(): number | undefined { return this.windowClass?.getWindowProperties().displayId; }
https://github.com/Joker-x-dev/CoolMallArkTS
de17c6c8b491dfb32098cb50bf501ac9d844310b
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/TypeConverter.ets
arkts
fromDbValue
数据库值转换为 ArkTS 值 根据目标属性类型进行适当的转换 @param value 数据库值 @param propertyType 目标属性类型标识 @param columnName 列名(用于错误报告) @returns ArkTS 值
static fromDbValue( value: DbValueType, propertyType: string, columnName: string, options?: TypeConversionOptions ): ValueType { // 处理 null 值 if (value === null) { return null } // 根据属性类型进行转换 switch (propertyType) { case 'string': if (typeof value === 'string...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left fromDbValue 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 DbV...
static fromDbValue( value: DbValueType, propertyType: string, columnName: string, options?: TypeConversionOptions ): ValueType { // 处理 null 值 if (value === null) { return null } // 根据属性类型进行转换 switch (propertyType) { case 'string': if (typeof value === 'string...
https://github.com/offlinecat-dev/OCNetORM
7ea1cdea840fc79957675f4651f7ae4f9037f64a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
valueOf
Returns the object itself @returns { Float32Array } @syscap SystemCapability.Utils.Lang @FaAndStageModel
public valueOf(): Float32Array { return this }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left valueOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left Float32Array A...
public valueOf(): Float32Array { return this }
https://gitcode.com/iop123123/arkts-static-skills
f92e5618285a6d24177a96bf9618799e9b5b3927
gitcode
openharmony/arkui_ace_engine
advanced_ui_component/multinavigation/source/multinavigation.ets
arkts
isTablet
whether the device type is tablet @returns true if is tablet
public static isTablet(): boolean { return DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_TABLET; }
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 isTablet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left...
public static isTablet(): boolean { return DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_TABLET; }
https://gitee.com/openharmony/arkui_ace_engine.git
f7228ecbc3dd4d3a660d3609b3438788999ae4ff
gitee
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/calculator/AdvancedSunshineCalculator.ets
arkts
getEquationOfTime
计算时间方程(分钟)
private getEquationOfTime(dayOfYear: number): number { const B = 2 * Math.PI / 364 * (dayOfYear - 81); return 9.87 * Math.sin(2 * B) - 7.53 * Math.cos(B) - 1.5 * Math.sin(B); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getEquationOfTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dayOfYear AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST...
private getEquationOfTime(dayOfYear: number): number { const B = 2 * Math.PI / 364 * (dayOfYear - 81); return 9.87 * Math.sin(2 * B) - 7.53 * Math.cos(B) - 1.5 * Math.sin(B); }
https://github.com/qiuhaotc/Sunshine_HarmonyOS
a5d4cd02c5fecf3d0e0131e7ed5ab3047f4afd6d
github
Xiwei753/xiezuoruanjian
apps/harmony/entry/src/main/ets/common/AdaptiveContext.ets
arkts
addObserver
订阅窗口尺寸变化
addObserver(observer: AdaptiveObserver): void { this.observers.add(observer) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addObserver AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left observer AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AdaptiveObserver AST#identifier#Right AS...
addObserver(observer: AdaptiveObserver): void { this.observers.add(observer) }
https://github.com/Xiwei753/xiezuoruanjian
6c9f6dbdbeb2ce26f42166cb554350e91e41aae1
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/Transformer.ets
arkts
prepareMatrixValuePx
Prepares the matrix that transforms values to pixels. Calculates the scale factors from the charts size and offsets. @param xChartMin @param deltaX @param deltaY @param yChartMin
public prepareMatrixValuePx(xChartMin: number, deltaX: number, deltaY: number, yChartMin: number) { let scaleX: number = this.mViewPortHandler.contentWidth() / deltaX; let scaleY: number = this.mViewPortHandler.contentHeight() / deltaY; if (scaleX == Number.MAX_VALUE) { scaleX = 0; } if (s...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left prepareMatrixValuePx AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left xChartMin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST...
public prepareMatrixValuePx(xChartMin: number, deltaX: number, deltaY: number, yChartMin: number) { let scaleX: number = this.mViewPortHandler.contentWidth() / deltaX; let scaleY: number = this.mViewPortHandler.contentHeight() / deltaY; if (scaleX == Number.MAX_VALUE) { scaleX = 0; } if (s...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
c836944f9e274d774383a47b38cf71dadebe8d09
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/PathPlanner.ets
arkts
isCongested
判断是否拥挤区域 @param position 位置
private isCongested(position: Position3D): boolean { // 简化实现:随机返回 return Math.random() < 0.1; // 10%概率拥挤 }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isCongested AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left position AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
private isCongested(position: Position3D): boolean { // 简化实现:随机返回 return Math.random() < 0.1; // 10%概率拥挤 }
https://github.com/LJ666-ui/harmony-health-care
da64f9607164d84edf0ffacf4867d855553a6e59
github
wly5556/S1-Orange
entry/src/main/ets/config/UserConfig.ets
arkts
readonly
只读访问配置项:不应在回调中修改ApplicationConfig,会导致配置项与存储的状态不同步
async readonly (reader: (conf: ApplicationConfig) => void) { if (!this.initialized) { await this.initPromise } reader(this.config) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#readonly#Left readonly AST#readonly#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left reader AST#identifier#Right AST#type_ann...
async readonly (reader: (conf: ApplicationConfig) => void) { if (!this.initialized) { await this.initPromise } reader(this.config) }
https://github.com/wly5556/S1-Orange
d8336c96a398d7235c482e1b535b5b4bc0dc4abf
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/common/utils/DAOHelper.ets
arkts
convertToOCRRecognitionRecord
转换为OCRRecognitionRecord
static convertToOCRRecognitionRecord(resultSet: relationalStore.ResultSet): OCRRecognitionRecord { const record = new OCRRecognitionRecord(); record.recordId = DAOHelper.getNumberValue(resultSet, 'record_id'); record.userId = DAOHelper.getNumberValue(resultSet, 'user_id'); const billId = DAOHelper.get...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left convertToOCRRecognitionRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right A...
static convertToOCRRecognitionRecord(resultSet: relationalStore.ResultSet): OCRRecognitionRecord { const record = new OCRRecognitionRecord(); record.recordId = DAOHelper.getNumberValue(resultSet, 'record_id'); record.userId = DAOHelper.getNumberValue(resultSet, 'user_id'); const billId = DAOHelper.get...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
0560c24ec74cbaaaa8e81846e539e86be16614a6
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/viewmodel/ComputerViewModel.ets
arkts
notifyDataReload
通知数据重新加载
private notifyDataReload(): void { this.listeners.forEach(listener => { listener.onDataReloaded(); }); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyDataReload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ex...
private notifyDataReload(): void { this.listeners.forEach(listener => { listener.onDataReloaded(); }); }
https://github.com/AlkaidLab/moonlight-harmony
60e8af903edc178dd1af36d7fe0dd64017734b52
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets
arkts
importScript
导入JS脚本
async importScript(path: string): Promise<string> { if (path.startsWith('http')) { return await this.cacheFile(path); } return await this.readTxtFile(path); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left importScript AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#ty...
async importScript(path: string): Promise<string> { if (path.startsWith('http')) { return await this.cacheFile(path); } return await this.readTxtFile(path); }
https://github.com/DaLongZhuaZi/manxia
34fd98c3b21ef69977366e9aaf1883a7c3323b90
github
ASweetBite/HarmonyPulse
entry/src/main/ets/utils/services/MusicShareService.ets
arkts
buildCollectionSharedData
封装集合分享数据(用于资料库或歌单) @param songs 歌曲列表 @param collectionName 显示的集合名称(如“资料库”或歌单名) @param collectionCover 集合封面图(如歌单封面)
buildCollectionSharedData(songs: SongItemType[], collectionName: string, collectionCover?: string): systemShare.SharedData | null { if (songs.length === 0) return null; let sharedData: systemShare.SharedData | null = null; for (let i = 0; i < songs.length; i++) { const song = songs[i]; const...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left buildCollectionSharedData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left songs AST#identifier#Right AST#:#Left : AST#:#Ri...
buildCollectionSharedData(songs: SongItemType[], collectionName: string, collectionCover?: string): systemShare.SharedData | null { if (songs.length === 0) return null; let sharedData: systemShare.SharedData | null = null; for (let i = 0; i < songs.length; i++) { const song = songs[i]; const...
https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/utils/services/MusicShareService.ets#L216-L243
5658a856170021edffc730c0384d113c0a9bc8f8
github
picklerick422/zju-learning-assistant-OH
entry/src/main/ets/services/NativeBridge.ets
arkts
login
---------------- 会话 ----------------
static async login(username: string, password: string): Promise<void> { await zla.login(username, password); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left login AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R...
static async login(username: string, password: string): Promise<void> { await zla.login(username, password); }
https://github.com/picklerick422/zju-learning-assistant-OH
97224c82e0bae1ebf552c1fdb174a0fa65aaa58f
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Diagnostics/StartupController.ets
arkts
getExecutionResults
获取执行结果
getExecutionResults(): StartupExecutionResult[] { return [...this.executionResults]; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getExecutionResults 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 StartupExecutionResult AST#identifier#Righ...
getExecutionResults(): StartupExecutionResult[] { return [...this.executionResults]; }
https://github.com/DaLongZhuaZi/manxia
c7f0f7ce8e45145cbba31b191ac9f28f8ac67201
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/ImageCacheManager.ets
arkts
isOnlineManga
判断是否为在线漫画 [修复] 本地文件不应该使用OnlineImageLoader
private isOnlineManga(options?: LoadOptions): boolean { // 明确标记为在线未下载的内容 if (options?.contentType === 'OnlineUndownloaded') { return true; } // 本地文件不是在线漫画 if (options?.contentType === 'LocalManga' || options?.contentType === 'Downloaded') { return false; } return false; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isOnlineManga AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left options AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERR...
private isOnlineManga(options?: LoadOptions): boolean { // 明确标记为在线未下载的内容 if (options?.contentType === 'OnlineUndownloaded') { return true; } // 本地文件不是在线漫画 if (options?.contentType === 'LocalManga' || options?.contentType === 'Downloaded') { return false; } return false; }
https://github.com/DaLongZhuaZi/manxia
e3877e9e01f85c328c9809be8dc3f5cbb1be6f3c
github
OnceWeWere/Weather_HarmonyOS
entry/src/main/ets/pages/StartPage.ets
arkts
aboutToAppear
默认不透明
aboutToAppear(): void { // 注册字体 font.registerFont({ familyName: '阿朱泡泡体', familySrc: $rawfile('fonts/阿朱泡泡体.ttf') }) this.timeOut_StatPage = setTimeout(() => { this.startExitAnimation() }, 2000) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { // 注册字体 font.registerFont({ familyName: '阿朱泡泡体', familySrc: $rawfile('fonts/阿朱泡泡体.ttf') }) this.timeOut_StatPage = setTimeout(() => { this.startExitAnimation() }, 2000) }
https://github.com/OnceWeWere/Weather_HarmonyOS
dac3cedf0451d295be49951d986f3e9d287d8299
github
arkui-x/samples
CodeLab/Cases/feature/databaseupgrade/src/main/ets/utils/DBUtils.ets
arkts
initDB
初始化db
initDB(): void { if (store !== undefined) { return; } relationalStore.getRdbStore(CONTEXT, STORE_CONFIG, async (err: BusinessError, rdbStore: relationalStore.RdbStore) => { store = rdbStore; if (err) { logger.error(`init DB failed, code is ${err.code}, message is ${err.message}`)...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left initDB 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 ...
initDB(): void { if (store !== undefined) { return; } relationalStore.getRdbStore(CONTEXT, STORE_CONFIG, async (err: BusinessError, rdbStore: relationalStore.RdbStore) => { store = rdbStore; if (err) { logger.error(`init DB failed, code is ${err.code}, message is ${err.message}`)...
https://gitcode.com/arkui-x/samples
43288729508f68be56abccb8bd2d91388021c65c
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/AbstractController.ets
arkts
isReady
控制器是否已就绪(初始化完成且尚未停止)
isReady(): boolean { return this.controllerState === ControllerState.Ready; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isReady AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_b...
isReady(): boolean { return this.controllerState === ControllerState.Ready; }
https://github.com/AlkaidLab/moonlight-harmony
8ac0db71807dd9c6fa716f5c8b1cd02635305335
github
openharmony-tpc/ohos_coap
libcoap/src/main/ets/components/mainpage/CoapClient.ets
arkts
setWaitSecond
客户端设置请求等待超时时间 @param waitSecond 请求等待时间
setWaitSecond(waitSecond: number) { this.coapClient.setWaitSecond(waitSecond, this.classId); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setWaitSecond AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left waitSecond AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right A...
setWaitSecond(waitSecond: number) { this.coapClient.setWaitSecond(waitSecond, this.classId); }
https://gitee.com/openharmony-tpc/ohos_coap.git
211be61f34db30bc23788d55f88fa33bb3c7aee3
gitee
Joker-x-dev/CoolMallArkTS
core/network/src/main/ets/datasource/address/AddressNetworkDataSourceImpl.ets
arkts
getAddressList
获取地址列表 @returns {Promise<NetworkResponse<Address[]>>} 地址列表
async getAddressList(): Promise<NetworkResponse<Address[]>> { const resp: AxiosResponse<NetworkResponse<Address[]>> = await NetworkClient.http.post("user/address/list"); return resp.data; }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAddressList 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#gener...
async getAddressList(): Promise<NetworkResponse<Address[]>> { const resp: AxiosResponse<NetworkResponse<Address[]>> = await NetworkClient.http.post("user/address/list"); return resp.data; }
https://github.com/Joker-x-dev/CoolMallArkTS
be7003f3eefcd255ac5a5966b77dc206a1039ce2
github
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/MyDemoOld/pages/heima/security/CountDownPage.ets
arkts
startCountDown
开启倒计时效果
startCountDown() { this.count = 5 // 开启定时器,保存定时器的id,用于后续清理 this.intervalId = setInterval(() => { this.count-- // 处理边界 if (this.count <= 0) { // 清除定时器 clearInterval(this.intervalId) // 页面跳转 this.router.replaceUrl({ url: 'pages/heima/security/Alarm...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startCountDown AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
startCountDown() { this.count = 5 // 开启定时器,保存定时器的id,用于后续清理 this.intervalId = setInterval(() => { this.count-- // 处理边界 if (this.count <= 0) { // 清除定时器 clearInterval(this.intervalId) // 页面跳转 this.router.replaceUrl({ url: 'pages/heima/security/Alarm...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
37298aa5df1a24dbbc91ee9174795b69ed0d8ac7
gitcode
xblLab/HarmonyProjectTemplate
commons/lib_api/src/main/ets/services/AuthorService.ets
arkts
signIn
登录 @param loginChannel 渠道
public signIn(loginChannel?: string, nickPhone?: string) { const raw = this.queryAuthorRaw(); if (raw) { if (loginChannel === 'wechat') { raw.authorNickName = '微信用户'; } else { raw.authorNickName = '华为用户'; } if (nickPhone) { raw.authorPhone = nickPhone; } ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left signIn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left loginChannel AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#string#L...
public signIn(loginChannel?: string, nickPhone?: string) { const raw = this.queryAuthorRaw(); if (raw) { if (loginChannel === 'wechat') { raw.authorNickName = '微信用户'; } else { raw.authorNickName = '华为用户'; } if (nickPhone) { raw.authorPhone = nickPhone; } ...
https://github.com/xblLab/HarmonyProjectTemplate
f6c3cc8ee6ee0cea94bf63e6c7998cdb1486a077
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
from
Creates an array from an object of std.core.Array<int>. @param { Array<int> } arr - An instance of the std.core.Array type to convert to an array. @returns { Uint8Array } - A new Uint8Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arr: Array<int>): Uint8Array { let result = new Uint8Array(arr.length) result.set(arr) return result }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ...
public static from(arr: Array<int>): Uint8Array { let result = new Uint8Array(arr.length) result.set(arr) return result }
https://gitcode.com/iop123123/arkts-static-skills
3de13211e47ac133ee369bb18ccc6382a7edf5a3
gitcode
Amaz1ny/HarmonyDO-public
entry/src/main/ets/services/network/CfChallengeService.ets
arkts
complete
由验证页回调:完成本次验证
complete(success: boolean): void { if (this.completed) return; this.completed = true; if (this.overlayVisibilityListener !== null) { this.overlayVisibilityListener(false); } if (success) { this.resetCooldown(); try { CfClearanceRefreshService.getInstance().startIfPossib...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left complete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left success AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#)#Left ) AS...
complete(success: boolean): void { if (this.completed) return; this.completed = true; if (this.overlayVisibilityListener !== null) { this.overlayVisibilityListener(false); } if (success) { this.resetCooldown(); try { CfClearanceRefreshService.getInstance().startIfPossib...
https://github.com/Amaz1ny/HarmonyDO-public
50d17468696cd72c01da01431c7a846c5b633a48
github
openharmony/arkui_ace_engine
examples/ScrollableComponentTest/entry/src/main/ets/pages/List/Table/CommonDataSource.ets
arkts
getData
根据索引获取单个数据项
getData(index: number) { return this.originDataArray[index]; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#...
getData(index: number) { return this.originDataArray[index]; }
https://gitee.com/openharmony/arkui_ace_engine.git
05bc7f0f1d8525cfcb15c04bd2b03c9e2a244656
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets
arkts
toLocaleString
Converts this object to locale-specific string representation @param { Intl.LocalesArgument } [ locales ] A string with a BCP 47 language tag, or an array of such strings. @param { object } [ options ] An object with configuration properties. @returns { string } A locale-specific string representing the object. @syscap...
public toLocaleString(locales?: Intl.LocalesArgument, options?: object): String { return this.toString() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toLocaleString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left locales AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#L...
public toLocaleString(locales?: Intl.LocalesArgument, options?: object): String { return this.toString() }
https://gitcode.com/iop123123/arkts-static-skills
516f7e266d09cea0736c0a44cc7d12468ac87389
gitcode
LZZLHY/hlib
entry/src/main/ets/utils/I18n.ets
arkts
ts
同步取出实际字符串。 优先用 bindContext 注入的全局 context;缺失时返回 fallback 或 key。
static ts(key: string, fallback?: string): string { const ctx: common.Context | null = I18n.appContext; if (ctx === null) { return fallback !== undefined ? fallback : key; } try { const value: string = ctx.resourceManager.getStringByNameSync(key); return value.length > 0 ? value : (f...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left ts AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R...
static ts(key: string, fallback?: string): string { const ctx: common.Context | null = I18n.appContext; if (ctx === null) { return fallback !== undefined ? fallback : key; } try { const value: string = ctx.resourceManager.getStringByNameSync(key); return value.length > 0 ? value : (f...
https://github.com/LZZLHY/hlib
b7966cdf01f34a0b322c9f22e4025532a4f5759d
github
openharmony/applications_mms
entry/src/main/ets/utils/MmsPreferences.ets
arkts
getValueFromPreferences
Get value from preferences
async getValueFromPreferences(key: string) { if (this.preferences == null) { HiLog.i(TAG, `getValueFromPreferences preferences is null`); return common.string.EMPTY_STR; } try { let value = await this.preferences.get(key, common.string.EMPTY_STR); this.setValueToMap(key, value.toSt...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getValueFromPreferences AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left key AST#identifier#Ri...
async getValueFromPreferences(key: string) { if (this.preferences == null) { HiLog.i(TAG, `getValueFromPreferences preferences is null`); return common.string.EMPTY_STR; } try { let value = await this.preferences.get(key, common.string.EMPTY_STR); this.setValueToMap(key, value.toSt...
https://gitee.com/openharmony/applications_mms.git
c0180c9dbfb10302c0c623a2e2fd18fca2ce0497
gitee
Joker-x-dev/CoolMallArkTS
core/util/src/main/ets/permission/PermissionUtils.ets
arkts
checkPermissionPermanentlyDenied
检查权限是否被永久拒绝 @param {Array<Permissions>} permissions 目标权限 @returns {Promise<boolean>} 是否已拒绝
private async checkPermissionPermanentlyDenied(permissions: Array<Permissions>): Promise<boolean> { // 通过检查是否可以再次请求权限来判断是否被永久拒绝 try { for (const permission of permissions) { // 如果已经授权,跳过 if (await this.checkPermissionGrant(permission)) { continue; } // 尝试请求权限,是...
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 checkPermissionPermanentlyDenied AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left p...
private async checkPermissionPermanentlyDenied(permissions: Array<Permissions>): Promise<boolean> { // 通过检查是否可以再次请求权限来判断是否被永久拒绝 try { for (const permission of permissions) { // 如果已经授权,跳过 if (await this.checkPermissionGrant(permission)) { continue; } // 尝试请求权限,是...
https://github.com/Joker-x-dev/CoolMallArkTS
8818b03028de1a46513de85790855d8dc7c7b6a2
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 { Iterable<number> } arrayLike - An array-like or iterable object to convert to an array. @param { function } [mapfn] - A mapping function to call on every element of the array. @returns { Float64Array } - A new Float64Array @static @syscap SystemCapability...
public static from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number): Float64Array { if (mapfn == undefined) { mapfn = (v: number, k: number): number => { return v } } let iter = arrayLike.$_iterator() // NOTE (templin.konstantin): This code section ...
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: Iterable<number>, mapfn?: (v: number, k: number) => number): Float64Array { if (mapfn == undefined) { mapfn = (v: number, k: number): number => { return v } } let iter = arrayLike.$_iterator() // NOTE (templin.konstantin): This code section ...
https://gitcode.com/iop123123/arkts-static-skills
a95e56a34901f3ac11d973a713af3e915dc65920
gitcode
CLMC2025/Vignette
entry/src/main/ets/sync/WebDavSyncManager.ets
arkts
ensureRemoteDirectory
确保远程目录存在,如果不存在则创建
private async ensureRemoteDirectory(client: IWebDavBackend, path: string): Promise<WebDavSyncResult | null> { try { // 递归创建父目录 const lastSlash = path.lastIndexOf('/'); if (lastSlash > 0) { const parent = path.substring(0, lastSlash); if (parent.length > 0 && parent !== '/') { ...
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 ensureRemoteDirectory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left client AST#identifier#Right AST...
private async ensureRemoteDirectory(client: IWebDavBackend, path: string): Promise<WebDavSyncResult | null> { try { // 递归创建父目录 const lastSlash = path.lastIndexOf('/'); if (lastSlash > 0) { const parent = path.substring(0, lastSlash); if (parent.length > 0 && parent !== '/') { ...
https://github.com/CLMC2025/Vignette
9b5e21c7165bddcc760d4439479156f2b176f0ed
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/BookshelfCategoryManager.ets
arkts
getItemCategory
获取内容所属分类
getItemCategory(itemId: string, contentType: ContentType): string { const key = `${contentType}_${itemId}`; const item = this.itemCategoryMap.get(key); return item?.categoryId || 'default'; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getItemCategory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left itemId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left...
getItemCategory(itemId: string, contentType: ContentType): string { const key = `${contentType}_${itemId}`; const item = this.itemCategoryMap.get(key); return item?.categoryId || 'default'; }
https://github.com/DaLongZhuaZi/manxia
5898f2e24f6131f5c5e65c762bde517bfc127f05
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ReadingAnalyticsManager.ets
arkts
setMangaGoal
设置漫画阅读目标
public async setMangaGoal(minutes: number): Promise<void> { this.goalsSettings.mangaGoalMinutes = Math.max(0, minutes); await this.saveGoalsSettings(); logger.info(TAG, `漫画阅读目标已设置为: ${minutes}分钟`); }
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 setMangaGoal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left minutes AST#identifier#Right AST#ERROR#Left AST#:#Left : A...
public async setMangaGoal(minutes: number): Promise<void> { this.goalsSettings.mangaGoalMinutes = Math.max(0, minutes); await this.saveGoalsSettings(); logger.info(TAG, `漫画阅读目标已设置为: ${minutes}分钟`); }
https://github.com/DaLongZhuaZi/manxia
30ff49ae2dc0bf09cb163e11b106fcdf6b88cd6c
github
FinalScave/SweetLine
platform/OHOS/sweetline/src/main/ets/Index.ets
arkts
charIndexToPosition
Convert a character index to a line/column position
public charIndexToPosition(index: number): TextPosition { const array: Int32Array = lib.Document_CharIndexToPosition(this.nativeHandle, index); return new TextPosition(array[0], array[1], index); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left charIndexToPosition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
public charIndexToPosition(index: number): TextPosition { const array: Int32Array = lib.Document_CharIndexToPosition(this.nativeHandle, index); return new TextPosition(array[0], array[1], index); }
https://github.com/FinalScave/SweetLine
195d061d9f0d09bbf1e1d61ea8b670bd84686297
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/SmartBudgetService.ets
arkts
calculatePeriodDates
计算周期日期
private static calculatePeriodDates(targetMonth: string, period: string): PeriodDatesResult { // targetMonth 格式: "2025-01" const parts = targetMonth.split('-'); const year = Number(parts[0]); const month = Number(parts[1]); const startDate = `${year}-${month.toString().padStart(2, '0')}-01`; ...
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 calculatePeriodDates AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetMonth AST#identifier#Right AST#ERROR#Lef...
private static calculatePeriodDates(targetMonth: string, period: string): PeriodDatesResult { // targetMonth 格式: "2025-01" const parts = targetMonth.split('-'); const year = Number(parts[0]); const month = Number(parts[1]); const startDate = `${year}-${month.toString().padStart(2, '0')}-01`; ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
057b897697029a41a9a4f659427c5fff7cb20128
github
offlinecat-dev/OCNetORM
src/main/ets/core/ScopeRegistry.ets
arkts
applyScope
应用作用域到查询构建器 @param entityName 实体名称 @param scopeName 作用域名称 @param queryBuilder 查询构建器 @returns 修改后的查询构建器,作用域不存在返回原查询构建器
applyScope(entityName: string, scopeName: string, queryBuilder: QueryBuilder): QueryBuilder { const scopeFunction = this.getScope(entityName, scopeName) if (scopeFunction === null) { return queryBuilder } return scopeFunction(queryBuilder) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left applyScope AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#...
applyScope(entityName: string, scopeName: string, queryBuilder: QueryBuilder): QueryBuilder { const scopeFunction = this.getScope(entityName, scopeName) if (scopeFunction === null) { return queryBuilder } return scopeFunction(queryBuilder) }
https://github.com/offlinecat-dev/OCNetORM
0e8f11e6359fd2e64eaa730373c16ce70ed89f96
github
youyeyejie/ZhiXing_ActHub
entry/src/test/TodoTestDataHelper.ets
arkts
createTodo
创建单个待办对象
private createTodo(id: string, content: string, createdAt: number, isDone: number): Todo { const todo = new Todo(); todo.id = `test_todo_${id}_${Date.now()}`; todo.content = content; todo.timestamp = createdAt; todo.categoryId = ''; todo.isDone = isDone; todo.inFocus = 0; todo.createdA...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left createTodo 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 stri...
private createTodo(id: string, content: string, createdAt: number, isDone: number): Todo { const todo = new Todo(); todo.id = `test_todo_${id}_${Date.now()}`; todo.content = content; todo.timestamp = createdAt; todo.categoryId = ''; todo.isDone = isDone; todo.inFocus = 0; todo.createdA...
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/test/TodoTestDataHelper.ets#L99-L110
4fb4f4a7dbc44d7d0916e5d729044d97da7849a8
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Preload/ChapterPreloadManager.ets
arkts
getAllTasks
获取所有任务状态
public getAllTasks(): PreloadTask[] { return Array.from(this.tasks.values()); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAllTasks 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 PreloadTas...
public getAllTasks(): PreloadTask[] { return Array.from(this.tasks.values()); }
https://github.com/DaLongZhuaZi/manxia
a97af3f1ba721459466e9b38ead01a9edc36ab86
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
constructor
Creates an Int16Array with respect to buf. @param { ArrayLike<Number> | ArrayBuffer } buf - data initializer @throws { RangeError } - Input parameter error. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLength = (buf as ArrayBuffer).getByteLength() if (this.byteLength % Int16Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength should be...
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#binary_expression#Lef...
public constructor(buf: ArrayLike<Number> | ArrayBuffer) { if (buf instanceof ArrayBuffer) { this.byteLength = (buf as ArrayBuffer).getByteLength() if (this.byteLength % Int16Array.BYTES_PER_ELEMENT.toInt() != 0) { throw new RangeError("ArrayBuffer.byteLength should be...
https://gitcode.com/iop123123/arkts-static-skills
7645a3b2e2fb765fd0a3b04b717c38c257f86e63
gitcode
XHXYT/Pixark
entry/src/main/ets/viewmodel/IllustDetailViewModel.ets
arkts
imageList
图片 URL 数组
get imageList(): PixivImage[] { if (!this.detailData) return []; // 检查是否有 meta_pages (多图) if (this.detailData.meta_pages && this.detailData.meta_pages.length > 0) { return this.detailData.meta_pages.map(page => page.image_urls); } // 单图情况,取 image_urls.large if (this.detailData.image_urls...
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left imageList 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 PixivImage AST#identi...
get imageList(): PixivImage[] { if (!this.detailData) return []; // 检查是否有 meta_pages (多图) if (this.detailData.meta_pages && this.detailData.meta_pages.length > 0) { return this.detailData.meta_pages.map(page => page.image_urls); } // 单图情况,取 image_urls.large if (this.detailData.image_urls...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/IllustDetailViewModel.ets#L44-L55
9adb8248c391ec846de276a47ec2a07bac3e2bc8
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/BasePopup.ets
arkts
setAttachViewId
依附View的ID @param attachViewId
setAttachViewId(attachViewId?: string): BasePopup<T> { this.attachViewId = attachViewId return this }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left setAttachViewId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left attachViewId AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right...
setAttachViewId(attachViewId?: string): BasePopup<T> { this.attachViewId = attachViewId return this }
https://github.com/wuba/omni-ui
d3e369c984355d9d1ff00705b8cae900a3f9c147
github
midori52000/ArkPilot
Agent/entry/src/main/ets/skills/SkillsBackendService.ets
arkts
discoverFromRepo
================================================================ 发现与扫描 ================================================================
async discoverFromRepo(owner: string, name: string, branch: string): Promise<DiscoverableSkill[]> { const repo = new SkillRepo(owner, name, branch, true); return await this.fetchRepoSkills(repo); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left discoverFromRepo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left owner AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async discoverFromRepo(owner: string, name: string, branch: string): Promise<DiscoverableSkill[]> { const repo = new SkillRepo(owner, name, branch, true); return await this.fetchRepoSkills(repo); }
https://github.com/midori52000/ArkPilot
59f6a6569bb09eca61bc8d599f952b1fbd4dcc2b
github
openharmony-tpc/VCard
library/src/main/ets/components/VCardParserImpl_V21.ets
arkts
handleEncoding
pencodingval = "7BIT" / "8BIT" / "QUOTED-PRINTABLE" / "BASE64" / "X-" word
protected handleEncoding(propertyData: VCardProperty, pencodingval: string): void { if (this.getAvailableEncodingSet().has(pencodingval) || pencodingval.startsWith("X-")) { propertyData.addParameter(VCardConstants.PARAM_ENCODING, pencodingval); // Update encoding right aw...
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left handleEncoding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left propertyData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#...
protected handleEncoding(propertyData: VCardProperty, pencodingval: string): void { if (this.getAvailableEncodingSet().has(pencodingval) || pencodingval.startsWith("X-")) { propertyData.addParameter(VCardConstants.PARAM_ENCODING, pencodingval); // Update encoding right aw...
https://gitee.com/openharmony-tpc/VCard.git
dd4a5d98c693314d2c6cc9864315a06433cf7c2a
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/viewmodel/StreamViewModel.ets
arkts
startAbr
--------------------------------------------------------------------------- 智能码率 (ABR) ---------------------------------------------------------------------------
async startAbr(mode: string): Promise<void> { if (!this.streamingSession) return; await this.streamingSession.startAbr(mode); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left startAbr AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left mode AST#identifier#Right AST#type_a...
async startAbr(mode: string): Promise<void> { if (!this.streamingSession) return; await this.streamingSession.startAbr(mode); }
https://github.com/AlkaidLab/moonlight-harmony
dcdb77b54dcf1edd204703d8a72e0a7ba467b54f
github
openharmony/codelabs
ETSUI/HarmonyPhotoAlbum/entry/src/main/ets/components/SearchBar.ets
arkts
build
防抖延迟(毫秒)
build() { Row() { // 搜索图标 Text('🔍') .fontSize(18) .margin({ left: 12, right: 8 }) // 搜索输入框 TextInput({ placeholder: '搜索图片名称或标签', text: this.searchText }) .layoutWeight(1) .height(40) .backgroundColor(Color.Transparent) ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Row() { // 搜索图标 Text('🔍') .fontSize(18) .margin({ left: 12, right: 8 }) // 搜索输入框 TextInput({ placeholder: '搜索图片名称或标签', text: this.searchText }) .layoutWeight(1) .height(40) .backgroundColor(Color.Transparent) ...
https://gitcode.com/openharmony/codelabs
bf7e467ae02242df2e32b7c0d23a5a1cff725048
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test6_original_index.ets
arkts
testStringPad
=== String padding and trimming edge cases ===
function testStringPad(): string { let s1: string = '42'.padStart(5, '0'); let s2: string = 'hi'.padEnd(10, '.'); let s3: string = ' mid '.trimStart(); let s4: string = ' mid '.trimEnd(); return s1 + '|' + s2 + '|' + s3 + '|' + s4; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testStringPad AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_ty...
function testStringPad(): string { let s1: string = '42'.padStart(5, '0'); let s2: string = 'hi'.padEnd(10, '.'); let s3: string = ' mid '.trimStart(); let s4: string = ' mid '.trimEnd(); return s1 + '|' + s2 + '|' + s3 + '|' + s4; }
https://github.com/miaochiahao/ark-ghidra
91ea02a0a7023b8c15e5d6ab34037a175da5cd22
github
wuba/omni-ui
omni_component/src/main/ets/components/guide/model/HighLightInfoOfComponent.ets
arkts
fetchLocation
更新组件坐标 @param parentId 父布局id @param componentId 组件id @returns 高亮区域的坐标
private fetchLocation(parentId: string, componentId: string): RectF | null { let originLocation = ComponentRectFUtil.getComponentRectF(parentId, componentId); if (!originLocation) { return null; } let left = originLocation.left - this.padding; let top = originLocation.top - this.padding; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left fetchLocation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left parentId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri...
private fetchLocation(parentId: string, componentId: string): RectF | null { let originLocation = ComponentRectFUtil.getComponentRectF(parentId, componentId); if (!originLocation) { return null; } let left = originLocation.left - this.padding; let top = originLocation.top - this.padding; ...
https://github.com/wuba/omni-ui
e249e2ef22eac9d4cedfa19fc38922363a783944
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Core/ErrorHandler.ets
arkts
createError
创建游戏错误
public createError( message: string, severity: ErrorSeverity = ErrorSeverity.MEDIUM, category: ErrorCategory = ErrorCategory.SYSTEM, context: Partial<ErrorContext> = {}, code: string = 'CUSTOM_ERROR', isRecoverable: boolean = true ): GameError { return new GameError(message, severity, ca...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left createError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Rig...
public createError( message: string, severity: ErrorSeverity = ErrorSeverity.MEDIUM, category: ErrorCategory = ErrorCategory.SYSTEM, context: Partial<ErrorContext> = {}, code: string = 'CUSTOM_ERROR', isRecoverable: boolean = true ): GameError { return new GameError(message, severity, ca...
https://github.com/DaLongZhuaZi/manxia
5821cdd3a71d10c33aa916e6af6de207607d72d0
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/ResultSetRow.ets
arkts
set
设置列值 @param columnName 列名 @param value 值
set(columnName: string, value: DbValueType): void { this.data.set(columnName, value) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left set AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left columnName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#Right A...
set(columnName: string, value: DbValueType): void { this.data.set(columnName, value) }
https://github.com/offlinecat-dev/OCNetORM
3f97de3ed6dd207dd24492447a47e751de01a28b
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
some
/ === with element lambda functions === Determines whether the specified callback function returns true for any element of an array. @param { function } predicate - A function that accepts three arguments. The some method calls the predicate function for each element in the array until the predicate returns a true or u...
public some(predicate: (element: number, index: int, array: Uint8ClampedArray) => boolean): boolean { for (let i = 0; i < this.lengthInt; i++) { if (predicate(this.getUnsafe(i).toDouble(), i, this)) { return true } } return false }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left some AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left predicate AST#identifi...
public some(predicate: (element: number, index: int, array: Uint8ClampedArray) => boolean): boolean { for (let i = 0; i < this.lengthInt; i++) { if (predicate(this.getUnsafe(i).toDouble(), i, this)) { return true } } return false }
https://gitcode.com/iop123123/arkts-static-skills
fd1f636c8ec1bc7aa79ac3bf7748a58928fb9beb
gitcode
Joker-x-dev/CoolMallArkTS
core/util/src/main/ets/toast/ToastUtils.ets
arkts
showBottom
显示底部 Toast @param {string | ResourceStr} message - 提示内容 @returns {void} 无返回值
static showBottom(message: string | ResourceStr): void { IBestToast.show({ position: "bottom", offsetY: "-20%", message: message }); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left showBottom AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#...
static showBottom(message: string | ResourceStr): void { IBestToast.show({ position: "bottom", offsetY: "-20%", message: message }); }
https://github.com/Joker-x-dev/CoolMallArkTS
7a61f9f2016cfdaffc1a080d20c3b3e14e71d282
github
DaLongZhuaZi/manxia
entry/src/main/ets/MyAbilityStage.ets
arkts
onAcceptWant
[核心修正] 为 want 参数添加明确的 Want 类型
onAcceptWant(want: Want): string { if (want.action === 'action.system.terminate') { logger.info(TAG, '🔴 应用即将终止(游戏引擎已移除)...'); // viewEngine.stop(); // 游戏引擎已移除 logger.info(TAG, '✅ 应用清理完成。'); } return "MyAbilityStage"; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onAcceptWant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#)#Left ) AST#...
onAcceptWant(want: Want): string { if (want.action === 'action.system.terminate') { logger.info(TAG, '🔴 应用即将终止(游戏引擎已移除)...'); // viewEngine.stop(); // 游戏引擎已移除 logger.info(TAG, '✅ 应用清理完成。'); } return "MyAbilityStage"; }
https://github.com/DaLongZhuaZi/manxia
e3e0ff371fbf800f4819725e5baa031dcd5e52d0
github
LongLiveY96/chatcube
entry/src/main/ets/state/AppSettingsStore.ets
arkts
brandColorFor
ProviderType 对应的品牌色资源。迁自原 ProviderViewModel.getProviderBrandColor
brandColorFor(type: ProviderType): Resource { if (type === ProviderType.OPENAI) { return $r('app.color.brand_openai') } else if (type === ProviderType.ANTHROPIC) { return $r('app.color.brand_anthropic') } else if (type === ProviderType.AZURE) { return $r('app.color.brand_azure') } el...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left brandColorFor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ProviderType AST#identifier#Right AST#)#Le...
brandColorFor(type: ProviderType): Resource { if (type === ProviderType.OPENAI) { return $r('app.color.brand_openai') } else if (type === ProviderType.ANTHROPIC) { return $r('app.color.brand_anthropic') } else if (type === ProviderType.AZURE) { return $r('app.color.brand_azure') } el...
https://github.com/LongLiveY96/chatcube
056901e793c327fdf161389a2fde6b07727d4304
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MainMenuPage.ets
arkts
toggleMangaPrivacy
切换漫画的隐私状态
private async toggleMangaPrivacy(mangaId: string, isPrivate: boolean): Promise<void> { try { logger.info(TAG, `切换漫画隐私状态: ${mangaId}, isPrivate=${isPrivate}`); // 使用通用方法更新隐私状态,自动检测内容类型 const targetManga = this.findLibraryMangaById(mangaId); if (targetManga !== null && this.isRemotePr...
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 toggleMangaPrivacy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mangaId AST#identifier#Right AST#ERROR#Left AST#:...
private async toggleMangaPrivacy(mangaId: string, isPrivate: boolean): Promise<void> { try { logger.info(TAG, `切换漫画隐私状态: ${mangaId}, isPrivate=${isPrivate}`); // 使用通用方法更新隐私状态,自动检测内容类型 const targetManga = this.findLibraryMangaById(mangaId); if (targetManga !== null && this.isRemotePr...
https://github.com/DaLongZhuaZi/manxia
f198652a38f94c4fd2dd3e397f2b4bf4ec0e57ec
github
richshaw2015/nds
ohos/entry/src/test/InputValidation.test.ets
arkts
validateMacAddress
验证MAC地址格式 MAC地址格式: XX:XX:XX:XX:XX:XX (X为十六进制字符) @param macAddress MAC地址字符串 @returns 验证结果对象
function validateMacAddress(macAddress: string): ValidationResult { if (!macAddress || macAddress.length === 0) { return { valid: false, error: '请输入MAC地址' }; } // MAC地址正则表达式 const macRegex = /^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$/; if (!macRegex.test(macAddress)) { return { valid: false, error: '格式无效...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left validateMacAddress AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left macAddress AST#identifier#Right AST#type_annotation#Left AST#:#Left...
function validateMacAddress(macAddress: string): ValidationResult { if (!macAddress || macAddress.length === 0) { return { valid: false, error: '请输入MAC地址' }; } // MAC地址正则表达式 const macRegex = /^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$/; if (!macRegex.test(macAddress)) { return { valid: false, error: '格式无效...
https://github.com/richshaw2015/nds
8b0f1c104d2afce77a4b4c6832226b4e87c3dddd
github
Cool_foolisher1/ArkTSRepository
GraphicalCode/features/algorithm/src/main/ets/service/AlgorithmService.ets
arkts
setComponentDetailToPreference
设置组件详情到首选项 @param componentId number @param data ComponentDetailModel @returns Promise<void>
public setComponentDetailToPreference(componentId: number, data: ComponentDetailModel): Promise<void> { return new Promise((resolve: () => void) => { PreferenceUtil.getInstance().hasValue(AlgorithmService.COMPONENT_DETAIL_DATA) .then((result) => { if (result) { PreferenceUtil.g...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setComponentDetailToPreference AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left componentId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Lef...
public setComponentDetailToPreference(componentId: number, data: ComponentDetailModel): Promise<void> { return new Promise((resolve: () => void) => { PreferenceUtil.getInstance().hasValue(AlgorithmService.COMPONENT_DETAIL_DATA) .then((result) => { if (result) { PreferenceUtil.g...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
ac2da4af1cac825f9c972550eac5493fb51f6f89
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RegExp.ets
arkts
input
Sets the original string used for matching. @param { String } val The string value to be set. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public set input(val: String) { this.input_ = val }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#identifier#Left input AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Lef...
public set input(val: String) { this.input_ = val }
https://gitcode.com/iop123123/arkts-static-skills
25a3f734c39fa3332321e389e90368efb590d043
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebDAV/WebDAVBackupManager.ets
arkts
cleanOldBackups
清理旧备份(保留最近N个)
async cleanOldBackups(keepCount: number = 5): Promise<void> { if (!this.client && !this.nativeClient) { const errorMsg = 'WebDAV未配置'; throw new Error(errorMsg); } try { const remoteBackups = await this.listRemoteBackups(); if (remoteBackups.length <= keepCount) { lo...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left cleanOldBackups AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keepCount AST#identifier#Righ...
async cleanOldBackups(keepCount: number = 5): Promise<void> { if (!this.client && !this.nativeClient) { const errorMsg = 'WebDAV未配置'; throw new Error(errorMsg); } try { const remoteBackups = await this.listRemoteBackups(); if (remoteBackups.length <= keepCount) { lo...
https://github.com/DaLongZhuaZi/manxia
647930271ccdb6c98e0d09a192448d978dc01b20
github
HarmonyOS_Samples/guide-snippets
ArkGraphics3D/entry/src/main/ets/common/utils.ets
arkts
SetOrbitFromTarget
0 press, 1 pinch
SetOrbitFromTarget(targetPosition: Vec3, rotation: Quaternion, orbitDistance: number): void { this.orbitDistance_ = orbitDistance; this.cameraRotation_ = rotation; this.cameraTargetPosition_ = targetPosition; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left SetOrbitFromTarget AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetPosition AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Vec3 AST#identifier#Right AST#ERROR#Right A...
SetOrbitFromTarget(targetPosition: Vec3, rotation: Quaternion, orbitDistance: number): void { this.orbitDistance_ = orbitDistance; this.cameraRotation_ = rotation; this.cameraTargetPosition_ = targetPosition; }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
cb76010357c7d718dfac9c0b72c901cc9e6f0119
gitcode