nwo
stringclasses
449 values
path
stringlengths
9
173
language
stringclasses
1 value
identifier
stringlengths
1
53
docstring
stringlengths
5
4.13k
function
stringlengths
10
87.2k
ast_function
stringlengths
351
354k
obf_function
stringlengths
10
87.2k
url
stringlengths
30
175
function_sha
stringlengths
40
40
source
stringclasses
3 values
openharmony-sig/fluttertpc_mobile_scanner
ohos/src/main/ets/MobileScannerPlugin.ets
arkts
setDisplay
竖屏时获取屏幕尺寸,设置预览流全屏示例
setDisplay() { // 以手机为例计算宽高 let displayClass = display.getDefaultDisplaySync(); this.displayHeight = px2vp(displayClass.height); this.displayWidth = px2vp(displayClass.width); if (displayClass !== null) { this.scanWidth = px2vp(displayClass.width); this.scanHeight = Math.round(this.sca...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setDisplay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS...
setDisplay() { // 以手机为例计算宽高 let displayClass = display.getDefaultDisplaySync(); this.displayHeight = px2vp(displayClass.height); this.displayWidth = px2vp(displayClass.width); if (displayClass !== null) { this.scanWidth = px2vp(displayClass.width); this.scanHeight = Math.round(this.sca...
https://gitee.com/openharmony-sig/fluttertpc_mobile_scanner.git
749ead4db77eab8179585e4ccc308ca558024b1b
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/common/utils/HttpUtil.ets
arkts
saveDoctorToken
保存医生Token
static async saveDoctorToken(token: string): Promise<void> { try { AppStorage.setOrCreate<string>('doctorToken', token); const settings: SettingsUtil = SettingsUtil.getInstance(); await settings.saveDoctorToken(token); } catch (error) { console.error('[HttpUtil] 保存医生Token失败:', error); ...
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 saveDoctorToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : ...
static async saveDoctorToken(token: string): Promise<void> { try { AppStorage.setOrCreate<string>('doctorToken', token); const settings: SettingsUtil = SettingsUtil.getInstance(); await settings.saveDoctorToken(token); } catch (error) { console.error('[HttpUtil] 保存医生Token失败:', error); ...
https://github.com/LJ666-ui/harmony-health-care
1d597e7c82016a8c3330d324d8abc522061b5644
github
LJ666-ui/harmony-health-care
entry/src/main/ets/components/ARNavigationComponents.ets
arkts
build
新增:导航按钮回调
build() { if (this.destination !== null) { Row() { // 左侧图标 Column() { Text(this.getCategoryIcon(this.destination.category)) .fontSize(28) Text(`${this.destination.floor}F`) .fontSize(11) .fontColor('#666666') .fon...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#if_statement#Left AST#if#Left i...
build() { if (this.destination !== null) { Row() { // 左侧图标 Column() { Text(this.getCategoryIcon(this.destination.category)) .fontSize(28) Text(`${this.destination.floor}F`) .fontSize(11) .fontColor('#666666') .fon...
https://github.com/LJ666-ui/harmony-health-care
e17fe15a533721d67ffe15a467f216435dfcba92
github
YDYm233/EasyRandom_HarmonyNextApp
product/default/src/main/ets/sub_pages/metronome/MetronomePage.ets
arkts
startMetronome
启动节拍器
startMetronome(): void { if (this.isRunning) { return } this.isRunning = true this.currentBeat = 0 this.beatLit = true if (this.useVibration) { VibratorManager.vibrateShort() } const interval = 60000 / this.bpm // 每拍间隔(ms) // 清除可能存在的旧定时器 if (this.time...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left startMetronome AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#...
startMetronome(): void { if (this.isRunning) { return } this.isRunning = true this.currentBeat = 0 this.beatLit = true if (this.useVibration) { VibratorManager.vibrateShort() } const interval = 60000 / this.bpm // 每拍间隔(ms) // 清除可能存在的旧定时器 if (this.time...
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
3d1ac8652c85f6f9c170b76ef8c9f7a1c4227b7b
github
Countly/countly-sdk-hos
library/src/main/ets/internal/DeviceInfo.ets
arkts
collectRamMetrics
RAM snapshot for crash metrics ONLY. Android collects RAM (and disk) exclusively inside `getCrashMetricsJSON`, not the session-metrics builder. We mirror that: `collect()` above is the session/RC/etc. metric builder and intentionally does NOT carry `_ram_*`; `ModuleCrashes.recordInternal` calls this method to enrich th...
public static collectRamMetrics(): Record<string, string> { const out: Record<string, string> = {}; try { const mem: hidebug.SystemMemInfo = hidebug.getSystemMemInfo(); const totalKb: number = Number(mem.totalMem); const availKb: number = Number(mem.availableMem); if (Number.isFinite(t...
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 collectRamMetrics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
public static collectRamMetrics(): Record<string, string> { const out: Record<string, string> = {}; try { const mem: hidebug.SystemMemInfo = hidebug.getSystemMemInfo(); const totalKb: number = Number(mem.totalMem); const availKb: number = Number(mem.availableMem); if (Number.isFinite(t...
https://github.com/Countly/countly-sdk-hos
d47ea40150172235a15ca77296d1f16b2c833ac2
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/RestorationChannel.ets
arkts
getRestorationData
Obtain the most current restoration data that the framework has provided.
getRestorationData(): Uint8Array { return this.restorationData; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getRestorationData 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 Uint8Array AST#identifier#Right AST#ERROR#R...
getRestorationData(): Uint8Array { return this.restorationData; }
https://gitee.com/openharmony-sig/flutter_engine.git
efb2b180e835946d840ba8edefa6ac45dc9f09a9
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/TypeCreator.ets
arkts
constructor
@param parameter type @param name name of parameter
public constructor(typ: Type, name: string) { this(TypeOrCreator.from(typ)) this.name = name }
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 typ AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Type ...
public constructor(typ: Type, name: string) { this(TypeOrCreator.from(typ)) this.name = name }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
ca212bdde0daa867f83915ff22ee55d0eea30f55
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
getColorByRole
获取指定颜色角色的颜色
public getColorByRole(role: ColorRole): string { return AppColors.getColor(role); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getColorByRole AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left role AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left C...
public getColorByRole(role: ColorRole): string { return AppColors.getColor(role); }
https://github.com/DaLongZhuaZi/manxia
a12a89539fb6f32cbdd470569838c6ff4c7e1060
github
openharmony/codelabs
Security/AccessPermission/entry/src/main/ets/common/util/DeviceListUtil.ets
arkts
initDmInstance
Initializing Device Management Objects.
initDmInstance(dealDeviceInfo: Function) { this.dealDeviceInfo = dealDeviceInfo; try { deviceManager.createDeviceManager(getContext(this).applicationInfo.name, (err, data) => { if (err) { Logger.error(TAG, 'createDeviceManager errCode:' + err.code + ',errMessage:' + err.message); ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initDmInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dealDeviceInfo AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Function AST#identifier#Right AS...
initDmInstance(dealDeviceInfo: Function) { this.dealDeviceInfo = dealDeviceInfo; try { deviceManager.createDeviceManager(getContext(this).applicationInfo.name, (err, data) => { if (err) { Logger.error(TAG, 'createDeviceManager errCode:' + err.code + ',errMessage:' + err.message); ...
https://gitee.com/openharmony/codelabs.git
657c3c4c1e418b25b133b23f2d1b7f9d451dd38d
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/AssistantService.ets
arkts
setCurrentAssistantId
把当前助手 id 切到目标 id。如果目标 id 在 DB/缓存里不存在则回落到 DEFAULT, 再从回落后的状态读出 Assistant 返回(保证返回值可用)
async setCurrentAssistantId(assistantId: string): Promise<Assistant> { await this.store.ensureAssistantsInitialized() const id = assistantId.trim() !== '' ? assistantId.trim() : DEFAULT_ASSISTANT_ID const candidate = this.store.getAssistantById(id) const effectiveAssistant = candidate !== null ? candi...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setCurrentAssistantId AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_para...
async setCurrentAssistantId(assistantId: string): Promise<Assistant> { await this.store.ensureAssistantsInitialized() const id = assistantId.trim() !== '' ? assistantId.trim() : DEFAULT_ASSISTANT_ID const candidate = this.store.getAssistantById(id) const effectiveAssistant = candidate !== null ? candi...
https://github.com/LongLiveY96/chatcube
06dacfe1c492d5e5e3a3a98f1fcdaf1a0bb7d368
github
terryma2024/happyword
harmonyos/entry/src/main/ets/services/MemoryScheduler.ets
arkts
qualifiesForFamiliar
V0.4.3: promote to Familiar when the player has built a recent streak (preferred signal) OR has accumulated enough cumulative correct answers (legacy fallback for snapshots migrated from before consecutiveCorrect existed).
private qualifiesForFamiliar(stat: WordStat): boolean { if (stat.consecutiveCorrect >= PROMOTE_TO_FAMILIAR_AT) { return true; } return stat.correctCount >= LEGACY_FAMILIAR_CORRECT_AT; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left qualifiesForFamiliar AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stat AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi...
private qualifiesForFamiliar(stat: WordStat): boolean { if (stat.consecutiveCorrect >= PROMOTE_TO_FAMILIAR_AT) { return true; } return stat.correctCount >= LEGACY_FAMILIAR_CORRECT_AT; }
https://github.com/terryma2024/happyword
7f5787d9b79678e4585a676e1e55bdfd56bddaea
github
Harrisonls2004/WaterFlow
entry/src/main/ets/common/utils/CommentManager.ets
arkts
getCommentsByProductId
Get comments for a specific product
static async getCommentsByProductId(productId: string): Promise<IComment[]> { try { // 优先从服务器获取 if (SERVER_ENABLED) { try { // 从 productId 中提取数字(如 "product_003" -> 3) let productIdNum = 0; const numMatch = productId.match(/\d+/); if (numMatch) { ...
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 getCommentsByProductId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left productId AST#identifier#Right AST#ERROR#Left AS...
static async getCommentsByProductId(productId: string): Promise<IComment[]> { try { // 优先从服务器获取 if (SERVER_ENABLED) { try { // 从 productId 中提取数字(如 "product_003" -> 3) let productIdNum = 0; const numMatch = productId.match(/\d+/); if (numMatch) { ...
https://github.com/Harrisonls2004/WaterFlow
c2dbda98390d62310325f3a2f5ba155340a7abbb
github
LZZLHY/hlib
entry/src/main/ets/utils/Redact.ets
arkts
url
脱敏 URL:把敏感 query 参数的值替换为 ***,保留 path 与 key 名。
static url(input: string): string { if (input.length === 0) { return input; } const qIdx: number = input.indexOf('?'); if (qIdx < 0) { return input; } const base: string = input.substring(0, qIdx); const query: string = input.substring(qIdx + 1); const parts: string[] = que...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
static url(input: string): string { if (input.length === 0) { return input; } const qIdx: number = input.indexOf('?'); if (qIdx < 0) { return input; } const base: string = input.substring(0, qIdx); const query: string = input.substring(qIdx + 1); const parts: string[] = que...
https://github.com/LZZLHY/hlib
f16a3c194a05da896c4710cd29a1c93172dc20aa
github
openharmony/applications_app_samples
code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangeSeekBarView.ets
arkts
touchInThumb
判断触碰事件有效
touchInThumb(event?: GestureEvent): boolean { if (this.touchInLeftThumb(event) || this.touchInRightThumb(event)) { return true; } else { return false; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left touchInThumb AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left GestureEvent AST#...
touchInThumb(event?: GestureEvent): boolean { if (this.touchInLeftThumb(event) || this.touchInRightThumb(event)) { return true; } else { return false; } }
https://github.com/openharmony/applications_app_samples
ff35b0616385aa58013c20460510546f136f18cd
github
the-wwyang/kids-learning-app
src/main/ets/services/LearningService.ets
arkts
recordLearningActivity
记录学习活动(答题、练习等)
public recordLearningActivity( moduleName: string, lessonName: string, score: number, correctCount: number, totalCount: number ): LearningRecord { const record: LearningRecord = { moduleName: moduleName, lessonName: lessonName, score: score, correctCount: correctCount...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left recordLearningActivity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string ...
public recordLearningActivity( moduleName: string, lessonName: string, score: number, correctCount: number, totalCount: number ): LearningRecord { const record: LearningRecord = { moduleName: moduleName, lessonName: lessonName, score: score, correctCount: correctCount...
https://github.com/the-wwyang/kids-learning-app
12e5096ea8851f35390434fe8201d36de1bf676e
github
LJ666-ui/harmony-health-care
entry/src/main/ets/core/DeviceManager.ets
arkts
getDeviceStatus
获取设备状态 @param deviceId 设备ID @returns DeviceStatus | undefined 设备状态
public getDeviceStatus(deviceId: string): DeviceStatus | undefined { return this.deviceStatuses.get(deviceId); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDeviceStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#strin...
public getDeviceStatus(deviceId: string): DeviceStatus | undefined { return this.deviceStatuses.get(deviceId); }
https://github.com/LJ666-ui/harmony-health-care
33d02f9a1415b0dec56617fb360604706c0bf89a
github
openharmony/applications_calendar_data
datamanager/src/main/ets/processor/alerts/AlertsProcessor.ets
arkts
findNextAlarmTime
查找给定时间之后的下一个alarm时间 @param rdbStore RdbStore @param mills 给定的事件 @return 返回下一个alarm的时间,如果不存在此类alarm,则返回-1
async function findNextAlarmTime(rdbStore: data_rdb.RdbStore, mills: number): Promise<number> { Log.info(TAG, 'findNextAlarmTime start.'); let alarmTime = INVALIDATE_TIME_MILLIS; const columns = [CalendarAlertsColumns.ALARM_TIME]; let predicates = new dataSharePredicates.DataSharePredicates(); predicates.grea...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left findNextAlarmTime AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rdbStore AST#identifier#Right A...
async function findNextAlarmTime(rdbStore: data_rdb.RdbStore, mills: number): Promise<number> { Log.info(TAG, 'findNextAlarmTime start.'); let alarmTime = INVALIDATE_TIME_MILLIS; const columns = [CalendarAlertsColumns.ALARM_TIME]; let predicates = new dataSharePredicates.DataSharePredicates(); predicates.grea...
https://gitee.com/openharmony/applications_calendar_data.git
e2394e3980811b0081e496025cc879e8cde961c9
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelChapterCacheManager.ets
arkts
isUsingDownloadDir
[新增] 检查是否使用Download目录
isUsingDownloadDir(): boolean { return this.useDownloadDir; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isUsingDownloadDir 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#...
isUsingDownloadDir(): boolean { return this.useDownloadDir; }
https://github.com/DaLongZhuaZi/manxia
9b8a17b9f03ca35bb9e2f187aaae973df00df9a6
github
offlinecat-dev/OCNetORM
src/main/ets/core/ColumnMetadata.ets
arkts
constructor
构造函数 @param propertyName ArkTS 属性名 @param columnName 数据库列名(可选,默认使用属性名)
constructor(propertyName: string, columnName?: string) { this.propertyName = propertyName this.columnName = columnName ? columnName : propertyName }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right A...
constructor(propertyName: string, columnName?: string) { this.propertyName = propertyName this.columnName = columnName ? columnName : propertyName }
https://github.com/offlinecat-dev/OCNetORM
3c9d5a497e492ff78655f72353309cfaea8d8c83
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test45_original_index.ets
arkts
testEveryComplex
--- Array.every with complex predicate ---
function testEveryComplex(): string { let matrix: number[][] = [[2, 4, 6], [1, 3, 5], [8, 10, 12]]; let results: boolean[] = []; for (let i: number = 0; i < matrix.length; i++) { let row: number[] = matrix[i]; let allEven: boolean = true; for (let j: number = 0; j < row.length; j++) { if (row[j]...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testEveryComplex 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...
function testEveryComplex(): string { let matrix: number[][] = [[2, 4, 6], [1, 3, 5], [8, 10, 12]]; let results: boolean[] = []; for (let i: number = 0; i < matrix.length; i++) { let row: number[] = matrix[i]; let allEven: boolean = true; for (let j: number = 0; j < row.length; j++) { if (row[j]...
https://github.com/miaochiahao/ark-ghidra
bd4834cd79de09936ddde23b83462661736cf367
github
encorexin/WordPressCMS
harmonyos/entry/src/main/ets/pages/KeywordsPage.ets
arkts
getGroupedKeywords
========== 计算属性 ==========
getGroupedKeywords(): Record<string, Keyword[]> { const query = this.searchQuery.trim().toLowerCase() let filtered: Keyword[] = [] for (let i = 0; i < this.allKeywords.length; i++) { const kw = this.allKeywords[i] if (query.length === 0 || kw.keyword.toLowerCase().includes(query)) { fi...
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left getGroupedKeywords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right...
getGroupedKeywords(): Record<string, Keyword[]> { const query = this.searchQuery.trim().toLowerCase() let filtered: Keyword[] = [] for (let i = 0; i < this.allKeywords.length; i++) { const kw = this.allKeywords[i] if (query.length === 0 || kw.keyword.toLowerCase().includes(query)) { fi...
https://github.com/encorexin/WordPressCMS
483e5ec289cf9a5bbefe75398fcf3abed9815e90
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/BridgeJsBuilder.ets
arkts
buildBridgeJs
Build pagination/scroll/touch bridge JS. One interpolation: ${layoutKind}.
static buildBridgeJs(layoutKind: EpubPageLayoutKind): string { return ` window.__mnxLayoutKind = '${layoutKind}'; window.__mnxGetScrollCandidates = function() { var list = []; var append = function(node) { if (!node) { return; } for (var i = 0;...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left buildBridgeJs AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left layoutKind AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static buildBridgeJs(layoutKind: EpubPageLayoutKind): string { return ` window.__mnxLayoutKind = '${layoutKind}'; window.__mnxGetScrollCandidates = function() { var list = []; var append = function(node) { if (!node) { return; } for (var i = 0;...
https://github.com/DaLongZhuaZi/manxia
f75c3d8beb5fd17196d2ec866b29e8d0fb874454
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/LRU.ets
arkts
constructor
Constructs a new LRUCache with the given capacity. @param { int } - maximum number of entries to cache (must be positive) @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(capacity: int) { if (capacity <= 0) { throw new Error("LRUCache capacity must be positive"); } this.capacity = capacity; this.map = new Map<K, LRUNode<K, V>>(); this.head = undefined; this.tail = undefined; this.mutex = Concurren...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifi...
public constructor(capacity: int) { if (capacity <= 0) { throw new Error("LRUCache capacity must be positive"); } this.capacity = capacity; this.map = new Map<K, LRUNode<K, V>>(); this.head = undefined; this.tail = undefined; this.mutex = Concurren...
https://gitcode.com/iop123123/arkts-static-skills
87bde9fd8f17f5abcec399faef95c40421707222
gitcode
HarmonyOS_Samples/BestPracticeSnippets
ArkUI/PureTabsExt/entry/src/main/ets/view/InTabComponent.ets
arkts
build
[EndExclude tabs_bar_translate]
build() { // [Start tabs_fading_edge] Tabs({controller: this.subController}){ // [StartExclude tabs_fading_edge] // [StartExclude tabs_bar_translate] ForEach(this.tabItems, (item: string, index: number) => { TabContent(){ List({ space: 10 }) { ForEach(this.conte...
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() { // [Start tabs_fading_edge] Tabs({controller: this.subController}){ // [StartExclude tabs_fading_edge] // [StartExclude tabs_bar_translate] ForEach(this.tabItems, (item: string, index: number) => { TabContent(){ List({ space: 10 }) { ForEach(this.conte...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
76c553f139f9efa5e88698df2ced7334d7f0da1b
gitcode
openharmony/codelabs
ETSUI/ChatAppDemo/entry/src/main/ets/common/I18nManager.ets
arkts
switchLanguage
切换语言逻辑 @param languageCode 'zh-Hans' 或 'en-US'
static switchLanguage(languageCode: string) { try { // 设置系统语言(这会影响 $r 的指向) i18n.System.setAppPreferredLanguage(languageCode); // 将当前语言持久化,以便下次启动时读取 AppStorage.setOrCreate('currentLanguage', languageCode); console.info(`成功切换语言至: ${languageCode}`); } catch (error) { let err...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left switchLanguage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left languageCode AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
static switchLanguage(languageCode: string) { try { // 设置系统语言(这会影响 $r 的指向) i18n.System.setAppPreferredLanguage(languageCode); // 将当前语言持久化,以便下次启动时读取 AppStorage.setOrCreate('currentLanguage', languageCode); console.info(`成功切换语言至: ${languageCode}`); } catch (error) { let err...
https://gitcode.com/openharmony/codelabs
e2c3f51b0f6d44d2b5f2085ee83f4dbff6bdfbe7
gitcode
openharmony/codelabs
Security/StringCipherArkTS/entry/src/main/ets/pages/Login.ets
arkts
login
Check whether the decrypted password is consistent with the password entered by the user. If yes, the login is successful.
login() { let user = this.userList[0]; if (this.decryptPassword === this.password) { // The login success page is displayed. router.replaceUrl({ url: CommonConstants.ROUTER_WELCOME_URL, params: { 'username': user.username } }).catch((err: Error) => { Logger.error(`Fai...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left login AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_declaration#Left AST#le...
login() { let user = this.userList[0]; if (this.decryptPassword === this.password) { // The login success page is displayed. router.replaceUrl({ url: CommonConstants.ROUTER_WELCOME_URL, params: { 'username': user.username } }).catch((err: Error) => { Logger.error(`Fai...
https://gitee.com/openharmony/codelabs.git
bb4b0622dca17bf0e95763373704570a2c55cf4f
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setCenterTextRadiusPercent
the rectangular radius of the bounding box for the center text, as a percentage of the pie hole default 1.f (100%)
public setCenterTextRadiusPercent(percent: number): void { this.mCenterTextRadiusPercent = percent; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCenterTextRadiusPercent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left percent AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number...
public setCenterTextRadiusPercent(percent: number): void { this.mCenterTextRadiusPercent = percent; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
a5718b4ec1b068856551ba354e03ee394dd71431
gitee
richshaw2015/nds
ohos/entry/src/main/ets/utils/ThemeManager.ets
arkts
init
初始化主题管理器 @param context UIAbilityContext 上下文 @returns Promise<void> Requirements: 2.6, 8.2, 8.4
public async init(context: common.UIAbilityContext): Promise<void> { if (this.initialized) { console.info(`${TAG} Already initialized`); return; } this.context = context; try { // 确保 SettingsManager 已初始化 // 这是主题持久化正常工作的前提条件 const settingsManager = SettingsManager.getIns...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left init AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Rig...
public async init(context: common.UIAbilityContext): Promise<void> { if (this.initialized) { console.info(`${TAG} Already initialized`); return; } this.context = context; try { // 确保 SettingsManager 已初始化 // 这是主题持久化正常工作的前提条件 const settingsManager = SettingsManager.getIns...
https://github.com/richshaw2015/nds
2a4e75cd0882b02498661b237cc454daf2a877a3
github
751496032/ZRouter
RouterApi/src/main/ets/api/Router.ets
arkts
getParamByName
@deprecated @see {ZRouter.getInstance().getParamByName} @param name @returns
public static getParamByName(name: string): Record<string, ObjectOrNull>[] { return ZRouter.getRouterMgr().getParamByName(name) }
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 getParamByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : A...
public static getParamByName(name: string): Record<string, ObjectOrNull>[] { return ZRouter.getRouterMgr().getParamByName(name) }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L524-L526
7bfeb503d62a19b721e223db234566a3ac855ca7
github
Joker-x-dev/CoolMallArkTS
core/model/src/main/ets/entity/OrderCount.ets
arkts
fromResponse
从接口响应构建订单统计(兼容中文字段) @param {object} data - 接口原始数据 @returns {OrderCount} 订单统计
static fromResponse(data: object): OrderCount { if (data instanceof OrderCount) { return new OrderCount(data); } const result: OrderCount = new OrderCount(); const source: Object = data as Object; result.pendingPayment = OrderCount.pickNumber(source, "pendingPayment", "待付款", result.pendingPa...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left fromResponse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left obj...
static fromResponse(data: object): OrderCount { if (data instanceof OrderCount) { return new OrderCount(data); } const result: OrderCount = new OrderCount(); const source: Object = data as Object; result.pendingPayment = OrderCount.pickNumber(source, "pendingPayment", "待付款", result.pendingPa...
https://github.com/Joker-x-dev/CoolMallArkTS
476016f5d2405a3863777ec1bf04b797ed5786c1
github
openharmony/codelabs
Data/DeviceHealth/entry/src/main/ets/services/EventHubManager.ets
arkts
emitBatteryWarning
发送电量不足信号
public emitBatteryWarning(soc: number): void { if (EventHubManager.ctx) { EventHubManager.ctx.eventHub.emit(EventHubManager.EVENT_LOW_BATTERY, soc); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left emitBatteryWarning AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left soc AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
public emitBatteryWarning(soc: number): void { if (EventHubManager.ctx) { EventHubManager.ctx.eventHub.emit(EventHubManager.EVENT_LOW_BATTERY, soc); } }
https://gitcode.com/openharmony/codelabs
35c6f3cd7656b9c1c1e97ed471cbe5e669b3a7e3
gitcode
yongoe1024/RdbPlus
rdbplus/src/main/ets/core/Connection.ets
arkts
execDQL
执行:查询
async execDQL(sql: string, params: Array<relationalStore.ValueType> = []): Promise<relationalStore.ResultSet> { try { Connection.logger?.info('execDQL:', sql, JSON.stringify(params)) return this.store.querySql(sql, params) } catch (e) { Connection.logger?.error('execDQL', e.message, e.code, ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left execDQL AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sql AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
async execDQL(sql: string, params: Array<relationalStore.ValueType> = []): Promise<relationalStore.ResultSet> { try { Connection.logger?.info('execDQL:', sql, JSON.stringify(params)) return this.store.querySql(sql, params) } catch (e) { Connection.logger?.error('execDQL', e.message, e.code, ...
https://github.com/yongoe1024/RdbPlus/blob/83f7347b7ac692941729d3464923155948e876bb/rdbplus/src/main/ets/core/Connection.ets#L88-L96
ebac57f259f48556bc8286a90d013831995c5a7d
github
fangmingtao/Ohs_ArkTs_Eyepetizer
entry/src/main/ets/common/DateUtil.ets
arkts
formatDuration
格式化时长(毫秒转 MM:SS) @param milliseconds 毫秒数(13位毫秒数) @returns 格式:03:00
static formatDuration(milliseconds: number): string { if (milliseconds < 0) { return '00:00'; } // 将毫秒转换为秒 const totalSeconds = Math.floor(milliseconds / 1000); const minutes = Math.floor(totalSeconds / 60); const secs = Math.floor(totalSeconds % 60); return `${DateUtil.padZero(min...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left formatDuration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left milliseconds AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#nu...
static formatDuration(milliseconds: number): string { if (milliseconds < 0) { return '00:00'; } // 将毫秒转换为秒 const totalSeconds = Math.floor(milliseconds / 1000); const minutes = Math.floor(totalSeconds / 60); const secs = Math.floor(totalSeconds % 60); return `${DateUtil.padZero(min...
https://gitcode.com/fangmingtao/Ohs_ArkTs_Eyepetizer
08adefaa14c6d52978ec7c63d855365ff049d047
gitcode
daugf2527/harmonyos-libretro-emulator
entry/src/main/ets/common/ErrorCodes.ets
arkts
getUserMessage
获取用户友好的错误消息
static getUserMessage(codeOrNumeric: string | number): string { let definition: ErrorCodeDefinition | undefined; if (typeof codeOrNumeric === 'number') { definition = ErrorCodeUtils.findByNumericCode(codeOrNumeric); } else { definition = ErrorCodeUtils.findByCode(codeOrNumeric); } if...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getUserMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left codeOrNumeric AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right A...
static getUserMessage(codeOrNumeric: string | number): string { let definition: ErrorCodeDefinition | undefined; if (typeof codeOrNumeric === 'number') { definition = ErrorCodeUtils.findByNumericCode(codeOrNumeric); } else { definition = ErrorCodeUtils.findByCode(codeOrNumeric); } if...
https://github.com/daugf2527/harmonyos-libretro-emulator
5f2021a6a019c75d0576652b8b5242433ea0192f
github
openharmony/applications_notes
common/utils/src/main/ets/default/baseUtil/FolderUtil.ets
arkts
duplicateDetection
folder name duplicate detection @param inputStr - Folder name input @param folderDataArray - folder already exist @return Promise<boolean> - if input name exist, return true, else return false
async duplicateDetection(inputStr: string, folderDataArray: FolderData[]): Promise<boolean> { for (let index = 0; index < folderDataArray.length; index++) { if (folderDataArray[index].folder_type == FolderType.CusDef && folderDataArray[index].name == inputStr) { return true } else { le...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left duplicateDetection AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left inputStr AST#identifier#Right AST#type_annotation#L...
async duplicateDetection(inputStr: string, folderDataArray: FolderData[]): Promise<boolean> { for (let index = 0; index < folderDataArray.length; index++) { if (folderDataArray[index].folder_type == FolderType.CusDef && folderDataArray[index].name == inputStr) { return true } else { le...
https://gitee.com/openharmony/applications_notes.git
7ca60fc00a5968c94e5b644d9b14b931a8a3f4e6
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets
arkts
operatorMultiply
Multiplies this BigInt by another. @param { BigInt } other The multiplier. @returns { BigInt } The result of the multiplication. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public operatorMultiply(other: BigInt): BigInt { if (this.isZero() || other.isZero()) { return new BigInt() } let result = new BigInt(0) let lhs = this let rhs = other // we're little endian, means digits at our vector // are stored as little-end...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left operatorMultiply AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
public operatorMultiply(other: BigInt): BigInt { if (this.isZero() || other.isZero()) { return new BigInt() } let result = new BigInt(0) let lhs = this let rhs = other // we're little endian, means digits at our vector // are stored as little-end...
https://gitcode.com/iop123123/arkts-static-skills
bb2359213fa1d8c66eea7999b86d633fe387e80b
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Box.ets
arkts
box
Creates a new BooleanBox instance with the specified initial value. @param { boolean } value - The initial boolean value to be wrapped @returns { BooleanBox } A new BooleanBox instance containing the specified boolean value @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static box(value: boolean): BooleanBox { return new BooleanBox(value); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left box AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#id...
public static box(value: boolean): BooleanBox { return new BooleanBox(value); }
https://gitcode.com/iop123123/arkts-static-skills
18f8d537cc40c10aa1512263e21160c0e6315df8
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/core/AlertManager.ets
arkts
clear
清空所有告警
public clear(): void { this.alerts = []; this.notifySubscribers(); console.log('AlertManager cleared'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left clear AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Rig...
public clear(): void { this.alerts = []; this.notifySubscribers(); console.log('AlertManager cleared'); }
https://github.com/LJ666-ui/harmony-health-care
a9738811142b956ec921029740e646e367204bad
github
openharmony-sig/FastBle
library/src/main/ets/BleManager.ets
arkts
setMtu
set Mtu @param bleDevice @param mtu @param callback
public setMtu(bleDevice: BleDevice, mtu: number, callback: BleMtuChangedCallback) { if (callback == null) { throw new Error("BleMtuChangedCallback can not be Null!"); } if (mtu > BleManager.DEFAULT_MAX_MTU) { BleLog.e("requiredMtu should lower than 512 !"); callback.onSetMTUFailure(new ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMtu AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bleDevice AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left BleD...
public setMtu(bleDevice: BleDevice, mtu: number, callback: BleMtuChangedCallback) { if (callback == null) { throw new Error("BleMtuChangedCallback can not be Null!"); } if (mtu > BleManager.DEFAULT_MAX_MTU) { BleLog.e("requiredMtu should lower than 512 !"); callback.onSetMTUFailure(new ...
https://gitee.com/openharmony-sig/FastBle.git
db0253127745fed7115cc2256b737dee936a5f97
gitee
Joker-x-dev/CoolMallArkTS
entry/src/main/ets/entryability/EntryAbility.ets
arkts
initIBestORM
初始化 IBest ORM 数据库
async initIBestORM(): Promise<void> { await IBestORMInit(this.context, { name: "app.db" }); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left initIBestORM AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic...
async initIBestORM(): Promise<void> { await IBestORMInit(this.context, { name: "app.db" }); }
https://github.com/Joker-x-dev/CoolMallArkTS
eef807da5c8c74dc39ecc07722d3b9227f78fc04
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewMangaLoader.ets
arkts
loadChapterImages
加载章节图片
loadChapterImages(chapter: ChapterInfoDatabaseRecord): PageInfoDatabaseRecord[] { try { logger.info(TAG, `开始加载章节图片: ${chapter.title} (${chapter.id})`); // 检查是否已在加载中 if (this.loadingChapters.has(chapter.id)) { throw new Error(`章节正在加载中: ${chapter.id}`); } // 获取源配置 ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left loadChapterImages AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapter AST#identifier#Right AST#:#Left : AST#:#Right AST#...
loadChapterImages(chapter: ChapterInfoDatabaseRecord): PageInfoDatabaseRecord[] { try { logger.info(TAG, `开始加载章节图片: ${chapter.title} (${chapter.id})`); // 检查是否已在加载中 if (this.loadingChapters.has(chapter.id)) { throw new Error(`章节正在加载中: ${chapter.id}`); } // 获取源配置 ...
https://github.com/DaLongZhuaZi/manxia
96fcfd02c2a23ad3e1fee7abb5e62745825bf862
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets
arkts
stringify
Converts int to JSON format @param d: int - int to be converted to a JSON as a Number @returns String - JSON representation of int
public static stringify(d: int): String { return StringBuilder.toString(d) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left stringify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Rig...
public static stringify(d: int): String { return StringBuilder.toString(d) }
https://gitcode.com/iop123123/arkts-static-skills
8fd44f6b0c1a8ef663893680a72b591d8cb43f58
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
loadTheme
加载保存的主题
private async loadTheme(): Promise<void> { try { if (!this.preferencesStore) { await this.initializePreferences(); } if (this.preferencesStore) { const savedTheme = await this.preferencesStore.get(this.THEME_KEY, ThemeType.AUTO); this.currentTheme = savedTheme as ThemeTy...
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 loadTheme AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
private async loadTheme(): Promise<void> { try { if (!this.preferencesStore) { await this.initializePreferences(); } if (this.preferencesStore) { const savedTheme = await this.preferencesStore.get(this.THEME_KEY, ThemeType.AUTO); this.currentTheme = savedTheme as ThemeTy...
https://github.com/DaLongZhuaZi/manxia
06a9d117672629bc26a4c1a530a87ed3419e83d7
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
forEach
Performs the specified action for each element in Uint8Array @param { function } callbackfn - A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public forEach(callbackfn: (value: number, index: int, array: Uint8Array) => void): void { for (let i = 0; i < this.lengthInt; i++) { callbackfn(this.getUnsafe(i).toDouble(), i, this) } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#identifier#Left forEach AST#identifier#Right AST#ERROR#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri...
public forEach(callbackfn: (value: number, index: int, array: Uint8Array) => void): void { for (let i = 0; i < this.lengthInt; i++) { callbackfn(this.getUnsafe(i).toDouble(), i, this) } }
https://gitcode.com/iop123123/arkts-static-skills
72c2febad82d66bc0f915ace472ef218f6e6c2cc
gitcode
Joker-x-dev/CoolMallArkTS
core/state/src/main/ets/UserState.ets
arkts
hasValidToken
是否拥有未过期的访问令牌 @returns {boolean} 是否可用
hasValidToken(): boolean { return !!this.auth?.token && !this.auth.isExpired(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasValidToken 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#state...
hasValidToken(): boolean { return !!this.auth?.token && !this.auth.isExpired(); }
https://github.com/Joker-x-dev/CoolMallArkTS
cf2d5fb3471a30f1198fca698469e77423903d9c
github
honjow/Next2V
shared/src/main/ets/network/ApiService.ets
arkts
getRecentTopics
Get all-site recently updated topics
async getRecentTopics(page: number = 1): Promise<V2exTopic[]> { const result = await this.getRecentTopicsPage(page) return result.topics }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getRecentTopics AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left page AST#identifier#Right AST#type_annotation#Left AST#:#Left :...
async getRecentTopics(page: number = 1): Promise<V2exTopic[]> { const result = await this.getRecentTopicsPage(page) return result.topics }
https://github.com/honjow/Next2V
1a5f9948885df7a21e7023bb82e4f06c6f659181
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Services/GlobalSearchService.ets
arkts
searchSuwayomi
搜索Suwayomi漫画(库搜索或指定源搜索)
async searchSuwayomi(keyword: string, sourceId?: string): Promise<UnifiedSearchItem[]> { try { if (!this.suwayomiExecutor.isConfigured()) { logger.warn(TAG, 'Suwayomi未配置'); return []; } let results: OnlineComicInfo[]; if (sourceId) { this.suwayomiExecutor.setCurren...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left searchSuwayomi AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyword AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async searchSuwayomi(keyword: string, sourceId?: string): Promise<UnifiedSearchItem[]> { try { if (!this.suwayomiExecutor.isConfigured()) { logger.warn(TAG, 'Suwayomi未配置'); return []; } let results: OnlineComicInfo[]; if (sourceId) { this.suwayomiExecutor.setCurren...
https://github.com/DaLongZhuaZi/manxia
40cdfdadd122af2bccbc15c8024f83d689ed37e3
github
openharmony-sig/ohos_easyui
entry/src/main/ets/pages/TestNavBar.ets
arkts
showLeftWarn
左边按钮的提示弹窗消息
showLeftWarn(){ promptAction.showToast({ message:"返回", duration:2000, bottom:300 }) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left showLeftWarn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left ...
showLeftWarn(){ promptAction.showToast({ message:"返回", duration:2000, bottom:300 }) }
https://gitee.com/openharmony-sig/ohos_easyui.git
65b3d57f02924a448479d93ef7cc646c573bb601
gitee
openharmony/codelabs
ETSUI/Habit/entry/src/main/ets/pages/HabitDetailPage.ets
arkts
statLabelStyle
统计卡片中的说明文字样式
@Extend(Text) function statLabelStyle() { .fontSize(12) .fontColor('#666') .margin({ top: 4 }) .fontWeight(FontWeight.Regular) }
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 statLabelStyle() { .fontSize(12) .fontColor('#666') .margin({ top: 4 }) .fontWeight(FontWeight.Regular) }
https://gitcode.com/openharmony/codelabs
afc54da7fbf58b20b6bebd0f9b553fab47ccb70b
gitcode
CPF-ApplicationTPC/openharmony_tpc_samples
OhosVideoCache/library/src/main/ets/HttpProxyCacheServer.ets
arkts
clearClientsMap
清理clientsMap
public clearClientsMap() { emitter.emit(`${this.serverHashId}_${VideoCacheConstant.HTTPURLSOURCE_CLEARCLIENTSMAP}`); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearClientsMap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left...
public clearClientsMap() { emitter.emit(`${this.serverHashId}_${VideoCacheConstant.HTTPURLSOURCE_CLEARCLIENTSMAP}`); }
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
e59e83e9b137a90624b1338b80f3583b04b145eb
gitcode
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/AudioManager.ets
arkts
getCurrentSong
Getter方法
getCurrentSong(): SongInfo | null { return this.currentSong; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getCurrentSong AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identi...
getCurrentSong(): SongInfo | null { return this.currentSong; }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
90393e2b6a627d31ab70b49043851ebc14386521
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/CompressionUtils.ets
arkts
validateArchiveFile
验证压缩文件 @param archivePath 压缩文件路径
private async validateArchiveFile(archivePath: string): Promise<string> { let actualFilePath: string = archivePath; // 初始化为原始路径 let isTemporaryFile: boolean = false; // 标记是否为临时文件 try { // 如果是URI路径,先复制到临时目录 if (archivePath.startsWith('file://')) { actualFilePath = await this.copyUr...
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 validateArchiveFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left archivePath AST#identifier#Right AST#ERROR#Left ...
private async validateArchiveFile(archivePath: string): Promise<string> { let actualFilePath: string = archivePath; // 初始化为原始路径 let isTemporaryFile: boolean = false; // 标记是否为临时文件 try { // 如果是URI路径,先复制到临时目录 if (archivePath.startsWith('file://')) { actualFilePath = await this.copyUr...
https://github.com/DaLongZhuaZi/manxia
e96b674591ddce1dee955fc189439b1b5d1365e2
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnCheckboxViewModel.ets
arkts
setCheckboxValues3
设置复选框组3的选中值集合 @param values 新的选中值数组
setCheckboxValues3(values: Array<string | number>): void { this.checkboxValues3 = values; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCheckboxValues3 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left values AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left A...
setCheckboxValues3(values: Array<string | number>): void { this.checkboxValues3 = values; }
https://github.com/codelably/tuniao-ui
c1427724b2ff6d078ddbca83f50955f268d24031
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsEngine.ets
arkts
extractUrls
从代码中提取可能的URL(用于预先发起网络请求)
private extractUrls(code: string): string[] { const urls: string[] = []; // 匹配常见的URL模式 const urlPatterns = [ /["'](https?:\/\/[^"'\s]+)["']/g, // 引号中的URL /url\s*[=:]\s*["']([^"']+)["']/gi, // url = "..." 或 url: "..." ]; for (const pattern of urlPatterns) { let match: RegEx...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractUrls AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s...
private extractUrls(code: string): string[] { const urls: string[] = []; // 匹配常见的URL模式 const urlPatterns = [ /["'](https?:\/\/[^"'\s]+)["']/g, // 引号中的URL /url\s*[=:]\s*["']([^"']+)["']/gi, // url = "..." 或 url: "..." ]; for (const pattern of urlPatterns) { let match: RegEx...
https://github.com/DaLongZhuaZi/manxia
bc05af395cc74094cb7b418724baea668eeb447f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/SparseArray.ets
arkts
from
Creates a new `SparseArray` instance from an `ArrayLike` object. @param { ArrayLike<T> } arr An array-like object to convert to an array. @returns { SparseArray<T> } A new SparseArray instance containing the elements from the array-like object. @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from<T>(arr: ArrayLike<T>): SparseArray<T> { const ret: SparseArray<T> = new SparseArray<T>() for (let i: int = 0; i < arr.length; i++) { ret.buffer.set(i, arr.$_get(i)) if (i + 1 > ret.maxLength) { ret.maxLength = i + 1 } } ...
AST#program#Left AST#ERROR#Left AST#binary_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#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#...
public static from<T>(arr: ArrayLike<T>): SparseArray<T> { const ret: SparseArray<T> = new SparseArray<T>() for (let i: int = 0; i < arr.length; i++) { ret.buffer.set(i, arr.$_get(i)) if (i + 1 > ret.maxLength) { ret.maxLength = i + 1 } } ...
https://gitcode.com/iop123123/arkts-static-skills
c613ebecc0de16420a600b0f0d216497564bda78
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/AxisBase.ets
arkts
setGridAlpha
设置GridLine的不透明度 @param alpha 不透明度,取值0到255之间,0是完全透明,255是完全不透明
public setGridAlpha(alpha: number): void { if (alpha < 0) { alpha = 0; } else if (alpha > 255) { alpha = 255; } this.mGridAlpha = alpha; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setGridAlpha AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alpha AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu...
public setGridAlpha(alpha: number): void { if (alpha < 0) { alpha = 0; } else if (alpha > 255) { alpha = 255; } this.mGridAlpha = alpha; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
88e759bd24c3936ac9ddfdd4ea7bc46689eb0770
gitee
openharmony-tpc/XmlGraphicsBatik
library/src/main/ets/batik/SVGManager.ets
arkts
_parseGeneralTypeToXML
转换键值对数据为XML格式 @param key 主键 @param generalObj 值
private _parseGeneralTypeToXML(key: string, value: number | string): string { let xml = key + "=\"" + value + "\" "; return xml; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left _parseGeneralTypeToXML AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
private _parseGeneralTypeToXML(key: string, value: number | string): string { let xml = key + "=\"" + value + "\" "; return xml; }
https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git
3a310109411cac42a0728d16af2185f563670a5d
gitee
apap6628114/nga_oh
entry/src/main/ets/common/managers/ReplyManager.ets
arkts
buildQuotePrefix
构建引用前缀 — 对应 Java ArticleListAdapter.getReplyIntent() 清洗 post.content 中的已有引用,避免多层嵌套 [quote][pid={pid},{tid},{page}]Reply[/pid] [b]Post by [uid={authorId}]{author}[/uid] ({postDate}):[/b]\n{cleanedContent}[/quote]\n
buildQuotePrefix(post: PostInfo, tid: number, page: number): string { const uid: string = post.authorid < 0 ? '-1' : String(post.authorid) let cleanContent: string = post.content cleanContent = cleanContent.replace(/\[quote\]([\s\S])*\[\/quote\]/g, '') cleanContent = cleanContent.replace(/\[b\]Reply t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left buildQuotePrefix AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left post AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PostInfo AST#identifier#Right AST#,#Lef...
buildQuotePrefix(post: PostInfo, tid: number, page: number): string { const uid: string = post.authorid < 0 ? '-1' : String(post.authorid) let cleanContent: string = post.content cleanContent = cleanContent.replace(/\[quote\]([\s\S])*\[\/quote\]/g, '') cleanContent = cleanContent.replace(/\[b\]Reply t...
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/common/managers/ReplyManager.ets#L123-L146
36ddf66d4049a41fa12b4c8e53a20dd8f4288b69
github
openharmony/developtools_profiler
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets
arkts
getMaxWidth
@return the maximum width that the axis can take (in dp).
public getMaxWidth(): number { return this.mMaxWidth; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMaxWidth 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#num...
public getMaxWidth(): number { return this.mMaxWidth; }
https://gitee.com/openharmony/developtools_profiler.git
86bd2a753d179a93f8ef5b7b987d77aae47a8f7a
gitee
openharmony-sig/jtar
library/src/main/ets/ohos_tar.ets
arkts
untar
untar解包
public untar(path: string): number { return ohos_tar.siuntar(this.rootPath + "/" + this.untarFileName, this.rootPath + "/" + path); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left untar AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR...
public untar(path: string): number { return ohos_tar.siuntar(this.rootPath + "/" + this.untarFileName, this.rootPath + "/" + path); }
https://gitee.com/openharmony-sig/jtar.git
2f269b5298d2bd706eed35669bac340bd53edc50
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectProxy.ets
arkts
isProxyClass
Checks if a class is generated by Proxy.create. @param { Class } klass - The class to check for proxy status. @returns { boolean } `true` if the class is a proxy class, `false` otherwise. @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static isProxyClass(klass: Class): boolean { return klass.isSubtypeOf(Class.from<Proxy>()) && Proxy.hasProxyFlag(klass) }
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 isProxyClass AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left klass AST#identifier#Right AST#:#Left : AS...
public static isProxyClass(klass: Class): boolean { return klass.isSubtypeOf(Class.from<Proxy>()) && Proxy.hasProxyFlag(klass) }
https://gitcode.com/iop123123/arkts-static-skills
974bbb5e1bdc5db697f632701235a7a968a23a67
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/ThemeManager.ets
arkts
setThemeMode
设置主题模式 @param mode 主题模式
public async setThemeMode(mode: ThemeMode): Promise<void> { this.currentThemeMode = mode; await this.applyTheme(); this.notifyThemeChangeListeners(); }
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 setThemeMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left : AST#...
public async setThemeMode(mode: ThemeMode): Promise<void> { this.currentThemeMode = mode; await this.applyTheme(); this.notifyThemeChangeListeners(); }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ThemeManager.ets#L63-L67
3c13b50efc61ff515ff778a5f8ee1f0572a46347
github
openharmony/codelabs
Data/PersonalAssistantPro/entry/src/main/ets/viewmodel/EventViewModel.ets
arkts
getEventStatusColor
获取日程状态对应的颜色资源 (用于 UI 展示) @param event
public getEventStatusColor(event: Event): string { const now = Date.now(); if (now > event.endTime) { return '#999999'; // 灰色 - 已结束 } else if (now >= event.startTime && now <= event.endTime) { return '#007DFF'; // 蓝色 - 进行中 } else { return '#FF9C00'; // 橙色 - 未开始 } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getEventStatusColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
public getEventStatusColor(event: Event): string { const now = Date.now(); if (now > event.endTime) { return '#999999'; // 灰色 - 已结束 } else if (now >= event.startTime && now <= event.endTime) { return '#007DFF'; // 蓝色 - 进行中 } else { return '#FF9C00'; // 橙色 - 未开始 } }
https://gitcode.com/openharmony/codelabs
f7f1b27b2e843ebdead8428777d50569a37707ef
gitcode
kumaleap/ArkLuban
library/src/main/ets/luban/Luban.ets
arkts
getTargetDirectory
获取目标目录 @returns 目标目录路径
private getTargetDirectory(): string { if (this.config.targetDir) { return this.config.targetDir; } // 使用默认输出目录(filesDir/luban/) return LubanUtils.getDefaultOutputDir(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getTargetDirectory 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 stri...
private getTargetDirectory(): string { if (this.config.targetDir) { return this.config.targetDir; } // 使用默认输出目录(filesDir/luban/) return LubanUtils.getDefaultOutputDir(); }
https://github.com/kumaleap/ArkLuban
66d3194bc78b96761c9a53c3a82869102e259535
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/ChartData.ets
arkts
removeDataSet
Removes the given DataSet from this data object. Also recalculates all minimum and maximum values. Returns true if a DataSet was removed, false if no DataSet could be removed. @param d
public removeDataSet(d: T): boolean { if (d == null) return false; if (!this.mDataSets) { return true; } let removed: boolean = this.mDataSets.remove(d); // if a DataSet was removed if (removed) { this.notifyDataChanged(); } return removed; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left removeDataSet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left T AST...
public removeDataSet(d: T): boolean { if (d == null) return false; if (!this.mDataSets) { return true; } let removed: boolean = this.mDataSets.remove(d); // if a DataSet was removed if (removed) { this.notifyDataChanged(); } return removed; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
cb974d4bbe5c78cb1e4cf0846047750287642f96
gitee
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/push/facades/PushManagerFacade.ets
arkts
onMessageReceived
订阅推送消息的数据回调。 注意:HarmonyOS PushKit 的消息到达机制基于 Want 分发, 实际推送消息会通过 UIAbility 的 onNewWant 生命周期回调传递。 注册此回调后,请在 UIAbility 的 onNewWant 中调用 PushManagerFacade.dispatchMessage(want) 将消息转发至此回调。
onMessageReceived(callback: (message: Object) => void): void { this.messageCallback = callback; logger.info(TAG, '推送消息回调已注册'); }
AST#program#Left AST#ERROR#Left AST#identifier#Left onMessageReceived 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 ( AST#(#Right AST#identifier#Left message A...
onMessageReceived(callback: (message: Object) => void): void { this.messageCallback = callback; logger.info(TAG, '推送消息回调已注册'); }
https://github.com/DaLongZhuaZi/NGF
664ed98806fbd55345b0279f999a256d35ed8860
github
LJ666-ui/harmony-health-care
entry/src/main/ets/services/SyncService.ets
arkts
startAutoSync
开始自动同步
private startAutoSync(): void { this.timer = setInterval(() => { this.sync(); }, this.syncInterval); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left startAutoSync 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#expre...
private startAutoSync(): void { this.timer = setInterval(() => { this.sync(); }, this.syncInterval); }
https://github.com/LJ666-ui/harmony-health-care
82410afd01d4c19cf09919af42846e757e036021
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/NotificationManager.ets
arkts
sendTransferUploadProgressNotification
发送局域网传书上传进度通知
public async sendTransferUploadProgressNotification( taskId: string, fileName: string, current: number, total: number ): Promise<boolean> { const progress = this.calculateProgressPercent(current, total); const config: NotificationConfig = { id: this.getNotificationId(taskId), tit...
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 sendTransferUploadProgressNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identi...
public async sendTransferUploadProgressNotification( taskId: string, fileName: string, current: number, total: number ): Promise<boolean> { const progress = this.calculateProgressPercent(current, total); const config: NotificationConfig = { id: this.getNotificationId(taskId), tit...
https://github.com/DaLongZhuaZi/manxia
26aeae939f6d1b7c82d31bf70b8b1932e636647d
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/UsbDriverService.ets
arkts
reportControllerState
==================== UsbDriverListener 实现 ====================
reportControllerState( controllerId: number, buttonFlags: number, leftStickX: number, leftStickY: number, rightStickX: number, rightStickY: number, leftTrigger: number, rightTrigger: number ): void { if (this.listener) { this.listener.reportControllerState( controll...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#call_expression#Left AST#identifier#Left reportControllerState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left controllerId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number...
reportControllerState( controllerId: number, buttonFlags: number, leftStickX: number, leftStickY: number, rightStickX: number, rightStickY: number, leftTrigger: number, rightTrigger: number ): void { if (this.listener) { this.listener.reportControllerState( controll...
https://github.com/AlkaidLab/moonlight-harmony
5fa3e181fc6d913b5fd111a35555ddc8b38d31ee
github
UnbalancedCat/ohos-ssh-core
ssh_lib/src/main/ets/core/SshClient.ets
arkts
sftpOpenFile
===== SFTP Phase 2: Binary & Streaming Operations ===== Open a remote file and return a file descriptor (fd).
async sftpOpenFile(path: string, flags: number, mode: number): Promise<number> { if (!this.handle) throw new SshError('Client is disposed', SshErrorCode.DISPOSED); try { return await ssh.sftpOpenFile(this.handle, path, flags, mode); } catch (err) { const msg = (err as Error).message ?? 'SFTP o...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left sftpOpenFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annotation#L...
async sftpOpenFile(path: string, flags: number, mode: number): Promise<number> { if (!this.handle) throw new SshError('Client is disposed', SshErrorCode.DISPOSED); try { return await ssh.sftpOpenFile(this.handle, path, flags, mode); } catch (err) { const msg = (err as Error).message ?? 'SFTP o...
https://github.com/UnbalancedCat/ohos-ssh-core
c14abc90325369468eaf534cd5cb838f06474d45
github
LJ666-ui/harmony-health-care
entry/src/main/ets/services/AuthService.ets
arkts
saveAuthInfo
保存认证信息到本地 @param token JWT Token @param userInfo 用户信息
static async saveAuthInfo(token: string, userInfo: PersistedUserInfo): Promise<void> { try { await HttpUtil.saveToken(token); const settings = SettingsUtil.getInstance(); await settings.saveUserInfo(userInfo); AppStorage.setOrCreate<string>('userToken', token); AppStorage.setOrCreate...
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 saveAuthInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST...
static async saveAuthInfo(token: string, userInfo: PersistedUserInfo): Promise<void> { try { await HttpUtil.saveToken(token); const settings = SettingsUtil.getInstance(); await settings.saveUserInfo(userInfo); AppStorage.setOrCreate<string>('userToken', token); AppStorage.setOrCreate...
https://github.com/LJ666-ui/harmony-health-care
71326854a9eccd7aa023d51c5d78c6d23860e03d
github
qiaomu8559968/FlipClock
clock_component/src/main/ets/components/FlipDigit.ets
arkts
aboutToAppear
顶层下部旋转角度
aboutToAppear() { this.oldData = this.data }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left...
aboutToAppear() { this.oldData = this.data }
https://gitcode.com/qiaomu8559968/FlipClock
692179574e82db75011bce498f11b6e40ac373d4
gitcode
openharmony/applications_mms
entry/src/main/ets/pages/index.ets
arkts
aboutToDisappear
Function executes before custom component destructor consumption. Changing state variables in the aboutToDisappear function is not allowed, especially changes to the @Link variable may cause unstable application behavior.
aboutToDisappear() { this.mConListCtrl.onDestroy(); this.mIndexCtrl.onDestroy(); this.smListener.off('change', this.isBreakpointSM); this.mdListener.off('change', this.isBreakpointMD); this.lgListener.off('change', this.isBreakpointLG); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear 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...
aboutToDisappear() { this.mConListCtrl.onDestroy(); this.mIndexCtrl.onDestroy(); this.smListener.off('change', this.isBreakpointSM); this.mdListener.off('change', this.isBreakpointMD); this.lgListener.off('change', this.isBreakpointLG); }
https://gitee.com/openharmony/applications_mms.git
ef5a51547d889386cb8b48a53d95665c124d80ab
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
toSorted
Creates a sorted copy @returns { Int8Array } - a sorted copy @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toSorted(): Int8Array { return new Int8Array(this).sort() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toSorted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left Int8Array AST...
public toSorted(): Int8Array { return new Int8Array(this).sort() }
https://gitcode.com/iop123123/arkts-static-skills
4fab9c6b6f6618a3042c300a0cddbde88922020f
gitcode
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/model/RemoteHost.ets
arkts
generateId
生成唯一 ID
static generateId(): string { const rand = cryptoFramework.createRandom(); const blob = rand.generateRandomSync(8); const randomStr = Array.from(new Uint8Array(blob.data)) .map((b: number) => b.toString(16).padStart(2, '0')).join(''); return 'host_' + Date.now().toString(36) + '_' + randomStr; ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#stri...
static generateId(): string { const rand = cryptoFramework.createRandom(); const blob = rand.generateRandomSync(8); const randomStr = Array.from(new Uint8Array(blob.data)) .map((b: number) => b.toString(16).padStart(2, '0')).join(''); return 'host_' + Date.now().toString(36) + '_' + randomStr; ...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
cde152f91bed121de61a6bec2aca231c7d3f917c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Core/ErrorHandler.ets
arkts
clearHistory
清理错误历史
public clearHistory(): void { this.errorHistory = []; this.statistics.recentErrors = []; this.statistics.totalErrors = 0; this.statistics.errorsByCategory = {} as Record<ErrorCategory, number>; this.statistics.errorsBySeverity = {} as Record<ErrorSeverity, number>; logger.info(ERROR_HANDLER_TA...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearHistory 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...
public clearHistory(): void { this.errorHistory = []; this.statistics.recentErrors = []; this.statistics.totalErrors = 0; this.statistics.errorsByCategory = {} as Record<ErrorCategory, number>; this.statistics.errorsBySeverity = {} as Record<ErrorSeverity, number>; logger.info(ERROR_HANDLER_TA...
https://github.com/DaLongZhuaZi/manxia
b47bbaea0590e48e6de40b4794cccd8d386072ff
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
div
Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant digits using rounding mode `rounding`. @param { Value } x {double | string | Decimal} @param { Value } y {double | string | Decimal} @returns { Decimal } the Decimal type
static div(x: Value, y: Value): Decimal { return new Decimal(x).div(y); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left div AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left x AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Ri...
static div(x: Value, y: Value): Decimal { return new Decimal(x).div(y); }
https://gitcode.com/iop123123/arkts-static-skills
b81c7262abd80118a46e16cff49ae715b63073b1
gitcode
openharmony/arkui_ace_engine
examples/ComponentSnapshot/entry/src/main/ets/common/ImageUtils.ets
arkts
mergeImage
[End get_snapshot_area] [Start merge_image]
static async mergeImage(areaArray: image.PositionArea[], lastOffsetY: number, listWidth: number, listHeight: number): Promise<PixelMap> { // 创建一个长截图位图对象 let opts: image.InitializationOptions = { editable: true, pixelFormat: 4, size: { width: uiContext?.vp2px(listWidth) || 0, ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left mergeImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#subscript_expression#Left AST#member_expression#Left AST#identifier#Left are...
static async mergeImage(areaArray: image.PositionArea[], lastOffsetY: number, listWidth: number, listHeight: number): Promise<PixelMap> { // 创建一个长截图位图对象 let opts: image.InitializationOptions = { editable: true, pixelFormat: 4, size: { width: uiContext?.vp2px(listWidth) || 0, ...
https://gitcode.com/openharmony/arkui_ace_engine
4d650963b93aa123727f61814d443f095adedc71
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
subTypeOf
`this` extends of `other` interface? Checks if this interface type is a subtype of another type. @param {Type} other Type to check against. @returns {boolean} True if this type is a subtype of other. @syscap SystemCapability.Utils.Lang @FaAndStageModel
protected override subTypeOf(other: Type): boolean { if (super.subTypeOf(other)) { return true } if (other instanceof InterfaceType) { return this.hasSuperInterface(other as InterfaceType) } return false }
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left subTypeOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left other AST#identifier#Right AST#ERROR#Left AST#:#L...
protected override subTypeOf(other: Type): boolean { if (super.subTypeOf(other)) { return true } if (other instanceof InterfaceType) { return this.hasSuperInterface(other as InterfaceType) } return false }
https://gitcode.com/iop123123/arkts-static-skills
a125f1d4a6472bf2a8472c36dade4246c052ff37
gitcode
openharmony-sig/commons-cli
library/src/main/ets/components/cli/Options.ets
arkts
addRequiredOption
Add an option that contains a short-name and a long-name. <p> The added option is set as required. It may be specified as requiring an argument. This method is a shortcut for: </p> <pre> <code> Options option = new Option(opt, longOpt, hasArg, description); option.setRequired(true); options.add(option); </code> </pre> ...
public addRequiredOption(opt: string, longOpt: string, hasArg: boolean, description: string): Options { let option = CliOption.createOption(opt, hasArg, description, longOpt); option.setRequired(true); this.addOption(option); return this; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addRequiredOption AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left opt AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left...
public addRequiredOption(opt: string, longOpt: string, hasArg: boolean, description: string): Options { let option = CliOption.createOption(opt, hasArg, description, longOpt); option.setRequired(true); this.addOption(option); return this; }
https://gitee.com/openharmony-sig/commons-cli.git
baa409f9c2b31a847f84c1e164cb46c2468a9a42
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
getExtraTopOffset
@return the extra offset to be appended to the viewport's top
public getExtraTopOffset(): number { return this.mExtraTopOffset; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getExtraTopOffset 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 A...
public getExtraTopOffset(): number { return this.mExtraTopOffset; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
ebafadbd7536b257cdd0aa608af8c17595848e32
gitee
CPF-ApplicationTPC/openharmony_tpc_samples
Spine/entry/src/main/ets/pages/Example4.ets
arkts
dispose
当此条目即将被处理时触发。这有可能在条目从未被设为当前条目的情况下发生。 在调用处理函数后,不应再保留对该条目的引用,因为它可能会被销毁或重新分配。
dispose(entry: TrackEntry) { console.info('spine listener loadAnimation dispose entry:', entry) },
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left dispose AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TrackEntry AST#identifier#Right ...
dispose(entry: TrackEntry) { console.info('spine listener loadAnimation dispose entry:', entry) },
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
936d9b67c380b1a2a71789ed967857b086f522b8
gitcode
CLMC2025/Vignette
entry/src/main/ets/manager/PromptTemplateManager.ets
arkts
getTemplateHistory
获取模板历史
getTemplateHistory(templateId: string): PromptTemplate[] { return this.templateHistory.get(templateId) || []; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getTemplateHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left templateId AST#ide...
getTemplateHistory(templateId: string): PromptTemplate[] { return this.templateHistory.get(templateId) || []; }
https://github.com/CLMC2025/Vignette
dde95535d9a8457f1131c0743bc54ae35873bbde
github
erosTeam/NextE
shared/src/main/ets/settings/ListModeSettings.ets
arkts
setColumnWidth
Single writer of the per-mode column min-width override (pinch-zoom / settings slider). The live in-memory updates during a pinch/drag are written directly to ListModeState; this persists the final value on release. `mode` is one of ListMode.GRID/WATERFALL/COVER_WALL/THUMBNAIL_GRID.
static async setColumnWidth( context: common.UIAbilityContext, mode: string, width: number, ): Promise<void> { connectListMode().setWidthFor(mode, width) const key: string = ListModeSettings.columnWidthKey(mode) if (key.length === 0) { return } try { const store: preferen...
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 setColumnWidth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left :...
static async setColumnWidth( context: common.UIAbilityContext, mode: string, width: number, ): Promise<void> { connectListMode().setWidthFor(mode, width) const key: string = ListModeSettings.columnWidthKey(mode) if (key.length === 0) { return } try { const store: preferen...
https://github.com/erosTeam/NextE
c7ba38c4c155b9b08a7e1eba2fdb90260f6bc202
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewNetworkTester.ets
arkts
runFullTest
执行完整测试
async runFullTest( url: string, controller?: webview.WebviewController, customHeaders?: Record<string, string> ): Promise<TestReport> { logger.info(TAG, `🚀 开始完整网络测试: ${url}`); logger.info(TAG, '='.repeat(60)); const report: TestReport = { timestamp: Date.now(), targetUrl: url, ...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left runFullTest AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async runFullTest( url: string, controller?: webview.WebviewController, customHeaders?: Record<string, string> ): Promise<TestReport> { logger.info(TAG, `🚀 开始完整网络测试: ${url}`); logger.info(TAG, '='.repeat(60)); const report: TestReport = { timestamp: Date.now(), targetUrl: url, ...
https://github.com/DaLongZhuaZi/manxia
1e7d976cafd765f3312b6cf3f501ab0f3edae51a
github
openharmony/codelabs
ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CheckEmptyUtil.ets
arkts
isEmptyArr
Check array is empty. @param {Array}arr @return {boolean} true(empty)
isEmptyArr(arr: Array<string>): boolean { return arr.length === 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isEmptyArr AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left Array AST#id...
isEmptyArr(arr: Array<string>): boolean { return arr.length === 0; }
https://gitee.com/openharmony/codelabs.git
e841c355c426122d787628fca517a789f2a8b10a
gitee
Countly/countly-sdk-hos
library/src/main/ets/internal/OverlayStore.ets
arkts
clearAll
Reset every overlay key, used on halt so a re-init doesn't see stale state from the previous instance.
public static clearAll(): void { AppStorage.SetOrCreate<boolean>(OverlayKeys.CONTENT_ACTIVE, false); AppStorage.SetOrCreate<boolean>(OverlayKeys.FEEDBACK_ACTIVE, false); AppStorage.SetOrCreate<string>(OverlayKeys.CONTENT_URL, ''); AppStorage.SetOrCreate<string>(OverlayKeys.FEEDBACK_URL, ''); Overl...
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 clearAll 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 clearAll(): void { AppStorage.SetOrCreate<boolean>(OverlayKeys.CONTENT_ACTIVE, false); AppStorage.SetOrCreate<boolean>(OverlayKeys.FEEDBACK_ACTIVE, false); AppStorage.SetOrCreate<string>(OverlayKeys.CONTENT_URL, ''); AppStorage.SetOrCreate<string>(OverlayKeys.FEEDBACK_URL, ''); Overl...
https://github.com/Countly/countly-sdk-hos
0ab40d143cabc1aab9bf5724fc3da9dbc777ad9a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
ecmaWeekDay
@see ECMA-262, 21.4.1.5 @param time @returns Week day.
function ecmaWeekDay(time: long): byte { let day = ecmaDayFromTime(time); let weekDay = ((day + 4) % 7).toByte(); return weekDay >= 0 ? weekDay : (weekDay + 7).toByte(); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left ecmaWeekDay AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left time AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Righ...
function ecmaWeekDay(time: long): byte { let day = ecmaDayFromTime(time); let weekDay = ((day + 4) % 7).toByte(); return weekDay >= 0 ? weekDay : (weekDay + 7).toByte(); }
https://gitcode.com/iop123123/arkts-static-skills
63897765481eaa0d7d7ef77dbbcfdcaee8ea8a6d
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelLoginManager.ets
arkts
normalizeSourceId
归一化书源ID(移除 ## 扩展段、片段标记)
private normalizeSourceId(sourceId: string): string { let normalized = sourceId.trim(); const extensionSeparator = normalized.indexOf('##'); if (extensionSeparator >= 0) { normalized = normalized.substring(0, extensionSeparator).trim(); } const fragmentIndex = normalized.indexOf('#'); i...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left normalizeSourceId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
private normalizeSourceId(sourceId: string): string { let normalized = sourceId.trim(); const extensionSeparator = normalized.indexOf('##'); if (extensionSeparator >= 0) { normalized = normalized.substring(0, extensionSeparator).trim(); } const fragmentIndex = normalized.indexOf('#'); i...
https://github.com/DaLongZhuaZi/manxia
66a0863c61a8d91fc7d1c98e7fb7fa04f6ff4073
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/AppStateManager.ets
arkts
getCurrentModelId
获取当前模型ID
getCurrentModelId(): string { return this.currentModelId }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentModelId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#stat...
getCurrentModelId(): string { return this.currentModelId }
https://github.com/LongLiveY96/chatcube
93638e70579eb78da857d543ded47fbb322bca2a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
getSourceConfig
获取图源配置(兼容旧的数字 ID 接口) @deprecated 请使用 getSourceConfigByPkg
async getSourceConfig(sourceId: number): Promise<Record<string, Object> | null> { try { const sql = 'SELECT * FROM comic_source WHERE id = ?'; const result = await this.databaseManager.querySql(sql, [sourceId]); if (result && result.length > 0) { const row: Record<string, Object> ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSourceConfig AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async getSourceConfig(sourceId: number): Promise<Record<string, Object> | null> { try { const sql = 'SELECT * FROM comic_source WHERE id = ?'; const result = await this.databaseManager.querySql(sql, [sourceId]); if (result && result.length > 0) { const row: Record<string, Object> ...
https://github.com/DaLongZhuaZi/manxia
f668d8af5b3302a7b8a722f42e6bb62c99bb0b3e
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets
arkts
getDenominator
Gets the denominator of the current RationalNumber object. @returns { long } returns the denominator.
public getDenominator(): long { return this.mden; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDenominator 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 long AS...
public getDenominator(): long { return this.mden; }
https://gitcode.com/iop123123/arkts-static-skills
3b9ace1b049d28830595d351f3fd28ea0e24f72f
gitcode
PollenWang6/HiXD
entry/src/main/ets/utils/NetworkUtil.ets
arkts
checkNow
异步检测当前网络是否可用 netId !== 0 表示有激活的网络
async checkNow(): Promise<boolean> { try { const netHandle: connection.NetHandle = await connection.getDefaultNet(); if (netHandle && netHandle.netId !== 0) { this._isAvailable = true; return true; } this._isAvailable = false; return false; } catch (_) { thi...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left checkNow 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 checkNow(): Promise<boolean> { try { const netHandle: connection.NetHandle = await connection.getDefaultNet(); if (netHandle && netHandle.netId !== 0) { this._isAvailable = true; return true; } this._isAvailable = false; return false; } catch (_) { thi...
https://github.com/PollenWang6/HiXD
f32fadeb896ba5bd27595442b76d909ef4d26f01
github
fbinba3955/Flymby
common/src/main/ets/video/ControlPanelView.ets
arkts
startLongPressSpeedUp
开始长按倍速播放
startLongPressSpeedUp() { if (this.isLongPressing) return this.isLongPressing = true this.mIndicatorMainText = "2x" this.mIndicatorSubText = ">>" this.originalSpeed = this.speed this.showControlPanel = false // 隐藏控制面板 // 设置为2倍速 this.onSpeedChange('2f') LogUtil.info('开始长按倍速播放,原始速度...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startLongPressSpeedUp 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_bl...
startLongPressSpeedUp() { if (this.isLongPressing) return this.isLongPressing = true this.mIndicatorMainText = "2x" this.mIndicatorSubText = ">>" this.originalSpeed = this.speed this.showControlPanel = false // 隐藏控制面板 // 设置为2倍速 this.onSpeedChange('2f') LogUtil.info('开始长按倍速播放,原始速度...
https://github.com/fbinba3955/Flymby
a8541f18f9216ca2203072ae523c7cc4ae3fe49a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/DependencyContainer.ets
arkts
getRegisteredDependencies
获取所有已注册的依赖
public getRegisteredDependencies(): string[] { if (!this.dependencies) { this.dependencies = new Map<string, DependencyDescriptor>(); } return Array.from(this.dependencies.keys()); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getRegisteredDependencies 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#L...
public getRegisteredDependencies(): string[] { if (!this.dependencies) { this.dependencies = new Map<string, DependencyDescriptor>(); } return Array.from(this.dependencies.keys()); }
https://github.com/DaLongZhuaZi/manxia
f8fa077e6f5640a8a648f879aec1d4e4a7ac6c47
github
luojiang001/Pulse
Pulse/entry/src/main/ets/pages/LoginView.ets
arkts
onRegisterSuccess
注册成功回调
onRegisterSuccess(phone: string) { this.phoneNumber = phone; this.password = ''; this.loginType = 0; this.showToast('注册成功,请登录', true); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onRegisterSuccess AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left phone AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#...
onRegisterSuccess(phone: string) { this.phoneNumber = phone; this.password = ''; this.loginType = 0; this.showToast('注册成功,请登录', true); }
https://github.com/luojiang001/Pulse
c3a63415d32b46cf4163d611cbef670ed4cebc3d
github
XJTUWYD/ArkDiff
entry/src/main/ets/engine/FilterRuleEngine.ets
arkts
serializeConfig
将过滤配置序列化(用于持久化/恢复)
static serializeConfig(config: FilterConfig): string { return JSON.stringify(config); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left serializeConfig 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#Lef...
static serializeConfig(config: FilterConfig): string { return JSON.stringify(config); }
https://github.com/XJTUWYD/ArkDiff
43f4364277691e8b3d70aab354dba220e4cf75e1
github
killetom/ktretrofit
ktretrofit/src/main/ets/retrofit/util/MetadataUtil.ets
arkts
defineBodyParameter
Define body parameter metadata
static defineBodyParameter(paramIndex: number, target: Object, propertyKey: string | symbol): void { this.defineMetadata('retrofit:bodyParam', paramIndex, target, propertyKey); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left defineBodyParameter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left paramIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST...
static defineBodyParameter(paramIndex: number, target: Object, propertyKey: string | symbol): void { this.defineMetadata('retrofit:bodyParam', paramIndex, target, propertyKey); }
https://github.com/killetom/ktretrofit
974beca6ebb4980733928c08cdaa2dc6051fe534
github
picklerick422/zju-learning-assistant-OH
entry/src/main/ets/services/NativeBridge.ets
arkts
getMonthSubs
---------------- 智云课堂 ----------------
static async getMonthSubs(month: string): Promise<Subject[]> { const json: string = await zla.getMonthSubs(month); return JSON.parse(json) as Subject[]; }
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 getMonthSubs AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left month AST#identifier#Right AST#:#Left : AST...
static async getMonthSubs(month: string): Promise<Subject[]> { const json: string = await zla.getMonthSubs(month); return JSON.parse(json) as Subject[]; }
https://github.com/picklerick422/zju-learning-assistant-OH
88b39abb148136de4f20fa3cdd524d77c7a474f3
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/CryptoUtil.ets
arkts
encodeAsn1Length
编码 ASN.1 长度
private static encodeAsn1Length(length: number): Uint8Array { if (length < 128) { return new Uint8Array([length]); } else if (length < 256) { return new Uint8Array([0x81, length]); } else if (length < 65536) { return new Uint8Array([0x82, (length >> 8) & 0xFF, length & 0xFF]); } else...
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 encodeAsn1Length AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left length AST#identifier#Right AST#:#L...
private static encodeAsn1Length(length: number): Uint8Array { if (length < 128) { return new Uint8Array([length]); } else if (length < 256) { return new Uint8Array([0x81, length]); } else if (length < 65536) { return new Uint8Array([0x82, (length >> 8) & 0xFF, length & 0xFF]); } else...
https://github.com/AlkaidLab/moonlight-harmony
fd26b4a6c7e72fdb0afe2e9c2dd3f917721acc51
github