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
heeh02/superconnect
harmony/entry/src/main/ets/components/BallGeometry.ets
arkts
seed
Initial dock: right edge, vertically centered (was `w-56-12`, `h/2-28`).
static seed(w: number, h: number): BallPos { return { x: w - BallGeometry.SIZE - BallGeometry.MARGIN, y: h / 2 - BallGeometry.SIZE / 2 }; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left seed AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left w AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R...
static seed(w: number, h: number): BallPos { return { x: w - BallGeometry.SIZE - BallGeometry.MARGIN, y: h / 2 - BallGeometry.SIZE / 2 }; }
https://github.com/heeh02/superconnect
0c16e38b514e3de5612b5ad17a0887ff6b673198
github
honjow/Next2V
shared/src/main/ets/settings/CacheSettings.ets
arkts
loadNodeDetail
Node header detail (avatar/title/header/topics). A V2exNode is tiny so it always inlines into payload_text (never the 256KB file path) — the topicDetail file name is reused only to satisfy saveCacheEntry's signature and is not actually written.
static async loadNodeDetail(context: common.UIAbilityContext, nodeName: string): Promise<V2exNode | null> { try { const rowKey = CacheSettings.nodeDetailRowKey(nodeName) const store = await LocalDataStore.open(context) const row = await CacheSettings.loadCacheEntry(context, store, rowKey, CACHE_...
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 loadNodeDetail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left :...
static async loadNodeDetail(context: common.UIAbilityContext, nodeName: string): Promise<V2exNode | null> { try { const rowKey = CacheSettings.nodeDetailRowKey(nodeName) const store = await LocalDataStore.open(context) const row = await CacheSettings.loadCacheEntry(context, store, rowKey, CACHE_...
https://github.com/honjow/Next2V
e5762f5183df1d0806783df7ee64257509095396
github
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/util/WindowUtil.ets
arkts
setMainWindowOrientation
设置主窗口方向 @param orientation window.Orientation @param onSuccess () => void
public static setMainWindowOrientation(orientation: window.Orientation, onSuccess?: () => void): void { try { // 设置窗口首选方向 WindowUtil.windowClass?.setPreferredOrientation(orientation, (error: BusinessError) => { const errorCode = error.code if (errorCode) { Logger.error(TAG, `...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#identifier#Left setMainWindowOrientation AST#identifier#Right AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left orientation AST#identifier#Right AST#ERROR#Left AST#:#Left : A...
public static setMainWindowOrientation(orientation: window.Orientation, onSuccess?: () => void): void { try { // 设置窗口首选方向 WindowUtil.windowClass?.setPreferredOrientation(orientation, (error: BusinessError) => { const errorCode = error.code if (errorCode) { Logger.error(TAG, `...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
aff6d69be323c95994a0afb76427d4581ab5c7ab
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
loadSourceToMemory
从数据库加载书源到内存(仅内部使用) 注意:这个方法不会持久化,用于初始化时加载
loadSourceToMemory(source: LegadoBookSource): void { this.sources.set(source.bookSourceUrl, source); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadSourceToMemory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left LegadoBookSource AST#identifier#Rig...
loadSourceToMemory(source: LegadoBookSource): void { this.sources.set(source.bookSourceUrl, source); }
https://github.com/DaLongZhuaZi/manxia
d4f706d9f8d52d1545fd51ff8f002728d526645b
github
HarmonyOS_Samples/guide-snippets
Ability/UIAbilityLifecycle/entry/src/main/ets/entryability/EntryAbility.ets
arkts
onBackground
[EndExclude onBackground] [StartExclude onForeground]
onBackground(): void { // 释放UI不可见时无用的资源 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackground 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#Le...
onBackground(): void { // 释放UI不可见时无用的资源 }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
b3abec8fd318b3b5ebd70624a20b8a7e3fc04be9
gitcode
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/VibratorManager.ets
arkts
isEnabled
═══════════════════════════════════════════════════════════════ 振动开关 ═══════════════════════════════════════════════════════════════ 查询应用内振动开关是否开启 从 AppStorage 读取,默认 true(开启)
static isEnabled(): boolean { const value = AppStorage.get<boolean>(STORAGE_KEY_VIBRATION) return value ?? true }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isEnabled 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#boo...
static isEnabled(): boolean { const value = AppStorage.get<boolean>(STORAGE_KEY_VIBRATION) return value ?? true }
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
e951fe45442f087a020b9154ec970a620ff9d025
github
Joker-x-dev/CoolMallArkTS
core/base/src/main/ets/viewmodel/BaseNetWorkListViewModel.ets
arkts
retryRequest
重试请求 @returns {void} 无返回值
retryRequest(): void { this.uiState = BaseNetWorkListUiState.LOADING; this.currentPage = 1; this.loadListData(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left retryRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block...
retryRequest(): void { this.uiState = BaseNetWorkListUiState.LOADING; this.currentPage = 1; this.loadListData(); }
https://github.com/Joker-x-dev/CoolMallArkTS
82f8ecd58c8d7d18eb1e919fd2ab1202c14e1dbc
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/IndoorLocator.ets
arkts
addToHistory
添加到历史记录
private addToHistory(result: PositioningResult): void { this.positionHistory.push(result); // 保持历史长度 if (this.positionHistory.length > this.maxHistoryLength) { this.positionHistory.shift(); } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left addToHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left result AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
private addToHistory(result: PositioningResult): void { this.positionHistory.push(result); // 保持历史长度 if (this.positionHistory.length > this.maxHistoryLength) { this.positionHistory.shift(); } }
https://github.com/LJ666-ui/harmony-health-care
9d49a72d1783080684d772a6b9333557314116f2
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
constructor
Creates an Int16Array with respect to length. @param { number } length - Number of elements @throws { RangeError } - If the length is outside the bounds of the buffer, throw an exception @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(length: number) { if (length < 0 || length > (Int.MAX_VALUE / Int16Array.BYTES_PER_ELEMENT).toInt()) { throw new RangeError("Range Error: length " + length + " is outside the bounds of the buffer") } this.lengthInt = length.toInt() this.byteLength = thi...
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 length AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu...
public constructor(length: number) { if (length < 0 || length > (Int.MAX_VALUE / Int16Array.BYTES_PER_ELEMENT).toInt()) { throw new RangeError("Range Error: length " + length + " is outside the bounds of the buffer") } this.lengthInt = length.toInt() this.byteLength = thi...
https://gitcode.com/iop123123/arkts-static-skills
a0358f9268a75539e9cd56dda028c2621384f63b
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamWindowManager.ets
arkts
setOnWindowSizeChanged
设置窗口大小变化回调(窗口模式下用户拖拽缩放时触发 XComponent 重算)
setOnWindowSizeChanged(callback: (() => void) | null): void { this.onWindowSizeChanged = callback; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setOnWindowSizeChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#(#Left ( AST#(#Right AST#formal_pa...
setOnWindowSizeChanged(callback: (() => void) | null): void { this.onWindowSizeChanged = callback; }
https://github.com/AlkaidLab/moonlight-harmony
1a65457dc60a10d212f01a53403a1096a9a0c9f3
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/StreamWindowManager.ets
arkts
unregisterWindowSizeListener
取消窗口大小变化监听器
private unregisterWindowSizeListener(win: window.Window): void { if (this.windowSizeChangeHandler) { try { win.off('windowSizeChange', this.windowSizeChangeHandler); } catch (_e) {} this.windowSizeChangeHandler = null; } if (this.windowSizeDebounceTimer !== -1) { clearTimeo...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left unregisterWindowSizeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left win AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#m...
private unregisterWindowSizeListener(win: window.Window): void { if (this.windowSizeChangeHandler) { try { win.off('windowSizeChange', this.windowSizeChangeHandler); } catch (_e) {} this.windowSizeChangeHandler = null; } if (this.windowSizeDebounceTimer !== -1) { clearTimeo...
https://github.com/AlkaidLab/moonlight-harmony
8449c6f89efacb1fc6694c58d0ee1a0b5202e4a8
github
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/ApiVersionUtil.ets
arkts
isApiSupported
检查是否支持指定API版本 @param minApiVersion 最低要求的API版本 @returns true表示支持,false表示不支持
static isApiSupported(minApiVersion?: number): boolean { // 如果没有指定版本要求,默认支持 if (minApiVersion === undefined || minApiVersion === null) { return true; } return deviceInfo.sdkApiVersion >= minApiVersion; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isApiSupported AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left minApiVersion AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST...
static isApiSupported(minApiVersion?: number): boolean { // 如果没有指定版本要求,默认支持 if (minApiVersion === undefined || minApiVersion === null) { return true; } return deviceInfo.sdkApiVersion >= minApiVersion; }
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
4f1de038df20c583e7d356c1883a7592f34acc29
github
youyeyejie/ZhiXing_ActHub
entry/src/main/ets/pages/idea/index.ets
arkts
build
渲染闪记模块测试骨架。 TODO: 当前组件多为占位,后续替换为真实数据流和详情交互。
build() { Stack({ alignContent: Alignment.BottomEnd }) { // 主页面内容 MainTabPageLayout({ title: "闪记", actionIcon: $r("sys.symbol.magnifyingglass"), onActionTap: () => { this.app.nav.pushOverlayByName( AppOverlayRoute.SEARCH, this.app.nav.createSea...
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() { Stack({ alignContent: Alignment.BottomEnd }) { // 主页面内容 MainTabPageLayout({ title: "闪记", actionIcon: $r("sys.symbol.magnifyingglass"), onActionTap: () => { this.app.nav.pushOverlayByName( AppOverlayRoute.SEARCH, this.app.nav.createSea...
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/pages/idea/index.ets#L61-L113
08d1c5ed2b3cd6ab16331543d7fdb2554e29e436
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SmartCategoryDAO.ets
arkts
deleteByUserId
批量删除用户的规则
static async deleteByUserId(userId: number): Promise<number> { try { const store = DatabaseManager.getDatabase(); const values: relationalStore.ValuesBucket = { is_deleted: 1, updated_at: new Date().toISOString() }; const predicates = new relationalStore.RdbPredicates(Smar...
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 deleteByUserId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : ...
static async deleteByUserId(userId: number): Promise<number> { try { const store = DatabaseManager.getDatabase(); const values: relationalStore.ValuesBucket = { is_deleted: 1, updated_at: new Date().toISOString() }; const predicates = new relationalStore.RdbPredicates(Smar...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
1c5724f6fc852258120e4d2d69a1496b02612aa8
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
with
Creates a copy with replaced value on index @param { int } index - index to change @param { short } value - value to set @returns { Int16Array } - an Int16Array with replaced value on index @throws { RangeError } - If the index exceeds the array range, throw an exception @syscap SystemCapability.Utils.Lang @FaAndStageM...
public with(index: int, value: short): Int16Array { let res = new Int16Array(this) res.set(index, value) return res }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
public with(index: int, value: short): Int16Array { let res = new Int16Array(this) res.set(index, value) return res }
https://gitcode.com/iop123123/arkts-static-skills
7d2d0e5d5d7a769b1b4375a2ae9814ec414aeaef
gitcode
the-wwyang/kids-learning-app
src/main/ets/services/QuestionCacheService.ets
arkts
clearCache
清空所有缓存(用于重置)
clearCache(): void { this.questionPools.clear(); this.questionHistory.clear(); this.answerHistory = []; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L...
clearCache(): void { this.questionPools.clear(); this.questionHistory.clear(); this.answerHistory = []; }
https://github.com/the-wwyang/kids-learning-app
a0b08dedf03f9abb88743e2fd9026e0cd1a6f842
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnCheckboxViewModel.ets
arkts
setCheckboxValues4
设置复选框组4的选中值集合 @param values 新的选中值数组
setCheckboxValues4(values: Array<string | number>): void { this.checkboxValues4 = values; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCheckboxValues4 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...
setCheckboxValues4(values: Array<string | number>): void { this.checkboxValues4 = values; }
https://github.com/codelably/tuniao-ui
ae527940ffaf257b1de49d7a2ad29b50a19e6dfd
github
Cool_foolisher1/ArkTSRepository
GraphicalCode/features/algorithm/src/main/ets/viewmodel/CardComponentSourceViewModel.ets
arkts
getData
获取数据 @param index 索引 @returns CardComponentModel
public getData(index: number): CardComponentModel { return this.cardComponentModels[index] }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number ...
public getData(index: number): CardComponentModel { return this.cardComponentModels[index] }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
0f1971ace0a775004c17ff1bf0d46791752b9b51
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/ARRenderer.ets
arkts
initialize
初始化渲染引擎 @param context Canvas渲染上下文
public async initialize(context: CanvasRenderingContext2D, width?: number, height?: number): Promise<void> { this.canvasContext = context; this.canvasWidth = width ?? 1080; this.canvasHeight = height ?? 1920; console.log( '[ARRenderer] 初始化完成,画布尺寸:', this.canvasWidth, 'x', this...
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 initialize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST...
public async initialize(context: CanvasRenderingContext2D, width?: number, height?: number): Promise<void> { this.canvasContext = context; this.canvasWidth = width ?? 1080; this.canvasHeight = height ?? 1920; console.log( '[ARRenderer] 初始化完成,画布尺寸:', this.canvasWidth, 'x', this...
https://github.com/LJ666-ui/harmony-health-care
9d9eae6168c46795ab3d3afd79c1eb8bc5f74df8
github
who7708/harmonyos-codelabs
HmosWorld/features/discover/src/main/ets/model/DiscoverModel.ets
arkts
loadMoreFeed
Load next page feed data
loadMoreFeed(): void { if (this.hasNextFeed) { this.loadingFeedStatus = LoadingStatus.LOADING; this.resourcesRepository.getMoreFeed(this.curFeedPage + 1).then((data: ResourcesData) => { data.resourceList.forEach((res: LearningResource) => { this.hotFeedList.push(new LearningResource(...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadMoreFeed 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#Le...
loadMoreFeed(): void { if (this.hasNextFeed) { this.loadingFeedStatus = LoadingStatus.LOADING; this.resourcesRepository.getMoreFeed(this.curFeedPage + 1).then((data: ResourcesData) => { data.resourceList.forEach((res: LearningResource) => { this.hotFeedList.push(new LearningResource(...
https://github.com/who7708/harmonyos-codelabs
d855e46cbba3acdfaecdda06a552441b7ddbfa03
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/FinancialHealth.ets
arkts
setDimensions
设置维度评分
setDimensions(dimensions: HealthDimensions): void { this.dimensionsJson = JSON.stringify(dimensions); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setDimensions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dimensions AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left HealthDimensions AST#identifier#Righ...
setDimensions(dimensions: HealthDimensions): void { this.dimensionsJson = JSON.stringify(dimensions); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
4fee3ff567393f84c35310fba625f3eb6b66a2c0
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/model/SessionState.ets
arkts
getInstance
Get the FreeRDP instance handle
getInstance(): number { return this.instance; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_...
getInstance(): number { return this.instance; }
https://github.com/tangwengang-del/freerdp-harmonyos
d457058e15bb89fe0f69f00240b9cf5d8b83710c
github
LJ666-ui/harmony-health-care
entry/src/main/ets/components/charts/line/LineChartRenderer.ets
arkts
drawAxis
绘制坐标轴
private drawAxis(): void { this.ctx.strokeStyle = this.config.axisColor; this.ctx.fillStyle = this.config.axisTextColor; this.ctx.font = `${this.config.axisTextSize}px sans-serif`; this.ctx.lineWidth = 2; // 绘制X轴 this.ctx.beginPath(); this.ctx.moveTo(this.plotArea.x, this.plotArea.y +...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left drawAxis 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...
private drawAxis(): void { this.ctx.strokeStyle = this.config.axisColor; this.ctx.fillStyle = this.config.axisTextColor; this.ctx.font = `${this.config.axisTextSize}px sans-serif`; this.ctx.lineWidth = 2; // 绘制X轴 this.ctx.beginPath(); this.ctx.moveTo(this.plotArea.x, this.plotArea.y +...
https://github.com/LJ666-ui/harmony-health-care
84caae663b75a4ebeb816b0d65276682d616030d
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.url.ets
arkts
hostname
Sets the hostname portion of the URL. @param { string } hostname - The hostname portion of the URL.
set hostname(hostname: string) { this.urlInner.setHostName(hostname); this.cHostname = this.urlInner.getHostName(); this.cHost = this.urlInner.getHost(); this.setHref(); }
AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left hostname AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left hostname AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERRO...
set hostname(hostname: string) { this.urlInner.setHostName(hostname); this.cHostname = this.urlInner.getHostName(); this.cHost = this.urlInner.getHost(); this.setHref(); }
https://gitcode.com/iop123123/arkts-static-skills
41f38089e0d6bcd8670095c712fc16bddc370fb8
gitcode
LZZLHY/hlib
entry/src/main/ets/storage/PreferencesStore.ets
arkts
pick
─── 内部 ───
private static pick(group: PrefGroup): preferences.Preferences { if (!PreferencesStore.initialized) { throw new Error('PreferencesStore.init() not called'); } if (group === 'settings') { return PreferencesStore.settings as preferences.Preferences; } return PreferencesStore.auth as pref...
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left pick AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST...
private static pick(group: PrefGroup): preferences.Preferences { if (!PreferencesStore.initialized) { throw new Error('PreferencesStore.init() not called'); } if (group === 'settings') { return PreferencesStore.settings as preferences.Preferences; } return PreferencesStore.auth as pref...
https://github.com/LZZLHY/hlib
cf94d358bd13d02cab6ee6fcf769c5972653d0bb
github
openharmony-sig/commons-cli
library/src/main/ets/components/cli/Options.ets
arkts
hasLongOption
Returns whether the named {@link Option} is a member of this {@link Options}. @param opt long name of the {@link Option} @return true if the named {@link Option} is a member of this {@link Options} @since 1.3
public hasLongOption(opt: string): boolean { opt = Util.stripLeadingHyphens(opt); return this.longOpts.containsKey(opt); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hasLongOption 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 str...
public hasLongOption(opt: string): boolean { opt = Util.stripLeadingHyphens(opt); return this.longOpts.containsKey(opt); }
https://gitee.com/openharmony-sig/commons-cli.git
0d71567dae18f7d1f90688a31b64de2ce8793b30
gitee
XHXYT/Pixark
entry/src/main/ets/viewmodel/FavoriteViewModel.ets
arkts
loadCurrentTabData
--- 核心加载逻辑 --- 加载当前 Tab 的数据
async loadCurrentTabData() { if (this.isRefreshing) return; // 防抖:如果正在刷新,不重复触发 this.isRefreshing = true; logger.debug('>>> 开始加载喜欢数据...'); try { if (this.mainTabIndex === 0) { appSettings.novel_mode ? await this.loadTrendNovelData() : await this.loadTrendData(); } else if (this.main...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadCurrentTabData AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { A...
async loadCurrentTabData() { if (this.isRefreshing) return; // 防抖:如果正在刷新,不重复触发 this.isRefreshing = true; logger.debug('>>> 开始加载喜欢数据...'); try { if (this.mainTabIndex === 0) { appSettings.novel_mode ? await this.loadTrendNovelData() : await this.loadTrendData(); } else if (this.main...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/FavoriteViewModel.ets#L66-L86
1c79fa9bbb8fa84b80234b3623020a1dd0d1081c
github
erosTeam/NextE
feature/reader/src/main/ets/viewmodel/ReaderViewModel.ets
arkts
precacheAhead
Pre-resolve the next PRECACHE_AHEAD pages' image URLs (eros_fe forward preload), fire-and-forget, so a forward swipe lands on an already-resolved page instead of waiting for its /s/→URL round-trip. resolve() caches the URL onto each image and coalesces with the page component's on-demand resolve, so this never double-f...
private precacheAhead(): void { this.precacheFrom(this.currentIndex + 1) }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left precacheAhead 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 precacheAhead(): void { this.precacheFrom(this.currentIndex + 1) }
https://github.com/erosTeam/NextE
e47b038fa3d6dd15270f915f5f0ba8fc90c26e37
github
IoTAccessControl/ArkTSAnalysis
TestApps/Test_user_info/entry/src/main/ets/pages/Index.ets
arkts
build
专门用于输入的字符串
build() { Scroll() { Column() { // 标题 Text('个人信息登记表') .fontSize(24) .fontWeight(FontWeight.Bold) .margin({ bottom: 20 }) .width('100%') .textAlign(TextAlign.Center) // 基础信息组 Row() { // 使用Flex布局确保标签顶格 Text(...
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() { Scroll() { Column() { // 标题 Text('个人信息登记表') .fontSize(24) .fontWeight(FontWeight.Bold) .margin({ bottom: 20 }) .width('100%') .textAlign(TextAlign.Center) // 基础信息组 Row() { // 使用Flex布局确保标签顶格 Text(...
https://github.com/IoTAccessControl/ArkTSAnalysis
f66e3fafc30901a72a276c58ebcb5f50783ec424
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
sort
Sorts in-place @param fn comparator @returns sorted BigUint64Array
public sort(fn: (a: BigInt, b: BigInt) => number): BigUint64Array { let arr: BigInt[] = new BigInt[this.length] for (let i = 0; i < this.length; ++i) { arr[i] = this.at(i) } // TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961 ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ...
public sort(fn: (a: BigInt, b: BigInt) => number): BigUint64Array { let arr: BigInt[] = new BigInt[this.length] for (let i = 0; i < this.length; ++i) { arr[i] = this.at(i) } // TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961 ...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
8a21a7f660739f0332fedfa78ad4828110fe170d
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
internal
Copies all elements of arr to the current Uint16Array starting from insertPos. @param arr array to copy data from @param insertPos start index where data from arr will be inserted {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set} public
/* public */ internal set(arr: number[], insertPos: int): void { if (insertPos < 0 || insertPos + arr.length > this.length) { throw new RangeError("set(insertPos: int, arr: number[]): size of arr is greater than Uint16Array.length") } for (let i = 0; i < arr.length; ++i) { ...
AST#program#Left AST#comment#Left /* public */ AST#comment#Right AST#ERROR#Left AST#call_expression#Left AST#identifier#Left internal AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#id...
/* public */ internal set(arr: number[], insertPos: int): void { if (insertPos < 0 || insertPos + arr.length > this.length) { throw new RangeError("set(insertPos: int, arr: number[]): size of arr is greater than Uint16Array.length") } for (let i = 0; i < arr.length; ++i) { ...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
4ec24523118a2184bd4f4a147fb2d35c87369448
gitee
openharmony/multimedia_camera_framework
frameworks/js/camera_napi/demo/entry/src/main/ets/Dialog/SettingDialog.ets
arkts
getMirrorBol
镜像持久化,再次进入,确定开关是否开启
getMirrorBol(bol: boolean): void { let cameraConfig: CameraConfig = GlobalContext.get().getObject('cameraConfig') as CameraConfig; cameraConfig.mirrorBol = bol; GlobalContext.get().setObject('cameraConfig', cameraConfig); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getMirrorBol AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bol AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#)#Left ) AS...
getMirrorBol(bol: boolean): void { let cameraConfig: CameraConfig = GlobalContext.get().getObject('cameraConfig') as CameraConfig; cameraConfig.mirrorBol = bol; GlobalContext.get().setObject('cameraConfig', cameraConfig); }
https://gitee.com/openharmony/multimedia_camera_framework.git
9226419eb7ca198f7ce5f88ba68ff16a60271c4a
gitee
wuba/omni-ui
omni_component/src/main/ets/components/guide/model/GuidePage.ets
arkts
getBackgroundColor
获取引导页蒙版背景色 @returns 引导页蒙版背景色
public getBackgroundColor(): string { return this.backgroundColor; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getBackgroundColor 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 ...
public getBackgroundColor(): string { return this.backgroundColor; }
https://github.com/wuba/omni-ui
f9d17798ff6df3e0897064b9b6d5c3bf62279969
github
openharmony/arkui_ace_engine
advanced_ui_component/treeview/source/treeview.ets
arkts
getTreeListener
Get treeListener. @return treeListener object @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Get treeListener. @return treeListener object @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
public getTreeListener(): TreeListener { return this.appEventBus; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTreeListener 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 TreeLi...
public getTreeListener(): TreeListener { return this.appEventBus; }
https://gitee.com/openharmony/arkui_ace_engine.git
d448d8da1ee28679daad15436b4fa504c934f756
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceConfigParser.ets
arkts
validateConfig
验证配置基础结构
private validateConfig(config: Record<string, Object>): ValidateConfigResult { if (!config || typeof config !== 'object') { return { valid: false, error: '配置必须是一个对象' }; } const configObj = config as Record<string, Object>; // 验证元数据 if (!configObj.metadata || typeof configObj.metadata !== '...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left validateConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiatio...
private validateConfig(config: Record<string, Object>): ValidateConfigResult { if (!config || typeof config !== 'object') { return { valid: false, error: '配置必须是一个对象' }; } const configObj = config as Record<string, Object>; // 验证元数据 if (!configObj.metadata || typeof configObj.metadata !== '...
https://github.com/DaLongZhuaZi/manxia
bdca93e2b18ba41bbc41c64a2f0882a869200e8e
github
SMAT-Lab/Homecheck-Sec2026
test/unittest/sample/RequireAwait/ets/requireAwaitNoReport.ets
arkts
testFunction
Async function declaration with await in Promise.all
async function testFunction(): Promise<void> { await Promise.all( [1, 2, 3].map( async value => Promise.resolve(value), ), ); };
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left testFunction AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#...
async function testFunction(): Promise<void> { await Promise.all( [1, 2, 3].map( async value => Promise.resolve(value), ), ); };
https://github.com/SMAT-Lab/Homecheck-Sec2026
c199c6af46ce86095f00d9bcaa9fa8668d211a26
github
zmuxuny/ai-guardian-star
entry/src/main/ets/database/DatabaseHelper.ets
arkts
loadSetting
加载用户的指定设置
public async loadSetting(username: string, key: string): Promise<string | null> { const predicates = new relationalStore.RdbPredicates("t_setting"); predicates.equalTo("username", username).and().equalTo("setting_key", key); let resultSet: relationalStore.ResultSet | undefined; try { resultSet =...
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 loadSetting AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : A...
public async loadSetting(username: string, key: string): Promise<string | null> { const predicates = new relationalStore.RdbPredicates("t_setting"); predicates.equalTo("username", username).and().equalTo("setting_key", key); let resultSet: relationalStore.ResultSet | undefined; try { resultSet =...
https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/database/DatabaseHelper.ets#L436-L455
5d69a7b11358b200feac1c7d2cb0b71571617e49
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
getStringListSingle
获取单个规则的字符串列表
private getStringListSingle(ruleStr: string): string[] { const chainedParts = this.splitJsonFirstRuleChain(ruleStr); if (chainedParts.length > 1) { return this.getStringListFromJsonFirstRuleChain(chainedParts); } const parsedRule = this.parseRule(ruleStr); let results: string[] = []; s...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getStringListSingle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ruleStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST...
private getStringListSingle(ruleStr: string): string[] { const chainedParts = this.splitJsonFirstRuleChain(ruleStr); if (chainedParts.length > 1) { return this.getStringListFromJsonFirstRuleChain(chainedParts); } const parsedRule = this.parseRule(ruleStr); let results: string[] = []; s...
https://github.com/DaLongZhuaZi/manxia
9c70248c0f5325c0fd5faf1f03b1fe0c01f78163
github
LongLiveY96/chatcube
entry/src/main/ets/services/AIApiService.ets
arkts
resetThinkingState
重置 thinking 状态(每次新请求前调用)
resetThinkingState(): void { this.isInThinkingBlock = false this.currentOpenAIStreamUsesCumulativeContent = false this.currentResponsesHostedImageMimeType = 'image/png' this.minimaxReasoningBuffer = '' this.minimaxContentBuffer = '' this.partialTagBuffer = '' this.streamToolCalls = new Map...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resetThinkingState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement...
resetThinkingState(): void { this.isInThinkingBlock = false this.currentOpenAIStreamUsesCumulativeContent = false this.currentResponsesHostedImageMimeType = 'image/png' this.minimaxReasoningBuffer = '' this.minimaxContentBuffer = '' this.partialTagBuffer = '' this.streamToolCalls = new Map...
https://github.com/LongLiveY96/chatcube
ec29f9208e9bad6b24364c94dc3b41544318077d
github
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/CloudSyncService.ets
arkts
syncTotpEntries
==================== TOTP 同步 ====================
async syncTotpEntries(entries: TotpEntry[]): Promise<void> { if (!this.isReady()) { return; } const body = { unionID: this.unionID, entries: entries.map((e: TotpEntry) => e.toJSON()) }; const result = await this.post('/totp', body); if (result) { hilog.info(DOMAIN, TAG, "同步 " + entries.length.to...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left syncTotpEntries AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left entries AST#identifier#Right ...
async syncTotpEntries(entries: TotpEntry[]): Promise<void> { if (!this.isReady()) { return; } const body = { unionID: this.unionID, entries: entries.map((e: TotpEntry) => e.toJSON()) }; const result = await this.post('/totp', body); if (result) { hilog.info(DOMAIN, TAG, "同步 " + entries.length.to...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
eb4cff9a71f6a1b05620211e0853570a1835f516
github
HarmonyOS_Codelabs/arkts-intermediate-syntax
entry/src/main/ets/pages/Index.ets
arkts
getLocationDisplayName
位置显示名称转换(UI层负责本地化)
getLocationDisplayName(location: string): string | ResourceStr { const locationMap: Record<string, Resource> = { 'livingRoom': $r('app.string.livingRoom'), 'bedroom': $r('app.string.bedroom'), 'entrance': $r('app.string.entrance'), 'all': $r('app.string.all') }; return locationMap[...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLocationDisplayName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left location AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string ...
getLocationDisplayName(location: string): string | ResourceStr { const locationMap: Record<string, Resource> = { 'livingRoom': $r('app.string.livingRoom'), 'bedroom': $r('app.string.bedroom'), 'entrance': $r('app.string.entrance'), 'all': $r('app.string.all') }; return locationMap[...
https://gitcode.com/HarmonyOS_Codelabs/arkts-intermediate-syntax
f103e29ffe55bec2217a5f769443479b3bbed815
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/services/store/DistributedKVService.ets
arkts
init
初始化 @param context 上下文 @returns
public static init(context: common.UIAbilityContext): Promise<void> { return new Promise((resolve, reject) => { try { DistributedKVService.context = context; // 获取当前应用的包名 bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((result) => { ...
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#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 init AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Rig...
public static init(context: common.UIAbilityContext): Promise<void> { return new Promise((resolve, reject) => { try { DistributedKVService.context = context; // 获取当前应用的包名 bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((result) => { ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/DistributedKVService.ets#L33-L83
2a707af2dc55fee3dcfa4b366b7fbeea71c54f1b
github
HarmonyOS_Samples/HarmonyOSComponentUXExamples
products/pc/src/main/ets/components/presentation/datapanel/components/RangeTypeGauge.ets
arkts
buildLinearGauge
Custom ContentModifier: converts Gauge to linear gradient indicator
@Builder function buildLinearGauge(config: GaugeConfiguration) { LinearGaugeComp({ config: config }) }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left buildLinearGauge AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#...
@Builder function buildLinearGauge(config: GaugeConfiguration) { LinearGaugeComp({ config: config }) }
https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples
e9847e13ef358ceb12ae8b366ec0e3139fa140cc
gitcode
the-wwyang/kids-learning-app
src/main/ets/services/ProfileService.ets
arkts
updateCurrentProfile
更新当前档案信息
public async updateCurrentProfile(nickname?: string, avatar?: string): Promise<boolean> { if (this.currentProfile === null) { return false; } try { if (nickname) { this.currentProfile.nickname = nickname; } if (avatar) { this.currentProfile.avatar = avatar; }...
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 updateCurrentProfile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left nickname AST#identifier#Right AST#ERROR#Left AST#?...
public async updateCurrentProfile(nickname?: string, avatar?: string): Promise<boolean> { if (this.currentProfile === null) { return false; } try { if (nickname) { this.currentProfile.nickname = nickname; } if (avatar) { this.currentProfile.avatar = avatar; }...
https://github.com/the-wwyang/kids-learning-app
512edf41f1fd2e5bad9e9e1e163e6b99439f7d5a
github
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/dao/StepDao.ets
arkts
getStepRecordByDate
根据日期查询步数记录
async getStepRecordByDate(date: string): Promise<StepRecord | null> { const rdbStore = await this.initDatabase(); try { const predicates = new relationalStore.RdbPredicates('step_records'); predicates.equalTo('date', date); const resultSet = await rdbStore.query( predicates, ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getStepRecordByDate AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left date AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async getStepRecordByDate(date: string): Promise<StepRecord | null> { const rdbStore = await this.initDatabase(); try { const predicates = new relationalStore.RdbPredicates('step_records'); predicates.equalTo('date', date); const resultSet = await rdbStore.query( predicates, ...
https://gitcode.com/openharmony/codelabs
a5af22ed95f92b0052dc7a6124328f39a5d29054
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadManager.ets
arkts
registerGamepad
注册手柄设备
private registerGamepad( deviceId: number, deviceInfo: inputDevice.InputDeviceData, hasJoystickSource: boolean, nameIndicatesGamepad: boolean ): void { // 防止重复注册:同一 deviceId 已注册时直接跳过 if (this.connectedDevices.has(deviceId)) { GamepadManager.DEBUG && console.info(`[GAMEPAD] 设备 ${device...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerGamepad 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#number#Left number AST#nu...
private registerGamepad( deviceId: number, deviceInfo: inputDevice.InputDeviceData, hasJoystickSource: boolean, nameIndicatesGamepad: boolean ): void { // 防止重复注册:同一 deviceId 已注册时直接跳过 if (this.connectedDevices.has(deviceId)) { GamepadManager.DEBUG && console.info(`[GAMEPAD] 设备 ${device...
https://github.com/AlkaidLab/moonlight-harmony
16020e651acef23020f00678411480a992bfae42
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
find
Finds the first element in the BigUint64Array that satisfies the condition @param fn condition @returns the first element that satisfies fn
public find(fn: (val: BigInt, index: int) => boolean): BigInt { let newF: (val: BigInt, index: int, array: BigUint64Array) => boolean = (val: BigInt, index: int, array: BigUint64Array): boolean => { return fn(val, index) } return this.find(newF) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left find AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ...
public find(fn: (val: BigInt, index: int) => boolean): BigInt { let newF: (val: BigInt, index: int, array: BigUint64Array) => boolean = (val: BigInt, index: int, array: BigUint64Array): boolean => { return fn(val, index) } return this.find(newF) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
7812e86818df4efcce35f056a36021a08d8fde68
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/aiagent/RAGRetriever.ets
arkts
buildKnowledgeContext
构建知识上下文 @param docs 知识文档列表 @param results 检索结果 @param totalFound 总共找到的数量 @returns 知识上下文
private buildKnowledgeContext( docs: KnowledgeDocument[], results: { docId: string; similarity: number }[], totalFound: number ): KnowledgeContext { // 格式化知识内容 let content = ''; const references: KnowledgeReference[] = []; for (let i = 0; i < docs.length; i++) { const doc = docs[i...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#ERROR#Right AST#expression_statement#Left AST#identifier#Left buildKnowledgeContext AST#identifier#Right AST#ERROR#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left docs AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#...
private buildKnowledgeContext( docs: KnowledgeDocument[], results: { docId: string; similarity: number }[], totalFound: number ): KnowledgeContext { // 格式化知识内容 let content = ''; const references: KnowledgeReference[] = []; for (let i = 0; i < docs.length; i++) { const doc = docs[i...
https://github.com/LJ666-ui/harmony-health-care
15e934e00692ac84974a1c0d83901de0cb2ca785
github
HarmonyOS_Samples/BestPracticeSnippets
HDRVivid/AVPlayer/MediaService/src/main/ets/controller/AvPlayerController.ets
arkts
setOutputDeviceChangeCallback
[End mode_volume]
private setOutputDeviceChangeCallback() { if (!this.avPlayer) { return; } this.avPlayer.on('audioOutputDeviceChangeWithInfo', (data: audio.AudioStreamDeviceChangeInfo) => { if (data.changeReason === audio.AudioStreamDeviceChangeReason.REASON_OLD_DEVICE_UNAVAILABLE) { Logger.info(TAG, `...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left setOutputDeviceChangeCallback 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_bloc...
private setOutputDeviceChangeCallback() { if (!this.avPlayer) { return; } this.avPlayer.on('audioOutputDeviceChangeWithInfo', (data: audio.AudioStreamDeviceChangeInfo) => { if (data.changeReason === audio.AudioStreamDeviceChangeReason.REASON_OLD_DEVICE_UNAVAILABLE) { Logger.info(TAG, `...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
675273faa36c5290a4b376c4f81f1bb74c2932fc
gitcode
openharmony-sig/applications_clock
feature/timer/src/main/ets/controller/TimerController.ets
arkts
writeTime
Recording the Current Time
public writeTime() { LogUtil.info(`${TAG} Recording time `); let timestamp = new Date().getTime(); this.lastTimeMs = Math.floor((this.beforePauseTime + timestamp - this.startTimestamp) / 10) * 10; this.timeList.push(this.lastTimeMs); this.notifyTimeListChanges(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left writeTime 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...
public writeTime() { LogUtil.info(`${TAG} Recording time `); let timestamp = new Date().getTime(); this.lastTimeMs = Math.floor((this.beforePauseTime + timestamp - this.startTimestamp) / 10) * 10; this.timeList.push(this.lastTimeMs); this.notifyTimeListChanges(); }
https://gitee.com/openharmony-sig/applications_clock.git
488910d4e72dc80f837e295e62cc013927c41959
gitee
xblLab/HarmonyProjectTemplate
commons/lib_account/src/main/ets/utils/HuaweiAuthUtils.ets
arkts
quickLoginAnonymousPhone
获取匿名手机号
static async quickLoginAnonymousPhone() { const authRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); authRequest.scopes = ['quickLoginAnonymousPhone']; authRequest.forceAuthorization = false; const controller = new authentication.AuthenticationController(); ...
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 quickLoginAnonymousPhone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
static async quickLoginAnonymousPhone() { const authRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest(); authRequest.scopes = ['quickLoginAnonymousPhone']; authRequest.forceAuthorization = false; const controller = new authentication.AuthenticationController(); ...
https://github.com/xblLab/HarmonyProjectTemplate
479b5d54e373e1d61be5bf8fc769a8ea68d72980
github
Joker-x-dev/CoolMallArkTS
feature/main/src/main/ets/viewmodel/CategoryViewModel.ets
arkts
toGoodsCategoryPage
跳转到商品分类页面 @param {number} categoryId - 分类 ID @returns {void} 无返回值
toGoodsCategoryPage(categoryId: number): void { const params: GoodsCategoryParam = { typeId: `${categoryId}`, featured: false, recommend: false, keyword: undefined }; GoodsNavigator.toCategory(params); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toGoodsCategoryPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left categoryId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left...
toGoodsCategoryPage(categoryId: number): void { const params: GoodsCategoryParam = { typeId: `${categoryId}`, featured: false, recommend: false, keyword: undefined }; GoodsNavigator.toCategory(params); }
https://github.com/Joker-x-dev/CoolMallArkTS
bc262c65b405bfe08023c73293e76d5ffc2f26b8
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/SubtitleUtil.ets
arkts
isSubtitleExist
检查字幕是否存在
static async isSubtitleExist(sandbox_subtitle: string, date: string): Promise<boolean> { return new Promise((resolve) => { fs.access(sandbox_subtitle + date).then((res: boolean) => { if (res) { resolve(true) } else { resolve(false) } })?.catch((err: Business...
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 isSubtitleExist AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sandbox_subtitle AST#identifier#Right AST#ERROR#Left AS...
static async isSubtitleExist(sandbox_subtitle: string, date: string): Promise<boolean> { return new Promise((resolve) => { fs.access(sandbox_subtitle + date).then((res: boolean) => { if (res) { resolve(true) } else { resolve(false) } })?.catch((err: Business...
https://github.com/Yebingiscn/SweetVideo
8a765dcbc5786bebd561e819b03813a1b53e7c13
github
DaLongZhuaZi/manxia
entry/src/main/ets/ShareExtAbility/ShareExtAbility.ets
arkts
handleSharedFiles
处理分享的文件
private async handleSharedFiles(uris: string[], session: UIExtensionContentSession): Promise<void> { try { // 验证和转换文件URI const validUris: string[] = []; for (const uri of uris) { try { // 转换为标准文件URI格式 const normalizedUri = this.normalizeFileUri(uri); ...
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 handleSharedFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uris AST#identifier#Right AST#:#Lef...
private async handleSharedFiles(uris: string[], session: UIExtensionContentSession): Promise<void> { try { // 验证和转换文件URI const validUris: string[] = []; for (const uri of uris) { try { // 转换为标准文件URI格式 const normalizedUri = this.normalizeFileUri(uri); ...
https://github.com/DaLongZhuaZi/manxia
39ff580fd41f216d5821bf2f209858435ba8c222
github
tianlongbaobao/idut-HarmonyOS-Next
entry/src/main/ets/pages/Jumping.ets
arkts
onPageShow
页面显示时,开始倒计时
onPageShow() { this.setImmersive() this.countDown(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow 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...
onPageShow() { this.setImmersive() this.countDown(); }
https://github.com/tianlongbaobao/idut-HarmonyOS-Next
0c2c6043508a0262bc4cf43113a9729096b9e51e
github
openharmony-sig/applications_clock
product/phone/src/main/ets/ServiceExtAbility/AlarmService.ets
arkts
sendDelayedKillAlarmMessage
Send a delay message after the alarm starts to automatically snooze the alarm.
private sendDelayedKillAlarmMessage(alarmInfo: AlarmInfo): number { this.clearKillAlarmMessage(this.killAlarmMessageId); LogUtil.info(TAG, `send auto snooze message alarm id: ${JSON.stringify(alarmInfo.id)}, time: ${alarmInfo.ringDuration! * SECOND_IN_MINUTE * MILLIS_IN_SECOND}`); return setTimeout(async...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left sendDelayedKillAlarmMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alarmInfo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right ...
private sendDelayedKillAlarmMessage(alarmInfo: AlarmInfo): number { this.clearKillAlarmMessage(this.killAlarmMessageId); LogUtil.info(TAG, `send auto snooze message alarm id: ${JSON.stringify(alarmInfo.id)}, time: ${alarmInfo.ringDuration! * SECOND_IN_MINUTE * MILLIS_IN_SECOND}`); return setTimeout(async...
https://gitee.com/openharmony-sig/applications_clock.git
6602e6fac7774817101723e9ce30e18d79644ac2
gitee
JackJiang2011/harmonychat
entry/src/main/ets/pages/ChatPage.ets
arkts
switchToLoginPage
切换到登陆界面。
switchToLoginPage() { // init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作) IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub); // goto login page! router.replaceUrl({ url: 'pages/LoginPage', }); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left switchToLoginPage 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#...
switchToLoginPage() { // init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作) IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub); // goto login page! router.replaceUrl({ url: 'pages/LoginPage', }); }
https://github.com/JackJiang2011/harmonychat
a0d6c6261537a9db22b0ea4716519ae2d2b730a2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/FTP/FTPNativeClient.ets
arkts
getFTPUrl
获取FTP URL
private getFTPUrl(path: string = ''): string { const useSFTP = this.config.useSFTP === true; const protocol = useSFTP ? 'sftp' : (this.config.useFTPS ? 'ftps' : 'ftp'); const port = this.config.port || (useSFTP ? 22 : (this.config.useFTPS ? 990 : 21)); const fullPath = path.startsWith('/') ? path : `/...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getFTPUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expressi...
private getFTPUrl(path: string = ''): string { const useSFTP = this.config.useSFTP === true; const protocol = useSFTP ? 'sftp' : (this.config.useFTPS ? 'ftps' : 'ftp'); const port = this.config.port || (useSFTP ? 22 : (this.config.useFTPS ? 990 : 21)); const fullPath = path.startsWith('/') ? path : `/...
https://github.com/DaLongZhuaZi/manxia
0493486bf18ba375fa551ad2d66fa2f21595d1c0
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/taskpool.ets
arkts
onExecutionFailed
Register a callback and call it when the task fails to execute @param { CallbackFunctionWithError } callback Callback to be registered and executed when the task fails to execute @throws Error if task is executed. It does not support the registration of listeners
onExecutionFailed(callback: CallbackFunctionWithError): void { this.throwIfCallbackCannotBeAdded(); InternalTask.of(this).onFailCallback = callback; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onExecutionFailed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CallbackFunctionWithError AST#iden...
onExecutionFailed(callback: CallbackFunctionWithError): void { this.throwIfCallbackCannotBeAdded(); InternalTask.of(this).onFailCallback = callback; }
https://gitcode.com/iop123123/arkts-static-skills
113f952c0eb7d2689191d806c847841e306f1436
gitcode
HarmonyOS_Samples/HarmonyOSComponentUXExamples
commons/componentuxexamplesbase/src/main/ets/utils/CommonUtils.ets
arkts
resourceStrEquals
Compares two ResourceStr values for equality. This method handles both raw strings and Resource objects. For Resource objects, it performs a deep comparison based on the resource ID and module information to determine equality, rather than relying on reference identity. @param a - The first ResourceStr to compare. @par...
public static resourceStrEquals(a: ResourceStr, b: ResourceStr): boolean { // 1. Check for strict equality (primitive value or reference identity). if (a === b) { return true; } // 2. Return false if types do not match (e.g., comparing a string to a Resource). if (typeof a !== typeof b) { ...
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 resourceStrEquals AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left a AST#identifier#Right AST#:#Left : A...
public static resourceStrEquals(a: ResourceStr, b: ResourceStr): boolean { // 1. Check for strict equality (primitive value or reference identity). if (a === b) { return true; } // 2. Return false if types do not match (e.g., comparing a string to a Resource). if (typeof a !== typeof b) { ...
https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples
532c0f21b42f1de15955657d1580a5481254483b
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/renderer/PieChartRenderer.ets
arkts
drawHole
draws the hole in the center of the chart and the transparent circle / hole
protected drawHole(c: CanvasRenderingContext2D): void { if (this.mChart.isDrawHoleEnabled()) { let radius: number = this.mChart.getRadius(); let holeRadius: number = radius * (this.mChart.getHoleRadius() / 100); let center: MPPointF = this.mChart.getCenterCircleBox(); // if (MyColor.alp...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left protected AST#identifier#Right AST#ERROR#Left AST#identifier#Left drawHole AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#...
protected drawHole(c: CanvasRenderingContext2D): void { if (this.mChart.isDrawHoleEnabled()) { let radius: number = this.mChart.getRadius(); let holeRadius: number = radius * (this.mChart.getHoleRadius() / 100); let center: MPPointF = this.mChart.getCenterCircleBox(); // if (MyColor.alp...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
b30cf9b69ab527644f24fbd8a20ead34d414d2fa
gitee
aimilin6688/KeePassHO
entry/src/main/ets/services/template/strategies/PresetTemplateStrategy.ets
arkts
applyTemplate
应用预置模板到条目
applyTemplate(entry: KdbxEntry, template: ITemplate, options?: TemplateApplyOptions): void { if (!this.supports(template)) { return; } const preset = template as IPresetTemplate; const opts: TemplateApplyOptions = { overwriteExisting: options?.overwriteExisting ?? DEFAULT_APPLY_OPTIONS.ov...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left applyTemplate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left KdbxEntry AST#identifier#Right AST#,#Left...
applyTemplate(entry: KdbxEntry, template: ITemplate, options?: TemplateApplyOptions): void { if (!this.supports(template)) { return; } const preset = template as IPresetTemplate; const opts: TemplateApplyOptions = { overwriteExisting: options?.overwriteExisting ?? DEFAULT_APPLY_OPTIONS.ov...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/strategies/PresetTemplateStrategy.ets#L25-L56
b3b31dd75999d046cc8c28617de9d3f9b6257d7e
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/UnifiedDownloadManager.ets
arkts
getTasksByType
获取指定类型的下载任务
public getTasksByType(type: UnifiedDownloadType): UnifiedDownloadTask[] { return this.getIndexedTasks(this.taskIdsByType.get(type)); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTasksByType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left U...
public getTasksByType(type: UnifiedDownloadType): UnifiedDownloadTask[] { return this.getIndexedTasks(this.taskIdsByType.get(type)); }
https://github.com/DaLongZhuaZi/manxia
3989d2ffcf881913709dc619f4e3a64c6661ca5d
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/ComputerManager.ets
arkts
loadFirstAppBoxArt
加载第一个应用的 boxArt 作为主机头像(异步,不阻塞主流程)
private async loadFirstAppBoxArt(computer: ComputerInfo, address: string): Promise<void> { try { // 使用保存的自定义端口(如果有) const nvHttp = NvHttp.fromAddress(address, computer, this.context || undefined); const apps = await nvHttp.getAppList(); if (apps.length > 0) { // 下载并缓存第一个应用的 boxArt,...
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 loadFirstAppBoxArt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left computer AST#identifier#Right AST#...
private async loadFirstAppBoxArt(computer: ComputerInfo, address: string): Promise<void> { try { // 使用保存的自定义端口(如果有) const nvHttp = NvHttp.fromAddress(address, computer, this.context || undefined); const apps = await nvHttp.getAppList(); if (apps.length > 0) { // 下载并缓存第一个应用的 boxArt,...
https://github.com/AlkaidLab/moonlight-harmony
3048526808baba30c849842b77aa76f1fc4cf9fc
github
electronicminer/Harmony-Markdown-Editor
entry/src/main/ets/utils/AIService.ets
arkts
isStepValid
校验单个 step 的必填字段
private static isStepValid(s: AgentStep): boolean { if (!s || !s.action) { return false; } // 有行号即可定位 const hasLine: boolean = typeof s.startLine === 'number' && s.startLine > 0; switch (s.action) { case 'replace': case 'replace_content': return (hasLine || !!s.anchor) &&...
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 isStepValid AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left s AST#identifier#Right AST#:#Left : AST#...
private static isStepValid(s: AgentStep): boolean { if (!s || !s.action) { return false; } // 有行号即可定位 const hasLine: boolean = typeof s.startLine === 'number' && s.startLine > 0; switch (s.action) { case 'replace': case 'replace_content': return (hasLine || !!s.anchor) &&...
https://github.com/electronicminer/Harmony-Markdown-Editor
21e205270f9dfb763d90722572a8dc975041b052
github
openharmony/codelabs
ETSUI/PassNote/entry/src/main/ets/common/NoteManager.ets
arkts
searchNotes
搜索便签 (新增功能)
static async searchNotes(keyword: string): Promise<Note[]> { const allNotes = await NoteManager.getNotes(); if (!keyword || keyword.trim() === '') { return allNotes; } // 过滤标题或内容包含关键字的项 return allNotes.filter(note => note.title.includes(keyword) || note.content.includes(keyword) ); ...
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 searchNotes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AS...
static async searchNotes(keyword: string): Promise<Note[]> { const allNotes = await NoteManager.getNotes(); if (!keyword || keyword.trim() === '') { return allNotes; } // 过滤标题或内容包含关键字的项 return allNotes.filter(note => note.title.includes(keyword) || note.content.includes(keyword) ); ...
https://gitcode.com/openharmony/codelabs
8f7a61f3b038a870bfaf38b07f75cc355b604440
gitcode
genjishare/snake-game
entry/src/main/ets/entryability/EntryAbility.ets
arkts
useExistingConnectionForFlow
使用现有caller连接进行流转
useExistingConnectionForFlow() { hilog.info(DOMAIN, TAG, '使用现有caller连接进行流转'); // 如果有现有的gameDataObject,直接更新数据 if (gameDataObject) { this.updateExistingDataObject(); } else { // 如果没有gameDataObject但有caller,重新创建数据对象 hilog.info(DOMAIN, TAG, '有caller但无gameDataObject,重新创建数据对象'); ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left useExistingConnectionForFlow 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#state...
useExistingConnectionForFlow() { hilog.info(DOMAIN, TAG, '使用现有caller连接进行流转'); // 如果有现有的gameDataObject,直接更新数据 if (gameDataObject) { this.updateExistingDataObject(); } else { // 如果没有gameDataObject但有caller,重新创建数据对象 hilog.info(DOMAIN, TAG, '有caller但无gameDataObject,重新创建数据对象'); ...
https://github.com/genjishare/snake-game
dccf6c99bf352a04e0881d58f0e8e072f986bc11
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/UserInfoRepository.ets
arkts
bindPhone
绑定手机号 @param {Record<string, string>} params - 绑定参数 @returns {Promise<NetworkResponse<Unknown>>} 绑定结果
async bindPhone(params: Record<string, string>): Promise<NetworkResponse<Unknown>> { return this.networkDataSource.bindPhone(params); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left bindPhone AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
async bindPhone(params: Record<string, string>): Promise<NetworkResponse<Unknown>> { return this.networkDataSource.bindPhone(params); }
https://github.com/Joker-x-dev/CoolMallArkTS
9c52c52fdddad0a1f448e5d08b541d6999d4f66e
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/DeviceSensorService.ets
arkts
isAccelActive
获取加速度计活跃状态
isAccelActive(): boolean { return this.accelEnabled; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAccelActive 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...
isAccelActive(): boolean { return this.accelEnabled; }
https://github.com/AlkaidLab/moonlight-harmony
18ab17510c7b86499604fcb840b8492bb4b53de4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SettingsManager.ets
arkts
setJSON
设置JSON对象
async setJSON<T>(key: string, value: T): Promise<void> { await this.setValue(key, JSON.stringify(value), SettingType.JSON); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setJSON AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type_...
async setJSON<T>(key: string, value: T): Promise<void> { await this.setValue(key, JSON.stringify(value), SettingType.JSON); }
https://github.com/DaLongZhuaZi/manxia
bda4a8d3bfb0c4ab9db78f26042cbe45cddbeab6
github
openharmony/codelabs
Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets
arkts
release
Release the video player.
release() { if (this.avPlayer !== null) { this.avPlayer.release(); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left release 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...
release() { if (this.avPlayer !== null) { this.avPlayer.release(); } }
https://gitee.com/openharmony/codelabs.git
29d4ea5e1cf18267045c1b9adfade91e6e6bb002
gitee
the-wwyang/kids-learning-app
src/main/ets/services/WrongQuestionService.ets
arkts
calculateStats
统计错题数据 @param records 所有错题记录 @returns 统计信息
static calculateStats(records: WrongQuestionRecord[]): WrongQuestionStats { const totalCount = records.length; const unmasteredCount = records.filter(r => !r.isMastered).length; const masteredCount = totalCount - unmasteredCount; // 按题型统计 const byType = new Map<QuestionType, number>(); for (c...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateStats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expr...
static calculateStats(records: WrongQuestionRecord[]): WrongQuestionStats { const totalCount = records.length; const unmasteredCount = records.filter(r => !r.isMastered).length; const masteredCount = totalCount - unmasteredCount; // 按题型统计 const byType = new Map<QuestionType, number>(); for (c...
https://github.com/the-wwyang/kids-learning-app
8a31dcfed45fa513d4fca9fd9f4b33dd4ff977f5
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/LinkedBlockingQueue.ets
arkts
constructor
Constructs a LinkedBlockingQueue with the capacity. @param { int } capacity the capacity of LinkedBlockingQueue
constructor(capacity: int) { if (capacity <= 0) { throw new RangeError("LinkedBlockingQueue:: Invalid capacity"); } this.actualCapacity = capacity; this.head = new ListNode<T>(); this.tail = this.head; }
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 capacity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Right ...
constructor(capacity: int) { if (capacity <= 0) { throw new RangeError("LinkedBlockingQueue:: Invalid capacity"); } this.actualCapacity = capacity; this.head = new ListNode<T>(); this.tail = this.head; }
https://gitcode.com/iop123123/arkts-static-skills
0f594fd6215ed7cd914cf45d4b32af1c25a18fcd
gitcode
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/VibratorManager.ets
arkts
vibrateMedium
中等振动 ~300ms,常用于操作确认
static vibrateMedium(): void { VibratorManager.logExecution('vibrateMedium'); VibratorManager.vibrateTime(300, VibrationUsage.PHYSICAL_FEEDBACK); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateMedium 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#expressi...
static vibrateMedium(): void { VibratorManager.logExecution('vibrateMedium'); VibratorManager.vibrateTime(300, VibrationUsage.PHYSICAL_FEEDBACK); }
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
3c2baed218f08ceba49b4dfea7d0641278872084
github
openharmony/codelabs
ETSUI/PassNote/entry/src/main/ets/pages/FaceRecPage.ets
arkts
getStatusText
获取状态描述文本
getStatusText(): string { switch (this.currentStatus) { case FaceRecStatus.IDLE: return '点击开始人脸识别'; case FaceRecStatus.PREPARING: return '准备中...'; case FaceRecStatus.POSITIONING: return '正在定位人脸...'; case FaceRecStatus.SCANNING: return `扫描中... ${this.progress...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStatusText 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#statemen...
getStatusText(): string { switch (this.currentStatus) { case FaceRecStatus.IDLE: return '点击开始人脸识别'; case FaceRecStatus.PREPARING: return '准备中...'; case FaceRecStatus.POSITIONING: return '正在定位人脸...'; case FaceRecStatus.SCANNING: return `扫描中... ${this.progress...
https://gitcode.com/openharmony/codelabs
babfd897535982a64c091fad196066a28064c8ae
gitcode
NissonCX/CQU-HarmonyOS-AppDev-Course-Exp
entry/src/main/ets/model/Card.ets
arkts
getDisplayText
获取卡牌的显示文本 @returns 显示文本
getDisplayText(): string { switch (this.rank) { case 1: return 'A'; case 11: return 'J'; case 12: return 'Q'; case 13: return 'K'; default: return this.rank.toString(); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDisplayText 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#stateme...
getDisplayText(): string { switch (this.rank) { case 1: return 'A'; case 11: return 'J'; case 12: return 'Q'; case 13: return 'K'; default: return this.rank.toString(); } }
https://github.com/NissonCX/CQU-HarmonyOS-AppDev-Course-Exp
bd371bbb0a9772bf06e9034ec68f1724cc27ac2c
github
CLMC2025/Vignette
entry/src/main/ets/context/OfflineContext.ets
arkts
addWords
批量添加词汇
addWords(words: WordInfo[]): void { for (const word of words) { this.addWord(word.word, word.pos, word.meaning); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addWords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left words AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left WordInfo AST#ide...
addWords(words: WordInfo[]): void { for (const word of words) { this.addWord(word.word, word.pos, word.meaning); } }
https://github.com/CLMC2025/Vignette
e283fbfab48fec0d4990ca8ed5c28b3d730a0156
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelDictRuleManager.ets
arkts
buildSearchUrl
构建查询URL
buildSearchUrl(rule: DictRule, word: string): string { return rule.urlRule.replace(/\{\{key\}\}/g, encodeURIComponent(word)); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left buildSearchUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rule AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DictRule AST#identifier#Right AST#,#Left ...
buildSearchUrl(rule: DictRule, word: string): string { return rule.urlRule.replace(/\{\{key\}\}/g, encodeURIComponent(word)); }
https://github.com/DaLongZhuaZi/manxia
a285492149c930b329d9ed44c6e40a8a0e9c95b6
github
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
updateProviderEnabled
更新服务商启用状态
async updateProviderEnabled(providerId: string, isEnabled: boolean): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null) { return } const valueBucket: relationalStore.ValuesBucket = { is_enabled: isEnabled ? 1 : 0 } const predicates = new relationalStore....
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left updateProviderEnabled AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#L...
async updateProviderEnabled(providerId: string, isEnabled: boolean): Promise<void> { await this.waitForInitialization() if (this.rdbStore === null) { return } const valueBucket: relationalStore.ValuesBucket = { is_enabled: isEnabled ? 1 : 0 } const predicates = new relationalStore....
https://github.com/LongLiveY96/chatcube
577614a1859aec5f33a528c02dd5fadcd6e34da4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ChangelogManager.ets
arkts
getCurrentVersionCode
获取当前版本码(数字)
getCurrentVersionCode(): number { return this.currentVersionCode; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentVersionCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#...
getCurrentVersionCode(): number { return this.currentVersionCode; }
https://github.com/DaLongZhuaZi/manxia
b40ae4e9e2e454301f767b621187f452581b332c
github
tdcare/tdwebrtc
src/main/ets/WebRTCManager.ets
arkts
sendMessage
发送数据通道消息
public sendMessage(channelLabel: string, message: string): boolean { if (!this.client) return false; return this.client.sendMessage(channelLabel, message); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left sendMessage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left channelLabel AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#strin...
public sendMessage(channelLabel: string, message: string): boolean { if (!this.client) return false; return this.client.sendMessage(channelLabel, message); }
https://github.com/tdcare/tdwebrtc
673bc285b478edb80fc65eeb6b642dc0dba44dd3
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
getStringListByRegex
通过正则获取字符串列表 支持: 单个正则, &&组合正则, ||组合正则, %%交叉合并
private getStringListByRegex(pattern: string): string[] { // 处理规则分割符 const splitResult = this.splitRuleStr(pattern); if (splitResult.rules.length > 1) { return this.getRegexListWithSplitRules(splitResult.rules, splitResult.splitType); } return this.getStringListByRegexSingle(pattern); ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getStringListByRegex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pattern AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS...
private getStringListByRegex(pattern: string): string[] { // 处理规则分割符 const splitResult = this.splitRuleStr(pattern); if (splitResult.rules.length > 1) { return this.getRegexListWithSplitRules(splitResult.rules, splitResult.splitType); } return this.getStringListByRegexSingle(pattern); ...
https://github.com/DaLongZhuaZi/manxia
3ef3aee92b0b7ec1348686cabfe0fd08a708d659
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/SettingsManager.ets
arkts
setLifecycleMonitorFloatingBallEnabled
设置生命周期悬浮球是否启用
async setLifecycleMonitorFloatingBallEnabled(enabled: boolean): Promise<void> { await this.setBoolean(SettingKeys.LIFECYCLE_FLOATING_BALL_ENABLED, enabled); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setLifecycleMonitorFloatingBallEnabled AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left...
async setLifecycleMonitorFloatingBallEnabled(enabled: boolean): Promise<void> { await this.setBoolean(SettingKeys.LIFECYCLE_FLOATING_BALL_ENABLED, enabled); }
https://github.com/DaLongZhuaZi/manxia
7325a64eb311140e78ba1fd4cc9d92b2bcc6be98
github
pangpang20/antennaPodHM
entry/src/main/ets/pages/PlayerPage.ets
arkts
showMoreOptionsMenu
显示更多选项菜单
showMoreOptionsMenu(): void { const buttons: ButtonOptions[] = [ new ButtonOptions('查看单集详情'), new ButtonOptions('分享这一集'), new ButtonOptions('下载到本地') ]; UIUtils.showActionMenu(new ActionMenuOptions('更多选项', buttons)).then((index: number) => { if (index >= 0) { switch (index) ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showMoreOptionsMenu AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen...
showMoreOptionsMenu(): void { const buttons: ButtonOptions[] = [ new ButtonOptions('查看单集详情'), new ButtonOptions('分享这一集'), new ButtonOptions('下载到本地') ]; UIUtils.showActionMenu(new ActionMenuOptions('更多选项', buttons)).then((index: number) => { if (index >= 0) { switch (index) ...
https://github.com/pangpang20/antennaPodHM
5c1000edbe10e0c1fc3186d4f87386c080fcec46
github
LJ666-ui/harmony-health-care
entry/src/main/ets/medicalimaging/ModelManager.ets
arkts
getModelInfo
获取模型信息 @param imagingType 影像类型 @returns 模型信息
getModelInfo(imagingType: ImagingType): ModelInfo | undefined { return this.modelInfoMap.get(imagingType); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getModelInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left imagingType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
getModelInfo(imagingType: ImagingType): ModelInfo | undefined { return this.modelInfoMap.get(imagingType); }
https://github.com/LJ666-ui/harmony-health-care
be2cac7d31aec8c2270b120c0da5e7dc21118908
github
killetom/ktretrofit
ktretrofit/src/main/ets/retrofit/interceptor/LoggingInterceptor.ets
arkts
intercept
Intercept the request and log information about it and the response. @param chain The interceptor chain to proceed with. @returns A Promise that resolves to the response.
async intercept(chain: Interceptor.Chain): Promise<Response<any>> { const request = chain.request(); const startTime = Date.now(); // Log request information based on log level if (this.logLevel >= LogLevel.BASIC) { console.log(`${this.tag}: --> ${request.method} ${request.url}`); } if...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left intercept AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left chain AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
async intercept(chain: Interceptor.Chain): Promise<Response<any>> { const request = chain.request(); const startTime = Date.now(); // Log request information based on log level if (this.logLevel >= LogLevel.BASIC) { console.log(`${this.tag}: --> ${request.method} ${request.url}`); } if...
https://github.com/killetom/ktretrofit
a01715d3e887b7bd8a7d482f5557cc3b71118225
github
openharmony-sig/arkcompiler_ets_frontend
arkoala/tests/src/ets-tests/pages/Navigator.test.ets
arkts
build
@State text: any = router.getParams()
build() { Navigator() { Text("Navigator test 1") } .active(false) .type(NavigationType.Push) .target("/target/attribute/page 1") .params({text: this.textParam}) Navigator({target: "/target/param/page2", type: NavigationType.Back}) { Text("Navigator test 2") } .active(f...
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() { Navigator() { Text("Navigator test 1") } .active(false) .type(NavigationType.Push) .target("/target/attribute/page 1") .params({text: this.textParam}) Navigator({target: "/target/param/page2", type: NavigationType.Back}) { Text("Navigator test 2") } .active(f...
https://gitee.com/openharmony-sig/arkcompiler_ets_frontend.git
bea28e43d72302e91e3a8f0c777d0e98d8274248
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/pages/NovelDetailPage.ets
arkts
getUncachedCount
获取下载范围内未缓存的章节数
getUncachedCount(): number { let count = 0; for (let i = this.downloadStartIndex; i <= this.downloadEndIndex; i++) { if (!this.cachedChapterIndexes.has(i)) { count++; } } return count; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUncachedCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#state...
getUncachedCount(): number { let count = 0; for (let i = this.downloadStartIndex; i <= this.downloadEndIndex; i++) { if (!this.cachedChapterIndexes.has(i)) { count++; } } return count; }
https://github.com/DaLongZhuaZi/manxia
1af118a7d1506939e006599698a2bbe7ff61c201
github
Cool_foolisher1/ArkTSRepository
GuardianAssistant/entry/src/main/ets/pages/Hardware/HardwareIndexPage.ets
arkts
getProcessInfo
获取进程相关的信息
getProcessInfo() { // 获取当前系统已运行的秒数(用于计算启动时间,运行时长) this.uptime = process.uptime() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getProcessInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef...
getProcessInfo() { // 获取当前系统已运行的秒数(用于计算启动时间,运行时长) this.uptime = process.uptime() }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
f6d40ced90b0ab59bd49b6e3865deb5afecf9c0e
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncRWLock.ets
arkts
IncReaders
Increments the reader count in the state. @param { long } state Current lock state @returns { long } Updated state value with incremented reader count @throws { RangeError } If the reader count would overflow the maximum allowed value @syscap SystemCapability.Utils.Lang
public static IncReaders(state: long): long { if ((state & State.READERS_MASK) == State.READERS_MASK) { throw new RangeError("AsyncReadWriteLock:: Too many readers"); } return state + State.ONE_READER; }
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 IncReaders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left state AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#...
public static IncReaders(state: long): long { if ((state & State.READERS_MASK) == State.READERS_MASK) { throw new RangeError("AsyncReadWriteLock:: Too many readers"); } return state + State.ONE_READER; }
https://gitcode.com/iop123123/arkts-static-skills
baac5493ac126e0fac99b70654945a0b89f45acc
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceActionEngine.ets
arkts
executeJavaScript
执行JavaScript代码(带默认超时保护)
private async executeJavaScript<T>(code: string, timeoutMs: number = 15000): Promise<T> { return new Promise<T>((resolve, reject) => { let finished: boolean = false; const timerId: number = setTimeout(() => { if (!finished) { finished = true; logger.warn(TAG, `JavaScript执行超...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#binary_expression#Left AST#identifier#Left executeJavaScript AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST...
private async executeJavaScript<T>(code: string, timeoutMs: number = 15000): Promise<T> { return new Promise<T>((resolve, reject) => { let finished: boolean = false; const timerId: number = setTimeout(() => { if (!finished) { finished = true; logger.warn(TAG, `JavaScript执行超...
https://github.com/DaLongZhuaZi/manxia
4d6da5409063aaf89fd917a828c1cb6e8d059e5e
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets
arkts
getAnimationConfig
获取动画配置
public getAnimationConfig(name: string): AnimationConfig | undefined { return this.animationRegistry.get(name); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAnimationConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public getAnimationConfig(name: string): AnimationConfig | undefined { return this.animationRegistry.get(name); }
https://github.com/DaLongZhuaZi/manxia
41def03821654a2e460135376e32a741014aea26
github
terryma2024/happyword
harmonyos/entry/src/main/ets/services/CocosBattleBridge.ets
arkts
handleSpellWrongTap
Mirrors BattlePage.handleSpellWrongLetterTap.
private handleSpellWrongTap(): void { const damage: number = this.engine.applySpellLetterPenalty(); if (damage <= 0) { return; } this.callbacks.playSfx(SoundKeys.ANSWER_WRONG); this.schedulePlayerHurtGrunt(); const lost: boolean = this.engine.getState().status === BattleStatus.Lost; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleSpellWrongTap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void ...
private handleSpellWrongTap(): void { const damage: number = this.engine.applySpellLetterPenalty(); if (damage <= 0) { return; } this.callbacks.playSfx(SoundKeys.ANSWER_WRONG); this.schedulePlayerHurtGrunt(); const lost: boolean = this.engine.getState().status === BattleStatus.Lost; ...
https://github.com/terryma2024/happyword
2f5aee613814fb9815e9a7661c09aa465be99b23
github
Joker-x-dev/CoolMallArkTS
core/navigation/src/main/ets/common/CommonNavigator.ets
arkts
toContributors
跳转到贡献者列表 @returns {void} 无返回值
static toContributors(): void { navigateTo(CommonRoutes.Contributors); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toContributors 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#express...
static toContributors(): void { navigateTo(CommonRoutes.Contributors); }
https://github.com/Joker-x-dev/CoolMallArkTS
7390bdb3b66bfb5db9cd8cd0266fb3a6d9244f10
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets
arkts
constructor
Constructs a new ClassCastError instance with provided message and error specific information @param { String | undefined } message - Error text @param { ErrorOptions | undefined } options - Error options @syscap SystemCapability.Utils.Lang
constructor(message?: String, options?: ErrorOptions) { super("ClassCastError", message, options) }
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 message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi...
constructor(message?: String, options?: ErrorOptions) { super("ClassCastError", message, options) }
https://gitcode.com/iop123123/arkts-static-skills
64b1245995845c4de97c37be26cd0053795642fb
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
with
Creates a copy with replaced value on index @param { int } index - index to change @param { long } value - value to set @returns { BigInt64Array } - an BigInt64Array with replaced value on index @throws { RangeError } - If the index exceeds the array range, throw an exception @syscap SystemCapability.Utils.Lang @FaAndS...
public with(index: int, value: long): BigInt64Array { let res = new BigInt64Array(this) res.set(index, value) return res }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
public with(index: int, value: long): BigInt64Array { let res = new BigInt64Array(this) res.set(index, value) return res }
https://gitcode.com/iop123123/arkts-static-skills
958bd29231272b04e741d8c2302de875787ce426
gitcode
Harrisonls2004/WaterFlow
entry/src/main/ets/common/utils/CartManager.ets
arkts
clearCart
Clear all cart data for current user
static async clearCart(): Promise<void> { cachedCartList = []; AppStorage.setOrCreate('shopping_cart_list', []); await CartManager.saveCart(); console.log('CartManager: cart cleared'); }
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 clearCart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left...
static async clearCart(): Promise<void> { cachedCartList = []; AppStorage.setOrCreate('shopping_cart_list', []); await CartManager.saveCart(); console.log('CartManager: cart cleared'); }
https://github.com/Harrisonls2004/WaterFlow
376317ac2a90e58ac2cc6d1be6b9463de8d45c3d
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/SubtitleUtil.ets
arkts
parseVttFile
解析VTT文件
static async parseVttFile(filePath: string) { try { const parser = new ParseVtt(filePath) const items = await SubtitleUtil.parseSubtitleFile<VttLine>( parser, (line: VttLine) => ({ startTimestampMillis: line.startTimestampMillis, endTimestampMillis: line.endTimestam...
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 parseVttFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : ...
static async parseVttFile(filePath: string) { try { const parser = new ParseVtt(filePath) const items = await SubtitleUtil.parseSubtitleFile<VttLine>( parser, (line: VttLine) => ({ startTimestampMillis: line.startTimestampMillis, endTimestampMillis: line.endTimestam...
https://github.com/Yebingiscn/SweetVideo
e88fe9fc9311e25d24a4db6afe165e4ae0bdbc82
github
XHXYT/Pixark
entry/src/main/ets/common/entity/IllustHistoryInfo.ets
arkts
constructor
构造函数 @param pid 插画 ID(必填) @param title 插画标题(可选,默认空字符串) @param accessTime 访问时间(可选,默认当前时间)
constructor(pid: string, title: string = '', accessTime: number = Date.now()) { this.pid = pid this.title = title; this.accessTime = accessTime; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pid AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AS...
constructor(pid: string, title: string = '', accessTime: number = Date.now()) { this.pid = pid this.title = title; this.accessTime = accessTime; }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/entity/IllustHistoryInfo.ets#L55-L59
9562b1b1a66e6336ea8715486b2766168a77b779
github
honjow/Next2V
shared/src/main/ets/network/ApiService.ets
arkts
toggleNodeIgnoreWithCookie
Ignore/un-ignore a node on V2EX (requires Cookie session). Returns the resulting ignored state.
async toggleNodeIgnoreWithCookie(cookie: string, nodeName: string): Promise<boolean> { const toggle = await this.getNodeIgnoreToggleActionWithCookie(cookie, nodeName) return this.executeNodeIgnoreToggleWithCookie(cookie, nodeName, toggle) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left toggleNodeIgnoreWithCookie AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cookie AST#identifier#Right AST#type_annotation#Left...
async toggleNodeIgnoreWithCookie(cookie: string, nodeName: string): Promise<boolean> { const toggle = await this.getNodeIgnoreToggleActionWithCookie(cookie, nodeName) return this.executeNodeIgnoreToggleWithCookie(cookie, nodeName, toggle) }
https://github.com/honjow/Next2V
575f73aacc18217ff0259dc25ccdd01d82cc33c8
github