nwo
stringclasses
449 values
path
stringlengths
9
173
language
stringclasses
1 value
identifier
stringlengths
1
53
docstring
stringlengths
5
4.13k
function
stringlengths
10
87.2k
ast_function
stringlengths
351
354k
obf_function
stringlengths
10
87.2k
url
stringlengths
30
175
function_sha
stringlengths
40
40
source
stringclasses
3 values
openharmony-sig/applications_clock
common/src/main/ets/manager/SnoozeManager.ets
arkts
increaseSnoozedTimes
The number of naps increases once. @param alarmId alarm id
async increaseSnoozedTimes(alarmId: string): Promise<void> { const snoozedTimes = await this.getSnoozedTimes(alarmId); const preferences = await this.getPreferences(); await preferences.put(alarmId, snoozedTimes + SNOOZE_COUNT_STEP); await preferences.flush(); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left increaseSnoozedTimes AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alarmId AST#identifier#Right AST#type_annotation#Left AST#...
async increaseSnoozedTimes(alarmId: string): Promise<void> { const snoozedTimes = await this.getSnoozedTimes(alarmId); const preferences = await this.getPreferences(); await preferences.put(alarmId, snoozedTimes + SNOOZE_COUNT_STEP); await preferences.flush(); }
https://gitee.com/openharmony-sig/applications_clock.git
079c5d4366424872ed3ed3843dfbcdfaac4843c1
gitee
LongLiveY96/chatcube
entry/src/main/ets/services/PreferencesService.ets
arkts
setCurrentProviderId
设置当前选中的服务商ID
async setCurrentProviderId(providerId: string): Promise<void> { await this.setString(PreferenceKeys.CURRENT_PROVIDER_ID, providerId) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setCurrentProviderId AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left providerId AST#identifier#Right AST#type_annotation#Left A...
async setCurrentProviderId(providerId: string): Promise<void> { await this.setString(PreferenceKeys.CURRENT_PROVIDER_ID, providerId) }
https://github.com/LongLiveY96/chatcube
7e7a8feddecd2feb330e9fb84ae7357ad86a272e
github
mybricks/comlib-harmony-normal
packages/rt-arkts/comlib/src/main/ets/AiMusic/model/AppMusicMediaPlayer.ets
arkts
autoPlayNext2
播放下一首 static async playNext2() { if (MediaPlayer.playlist.length === 0) return await MediaPlayer.switchToSong(MediaPlayer.getNextIndex('next')) } 自动播放下一首(根据播放模式)
static async autoPlayNext2() { if (MediaPlayer.playlist.length === 0) return switch (MediaPlayer.playMode) { case PlayMode.SEQUENCE: await MediaPlayer.playNext() break case PlayMode.SINGLE: // 单曲循环模式下重新播放当前歌曲 if (MediaPlayer.currentSong?.file?.cloudFileUrl) { ...
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 autoPlayNext2 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ER...
static async autoPlayNext2() { if (MediaPlayer.playlist.length === 0) return switch (MediaPlayer.playMode) { case PlayMode.SEQUENCE: await MediaPlayer.playNext() break case PlayMode.SINGLE: // 单曲循环模式下重新播放当前歌曲 if (MediaPlayer.currentSong?.file?.cloudFileUrl) { ...
https://github.com/mybricks/comlib-harmony-normal
d8b493728e84fdfd3d511be04d5dbe24077d6c0e
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
filter
Creates a new Float32Array from current Float32Array based on a condition fn. @param fn the condition to apply for each element @returns a new Float32Array with elements from current Float32Array that satisfy condition fn
public filter(fn: (val: float, index: int, array: Float32Array) => boolean): Float32Array { let markers = new boolean[this.length] let resLen = 0 for (let i = 0; i < this.length; ++i) { markers[i] = fn(this.at(i), i, this) if (markers[i]) { ++resLen ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left filter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R...
public filter(fn: (val: float, index: int, array: Float32Array) => boolean): Float32Array { let markers = new boolean[this.length] let resLen = 0 for (let i = 0; i < this.length; ++i) { markers[i] = fn(this.at(i), i, this) if (markers[i]) { ++resLen ...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
791366fedede5a5d4369309e84349b3abf153bbb
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/UndefinableStringArray.ets
arkts
reserve
Increases capacity if passed argument is greater than current capacity @param { int } capacity - The new capacity requirement @syscap SystemCapability.Utils.Lang
public reserve(capacity: int): void { if (this.data.length < capacity) { let newData : FixedArray<UndefinableString> = new FixedArray<UndefinableString>(capacity) for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i] } ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reserve 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#R...
public reserve(capacity: int): void { if (this.data.length < capacity) { let newData : FixedArray<UndefinableString> = new FixedArray<UndefinableString>(capacity) for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i] } ...
https://gitcode.com/iop123123/arkts-static-skills
23c2ceacc73d115db8d2ee61033ea74ebad25210
gitcode
AetheriumSimulator/qemu-hmos
entry/src/main/ets/managers/VNCSettings.ets
arkts
setNativePort
设置原生客户端端口
async setNativePort(port: number): Promise<void> { this.settings.nativePort = port await this.save() }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setNativePort AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parame...
async setNativePort(port: number): Promise<void> { this.settings.nativePort = port await this.save() }
https://github.com/AetheriumSimulator/qemu-hmos
48ca4276bec7c0d13c714442c9a21d8f557ba1cc
github
erosTeam/NextE
shared/src/main/ets/state/FavSelectionState.ets
arkts
publishOpenOrderMenu
The title-bar order icon can't anchor a dropdown (HDS menu icons aren't owned nodes), so it asks FavoritesPage (which owns the VM + an anchor node) to open the native order Menu.
static publishOpenOrderMenu(): void { const s: FavSelectionState = connectFavSelection() s.cmdArg = '' s.cmdKind = 'openOrderMenu' s.cmdSeq = s.cmdSeq + 1 DiagnosticLogger.info('favorites', 'fav_command_publish', `kind=openOrderMenu seq=${s.cmdSeq}`) }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left publishOpenOrderMenu 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#e...
static publishOpenOrderMenu(): void { const s: FavSelectionState = connectFavSelection() s.cmdArg = '' s.cmdKind = 'openOrderMenu' s.cmdSeq = s.cmdSeq + 1 DiagnosticLogger.info('favorites', 'fav_command_publish', `kind=openOrderMenu seq=${s.cmdSeq}`) }
https://github.com/erosTeam/NextE
0a22c3d16425be17c18f8c65fe4c9f0606759712
github
LZZLHY/hlib
entry/src/main/ets/utils/PublicDownloadDir.ets
arkts
activatePersisted
启动时激活已持久化的公共目录授权(best-effort)。手机需要,平板跳过。
static async activatePersisted(): Promise<void> { if (PublicDownloadDir.isTabletSilent()) { return; } const stored: string = AppStorage.get<string>(AppStorageKeys.PUBLIC_DOWNLOAD_URI) ?? ''; if (stored.length > 0) { await PublicDownloadDir.activate(stored); } }
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 activatePersisted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
static async activatePersisted(): Promise<void> { if (PublicDownloadDir.isTabletSilent()) { return; } const stored: string = AppStorage.get<string>(AppStorageKeys.PUBLIC_DOWNLOAD_URI) ?? ''; if (stored.length > 0) { await PublicDownloadDir.activate(stored); } }
https://github.com/LZZLHY/hlib
f9e359c1503fed4c89333dd05cd8bf71d35033b9
github
Dabing-0x19d/berverage_HarmonyOS6.0
entry/src/main/ets/utils/ShareUtil.ets
arkts
createPixelMapWithBg
创建带纯色背景的 PixelMap
private static createPixelMapWithBg(width: number, height: number, bgColor: string): PixelMap { // 填充背景色 const color = bgColor.startsWith('#') ? bgColor.substring(1) : 'FFFFFF'; const r = parseInt(color.substring(0, 2), 16); const g = parseInt(color.substring(2, 4), 16); const b = parseInt(color.s...
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 createPixelMapWithBg AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#...
private static createPixelMapWithBg(width: number, height: number, bgColor: string): PixelMap { // 填充背景色 const color = bgColor.startsWith('#') ? bgColor.substring(1) : 'FFFFFF'; const r = parseInt(color.substring(0, 2), 16); const g = parseInt(color.substring(2, 4), 16); const b = parseInt(color.s...
https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0
c5ec64c5781caef4b0661cc89ee3685928982e07
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets
arkts
stringify
Converts doubles array to JSON format @param d: FixedArray<double> - doubles array to be converted to a JSON as an Array of Numbers @returns String - JSON representation of doubles array
public static stringify(d: FixedArray<double>): String { let s = new StringBuilder('[') let last_elem = d.length - 1 for (let i = 0; i < last_elem; ++i) { s.append(JSON.stringify(d[i])) s.append(',') } if (d.length > 0) { s.append(JSON.stri...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left stringify AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Rig...
public static stringify(d: FixedArray<double>): String { let s = new StringBuilder('[') let last_elem = d.length - 1 for (let i = 0; i < last_elem; ++i) { s.append(JSON.stringify(d[i])) s.append(',') } if (d.length > 0) { s.append(JSON.stri...
https://gitcode.com/iop123123/arkts-static-skills
9f2ccd7dcd78b121f15de7d308fc2256155d7581
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets
arkts
size
Returns number of Entries with unique keys in the Map @returns number of Entries with unique keys in the Map
override get size(): int { return this.sizeVal }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#identifier#Left size AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AS...
override get size(): int { return this.sizeVal }
https://gitcode.com/iop123123/arkts-static-skills
207c6e94c4253c315c07ef3c4d8acf00d753f78b
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
transformToPageInfo
转换为页面信息
private transformToPageInfo(data: Object, index: number): PageInfo { const item = data as Record<string, Object>; // 如果有kid字段但没有imageUrl,构建完整的图片URL(用于Komiic API等) let imageUrl = String(item.imageUrl || item.url || ''); if (!imageUrl && item.kid) { imageUrl = `https://komiic.com/api/image/${...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left transformToPageInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
private transformToPageInfo(data: Object, index: number): PageInfo { const item = data as Record<string, Object>; // 如果有kid字段但没有imageUrl,构建完整的图片URL(用于Komiic API等) let imageUrl = String(item.imageUrl || item.url || ''); if (!imageUrl && item.kid) { imageUrl = `https://komiic.com/api/image/${...
https://github.com/DaLongZhuaZi/manxia
b62099c905bff6b6602691f9d69252b8a06630a2
github
openharmony-sig/fluttertpc_flutter_qr_reader
ohos/src/main/ets/me/hetian/flutter_qr_reader/components/viewmodel/CustomScanViewModel.ets
arkts
initCustomScan
初始化自定义扫码 @returns {void}
initCustomScan(options?: scanBarcode.ScanOptions): void { try { if (options) { this.customScanInitOptions = options } customScan.init(this.customScanInitOptions); this.scanInitialized = true; } catch (error) { Log.e(TAG, 'init failed error: ' + JSON.stringify(error)) ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left initCustomScan AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left options AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#id...
initCustomScan(options?: scanBarcode.ScanOptions): void { try { if (options) { this.customScanInitOptions = options } customScan.init(this.customScanInitOptions); this.scanInitialized = true; } catch (error) { Log.e(TAG, 'init failed error: ' + JSON.stringify(error)) ...
https://gitee.com/openharmony-sig/fluttertpc_flutter_qr_reader.git
50e34bc353b59beb8c233a9ecfff4b0c1b473830
gitee
popsiclelmlm/Hey
entry/src/main/ets/features/assets/AssetsController.ets
arkts
downloadAsset
执行资源网络更新下载
async downloadAsset( context: common.Context, fileName: string, url: string, language: AppLanguage, onStart: () => void, onSuccess: () => void, onError: (errMsg: string) => void, onComplete: () => void ): Promise<void> { onStart(); const tempPath = `${context.filesDir}/${fil...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left downloadAsset AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left context AST#identifier#Right AST#type_annotation#Left AS...
async downloadAsset( context: common.Context, fileName: string, url: string, language: AppLanguage, onStart: () => void, onSuccess: () => void, onError: (errMsg: string) => void, onComplete: () => void ): Promise<void> { onStart(); const tempPath = `${context.filesDir}/${fil...
https://github.com/popsiclelmlm/Hey
92b42f15e930ba04dc7da0a83323d001c998fd0d
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/SharedLedgerService.ets
arkts
createSharedBill
==================== 共享账单管理 ==================== 创建共享账单
static async createSharedBill( ledgerId: number, creatorId: number, creatorName: string, amount: number, description: string, categoryId: number, categoryName: string, splitMethod: 'equal' | 'by_amount' | 'by_percentage' | 'custom', splits: BillSplit[], attachments?: string )...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left createSharedBill AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ledgerId AST#identifier#Rig...
static async createSharedBill( ledgerId: number, creatorId: number, creatorName: string, amount: number, description: string, categoryId: number, categoryName: string, splitMethod: 'equal' | 'by_amount' | 'by_percentage' | 'custom', splits: BillSplit[], attachments?: string )...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e050f1ec9cea500990fef30cf6d5d108676f9117
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NativeJsEngine.ets
arkts
isReady
检查引擎是否已初始化
isReady(): boolean { return this.isInitialized && this.vmId >= 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isReady AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_b...
isReady(): boolean { return this.isInitialized && this.vmId >= 0; }
https://github.com/DaLongZhuaZi/manxia
7cfc399fb906f4cccb7fb626e85dca4ee2ceee29
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/SnapshotCapture.ets
arkts
captureComponents
批量捕获多个组件的快照 @param componentIds 组件ID列表 @param options 快照选项 @returns Map<componentId, PixelMap>
public async captureComponents( componentIds: string[], options?: Partial<SnapshotOptions> ): Promise<Map<string, PixelMap>> { const snapshots = new Map<string, PixelMap>(); if (!this.uiContext) { logger.error(TAG, 'UIContext未初始化'); return snapshots; } const uiContext = this.uiC...
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 captureComponents AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left componentIds AST#identifier#Right AST#ERROR#Left AST#...
public async captureComponents( componentIds: string[], options?: Partial<SnapshotOptions> ): Promise<Map<string, PixelMap>> { const snapshots = new Map<string, PixelMap>(); if (!this.uiContext) { logger.error(TAG, 'UIContext未初始化'); return snapshots; } const uiContext = this.uiC...
https://github.com/DaLongZhuaZi/manxia
3b76f176bfcf1ed7b906d65e377be1bfed75ea56
github
wuba/omni-ui
omni_component/src/main/ets/components/chart/OmniFunnelChart.ets
arkts
drawRightFunnel
(startX,startY),(startX,startY+height),(startX+width-height,startY+height),(startX+width,startY)
function drawRightFunnel(options: FunnelChartOptions) { options.context.beginPath() options.context.moveTo(options.startX, options.startY) //设置中心点 options.context.lineTo(options.startX, options.startY + options.height) if (options.diffWidth) { options.context.lineTo(options.startX + options.width - options....
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left drawRightFunnel AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left options AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
function drawRightFunnel(options: FunnelChartOptions) { options.context.beginPath() options.context.moveTo(options.startX, options.startY) //设置中心点 options.context.lineTo(options.startX, options.startY + options.height) if (options.diffWidth) { options.context.lineTo(options.startX + options.width - options....
https://github.com/wuba/omni-ui
8040ea181d42f81466c40acd9a310d26e6b6ea55
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/components/ShortcutManager.ets
arkts
addShortcut
添加自定义快捷键
async addShortcut(name: string, keys: number[], icon?: string, color?: string, keySequence?: number[][]): Promise<Shortcut> { const newShortcut: Shortcut = { id: `user_${Date.now()}`, name: name, keys: keys, keySequence: keySequence, icon: icon, color: color, isBuiltin: f...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addShortcut AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left name AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
async addShortcut(name: string, keys: number[], icon?: string, color?: string, keySequence?: number[][]): Promise<Shortcut> { const newShortcut: Shortcut = { id: `user_${Date.now()}`, name: name, keys: keys, keySequence: keySequence, icon: icon, color: color, isBuiltin: f...
https://github.com/AlkaidLab/moonlight-harmony
1b4a8a8688bbc156d98eb67041e149eaede6a576
github
harmonyos/codelabs
HarmonyOS_NEXT/RankingDemo/entry/src/main/ets/viewmodel/RankViewModel.ets
arkts
loadRankDataSource1
Load data from the rankData1 of the Mock file.
loadRankDataSource1(): RankData[] { return rankData1; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left loadRankDataSource1 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left RankData AST...
loadRankDataSource1(): RankData[] { return rankData1; }
https://gitee.com/harmonyos/codelabs.git
1d2a79276bf151b601cf53bc159767251e73746a
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets
arkts
entries
Returns an array of key/values of properties of an object @param o object that contains the fields @returns array representation of key/value
public static entries(o: Object): NullishEntryType[] { if (o instanceof Char || o instanceof Boolean || o instanceof Byte || o instanceof Short || o instanceof Int || o instanceof Long || o instanceof Float || o instanceof D...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left entries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right...
public static entries(o: Object): NullishEntryType[] { if (o instanceof Char || o instanceof Boolean || o instanceof Byte || o instanceof Short || o instanceof Int || o instanceof Long || o instanceof Float || o instanceof D...
https://gitcode.com/iop123123/arkts-static-skills
a363367dd4558964a2feca0d2d89bb331ef849bd
gitcode
openharmony/vendor_unionman
unionpi_tiger/sample_api11/app/A311D_FactoryTest_app/entry/src/main/ets/a311d/interfaceButton/wifiButton.ets
arkts
addListener
监听wifi的变化
addListener() { // 连接状态改变时,修改连接信息 wifi.on('wifiConnectionChange', async state => { Logger.log(TAG, `wifiConnectionChange: ${state}`) await this.getLinkedInfo() }) // wifi状态改变时,先清空wifi列表,然后判断是否是开启状态,如果是就扫描 wifi.on('wifiStateChange', state => { Logger.log(TAG, `wifiStateLisener sta...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left addListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
addListener() { // 连接状态改变时,修改连接信息 wifi.on('wifiConnectionChange', async state => { Logger.log(TAG, `wifiConnectionChange: ${state}`) await this.getLinkedInfo() }) // wifi状态改变时,先清空wifi列表,然后判断是否是开启状态,如果是就扫描 wifi.on('wifiStateChange', state => { Logger.log(TAG, `wifiStateLisener sta...
https://gitee.com/openharmony/vendor_unionman.git
c028de7fa5e07681724ea6dc7f40b540b7cce6a3
gitee
webabcd/HarmonyDemo
entry/src/main/ets/pages/component/navigation/NavigationDemo3.ets
arkts
register
为指定的页面注册一个动画控制的相关信息
register(id: string, animateCallback: (operation: NavigationOperation) => void ): void { if (customTransitionMap.has(id)) { let myAnimation = customTransitionMap.get(id); if (myAnimation != undefined) { myAnimation.animateCallback = animateCallback; return; } } let params...
AST#program#Left AST#ERROR#Left AST#identifier#Left register AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Right AST#call_expression#Left AST#identifier#...
register(id: string, animateCallback: (operation: NavigationOperation) => void ): void { if (customTransitionMap.has(id)) { let myAnimation = customTransitionMap.get(id); if (myAnimation != undefined) { myAnimation.animateCallback = animateCallback; return; } } let params...
https://github.com/webabcd/HarmonyDemo
a2a396693014e40479c43ec510b81366eda179e7
github
Joker-x-dev/CoolMallArkTS
core/network/src/main/ets/datasource/userinfo/UserInfoNetworkDataSourceImpl.ets
arkts
updatePersonInfo
更新个人信息 @param {Record<string, unknown>} params - 更新参数 @returns {Promise<NetworkResponse<Unknown>>} 更新结果
async updatePersonInfo(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> { const resp: AxiosResponse<NetworkResponse<Unknown>> = await NetworkClient.http.post("user/info/updatePerson", params); return resp.data; }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updatePersonInfo 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#:#Lef...
async updatePersonInfo(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> { const resp: AxiosResponse<NetworkResponse<Unknown>> = await NetworkClient.http.post("user/info/updatePerson", params); return resp.data; }
https://github.com/Joker-x-dev/CoolMallArkTS
f97c7d9a16fbba41c679b282dbc9d9107de9af9a
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
setUsePublicDownloadDir
设置是否使用公共Download目录
public setUsePublicDownloadDir(use: boolean): void { this.usePublicDownloadDir = use; logger.info(TAG, `使用公共Download目录: ${use}`); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setUsePublicDownloadDir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left use AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie...
public setUsePublicDownloadDir(use: boolean): void { this.usePublicDownloadDir = use; logger.info(TAG, `使用公共Download目录: ${use}`); }
https://github.com/DaLongZhuaZi/manxia
e9c10cc75d23b183f26db8faae87c7d25e59bbe5
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/CoverCacheManager.ets
arkts
tryDownloadCover
尝试下载封面(内部方法) @returns [success, sslError] - 下载是否成功,是否是SSL错误
private async tryDownloadCover( url: string, headers: Record<string, string>, localPath: string ): Promise<boolean[]> { try { const httpRequest = http.createHttp(); const requestOptions: http.HttpRequestOptions = { method: http.RequestMethod.GET, header: headers, ...
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 tryDownloadCover AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left ...
private async tryDownloadCover( url: string, headers: Record<string, string>, localPath: string ): Promise<boolean[]> { try { const httpRequest = http.createHttp(); const requestOptions: http.HttpRequestOptions = { method: http.RequestMethod.GET, header: headers, ...
https://github.com/DaLongZhuaZi/manxia
a2bbd72e3cfe171ea3b3559f1781d78efbc758e6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Database/DatabaseTypes.ets
arkts
createChapterInfoRecord
创建章节信息数据库记录
static createChapterInfoRecord(): ChapterInfoDatabaseRecord { return { id: '', comicId: '', externalId: '', title: '', chapterIndex: 0, chapterNumber: 0, pageCount: 0, isDownloaded: false, downloadPath: null, publishTime: 0, addTime: 0, creat...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createChapterInfoRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Lef...
static createChapterInfoRecord(): ChapterInfoDatabaseRecord { return { id: '', comicId: '', externalId: '', title: '', chapterIndex: 0, chapterNumber: 0, pageCount: 0, isDownloaded: false, downloadPath: null, publishTime: 0, addTime: 0, creat...
https://github.com/DaLongZhuaZi/manxia
65fca3e68e72b9f7dd0e047f1442730bcb10c5db
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/constants/ApiConstants.ets
arkts
userFollowers
获取粉丝列表
static userFollowers(username: string): string { return `/u/${username}/follow/followers`; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left userFollowers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#...
static userFollowers(username: string): string { return `/u/${username}/follow/followers`; }
https://github.com/Amaz1ny/HarmonyDO-public
d761220a35136066ba45539e081a48314c66ef6a
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test53_original_index.ets
arkts
hasPathSum
--- Binary tree path sum (using arrays) ---
function hasPathSum(tree: (number | null)[], index: number, target: number): boolean { if (index >= tree.length || tree[index] === null) { return false; } let val: number = tree[index] as number; let leftIdx: number = 2 * index + 1; let rightIdx: number = 2 * index + 2; let isLeaf: boolean = leftIdx >= ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left hasPathSum AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left tree AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function hasPathSum(tree: (number | null)[], index: number, target: number): boolean { if (index >= tree.length || tree[index] === null) { return false; } let val: number = tree[index] as number; let leftIdx: number = 2 * index + 1; let rightIdx: number = 2 * index + 2; let isLeaf: boolean = leftIdx >= ...
https://github.com/miaochiahao/ark-ghidra
a685ddd31e0a4cf8447c653d04fa2fffd8f5c98b
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Array.ets
arkts
lastIndexOf
lastIndexOf(arr: char[], key: char, fromIndex: int) tries to find entry of key into arr which is not greater than fromIndex @param arr array to find a key @param key a value to find @param fromIndex an index of arr to begin search with (including, search is performed backwards) @returns last index of key if found in ar...
function lastIndexOf(arr: char[], key: char, fromIndex: int): int throws { return lastIndexOf(arr, key, -1, fromIndex) }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left lastIndexOf AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function lastIndexOf(arr: char[], key: char, fromIndex: int): int throws { return lastIndexOf(arr, key, -1, fromIndex) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
76fc03ae3af0387edef6d9166a9992bf2305b59a
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/AxisBase.ets
arkts
isDrawGridLinesEnabled
Returns true if drawing grid lines is enabled for this axis. @return
public isDrawGridLinesEnabled(): boolean { return this.mDrawGridLines; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDrawGridLinesEnabled 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 bo...
public isDrawGridLinesEnabled(): boolean { return this.mDrawGridLines; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
89edc867e128db9fd15c4c8f51477d9e2f069825
gitee
Joker-x-dev/CoolMallArkTS
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
handleDefaultSwitchChange
处理默认地址开关变化 @param {boolean | IBestStringNumber} value - 选中值 @returns {void} 无返回值
handleDefaultSwitchChange(value: boolean | IBestStringNumber): void { const isDefault: boolean = value === true || value === 1 || value === "1" || value === "on"; this.updateIsDefaultAddress(isDefault); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left handleDefaultSwitchChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left bo...
handleDefaultSwitchChange(value: boolean | IBestStringNumber): void { const isDefault: boolean = value === true || value === 1 || value === "1" || value === "on"; this.updateIsDefaultAddress(isDefault); }
https://github.com/Joker-x-dev/CoolMallArkTS
0f9ec9a2432ced3a32c476c3760df837103cf3f3
github
killetom/ktretrofit
entry/src/main/ets/example/RetrofitConfigExample.ets
arkts
getUsersExample
Example methods to demonstrate usage Get list of users with pagination
getUsersExample(page: number = 1, limit: number = 10): User[] { try { const userService = this.createUserService(); const call = userService.getUsers(page, limit); const response = call.execute(); console.log('Users fetched successfully:', response.body); return response.ge...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getUsersExample AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left page AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier...
getUsersExample(page: number = 1, limit: number = 10): User[] { try { const userService = this.createUserService(); const call = userService.getUsers(page, limit); const response = call.execute(); console.log('Users fetched successfully:', response.body); return response.ge...
https://github.com/killetom/ktretrofit
4468124b398d0909e38f1038907842303cd8ef71
github
openharmony/arkcompiler_taihe_ffi_gen
test/ani_bundle/user/main.ets
arkts
test_bundle_class_want_with_bundleName_noSet
ohos.app.ability.Want.d.ts
function test_bundle_class_want_with_bundleName_noSet() { let wantTest = new Want(); let info = wantTest.bundleName; arktest.assertEQ(info, undefined) }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left test_bundle_class_want_with_bundleName_noSet AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left ...
function test_bundle_class_want_with_bundleName_noSet() { let wantTest = new Want(); let info = wantTest.bundleName; arktest.assertEQ(info, undefined) }
https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen
c0d748103495529b866adb55db6b2eb2a4fbb7cf
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/customkey/CustomKeyStore.ets
arkts
init
初始化:从持久化加载数据
static async init(): Promise<void> { try { const json = await PreferencesUtil.get<string>(STORAGE_KEY_PROFILES, ''); if (json) { CustomKeyStore.profiles = JSON.parse(json) as CustomKeyProfile[]; } else { CustomKeyStore.profiles = []; } CustomKeyStore.activeProfileName...
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 init AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS...
static async init(): Promise<void> { try { const json = await PreferencesUtil.get<string>(STORAGE_KEY_PROFILES, ''); if (json) { CustomKeyStore.profiles = JSON.parse(json) as CustomKeyProfile[]; } else { CustomKeyStore.profiles = []; } CustomKeyStore.activeProfileName...
https://github.com/AlkaidLab/moonlight-harmony
ec1845c097895d96da9f05ad5032c73f7c855fa2
github
openharmony/applications_app_samples
code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/utils/NetUtils.ets
arkts
getWifiIsConnected
查询WLAN是否已连接是判断能否通过Wi-Fi 进行各种网络活动的直接方式。 @returns true,已连接。false,未连接
getWifiIsConnected(): boolean { try { let ret = wifiManager.isConnected(); logger.info('isConnected:' + ret); return ret; } catch (error) { logger.error('failed:' + JSON.stringify(error)); } return false; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getWifiIsConnected 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#...
getWifiIsConnected(): boolean { try { let ret = wifiManager.isConnected(); logger.info('isConnected:' + ret); return ret; } catch (error) { logger.error('failed:' + JSON.stringify(error)); } return false; }
https://github.com/openharmony/applications_app_samples
ed0f65cac60d82c7bf994857b93e5aa72a6c8f6c
github
openharmony/codelabs
ETSUI/MemoTime/entry/src/main/ets/service/AudioService.ets
arkts
stopRecording
停止录音并保存
async stopRecording(): Promise<Recording | null> { if (this.recordingState === RecordingState.IDLE || !this.avRecorder) { return null } try { this.stopDurationTimer() await this.avRecorder.stop() await this.avRecorder.release() this.avRecorder = null // 获取文件信息 c...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left stopRecording AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left A...
async stopRecording(): Promise<Recording | null> { if (this.recordingState === RecordingState.IDLE || !this.avRecorder) { return null } try { this.stopDurationTimer() await this.avRecorder.stop() await this.avRecorder.release() this.avRecorder = null // 获取文件信息 c...
https://gitcode.com/openharmony/codelabs
c451acb218c477127b9a6f564b4d5aa919d52643
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EnumConstant.ets
arkts
getType
getType @returns { Type } get current object's type @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getType(): Type { return this.typ! }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getType 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 Type AST#ident...
public getType(): Type { return this.typ! }
https://gitcode.com/iop123123/arkts-static-skills
7d8fb3a1dc157cb6ddd52ee56be3feddc7228df5
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/CacheConfigManager.ets
arkts
updateMemoryCacheConfig
更新内存缓存配置
public async updateMemoryCacheConfig(config: MemoryCacheConfig): Promise<void> { const newConfig = this.cloneConfig(this.config); newConfig.memoryCache = this.mergeMemoryCache(this.config.memoryCache, config); await this.updateConfig(newConfig); }
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 updateMemoryCacheConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#...
public async updateMemoryCacheConfig(config: MemoryCacheConfig): Promise<void> { const newConfig = this.cloneConfig(this.config); newConfig.memoryCache = this.mergeMemoryCache(this.config.memoryCache, config); await this.updateConfig(newConfig); }
https://github.com/DaLongZhuaZi/manxia
f17143f99f9a6efcf556bc01d1f420f1132076be
github
the-wwyang/kids-learning-app
src/main/ets/storage/AchievementStorageService.ets
arkts
saveAchievements
保存成就数据 @param achievements 成就列表
static async saveAchievements(achievements: Achievement[]): Promise<void> { try { await dataStorage.saveObject( AchievementStorageService.STORE_NAME, AchievementStorageService.KEY_ACHIEVEMENTS, achievements ); // 记录同步时间 await dataStorage.saveString( Achieve...
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 saveAchievements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left achievements AST#identifier#Right AST#:...
static async saveAchievements(achievements: Achievement[]): Promise<void> { try { await dataStorage.saveObject( AchievementStorageService.STORE_NAME, AchievementStorageService.KEY_ACHIEVEMENTS, achievements ); // 记录同步时间 await dataStorage.saveString( Achieve...
https://github.com/the-wwyang/kids-learning-app
ed7b3b5a3f8847afd130a128ab43dd9abf10553f
github
aimilin6688/KeePassHO
entry/src/main/ets/services/template/TemplateFactory.ets
arkts
createEmptyEntry
创建空条目(无模板)
createEmptyEntry(parentGroup: KdbxGroup): KdbxEntry { return TemplateBuilder.create(parentGroup).build(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left createEmptyEntry AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left parentGroup AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left KdbxGroup AST#identifier#Right AST#ERROR#Right A...
createEmptyEntry(parentGroup: KdbxGroup): KdbxEntry { return TemplateBuilder.create(parentGroup).build(); }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateFactory.ets#L182-L184
fcbe72b8ce421cddf5cf8d8fd84b584c1d177bbb
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
setSourcePinnedList
保存置顶图源ID列表
async setSourcePinnedList(ids: number[]): Promise<void> { try { await this.saveSetting('source:pinned_list', JSON.stringify(ids), 'json'); logger.info(TAG, `已保存置顶图源列表: ${ids.length}个`); } catch (error) { logger.error(TAG, '保存置顶图源列表失败', String(error)); throw error as Error; } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setSourcePinnedList AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ids AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async setSourcePinnedList(ids: number[]): Promise<void> { try { await this.saveSetting('source:pinned_list', JSON.stringify(ids), 'json'); logger.info(TAG, `已保存置顶图源列表: ${ids.length}个`); } catch (error) { logger.error(TAG, '保存置顶图源列表失败', String(error)); throw error as Error; } }
https://github.com/DaLongZhuaZi/manxia
7131eae28ddc708079939dbdb0bac7f20c19fe60
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
loadSettings
加载所有设置
async loadSettings(): Promise<void> { if (this.isLoaded) return; try { // 加载搜索设置 this.searchSettings = this.settingsManager.getJSON<NovelSearchSettings>( NOVEL_SETTING_KEYS.SEARCH_SETTINGS, DEFAULT_SEARCH_SETTINGS ); // 加载书架设置 this.bookshelfSettings = this.setti...
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadSettings AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right ...
async loadSettings(): Promise<void> { if (this.isLoaded) return; try { // 加载搜索设置 this.searchSettings = this.settingsManager.getJSON<NovelSearchSettings>( NOVEL_SETTING_KEYS.SEARCH_SETTINGS, DEFAULT_SEARCH_SETTINGS ); // 加载书架设置 this.bookshelfSettings = this.setti...
https://github.com/DaLongZhuaZi/manxia
71eab4cd7cd0c8c837d57b0d293ffa17a1be2b36
github
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/pages/ContactEditPage.ets
arkts
isAddMode
判断是否是添加模式
isAddMode(): boolean { return this.contactId === -1; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAddMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement...
isAddMode(): boolean { return this.contactId === -1; }
https://gitcode.com/openharmony/codelabs
1dff07610bac480e868399bd13d57e9a9fd795ac
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test12_original_index.ets
arkts
testArrayGuard
--- Array.isArray type guard ---
function testArrayGuard(val: Object): string { if (val instanceof Array) { let arr: Object[] = val as Object[]; return 'array:' + String(arr.length); } return 'not-array'; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testArrayGuard AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left val AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function testArrayGuard(val: Object): string { if (val instanceof Array) { let arr: Object[] = val as Object[]; return 'array:' + String(arr.length); } return 'not-array'; }
https://github.com/miaochiahao/ark-ghidra
dc73d2941746ac5e7009585c6186701c9673e59b
github
azhu0001/localsend-harmony
entry/src/main/ets/utils/FileProvider.ets
arkts
getFileName
获取文件名 @param pathName 文件路径 @returns
static getFileName(pathName: string): string { const suffixIndex = pathName.lastIndexOf('/') if (suffixIndex > 0) { return pathName.substring(suffixIndex + 1) } return '' }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getFileName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pathName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Ri...
static getFileName(pathName: string): string { const suffixIndex = pathName.lastIndexOf('/') if (suffixIndex > 0) { return pathName.substring(suffixIndex + 1) } return '' }
https://gitcode.com/azhu0001/localsend-harmony
8620371f2b379a3d43e8466ce78258b76f13fb11
gitcode
openharmony/codelabs
ETSUI/MemoTime/entry/src/main/ets/service/AudioService.ets
arkts
onPlaybackComplete
播放完成回调
private onPlaybackComplete(): void { this.stopProgressTimer() this.playbackState = PlaybackState.IDLE if (this.playbackCallback?.onPlaybackComplete) { this.playbackCallback.onPlaybackComplete() } this.currentPlayingId = '' }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left onPlaybackComplete 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#...
private onPlaybackComplete(): void { this.stopProgressTimer() this.playbackState = PlaybackState.IDLE if (this.playbackCallback?.onPlaybackComplete) { this.playbackCallback.onPlaybackComplete() } this.currentPlayingId = '' }
https://gitcode.com/openharmony/codelabs
7a20909f2ffa1d369754af8d5d25adc4b7938cc4
gitcode
codelably/HCompass
packages/user/src/main/ets/viewmodel/ProfileViewModel.ets
arkts
logout
执行退出登录 @returns {void} 无返回值
logout(): void { this.userState.logout(); const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService); navigation?.navigateBack(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left logout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left ...
logout(): void { this.userState.logout(); const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService); navigation?.navigateBack(); }
https://github.com/codelably/HCompass
4e97f05efb1f1f7d0595fc770ace563cebb3e680
github
openharmony/applications_mms
entry/src/main/ets/service/SettingService.ets
arkts
updateSmscNumber
Updating SMSC Numbers @param actionData @param callback @return
updateSmscNumber(actionData) { mSettingModel.updateSmscNumber(actionData, result => { if (result.code == common.int.SUCCESS) { HiLog.i(TAG, 'updateSmscNumber, success'); } else { HiLog.w(TAG, 'updateSmscNumber, fail'); } }); },
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateSmscNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left actionData AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right ...
updateSmscNumber(actionData) { mSettingModel.updateSmscNumber(actionData, result => { if (result.code == common.int.SUCCESS) { HiLog.i(TAG, 'updateSmscNumber, success'); } else { HiLog.w(TAG, 'updateSmscNumber, fail'); } }); },
https://gitee.com/openharmony/applications_mms.git
f82d1d9970142baabf31e51c3280ad10c02c559a
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
registerEBookDownloadTask
注册已下载完成的电子书文件为下载任务 适用于页面已通过其他方式(如 WebView cookies + HTTP)完成文件下载的场景 文件已存在于 filePath,此方法仅创建任务记录并发送通知
public async registerEBookDownloadTask( bookId: string, bookTitle: string, filePath: string, fileFormat: string, sourceId?: number ): Promise<string> { try { const taskId = `ebook_${bookId}_${Date.now()}`; const displayName = `${bookTitle} (${fileFormat.toUpperCase()})`; c...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left registerEBookDownloadTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bookId AST#identifier#Right AS...
public async registerEBookDownloadTask( bookId: string, bookTitle: string, filePath: string, fileFormat: string, sourceId?: number ): Promise<string> { try { const taskId = `ebook_${bookId}_${Date.now()}`; const displayName = `${bookTitle} (${fileFormat.toUpperCase()})`; c...
https://github.com/DaLongZhuaZi/manxia
987f7e1412f1713261c8b25746d905da33f15050
github
openharmony/applications_calendar_data
datamanager/src/main/ets/processor/instances/InstanceQueryParams.ets
arkts
isValidBeginEnd
judge is valid begin&end params: 1.has valid begin&end value 2.begin&end >0 3.begin<end @param begin the begin params @param end the end params
public isValidBeginEnd(): boolean { const begin = this.getBegin(); const end = this.getEnd(); if (begin === null || begin === undefined) { return false; } if (end === null || end === undefined) { return false; } return end >= 0 && end >= 0 && begin < end; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isValidBeginEnd 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 A...
public isValidBeginEnd(): boolean { const begin = this.getBegin(); const end = this.getEnd(); if (begin === null || begin === undefined) { return false; } if (end === null || end === undefined) { return false; } return end >= 0 && end >= 0 && begin < end; }
https://gitee.com/openharmony/applications_calendar_data.git
a79b3ae4d28b5b462beda00b6bffaad96cc46016
gitee
codelably/HCompass
packages/user/src/main/ets/services/UserInfoRepositoryImpl.ets
arkts
getPersonInfo
获取用户个人信息 @returns {Promise<NetworkResult<User>>} 用户信息响应
async getPersonInfo(): Promise<NetworkResult<User>> { return this.networkDataSource.getPersonInfo(); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getPersonInfo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generi...
async getPersonInfo(): Promise<NetworkResult<User>> { return this.networkDataSource.getPersonInfo(); }
https://github.com/codelably/HCompass
ee2ce3d3fa668e199d78d8371c5ea56892650fe6
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/components/VideoComp.ets
arkts
updateActiveIndex
是否正在记录历史 更新切换索引的状态
updateActiveIndex() { this.activeIndex === this.index ? this.startVideo() : this.stopVideo() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateActiveIndex 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#...
updateActiveIndex() { this.activeIndex === this.index ? this.startVideo() : this.stopVideo() }
https://github.com/SMAT-Lab/PhantomRendering
b1cf0adaf677c0fd796e9fcf9b7b8177c6cc412b
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/AnomalyDetectionService.ets
arkts
createAnomalyRecord
创建异常记录
private static async createAnomalyRecord( bill: Bill, userId: number, anomaly: AnomalyDetectionResult ): Promise<void> { try { const record = new AnomalyRecord(); record.userId = userId; record.billId = bill.billId; record.anomalyType = anomaly.anomalyType; record.sever...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left createAnomalyRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#...
private static async createAnomalyRecord( bill: Bill, userId: number, anomaly: AnomalyDetectionResult ): Promise<void> { try { const record = new AnomalyRecord(); record.userId = userId; record.billId = bill.billId; record.anomalyType = anomaly.anomalyType; record.sever...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
a868632366a540b513e5f65ba50d03e9a1bfd232
github
LongLiveY96/chatcube
entry/src/main/ets/services/DatabaseService.ets
arkts
addReasoningContentColumnIfNeeded
添加 reasoning_content 字段(用于推理模型)
private async addReasoningContentColumnIfNeeded(): Promise<void> { if (this.rdbStore === null) { return } try { await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.MESSAGES} ADD COLUMN reasoning_content TEXT DEFAULT ''`) } catch (error) { // 如果字段已存在,会抛出错误,忽略即可 console.info...
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 addReasoningContentColumnIfNeeded AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_...
private async addReasoningContentColumnIfNeeded(): Promise<void> { if (this.rdbStore === null) { return } try { await this.rdbStore.executeSql(`ALTER TABLE ${TableNames.MESSAGES} ADD COLUMN reasoning_content TEXT DEFAULT ''`) } catch (error) { // 如果字段已存在,会抛出错误,忽略即可 console.info...
https://github.com/LongLiveY96/chatcube
79764d0777daa63848f602af07c16a3629f08edb
github
AGenUI/AGenUI
playground/harmony/entry/src/ohosTest/ets/test/tests/ReentrantDeadlockTest.ets
arkts
isWorkerThreadAlive
Check if the worker thread is still alive by trying to create a new surface. Returns true if onCreateSurface fires within the timeout.
function isWorkerThreadAlive(sm: SurfaceManager, surfaceId: string): Promise<boolean> { return new Promise<boolean>((resolve) => { let resolved = false; const timer = setTimeout(() => { if (!resolved) { resolved = true; sm.removeListener(listener); resolve(false); } }, ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isWorkerThreadAlive AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sm AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
function isWorkerThreadAlive(sm: SurfaceManager, surfaceId: string): Promise<boolean> { return new Promise<boolean>((resolve) => { let resolved = false; const timer = setTimeout(() => { if (!resolved) { resolved = true; sm.removeListener(listener); resolve(false); } }, ...
https://github.com/AGenUI/AGenUI
743273c7ee622835d30c07749febf572442cd851
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
sort
Sorts in-place @param { function } [compareFn] - comparator _ used to determine the order of the elements. compareFn returns a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. @returns { this } - sorted Int16Array @syscap SystemCapability.Utils.Lang @...
public sort(compareFn?: (a: number, b: number) => int): this { if (compareFn == undefined) { this.sort() return this } let cmp = (l: short, r: short): int => { const result = compareFn!((l).toDouble(), (r).toDouble()) return result.toInt() ...
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 compareFn AST#identifi...
public sort(compareFn?: (a: number, b: number) => int): this { if (compareFn == undefined) { this.sort() return this } let cmp = (l: short, r: short): int => { const result = compareFn!((l).toDouble(), (r).toDouble()) return result.toInt() ...
https://gitcode.com/iop123123/arkts-static-skills
81383fe0f59edc8fffbce067944841d127f1a7b1
gitcode
CLMC2025/Vignette
entry/src/main/ets/ui/Animations.ets
arkts
getAnimationProgress
获取动画进度
getAnimationProgress(key: string): number { const state = this.animationStates.get(key); return state !== undefined ? state.progress : 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAnimationProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Le...
getAnimationProgress(key: string): number { const state = this.animationStates.get(key); return state !== undefined ? state.progress : 0; }
https://github.com/CLMC2025/Vignette
87c238f7b8527aa946a224dd3ebba2895e1da4fd
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/utils/KeyboardMapper.ets
arkts
isCtrlPressed
Check if Ctrl is pressed
isCtrlPressed(): boolean { return this.ctrlPressed; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isCtrlPressed 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...
isCtrlPressed(): boolean { return this.ctrlPressed; }
https://github.com/tangwengang-del/freerdp-harmonyos
a76f48d73bf475bbb85d915701a70a4ead71c5e5
github
CLMC2025/Vignette
entry/src/main/ets/vocabulary/SnowballSystem.ets
arkts
getSnowballStats
获取滚雪球统计
getSnowballStats(): SnowballStats { const allAssociations: WordAssociation[] = []; this.associations.forEach((assocList: WordAssociation[]) => { allAssociations.push(...assocList); }); const total = allAssociations.length; const averageStrength = total > 0 ? allAssociations.reduce((...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSnowballStats 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 SnowballStats AST#identifier#Right AST#ERROR#...
getSnowballStats(): SnowballStats { const allAssociations: WordAssociation[] = []; this.associations.forEach((assocList: WordAssociation[]) => { allAssociations.push(...assocList); }); const total = allAssociations.length; const averageStrength = total > 0 ? allAssociations.reduce((...
https://github.com/CLMC2025/Vignette
07292fb916103eecc96ee1198f313bd8b29d444b
github
LJ666-ui/harmony-health-care
entry/src/main/ets/smartward/core/executors/RuleExecutor.ets
arkts
getInstance
获取规则执行器单例实例
public static getInstance(): RuleExecutor { if (!RuleExecutor.instance) { RuleExecutor.instance = new RuleExecutor(); } return RuleExecutor.instance; }
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 getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
public static getInstance(): RuleExecutor { if (!RuleExecutor.instance) { RuleExecutor.instance = new RuleExecutor(); } return RuleExecutor.instance; }
https://github.com/LJ666-ui/harmony-health-care
40cf57269362feea738edc0d51fb99163a2d06bb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/LRU.ets
arkts
computeIfAbsent
Atomically computes and inserts a value if the key is absent. If the key already exists, returns the existing value without calling producer. @param { K } - the key @param { Function } - function that computes the value for the key @returns { V } - the existing or newly computed value @syscap SystemCapability.Utils.Lan...
public computeIfAbsent(key: K, producer: (key: K) => V): V { ConcurrencyHelpers.mutexLock(this.mutex); try { let node: LRUNode<K, V> | undefined = this.map.get(key); if (node !== undefined) { this.moveToFront(node); return node.value; ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left computeIfAbsent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#...
public computeIfAbsent(key: K, producer: (key: K) => V): V { ConcurrencyHelpers.mutexLock(this.mutex); try { let node: LRUNode<K, V> | undefined = this.map.get(key); if (node !== undefined) { this.moveToFront(node); return node.value; ...
https://gitcode.com/iop123123/arkts-static-skills
88a42e0a7a1746a01d6aa9b8f7de93399df671e6
gitcode
Kira-Yagami-Light/Kira-Projects
TodoTask/entry/src/main/ets/data/repository/TaskRepository.ets
arkts
toggleTaskCompletion
切换任务完成状态 @param id 任务 ID @returns Promise<boolean> 是否成功
async toggleTaskCompletion(id: number): Promise<boolean> { try { const task = await this.getTaskById(id); if (!task) { return false; } task.is_completed = !task.is_completed; return await this.updateTask(task); } catch (err) { Logger.error(this.LOG_TAG, `Failed to ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left toggleTaskCompletion AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async toggleTaskCompletion(id: number): Promise<boolean> { try { const task = await this.getTaskById(id); if (!task) { return false; } task.is_completed = !task.is_completed; return await this.updateTask(task); } catch (err) { Logger.error(this.LOG_TAG, `Failed to ...
https://github.com/Kira-Yagami-Light/Kira-Projects
0ce290c5ec129fa8beeba5efbb1d02e9d4dbd3b9
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
searchByTag
通过标签/分类搜索作品列表 @param tagId 标签ID或标签名称 @param page 页码 @returns 搜索结果
async searchByTag(tagId: string, page: number = 1): Promise<EngineResult<SearchResult>> { if (!this.config) { logger.error(TAG, '配置未加载,无法执行标签搜索'); throw new MangaSourceError( MangaSourceErrorCode.CONFIG_NOT_LOADED, '配置未加载' ); } const startTime = Date.now(); logger.in...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left searchByTag AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left tagId AST#identifier#Right AST#ty...
async searchByTag(tagId: string, page: number = 1): Promise<EngineResult<SearchResult>> { if (!this.config) { logger.error(TAG, '配置未加载,无法执行标签搜索'); throw new MangaSourceError( MangaSourceErrorCode.CONFIG_NOT_LOADED, '配置未加载' ); } const startTime = Date.now(); logger.in...
https://github.com/DaLongZhuaZi/manxia
ed77741c49b1a35d0f1f04fa6322e32f47f4e198
github
YDYm233/EasyRandom_HarmonyNextApp
common/SystemUtils/src/main/ets/utils/VibratorManager.ets
arkts
vibrateMuyu
═══════════════════════════════════════════════════════════════ 趣味场景快捷法(适配 EasyRandom 应用) ═══════════════════════════════════════════════════════════════ 木鱼敲击反馈 — 极短振动 20ms,内置 50ms 防抖 专为高频连击场景设计,自动跳过过快的重复触发,避免振动重叠
static vibrateMuyu(): void { if (!VibratorManager.isEnabled()) { return; } if (VibratorManager.shouldDebounce()) { return; } VibratorManager.logExecution('vibrateMuyu'); try { vibrator.startVibration( { type: 'time', duration: 20 }, { usage: VibrationUsage.TOU...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateMuyu 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#Ri...
static vibrateMuyu(): void { if (!VibratorManager.isEnabled()) { return; } if (VibratorManager.shouldDebounce()) { return; } VibratorManager.logExecution('vibrateMuyu'); try { vibrator.startVibration( { type: 'time', duration: 20 }, { usage: VibrationUsage.TOU...
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
a93289e6e8228016c14ddc7c64028bd25d6ccff1
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/GamepadManager.ets
arkts
loadTouchpadMouseSetting
加载触摸板鼠标设置
async loadTouchpadMouseSetting(): Promise<void> { this.touchpadMouseEnabled = await PreferencesUtil.get<boolean>(SettingsKeys.GAMEPAD_TOUCHPAD_MOUSE, false); console.info(`[GAMEPAD] 触摸板鼠标模拟: ${this.touchpadMouseEnabled}`); }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadTouchpadMouseSetting AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal...
async loadTouchpadMouseSetting(): Promise<void> { this.touchpadMouseEnabled = await PreferencesUtil.get<boolean>(SettingsKeys.GAMEPAD_TOUCHPAD_MOUSE, false); console.info(`[GAMEPAD] 触摸板鼠标模拟: ${this.touchpadMouseEnabled}`); }
https://github.com/AlkaidLab/moonlight-harmony
2d0756df394b06ab536b3c20408b48ee2f2990e6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Tracking/trackers/SuwayomiTracker.ets
arkts
getLoginUrl
获取登录URL(Suwayomi不使用OAuth)
public getLoginUrl(): string { return ''; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLoginUrl 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#str...
public getLoginUrl(): string { return ''; }
https://github.com/DaLongZhuaZi/manxia
d28bd5457f86c18da9a34a0e1e5700c1e567bfad
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/NotificationService.ets
arkts
markAllAsRead
标记所有通知为已读
static async markAllAsRead(): Promise<void> { const userId =await UserSessionService.getCurrentUserId(); if (!userId) { return; } await NotificationDAO.markAllAsRead(userId); }
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 markAllAsRead AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#...
static async markAllAsRead(): Promise<void> { const userId =await UserSessionService.getCurrentUserId(); if (!userId) { return; } await NotificationDAO.markAllAsRead(userId); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e4684478155d843b4c9ad9cec4cf71af85ad2544
github
xblLab/HarmonyProjectTemplate
commons/lib_api/src/main/ets/services/MineService.ets
arkts
clearMyHistory
清空我的足迹 @returns
public clearMyHistory(): string[] { const mineUserInfo = this.queryAuthorRaw() as MyAuthor; mineUserInfo.myHistory = [] return mineUserInfo.myHistory }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearMyHistory 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...
public clearMyHistory(): string[] { const mineUserInfo = this.queryAuthorRaw() as MyAuthor; mineUserInfo.myHistory = [] return mineUserInfo.myHistory }
https://github.com/xblLab/HarmonyProjectTemplate
e73ee371cc04504ef8b26c80ee30b598406c46f0
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets
arkts
transformToMangaInfo
转换为漫画信息
private transformToMangaInfo(data: Object): MangaInfo { const item = data as Record<string, Object>; // 输出提取到的字段以便调试 const keys = Object.keys(item); logger.debug(TAG, `提取到的字段: ${keys.join(', ')}`); logger.debug(TAG, `原始id值: ${item.id}, 类型: ${typeof item.id}`); // 输出图片调试信息(如果有) if...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left transformToMangaInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi...
private transformToMangaInfo(data: Object): MangaInfo { const item = data as Record<string, Object>; // 输出提取到的字段以便调试 const keys = Object.keys(item); logger.debug(TAG, `提取到的字段: ${keys.join(', ')}`); logger.debug(TAG, `原始id值: ${item.id}, 类型: ${typeof item.id}`); // 输出图片调试信息(如果有) if...
https://github.com/DaLongZhuaZi/manxia
27e539f601ff29f53016e87c6c97629fa082329f
github
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/MyDemoOld/pages/component/lazyforeach/LazyForEachPage.ets
arkts
registerDataChangeListener
为LazyForEach组件向其数据源处添加listener监听 @param listener 监听器
registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { console.info('add listener') this.listeners.push(listener) } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerDataChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DataChangeListener AST#id...
registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { console.info('add listener') this.listeners.push(listener) } }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
6039a21fde35b0194e188ccb017ff1c39a837a1a
gitcode
HarmonyCandies/image_cropper
image_cropper/src/main/ets/model/Geometry.ets
arkts
toString
String representation
toString(): string { return `Offset(${this.dx.toFixed(1)}, ${this.dy.toFixed(1)})`; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statement_blo...
toString(): string { return `Offset(${this.dx.toFixed(1)}, ${this.dy.toFixed(1)})`; }
https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/model/Geometry.ets#L167-L169
271ba278a47446a7d0153a05acb6e66a5af0ce8b
github
Countly/countly-sdk-hos
library/src/ohosTest/ets/test/Consent.test.ets
arkts
<arrow>
RequestQueueApi
async (): Promise<void> => { h.instance.requests.enableOfflineMode(); },
AST#program#Left AST#ERROR#Left AST#arrow_function#Left AST#async#Left async AST#async#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_type#Left AST#type_identifier#Left Promise AST#type_identifi...
async (): Promise<void> => { h.instance.requests.enableOfflineMode(); },
https://github.com/Countly/countly-sdk-hos
9659b4c8b243689a7516f8d55f80f834a9f52391
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrCodeGenerator.ets
arkts
getMask
Mask pattern evaluation
private getMask(pattern: number, row: number, col: number): boolean { switch (pattern) { case 0: return (row + col) % 2 === 0; case 1: return row % 2 === 0; case 2: return col % 3 === 0; case 3: return (row + col) % 3 === 0; case 4: return (Math.floor(row / 2) + Math.floor(col / 3)) ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getMask 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#number#Left number AST#number#Righ...
private getMask(pattern: number, row: number, col: number): boolean { switch (pattern) { case 0: return (row + col) % 2 === 0; case 1: return row % 2 === 0; case 2: return col % 3 === 0; case 3: return (row + col) % 3 === 0; case 4: return (Math.floor(row / 2) + Math.floor(col / 3)) ...
https://github.com/AlkaidLab/moonlight-harmony
963bdd37f62f3087b1421220ea4ce7746665c62d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EnumConstant.ets
arkts
getStringValue
getStringValue @returns { string } get current object's stringvalue @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getStringValue(): string { return this.strVal }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStringValue 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#...
public getStringValue(): string { return this.strVal }
https://gitcode.com/iop123123/arkts-static-skills
9f1fe10e639b5bd60ad846baea16c329ea11ef43
gitcode
openharmony/codelabs
Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets
arkts
startRemoteAbility
拉起远端FA
function startRemoteAbility(deviceId) { var params = { deviceId: localDeviceId } var wantValue = { bundleName: 'com.huawei.cookbook', abilityName: 'com.huawei.cookbook.MainAbility', deviceId: deviceId, parameters: params }; featureAbility.startAbility({ want: wantValue }).then((data)...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left startRemoteAbility AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left deviceId AST#identifier#Right AST#required_parameter#Right AST#)#Le...
function startRemoteAbility(deviceId) { var params = { deviceId: localDeviceId } var wantValue = { bundleName: 'com.huawei.cookbook', abilityName: 'com.huawei.cookbook.MainAbility', deviceId: deviceId, parameters: params }; featureAbility.startAbility({ want: wantValue }).then((data)...
https://gitee.com/openharmony/codelabs.git
1f409e9c174c5f2d61b1760c4ef7faf7179cf193
gitee
openharmony-sig/commons-cli
library/src/main/ets/components/cli/DefaultParser.ets
arkts
handleToken
Handles any command line token. @param token the command line token to handle @throws ParseException
private handleToken(token: string): void { this.currentToken = token; if (this.skipParsing) { this.cmd.addArg(token); } else if ("--" == token) { this.skipParsing = true; } else if (this.currentOption != null && this.currentOption.acceptsArg() && this.isArgument(token)) { this.curre...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
private handleToken(token: string): void { this.currentToken = token; if (this.skipParsing) { this.cmd.addArg(token); } else if ("--" == token) { this.skipParsing = true; } else if (this.currentOption != null && this.currentOption.acceptsArg() && this.isArgument(token)) { this.curre...
https://gitee.com/openharmony-sig/commons-cli.git
11b8eae47ee786a4d9a7e019faccbe9f567a1c88
gitee
Yebingiscn/SweetVideo
entry/src/main/ets/utils/TaskpoolUtil.ets
arkts
extractVideoFrameAsCoverTask
TaskPool 任务:从视频中提取指定时间的帧作为封面
@Concurrent async function extractVideoFrameAsCoverTask( uri: string, width: number, height: number, timeUs: number ): Promise<VideoFrameExtractionResult> { let avImageGenerator: media.AVImageGenerator | undefined let file: fs.File | undefined try { avImageGenerator = await media.createAVImageGenerat...
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left extractVideoFrameAsCoverTask AST#identifier#Right AST#...
@Concurrent async function extractVideoFrameAsCoverTask( uri: string, width: number, height: number, timeUs: number ): Promise<VideoFrameExtractionResult> { let avImageGenerator: media.AVImageGenerator | undefined let file: fs.File | undefined try { avImageGenerator = await media.createAVImageGenerat...
https://github.com/Yebingiscn/SweetVideo
bc1c13ad7a29404f0559230bdf81cdd9e90d170c
github
XJTUWYD/ArkDiff
entry/src/main/ets/utils/PatchExporter.ets
arkts
buildHunk
========= 内部方法 ========= 构建单个 hunk:生成 body 行,并从 body 反推 header 计数, 保证 @@ -a,b +c,d @@ 与实际输出行严格一致(context 行对 A/B 对称计入)。
private static buildHunk( chunk: DiffChunk, linesA: DiffLine[], linesB: DiffLine[], contextLines: number ): { header: string; body: string[] } | null { const body: string[] = []; let oldCount = 0; let newCount = 0; // 前导上下文(公共未变更行,A/B 共享) const leadStart = Math.max(0, chunk.star...
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 buildHunk AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chunk AST#identifier#Right AST#:#Left : AS...
private static buildHunk( chunk: DiffChunk, linesA: DiffLine[], linesB: DiffLine[], contextLines: number ): { header: string; body: string[] } | null { const body: string[] = []; let oldCount = 0; let newCount = 0; // 前导上下文(公共未变更行,A/B 共享) const leadStart = Math.max(0, chunk.star...
https://github.com/XJTUWYD/ArkDiff
e94cafbb4df39893ed146b6b2213ea4876c56928
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/ThemeAware.ets
arkts
getTestManagementThemedColor
获取测试管理页面的主题颜色
public static getTestManagementThemedColor( colorType: 'background' | 'text_primary' | 'text_secondary' | 'button_background' | 'panel_background' | 'panel_border' | 'accent_primary' | 'accent_primary_dimmed' | 'button_primary' | 'button_secondary' | 'button_inactive' | 'divider' | 'text_white' | 'tex...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#assignment_expression#Left AST#non_null_expression#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left getTestManageme...
public static getTestManagementThemedColor( colorType: 'background' | 'text_primary' | 'text_secondary' | 'button_background' | 'panel_background' | 'panel_border' | 'accent_primary' | 'accent_primary_dimmed' | 'button_primary' | 'button_secondary' | 'button_inactive' | 'divider' | 'text_white' | 'tex...
https://github.com/DaLongZhuaZi/manxia
26456a362c5efce136268dc2b171662f806cd1c5
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
getTransformer
Returns the Transformer class that contains all matrices and is responsible for transforming values into pixels on the screen and backwards. @return
public getTransformer(which: AxisDependency): Transformer | null { if (which == AxisDependency.LEFT) return this.mLeftAxisTransformer; else return this.mRightAxisTransformer; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTransformer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left which AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
public getTransformer(which: AxisDependency): Transformer | null { if (which == AxisDependency.LEFT) return this.mLeftAxisTransformer; else return this.mRightAxisTransformer; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
0a703831fdb56083caf5c8ac203b1ce672487d10
gitee
HarmonyOS_Codelabs/arkts-intermediate-syntax
entry/src/main/ets/model/Light.ets
arkts
getBrightness
getBrightness 方法:获取当前亮度
getBrightness(): number { return this.brightness; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getBrightness 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#statemen...
getBrightness(): number { return this.brightness; }
https://gitcode.com/HarmonyOS_Codelabs/arkts-intermediate-syntax
49ce02123d530725822eb19c1f247e2de15f3fac
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/network/QrCodeGenerator.ets
arkts
penalty
Calculate penalty score for mask selection
penalty(): number { let score = 0; const n = this.size; // Rule 1: Adjacent same-color modules in row/column (5+ = 3 + extra) for (let i = 0; i < n; i++) { let rowRun = 1; let colRun = 1; for (let j = 1; j < n; j++) { // Row if (this.modules[i][j] === this.modules[i]...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left penalty 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_bloc...
penalty(): number { let score = 0; const n = this.size; // Rule 1: Adjacent same-color modules in row/column (5+ = 3 + extra) for (let i = 0; i < n; i++) { let rowRun = 1; let colRun = 1; for (let j = 1; j < n; j++) { // Row if (this.modules[i][j] === this.modules[i]...
https://github.com/AlkaidLab/moonlight-harmony
59eaf492e917ccafbbec8fd7ebbfb2ca09ffc174
github
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
initialize
Init and clear old content.
private initialize(): void { if (this.input !== undefined) { this.imageRatio = this.input.width / this.input.height; } this.determineMaxScaleFactor(); this.clear(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initialize 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...
private initialize(): void { if (this.input !== undefined) { this.imageRatio = this.input.width / this.input.height; } this.determineMaxScaleFactor(); this.clear(); }
https://gitee.com/openharmony/codelabs.git
a9e9b0166a956aa6614db5585a6f424efa69b847
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/components/PreloadManager.ets
arkts
addBatch
批量添加预加载任务
addBatch(items: PreloadTaskItem[]): void { for (let i = 0; i < items.length; i++) { const item = items[i]; this.addToQueue(item.pageIndex, item.pageId, item.url, item.priority); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addBatch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left items AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left PreloadTaskItem ...
addBatch(items: PreloadTaskItem[]): void { for (let i = 0; i < items.length; i++) { const item = items[i]; this.addToQueue(item.pageIndex, item.pageId, item.url, item.priority); } }
https://github.com/DaLongZhuaZi/manxia
0c4cfa26b1fee89118c5c0a84951a5549b810f34
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/AnimationHelper.ets
arkts
updateListDebounced
带防抖的更新
public updateListDebounced( newList: T[], callback: (list: T[], type: AnimationType) => void, delayMs: number = 300 ): void { this.debouncer.debounce(() => { const animationType = this.updateList(newList); callback(newList, animationType); }, delayMs); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateListDebounced AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left newList AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#ide...
public updateListDebounced( newList: T[], callback: (list: T[], type: AnimationType) => void, delayMs: number = 300 ): void { this.debouncer.debounce(() => { const animationType = this.updateList(newList); callback(newList, animationType); }, delayMs); }
https://github.com/DaLongZhuaZi/manxia
4090b7f7d7acde08cf7ed3c5026c42db8457ba98
github
CLMC2025/Vignette
entry/src/main/ets/sync/webdav/WebDavCrypto.ets
arkts
fallbackRandomBytes
Fallback PRNG when cryptoFramework is unavailable (e.g., emulator). WARNING: This is NOT cryptographically secure. It uses multiple entropy sources (Date.now(), Math.random(), performance counters) mixed through SHA-256 to produce pseudo-random bytes. This is acceptable ONLY for development/emulator use. On real device...
function fallbackRandomBytes(len: number): Uint8Array { const out = new Uint8Array(len); // Generate random bytes in 32-byte chunks using SHA-256 as a mixing function let offset = 0; // Initialize counter with some randomness to avoid predictable sequences let counter = Math.floor(Math.random() * 1000000); ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left fallbackRandomBytes AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left len AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
function fallbackRandomBytes(len: number): Uint8Array { const out = new Uint8Array(len); // Generate random bytes in 32-byte chunks using SHA-256 as a mixing function let offset = 0; // Initialize counter with some randomness to avoid predictable sequences let counter = Math.floor(Math.random() * 1000000); ...
https://github.com/CLMC2025/Vignette
e81a3b6e2a75630d3d20558bebc85c15f8f9467f
github
openharmony-sig/ohos_danmaku_flame_master
library/src/main/ets/components/common/master/flame/danmaku/danmaku/model/ohos/DanmakuContext.ets
arkts
setDanmakuBold
�����Ƿ������ʾ,��ijЩ������Ч @param bold @return
public setDanmakuBold(bold: boolean): DanmakuContext { this.mDisplayer.setFakeBoldText(bold); this.notifyConfigureChanged(DanmakuConfigTag.DANMAKU_BOLD, bold); return this; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDanmakuBold AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bold AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left b...
public setDanmakuBold(bold: boolean): DanmakuContext { this.mDisplayer.setFakeBoldText(bold); this.notifyConfigureChanged(DanmakuConfigTag.DANMAKU_BOLD, bold); return this; }
https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git
423e03fcf0848d88e20196beeb002f6e4788ff63
gitee
CPF-ApplicationTPC/ImageKnife
library/src/main/ets/ImageKnife.ets
arkts
setJpegOptimizeDecoding
设置默认解码是否使用优化jpeg图片解码 没有调用时,默认不启用 设置为true后,会优化Jpeg解码,以减小解码后的图片内存占用 如果Jpeg图片设置了图形变换,则不会应用该解码优化,仍然使用默认的解码方式 启用后,getCacheImage接口可能获取到非RGBA像素格式的pixelmap @param enable 是否开启jpeg解码优化
setJpegOptimizeDecoding(enable: boolean): void { this.enableJpegOptimizeDecoding = enable; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setJpegOptimizeDecoding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right A...
setJpegOptimizeDecoding(enable: boolean): void { this.enableJpegOptimizeDecoding = enable; }
https://gitcode.com/CPF-ApplicationTPC/ImageKnife/blob/b77b0fbdd908f68c6c5b9baf28a9ca75c07b6d0a/library/src/main/ets/ImageKnife.ets#L605-L607
ba3ec853fc572cc927f5d8211071eb9683f09db6
gitcode
Explore-In-HMOS-Wearable/bilingual-phrasebook
entry/src/main/ets/utils/LocaleManager.ets
arkts
onSystemLocaleChanged
Called when the system language changes externally (e.g. from watch settings). Applies the new locale only if it differs from the current one.
async onSystemLocaleChanged(languageTag: string): Promise<void> { if (!languageTag || this.isUpdating) { return; } const newLocale = appLocaleFromString(languageTag); if (newLocale !== this.locale) { await this.updateAppLocale(newLocale); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left onSystemLocaleChanged AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left languageTag AST#identif...
async onSystemLocaleChanged(languageTag: string): Promise<void> { if (!languageTag || this.isUpdating) { return; } const newLocale = appLocaleFromString(languageTag); if (newLocale !== this.locale) { await this.updateAppLocale(newLocale); } }
https://github.com/Explore-In-HMOS-Wearable/bilingual-phrasebook
3d1f962997395489472785680643412198f3f7e5
github
the-wwyang/kids-learning-app
src/main/ets/services/ParentalControlService.ets
arkts
isWithinAllowedTime
检查是否在允许的时间段内
private isWithinAllowedTime(ranges: TimeRange[]): boolean { if (!ranges || ranges.length === 0) return true; const now = new Date(); const currentMinutes = now.getHours() * 60 + now.getMinutes(); return ranges.some(range => { const startMinutes = range.startHour * 60 + range.startMinute; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isWithinAllowedTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ranges AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscri...
private isWithinAllowedTime(ranges: TimeRange[]): boolean { if (!ranges || ranges.length === 0) return true; const now = new Date(); const currentMinutes = now.getHours() * 60 + now.getMinutes(); return ranges.some(range => { const startMinutes = range.startHour * 60 + range.startMinute; ...
https://github.com/the-wwyang/kids-learning-app
6477897632c2ff31ce28d43ef7b4c01a187262d5
github
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets
arkts
scaleRectBasedOnPoint
Scale rectangle by points. @param rect @param p @param scale
static scaleRectBasedOnPoint(rect: RectF, p: Point, scale: number): void { let operate: RectF = rect; operate.left = (rect.left - p.x) * scale + p.x; operate.right = (rect.right - p.x) * scale + p.x; operate.top = (rect.top - p.y) * scale + p.y; operate.bottom = (rect.bottom - p.y) * scale + p.y; ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left scaleRectBasedOnPoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rect AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
static scaleRectBasedOnPoint(rect: RectF, p: Point, scale: number): void { let operate: RectF = rect; operate.left = (rect.left - p.x) * scale + p.x; operate.right = (rect.right - p.x) * scale + p.x; operate.top = (rect.top - p.y) * scale + p.y; operate.bottom = (rect.bottom - p.y) * scale + p.y; ...
https://gitee.com/openharmony/codelabs.git
565b25e6ac9886739afd762b4eba6d032adbf6f1
gitee
LJ666-ui/harmony-health-care
entry/src/main/ets/rag/VectorRetriever.ets
arkts
search
向量检索 @param query 查询文本 @param topK 返回数量 @returns 检索结果
async search(query: string, topK: number): Promise<RetrievalResult[]> { console.info('[VectorRetriever] 开始向量检索:', query); try { // 1. 查询向量化 const queryVector = await this.embed(query); console.info('[VectorRetriever] 查询向量化完成'); // 2. 向量相似度搜索 const results = await this.searchSim...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left search AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left query AST#identifier#Right AST#type_annotation#Left AST#:#Left ...
async search(query: string, topK: number): Promise<RetrievalResult[]> { console.info('[VectorRetriever] 开始向量检索:', query); try { // 1. 查询向量化 const queryVector = await this.embed(query); console.info('[VectorRetriever] 查询向量化完成'); // 2. 向量相似度搜索 const results = await this.searchSim...
https://github.com/LJ666-ui/harmony-health-care
df171cf80aa8ce081e414d3bc2fe0c198189846a
github
openharmony/codelabs
CommonEventAndNotification/AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
getAlarmRepeatDayContent
Obtains the number of repetition days of an alarm task. @param repeatDays Array<number> @return content string
public getAlarmRepeatDayContent(repeatDays: Array<number>): string{ let content = MainConstant.DEFAULT_STRING_NULL; for (let i = 0; i < repeatDays.length; i++) { let repeatDay = repeatDays[i]; let repeatContent: string = CommonConstants.DEFAULT_STRING_MONDAY; switch (repeatDay) { cas...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAlarmRepeatDayContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left repeatDays AST#identifier#Right AST#ERROR#Left AST#:#Left :...
public getAlarmRepeatDayContent(repeatDays: Array<number>): string{ let content = MainConstant.DEFAULT_STRING_NULL; for (let i = 0; i < repeatDays.length; i++) { let repeatDay = repeatDays[i]; let repeatContent: string = CommonConstants.DEFAULT_STRING_MONDAY; switch (repeatDay) { cas...
https://gitee.com/openharmony/codelabs.git
da588fe2fd28c4a8e207331ec56110828984c14d
gitee
erosTeam/NextE
shared/src/main/ets/state/UserTagStore.ets
arkts
ingestInlineTags
E-Hentai list rows carry the user's tag colours inline even when the detail page does not. eros_fe feeds those SimpleTag colours into TagController.addAllSimpleTag(), then detail getColorCode() can reuse them. Keep that as a separate fallback index so My Tags still owns hide/watch state and wins when both sources know ...
ingestInlineTags(tags: SimpleTag[]): boolean { let changed: boolean = false tags.forEach((t: SimpleTag) => { if (t.backgroundColor.length === 0 && t.color.length === 0) { return } const tagText: string = EhConstants.canonicalTagText(t.text).trim() if (tagText.length === 0) { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left ingestInlineTags AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tags AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left SimpleTag...
ingestInlineTags(tags: SimpleTag[]): boolean { let changed: boolean = false tags.forEach((t: SimpleTag) => { if (t.backgroundColor.length === 0 && t.color.length === 0) { return } const tagText: string = EhConstants.canonicalTagText(t.text).trim() if (tagText.length === 0) { ...
https://github.com/erosTeam/NextE
aa8a48a8cb8f315eeb1e9416e64b43536c20c94e
github
gongshijier/harmonyLab
entry/src/main/ets/feed/load/net/NetLoader.ets
arkts
load
load data
static async load(): Promise<ArrayList<NewCell>> { console.info('load data star'); // let httpRequest = http.createHttp(); // var res = await httpRequest.request("http://v.juhe.cn/toutiao/index?type=top&key=6351037e0245a94ecae0bd699f2d72f3", // { // method: http.RequestMethod.GET, // ...
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 load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS...
static async load(): Promise<ArrayList<NewCell>> { console.info('load data star'); // let httpRequest = http.createHttp(); // var res = await httpRequest.request("http://v.juhe.cn/toutiao/index?type=top&key=6351037e0245a94ecae0bd699f2d72f3", // { // method: http.RequestMethod.GET, // ...
https://github.com/gongshijier/harmonyLab
6ce1484fb16353c0789f7d1f5b7301918de89554
github
Joker-x-dev/CoolMallArkTS
core/state/src/main/ets/UserState.ets
arkts
isLoggedIn
当前是否已登录(依据 auth 与 userInfo 是否存在) @returns {boolean} 登录状态
isLoggedIn(): boolean { return !!this.getToken(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isLoggedIn 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#statemen...
isLoggedIn(): boolean { return !!this.getToken(); }
https://github.com/Joker-x-dev/CoolMallArkTS
35f9f38934253a5dfb57c14d547b43b7861cefa1
github
iHongRen/harmony-study-demo
entry/src/main/ets/pages/transcoder/Transcoder.ets
arkts
releaseTranscoderingProcess
释放转码流程。
async releaseTranscoderingProcess() { if (Transcoder.canIUse()) { if (this.avTranscoder != undefined) { // 1.释放转码实例。 await this.avTranscoder.release(); this.avTranscoder = undefined; // 2.关闭转码目标文件fd。 fileIo.closeSync(this.avTranscoder!.fdDst); } } }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left releaseTranscoderingProcess 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#{...
async releaseTranscoderingProcess() { if (Transcoder.canIUse()) { if (this.avTranscoder != undefined) { // 1.释放转码实例。 await this.avTranscoder.release(); this.avTranscoder = undefined; // 2.关闭转码目标文件fd。 fileIo.closeSync(this.avTranscoder!.fdDst); } } }
https://github.com/iHongRen/harmony-study-demo
944c81a4fcb21ffbb55e4d4c9fab3012960f8078
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test12_original_index.ets
arkts
testCompoundAssign
--- Compound assignment operators ---
function testCompoundAssign(): number { let x: number = 10; x = x + 5; x = x - 3; x = x * 2; x = x / 4; x = x % 7; return x; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testCompoundAssign AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefin...
function testCompoundAssign(): number { let x: number = 10; x = x + 5; x = x - 3; x = x * 2; x = x / 4; x = x % 7; return x; }
https://github.com/miaochiahao/ark-ghidra
f16712c79a20ed66c7740bf4649e318f5da48bda
github
arkui-x/samples
CodeLab/Cases/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets
arkts
delete
删除tab项 @param name - tab项标题
public delete(name: string) { this.keys = []; this.tabsInfo.delete(name); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#delete#Left delete AST#delete#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#identifier#Left name AST#identifier#Right AST#type_annotation#Left AST#:#...
public delete(name: string) { this.keys = []; this.tabsInfo.delete(name); }
https://gitcode.com/arkui-x/samples
1e41c90f1735d61493beff63e9415076d3a5e92b
gitcode