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/commons-cli | library/src/main/ets/components/cli/HelpFormatter.ets | arkts | findWrapPos | Finds the next text wrap position after {@code startPos} for the text in {@code text} with the column width
{@code width}. The wrap point is the last position before startPos+width having a whitespace character (space,
\n, \r). If there is no whitespace character before startPos+width, it will return startPos+width.
@p... | public findWrapPos(text: string, width: number, startPos: number): number {
// the line ends before the max wrap pos or a new line char found
let str = text.substring(startPos);
let pos = str.indexOf("\n");
if (pos != -1 && pos <= width) {
return pos + 1;
}
pos = str.indexOf("\t");
i... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left findWrapPos AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | public findWrapPos(text: string, width: number, startPos: number): number {
// the line ends before the max wrap pos or a new line char found
let str = text.substring(startPos);
let pos = str.indexOf("\n");
if (pos != -1 && pos <= width) {
return pos + 1;
}
pos = str.indexOf("\t");
i... | https://gitee.com/openharmony-sig/commons-cli.git | daa9f1e005c5f5ff5c090b07c78c1f51113f054c | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/WebViewDataCacheManager.ets | arkts | isExpired | 检查缓存项是否过期 | private isExpired<T>(item: CacheItem<T>): boolean {
return Date.now() > item.expireTime;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#binary_expression#Left AST#identifier#Left isExpired AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Left ( AST#(#... | private isExpired<T>(item: CacheItem<T>): boolean {
return Date.now() > item.expireTime;
} | https://github.com/DaLongZhuaZi/manxia | b3e81f3ebda2f59eb9819b592fdfe69bae418b20 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | parseIndexString | 解析索引字符串
支持: 0, 0:3, 0:10:2, -1 | private parseIndexString(indexStr: string, result: IndexSelectorResult): void {
const parts = indexStr.split(',');
for (const part of parts) {
const trimmed = part.trim();
if (!trimmed) {
continue;
}
if (trimmed.includes(':')) {
// 范围索引 start:end:step
const rang... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseIndexString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left indexStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s... | private parseIndexString(indexStr: string, result: IndexSelectorResult): void {
const parts = indexStr.split(',');
for (const part of parts) {
const trimmed = part.trim();
if (!trimmed) {
continue;
}
if (trimmed.includes(':')) {
// 范围索引 start:end:step
const rang... | https://github.com/DaLongZhuaZi/manxia | ddde641262a7a2ae57106f9eaf3275072ce79b34 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/ComputerManager.ets | arkts | scanNetwork | ═══════════════════════════════════════════════════════════
扫描 & 配对
═══════════════════════════════════════════════════════════
扫描网络发现电脑(mDNS 回调会自动处理发现的主机) | async scanNetwork(): Promise<void> {
if (!this.mdnsDiscovery) {
console.error('ComputerManager: mDNS 发现服务未初始化');
return;
}
try {
const discovered = await this.mdnsDiscovery.discover(5000);
console.info(`ComputerManager: mDNS 扫描完成,发现 ${discovered.length} 台电脑`);
} catch (err) {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left scanNetwork AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST... | async scanNetwork(): Promise<void> {
if (!this.mdnsDiscovery) {
console.error('ComputerManager: mDNS 发现服务未初始化');
return;
}
try {
const discovered = await this.mdnsDiscovery.discover(5000);
console.info(`ComputerManager: mDNS 扫描完成,发现 ${discovered.length} 台电脑`);
} catch (err) {
... | https://github.com/AlkaidLab/moonlight-harmony | dec138e953bceb93b5d03a1f0f8cbb39108e8687 | github |
YANGZX22/Voot | entry/src/main/ets/services/SherpaWhisperMicService.ets | arkts | setVadSensitivity | Set VAD sensitivity.
Currently a placeholder for future implementation or simple energy threshold adjustment.
@param sensitivity 0=Low, 1=Medium, 2=High | setVadSensitivity(sensitivity: number): void {
// TODO: Implement actual VAD sensitivity adjustment
// For now, we can just log it or adjust internal thresholds if available
if (this.enableDebugLogs) {
console.info(`[SherpaMic] VAD sensitivity set to ${sensitivity}`);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setVadSensitivity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sensitivity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ... | setVadSensitivity(sensitivity: number): void {
// TODO: Implement actual VAD sensitivity adjustment
// For now, we can just log it or adjust internal thresholds if available
if (this.enableDebugLogs) {
console.info(`[SherpaMic] VAD sensitivity set to ${sensitivity}`);
}
} | https://github.com/YANGZX22/Voot | 62a97c34e2f8986cd710d3cf4bcd0dad75aee1a4 | github |
XHXYT/Pixark | entry/src/main/ets/viewmodel/IllustDetailViewModel.ets | arkts | bookmarkOrCancel | 收藏/取消收藏 | async bookmarkOrCancel(isBookmark?: boolean) {
if (!this.detailData) return;
const illust_id = this.detailData.id;
// 确定目标状态:传了参数就以参数为准,没传就取反当前状态
const targetBookmark = isBookmark ?? !this.detailData.is_bookmarked;
// 防抖优化:如果目标状态和当前状态一致,说明无需操作,直接返回
if (targetBookmark === this.detailData.is_bo... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left bookmarkOrCancel AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left isBookmark AST#identifier#Ri... | async bookmarkOrCancel(isBookmark?: boolean) {
if (!this.detailData) return;
const illust_id = this.detailData.id;
// 确定目标状态:传了参数就以参数为准,没传就取反当前状态
const targetBookmark = isBookmark ?? !this.detailData.is_bookmarked;
// 防抖优化:如果目标状态和当前状态一致,说明无需操作,直接返回
if (targetBookmark === this.detailData.is_bo... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/IllustDetailViewModel.ets#L238-L280 | 197579c9c07736268633b35ef89702de76194543 | github |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/viewmodel/CalendarViewModel.ets | arkts | getNextMonth | 获取下一月 | public getNextMonth(year: number, month: number): MonthInfo {
let nextMonth = month + 1;
let nextYear = year;
if (nextMonth > 12) {
nextMonth = 1;
nextYear++;
}
return new MonthInfo(nextYear, nextMonth);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNextMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left num... | public getNextMonth(year: number, month: number): MonthInfo {
let nextMonth = month + 1;
let nextYear = year;
if (nextMonth > 12) {
nextMonth = 1;
nextYear++;
}
return new MonthInfo(nextYear, nextMonth);
} | https://gitcode.com/openharmony/codelabs | 32d518d7317851b8a260d8e703d125de61f4a754 | gitcode |
Countly/countly-sdk-hos | library/src/main/ets/internal/Utils.ets | arkts | dayOfWeek | 0 = Sunday ... 6 = Saturday (matches Countly server convention). | public static dayOfWeek(tsMs: number): number {
return new Date(tsMs).getDay();
} | 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 dayOfWeek AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tsMs AST#identifier#Right AST#:#Left : AST#:#... | public static dayOfWeek(tsMs: number): number {
return new Date(tsMs).getDay();
} | https://github.com/Countly/countly-sdk-hos | 9450237ee5154864105ee1ca431b22e38f8f9e03 | github |
openharmony-sig/applications_calculator | common/src/main/ets/util/CommonUtil.ets | arkts | expIndexToDisplayIndex | 将实际表达式的光标位置转换为页面显示的光标位置.
@param displayExp 实际的表达式.
@param displayIndex 实际表达式的光标位置
@returns 页面显示的光标位置. | public static expIndexToDisplayIndex(exp: string, expIndex: number): number {
let displayExp: string = CommonUtil.getDisplayExp(exp);
let cursorIndex: number = 0;
let displayIndex: number = expIndex;
for (let i = 0; i < displayExp.length; i++) {
if (displayExp.charAt(i) === ',') {
displa... | 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 expIndexToDisplayIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left exp AST#identifier#Right AST#:#L... | public static expIndexToDisplayIndex(exp: string, expIndex: number): number {
let displayExp: string = CommonUtil.getDisplayExp(exp);
let cursorIndex: number = 0;
let displayIndex: number = expIndex;
for (let i = 0; i < displayExp.length; i++) {
if (displayExp.charAt(i) === ',') {
displa... | https://gitee.com/openharmony-sig/applications_calculator.git | 4016197a5e491574a809159f761ed4460806e898 | gitee |
AGenUI/AGenUI | platforms/harmony/agenui/src/main/ets/agenui/hybrid/HybridWebView.ets | arkts | handleLoadError | Handles load failures.
@param error Error message | public handleLoadError(error: string): void {
hilog.error(0, TAG, 'handleLoadError: nodeId=%{public}s, error=%{public}s', this.getNodeId(), error);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left handleLoadError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left error AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public handleLoadError(error: string): void {
hilog.error(0, TAG, 'handleLoadError: nodeId=%{public}s, error=%{public}s', this.getNodeId(), error);
} | https://github.com/AGenUI/AGenUI | c8c2a47eb0daa0b1a3f908a218dfd8d021e132b8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/ThemeAware.ets | arkts | background | 快捷方法:获取页面背景色 | public static get background(): string {
return AppColors.background;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left background AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST... | public static get background(): string {
return AppColors.background;
} | https://github.com/DaLongZhuaZi/manxia | fd79c95691ae68eadaee51e8737b3088f5664a8b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/DownloadManager.ets | arkts | setContext | 设置应用上下文 | public setContext(context: common.UIAbilityContext): void {
this.context = context;
this.downloadDirManager.setContext(context);
this.onlineArchiveService.setContext(context);
logger.info(TAG, '应用上下文已设置');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#... | public setContext(context: common.UIAbilityContext): void {
this.context = context;
this.downloadDirManager.setContext(context);
this.onlineArchiveService.setContext(context);
logger.info(TAG, '应用上下文已设置');
} | https://github.com/DaLongZhuaZi/manxia | dc0d2d6871e990a11bc7917b44998f059e48c058 | github |
XXYoLoong/SchoolSmart | entry/src/main/ets/pages/Notifications.ets | arkts | build | build 方法构建页面的 UI 布局 | build() {
// 使用 Scroll 组件确保内容在超出屏幕时可以滚动查看
Scroll(){
// 主垂直布局容器,用于依次排列各个页面模块
Column() {
// 顶部导航区域,包含返回按钮和页面标题
Row(){
// 返回按钮图标,点击时调用 router.back() 返回上一页
Image($r('app.media.back_left'))
.width("20%") // 占父容器宽度的20%
.height("30vp... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
// 使用 Scroll 组件确保内容在超出屏幕时可以滚动查看
Scroll(){
// 主垂直布局容器,用于依次排列各个页面模块
Column() {
// 顶部导航区域,包含返回按钮和页面标题
Row(){
// 返回按钮图标,点击时调用 router.back() 返回上一页
Image($r('app.media.back_left'))
.width("20%") // 占父容器宽度的20%
.height("30vp... | https://github.com/XXYoLoong/SchoolSmart | 833481ad6bbc3eda560dea1e24ddfe3f438ba14e | github |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | timeout | 设置查询超时(毫秒)
@param timeoutMs 超时时间,<= 0 表示禁用
@returns 当前实例(支持链式调用) | timeout(timeoutMs: number): QueryBuilder {
this.queryTimeoutMs = timeoutMs > 0 ? Math.floor(timeoutMs) : 0
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left timeout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left timeoutMs AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#Righ... | timeout(timeoutMs: number): QueryBuilder {
this.queryTimeoutMs = timeoutMs > 0 ? Math.floor(timeoutMs) : 0
return this
} | https://github.com/offlinecat-dev/OCNetORM | 7c95092f7b0406f5fbe97a92e8dde09ac4f4dd6f | github |
openharmony/xts_tools | sample/AppSampleD/entry/src/main/ets/appsampled/data/SearchResult.ets | arkts | constructor | 视频展示图片的文件名称 | constructor(videoAuthorName: string, videoAuthorIcon: Resource, videoLikeNum: string, videoTitle: string, video: Resource) {
this.videoAuthorName = videoAuthorName;
this.videoAuthorIcon = videoAuthorIcon;
this.videoLikeNum = videoLikeNum;
this.videoTitle = videoTitle;
this.video = video;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left videoAuthorName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Righ... | constructor(videoAuthorName: string, videoAuthorIcon: Resource, videoLikeNum: string, videoTitle: string, video: Resource) {
this.videoAuthorName = videoAuthorName;
this.videoAuthorIcon = videoAuthorIcon;
this.videoLikeNum = videoLikeNum;
this.videoTitle = videoTitle;
this.video = video;
} | https://gitee.com/openharmony/xts_tools.git | 16a3a7b0515241045423dbd0de6a06317855baf8 | gitee |
openharmony/codelabs | ETSUI/PositioningDemo/entry/src/main/ets/service/ReminderService.ets | arkts | onSportDataUpdate | 处理运动数据更新 | onSportDataUpdate(sportData: SportData): void {
this.checkDurationReminder(sportData);
this.checkGoalAchievementReminder(sportData);
this.checkRestReminder(sportData);
console.log('处理运动数据更新提醒');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onSportDataUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left sportData AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left SportData AST#identifier#Right AS... | onSportDataUpdate(sportData: SportData): void {
this.checkDurationReminder(sportData);
this.checkGoalAchievementReminder(sportData);
this.checkRestReminder(sportData);
console.log('处理运动数据更新提醒');
} | https://gitcode.com/openharmony/codelabs | e7b9a422df359708f69b23ed6796c1a7ee59725a | gitcode |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/pages/Tabs/HomeTabsComp.ets | arkts | onPrivacySettingsChange | 当设置发生变化时,也需要更新链接 | onPrivacySettingsChange() {
this.togglePrivacyEntry()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPrivacySettingsChange 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_... | onPrivacySettingsChange() {
this.togglePrivacyEntry()
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | ea65927b551f0ae687d52f37b04edfc535012bdc | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/highlight/ChartHighlighter.ets | arkts | getMinimumDistance | Returns the minimum distance from a touch value (in pixels) to the
closest value (in pixels) that is displayed in the chart.
@param closestValues
@param pos
@param axis
@return | protected getMinimumDistance(closestValues: JArrayList<Highlight>, pos: number, axis: AxisDependency): number {
let distance: number = Number.MAX_VALUE;
for (let i: number = 0; i < closestValues.size(); i++) {
let high: Highlight | null = closestValues.get(i);
if (high && high.getAxis() == axi... | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left getMinimumDistance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left closestValues AST#identifier#Right AST#ERROR#Left AST#:#... | protected getMinimumDistance(closestValues: JArrayList<Highlight>, pos: number, axis: AxisDependency): number {
let distance: number = Number.MAX_VALUE;
for (let i: number = 0; i < closestValues.size(); i++) {
let high: Highlight | null = closestValues.get(i);
if (high && high.getAxis() == axi... | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 1681e1f60a538734ce09e78ee9d11e4231da7ca1 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/query/AggregateResult.ets | arkts | isEmpty | 检查结果是否为空
@returns 是否为空 | isEmpty(): boolean {
return this.rows.length === 0
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isEmpty 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... | isEmpty(): boolean {
return this.rows.length === 0
} | https://github.com/offlinecat-dev/OCNetORM | cd9e526ed1ae9c4f0ae89ba8965a3d50fbca13c1 | github |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/core/services/FocusTimerEngine.ets | arkts | clearBackgroundTimeout | 清理后台倒计时器 | private clearBackgroundTimeout(): void {
if (this.backgroundTimeoutId !== -1) {
clearTimeout(this.backgroundTimeoutId);
this.backgroundTimeoutId = -1;
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left clearBackgroundTimeout 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 ... | private clearBackgroundTimeout(): void {
if (this.backgroundTimeoutId !== -1) {
clearTimeout(this.backgroundTimeoutId);
this.backgroundTimeoutId = -1;
}
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/services/FocusTimerEngine.ets#L133-L138 | 56a2a590a2abca1a00bb6b9722e8c6149c239321 | github |
SakuraNeko/Deepseek-Harmony | entry/src/main/ets/pages/Index.ets | arkts | onColorModeChange | 系统深色模式切换时,同步 WebView 容器背景色,避免切换时白底闪烁 | onColorModeChange(): void {
if (this.currentColorMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK) {
this.webBgColor = Color.Black;
} else {
this.webBgColor = Color.White;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onColorModeChange 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#object_pattern#Left AST#{#... | onColorModeChange(): void {
if (this.currentColorMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK) {
this.webBgColor = Color.Black;
} else {
this.webBgColor = Color.White;
}
} | https://github.com/SakuraNeko/Deepseek-Harmony | c6b88cdceafe2e831fe65e433b0fe440d3e6dc01 | github |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/viewmodel/EventViewModel.ets | arkts | validateEventTime | 检查日程起止时间是否合法 | public validateEventTime(start: number, end: number): boolean {
if (start >= end) {
this.logger.warn('Validate failed: Start time must be before end time');
return false;
}
return true;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left validateEventTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left start AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | public validateEventTime(start: number, end: number): boolean {
if (start >= end) {
this.logger.warn('Validate failed: Start time must be before end time');
return false;
}
return true;
} | https://gitcode.com/openharmony/codelabs | 524cd3f5b8b55cbdc9b91ec755e001d70d1d9374 | gitcode |
openharmony-sig/smartperf | device/device_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets | arkts | getYMin | Returns the smallest y-value the data object contains.
@return
public getYMin() : number {
return this.mYMin;
}
Returns the minimum y-value for the specified axis.
@param axis
@return | public getYMin(axis ?: AxisDependency) : number{
if (axis == null) {
return this.mYMin;
}
if (axis == AxisDependency.LEFT) {
if (this.mLeftAxisMin == Number.MAX_VALUE) {
return this.mRightAxisMin;
} else
return this.mLeftAx... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getYMin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left axis AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST... | public getYMin(axis ?: AxisDependency) : number{
if (axis == null) {
return this.mYMin;
}
if (axis == AxisDependency.LEFT) {
if (this.mLeftAxisMin == Number.MAX_VALUE) {
return this.mRightAxisMin;
} else
return this.mLeftAx... | https://gitee.com/openharmony-sig/smartperf.git | 1b8dc5ba9e2c4ba48c27f9959ca710317440e180 | gitee |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets | arkts | reportWindowClose | Does the cleaning jobs of this window. Is the very last method called in the window's life.
Removes the working directory if not isZone.
And destroys the web nodes, and clears hosts from AppStorageV2. | async reportWindowClose() {
meow(`Window [${this.windowId}] closed.`, `meowUiHost][reportWindowClose][${this.windowId}`, meowLevel.WARN);
const isLastWindow = getCreateMyApp().windowIds.length == 0;
const nextTimeNeed = startUpOptionFromSettings() == 'continue';
// Web nodes
this.myTabs.requestDe... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left reportWindowClose AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#{#Left { AST#{#Right AST#ERROR#Right AST#ex... | async reportWindowClose() {
meow(`Window [${this.windowId}] closed.`, `meowUiHost][reportWindowClose][${this.windowId}`, meowLevel.WARN);
const isLastWindow = getCreateMyApp().windowIds.length == 0;
const nextTimeNeed = startUpOptionFromSettings() == 'continue';
// Web nodes
this.myTabs.requestDe... | https://github.com/awaLiny2333/LinysBrowser_NEXT | 2d6d2e598a7b22608e2dd38bc5208d8e42f3e31f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceSelectorEngine.ets | arkts | executeAttributeSelector | 执行属性选择器 | private async executeAttributeSelector(
selector: Selector,
context: SelectorContext,
executeJS: (script: string) => Promise<Object>
): Promise<SelectorResult> {
// 类型安全的属性访问
const attributeSelector = selector as AttributeSelector;
if (!attributeSelector.attribute) {
throw new MangaSou... | 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 executeAttributeSelector AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left selector AST#identifier#Righ... | private async executeAttributeSelector(
selector: Selector,
context: SelectorContext,
executeJS: (script: string) => Promise<Object>
): Promise<SelectorResult> {
// 类型安全的属性访问
const attributeSelector = selector as AttributeSelector;
if (!attributeSelector.attribute) {
throw new MangaSou... | https://github.com/DaLongZhuaZi/manxia | 090e816892ffc355af34d2b35a3d0eff2bc1765e | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/FontAware.ets | arkts | getNovelLineHeight | 获取小说行高 | public static getNovelLineHeight(): number {
return FontAwareHelper.globalState.novelLineHeight;
} | 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 getNovelLineHeight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | public static getNovelLineHeight(): number {
return FontAwareHelper.globalState.novelLineHeight;
} | https://github.com/DaLongZhuaZi/manxia | 8e19cd7be9d912f15b602d10450f8dea66f8da75 | github |
751496032/DSBridge-HarmonyOS | library/src/main/ets/core/WebViewControllerProxy.ets | arkts | setClosePageListener | 设置关闭页面监听
@param listener | setClosePageListener(listener: OnCloseWindowListener) {
this.bridge.setClosePageListener(listener)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setClosePageListener 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 OnCloseWindowLis... | setClosePageListener(listener: OnCloseWindowListener) {
this.bridge.setClosePageListener(listener)
} | https://github.com/751496032/DSBridge-HarmonyOS/blob/6e69923a816e400710e23c8bab549fe790545bc6/library/src/main/ets/core/WebViewControllerProxy.ets#L119-L121 | 8ff04652a3a93001d30a81c77f62143f1e02cb3c | github |
Joker-x-dev/CoolMallArkTS | feature/order/src/main/ets/viewmodel/OrderConfirmViewModel.ets | arkts | calculatePrices | 计算价格(包括优惠券折扣)
@returns {void} 无返回值 | private calculatePrices(): void {
let discountValue = 0;
if (this.selectedCoupon && this.selectedCoupon.condition) {
// 检查是否满足使用条件
if (this.originalPrice >= this.selectedCoupon.condition.fullAmount) {
discountValue = this.selectedCoupon.amount ?? 0;
}
}
this.discountAmount ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left calculatePrices AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#... | private calculatePrices(): void {
let discountValue = 0;
if (this.selectedCoupon && this.selectedCoupon.condition) {
// 检查是否满足使用条件
if (this.originalPrice >= this.selectedCoupon.condition.fullAmount) {
discountValue = this.selectedCoupon.amount ?? 0;
}
}
this.discountAmount ... | https://github.com/Joker-x-dev/CoolMallArkTS | 525c3d2418ed6417bf41f3d5462de9b614602ddc | github |
HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | entry/src/main/ets/pages/AudioCapturer.ets | arkts | release | release | public async release() {
this.mAudioCapturer?.off('readData');
if (null === this.mAudioCapturer) {
console.error(TAG, `AudioCapturerUtil have not init`);
return;
}
if (this.mAudioCapturer.state === audio.AudioState.STATE_RELEASED || this.mAudioCapturer.state === audio.AudioState.STATE_NEW)... | 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 release AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Ri... | public async release() {
this.mAudioCapturer?.off('readData');
if (null === this.mAudioCapturer) {
console.error(TAG, `AudioCapturerUtil have not init`);
return;
}
if (this.mAudioCapturer.state === audio.AudioState.STATE_RELEASED || this.mAudioCapturer.state === audio.AudioState.STATE_NEW)... | https://gitcode.com/HarmonyOS_Samples/core-speech-kit-sample-code-ark-ts-kit-asrdemo | 5ee8c1d0b6c4d7305b8921dc87b4a7732f795f6c | gitcode |
NissonCX/CQU-HarmonyOS-AppDev-Course-Exp | entry/src/main/ets/utils/ExpressionEvaluator.ets | arkts | validateNumbers | 验证使用的数字是否与发牌一致
@param usedNumbers 表达式中使用的数字
@param cardValues 卡牌数值
@returns 是否匹配 | private static validateNumbers(usedNumbers: number[], cardValues: number[]): boolean {
// 必须使用4个数字
if (usedNumbers.length !== 4) {
return false;
}
// 创建副本进行排序和比较
const usedCopy = [...usedNumbers].sort((a, b) => a - b);
const cardCopy = [...cardValues].sort((a, b) => a - b);
... | 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 validateNumbers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left usedNumbers AST#identifier#Right AST#ERROR#Left AST... | private static validateNumbers(usedNumbers: number[], cardValues: number[]): boolean {
// 必须使用4个数字
if (usedNumbers.length !== 4) {
return false;
}
// 创建副本进行排序和比较
const usedCopy = [...usedNumbers].sort((a, b) => a - b);
const cardCopy = [...cardValues].sort((a, b) => a - b);
... | https://github.com/NissonCX/CQU-HarmonyOS-AppDev-Course-Exp | 871cd6444939b2cd501b726573367bbc07db1e8c | github |
OHPG/FinSdk | jellyfin/src/main/ets/api/ItemsApi.ets | arkts | getItems | getItems
@summary Gets items based on a query.
@param {ItemsApiGetItemsRequest} requestParameters Request parameters.
@param {*} [options] Override http request option.
@throws {RequiredError}
@memberof ItemsApi | public async getItems(requestParameters: ItemsApiGetItemsRequest = {}): Promise<BaseItemDtoQueryResult> {
return this.apiClient.get({path: "/Items", parameters: requestParameters})
} | 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 getItems AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right AST#:#Le... | public async getItems(requestParameters: ItemsApiGetItemsRequest = {}): Promise<BaseItemDtoQueryResult> {
return this.apiClient.get({path: "/Items", parameters: requestParameters})
} | https://github.com/OHPG/FinSdk | 4d49e663c1a89c8687d974e99a93173176183483 | github |
fbinba3955/Flymby | common/src/main/ets/video/AvManager.ets | arkts | report | 上报状态到播控中心 | public report(type: string, data: Record<string, Object>) {
if (this.mRegisterFinished === false) {
return;
}
switch (type) {
case 'play':
LogUtil.info(TAG, `Report : type = play, data = ${JSON.stringify(data)}`);
this.mCurrentPlayState = avSession.PlaybackState.PLAYBACK_STATE_... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left report AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AS... | public report(type: string, data: Record<string, Object>) {
if (this.mRegisterFinished === false) {
return;
}
switch (type) {
case 'play':
LogUtil.info(TAG, `Report : type = play, data = ${JSON.stringify(data)}`);
this.mCurrentPlayState = avSession.PlaybackState.PLAYBACK_STATE_... | https://github.com/fbinba3955/Flymby | d647c8c54fbeb253db6ff164e8ef1e49440f569a | github |
DaLongZhuaZi/NGF | ngf_framework/src/main/ets/utils/PerformanceMonitor.ets | arkts | measure | 测量两个打点之间的时间差 | measure(name: string, startMark: string, endMark: string): NGFPerformanceMeasure | null {
const start = this.marks.get(startMark);
const end = this.marks.get(endMark);
if (start === undefined || end === undefined) {
logger.warn(TAG, '测量失败: startMark=' + startMark + ', endMark=' + endMark);
ret... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left measure AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string... | measure(name: string, startMark: string, endMark: string): NGFPerformanceMeasure | null {
const start = this.marks.get(startMark);
const end = this.marks.get(endMark);
if (start === undefined || end === undefined) {
logger.warn(TAG, '测量失败: startMark=' + startMark + ', endMark=' + endMark);
ret... | https://github.com/DaLongZhuaZi/NGF | 5805c7466f174223d61b2d9954258a9690cdb51e | github |
awaLiny2333/Spaceow | woof/src/main/ets/components/GridSpace.ets | arkts | layoutAllOnes | 当所有文件大小为零或缩放失败时,将所有文件以边长为 1 的正方形平铺
(按从左到右、从上到下的顺序填充,保证不重叠且不超过棋盘) | function layoutAllOnes(files: meowFile[], resolution: number): gridSpacePosition[] {
const result: gridSpacePosition[] = [];
const total = files.length;
const maxPerRow = resolution; // 每行最多放 resolution 个
for (let i = 0; i < total; i++) {
const row = Math.floor(i / maxPerRow);
const col = i % maxPerRow;... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left layoutAllOnes AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left files AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | function layoutAllOnes(files: meowFile[], resolution: number): gridSpacePosition[] {
const result: gridSpacePosition[] = [];
const total = files.length;
const maxPerRow = resolution; // 每行最多放 resolution 个
for (let i = 0; i < total; i++) {
const row = Math.floor(i / maxPerRow);
const col = i % maxPerRow;... | https://github.com/awaLiny2333/Spaceow/blob/d256e91c0feb34459ecf81ce388c749d614c3bfa/woof/src/main/ets/components/GridSpace.ets#L424-L438 | 3fe85218084fd25184e43b3498d7f3566be40c9d | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/Byte.ets | arkts | doubleValue | Returns value of this instance
@returns value as double | public override doubleValue(): double {
return this.value as double;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left doubleValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | public override doubleValue(): double {
return this.value as double;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 47ed39fba028665fd561c09acbca8a8bdbfd2dda | gitee |
ASweetBite/HarmonyPulse | entry/src/main/ets/utils/managers/RdbManager.ets | arkts | createPlaylist | ==================== 歌单 (Playlist) 操作 ====================
创建新歌单
@param name 歌单名称
@param img 封面图片路径
@returns 返回新生成的 playlistId | async createPlaylist(name: string, img: string): Promise<number> {
if (!this.rdbStore) return -1;
const value:ValuesBucket = {
name: name,
img: img
};
// 插入并返回自增的主键 ID
const rowId = await this.rdbStore.insert(this.tableNamePlaylist, value);
return rowId;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left createPlaylist AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left nam... | async createPlaylist(name: string, img: string): Promise<number> {
if (!this.rdbStore) return -1;
const value:ValuesBucket = {
name: name,
img: img
};
// 插入并返回自增的主键 ID
const rowId = await this.rdbStore.insert(this.tableNamePlaylist, value);
return rowId;
} | https://github.com/ASweetBite/HarmonyPulse/blob/a7fcf153a20bafa29ac1fb8c25743dd5350dc54c/entry/src/main/ets/utils/managers/RdbManager.ets#L254-L264 | bf158ee1b8653a16bddacd724590e732845708b0 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/HttpService.ets | arkts | postWithTimeout | POST 请求 (带超时配置) | async postWithTimeout(
url: string,
body: string,
headers: Record<string, string>,
timeout: number,
options?: HttpRequestRuntimeOptions
): Promise<HttpResponse> {
const config: HttpRequestConfig = {
url: url,
method: HttpMethod.POST,
headers: headers,
body: body,
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left postWithTimeout AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async postWithTimeout(
url: string,
body: string,
headers: Record<string, string>,
timeout: number,
options?: HttpRequestRuntimeOptions
): Promise<HttpResponse> {
const config: HttpRequestConfig = {
url: url,
method: HttpMethod.POST,
headers: headers,
body: body,
... | https://github.com/LongLiveY96/chatcube | c56c435ffe4cab25780d0e6634da85c0d78ddd82 | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/views/components/TopicBadges.ets | arkts | normalizeFaIconName | 话题/分类/标签的徽章与图标映射
说明:
- Discourse 分类 icon 字段通常是 FontAwesome 名称或 css-like class(如 "fa-solid fa-code")。
- 鸿蒙端优先用系统 SymbolGlyph 做近似映射;未知 icon 退化为 null,由调用方决定兜底(logo/lock/dot)。 | function normalizeFaIconName(raw: string | null): string {
if (raw === null) return '';
const s: string = raw.trim().toLowerCase();
if (s.length === 0) return '';
// 解析 css-like class:fa-solid fa-code / fas fa-code 等
const tokens: string[] = s.split(/\s+/);
let last: string = '';
for (let i = 0; i < toke... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left normalizeFaIconName AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left raw AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | function normalizeFaIconName(raw: string | null): string {
if (raw === null) return '';
const s: string = raw.trim().toLowerCase();
if (s.length === 0) return '';
// 解析 css-like class:fa-solid fa-code / fas fa-code 等
const tokens: string[] = s.split(/\s+/);
let last: string = '';
for (let i = 0; i < toke... | https://github.com/Amaz1ny/HarmonyDO-public | 73cc999c29e9dc52d4985f7f9be54e5ba87169d2 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/WebDAVSyncService.ets | arkts | importLocal | 从本地 zip 执行导入 | async importLocal(
localPath: string,
options: ImportOptions,
onProgress?: SyncProgressCallback
): Promise<SyncImportResult> {
const startTime = Date.now()
try {
const result = await ImportExportService.getInstance().importData(localPath, options, (pct: number) => {
if (onProgress ... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left importLocal AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left localPath AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async importLocal(
localPath: string,
options: ImportOptions,
onProgress?: SyncProgressCallback
): Promise<SyncImportResult> {
const startTime = Date.now()
try {
const result = await ImportExportService.getInstance().importData(localPath, options, (pct: number) => {
if (onProgress ... | https://github.com/LongLiveY96/chatcube | dade4959529cfa4fba6e7c0527c611b736243de7 | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/utils/CartManager.ets | arkts | toggleSelection | Toggle selection status. | static async toggleSelection(cartId: number): Promise<void> {
let newCartList: ICartItemData[] = [];
for (let i = 0; i < cachedCartList.length; i++) {
if (cachedCartList[i].cartId === cartId) {
let newItem: ICartItemData = {
cartId: cachedCartList[i].cartId,
quantity: cachedC... | 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 toggleSelection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cartId AST#identifier#Right AST#:#Left :... | static async toggleSelection(cartId: number): Promise<void> {
let newCartList: ICartItemData[] = [];
for (let i = 0; i < cachedCartList.length; i++) {
if (cachedCartList[i].cartId === cartId) {
let newItem: ICartItemData = {
cartId: cachedCartList[i].cartId,
quantity: cachedC... | https://github.com/Harrisonls2004/WaterFlow | ae391f11e0b85c30e5d88b53e7cd0d96939367e6 | github |
openharmony-sig/ohos_easyui | easyui/src/main/ets/common/components/CustomCalendar.ets | arkts | selectDay | 点击选择日期 | selectDay(e:any){//e可能是整数或者字符串
// if(!e) return;
if(e.label == 'last'){
this.cutMonth(-1);
}
if(e.label == 'next'){
this.cutMonth(1);
}
this.isSelectDay = e.time;
console.log(this.isSelectDay)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left selectDay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left any AST#identifier#Right AST#)#Lef... | selectDay(e:any){//e可能是整数或者字符串
// if(!e) return;
if(e.label == 'last'){
this.cutMonth(-1);
}
if(e.label == 'next'){
this.cutMonth(1);
}
this.isSelectDay = e.time;
console.log(this.isSelectDay)
} | https://gitee.com/openharmony-sig/ohos_easyui.git | 8ec04a12284166223ad982706939538d460cb19d | gitee |
the-wwyang/kids-learning-app | src/main/ets/storage/AchievementManager.ets | arkts | checkAndUpdateAchievements | 检查并更新成就进度 | public async checkAndUpdateAchievements(): Promise<AchievementUnlockedEvent[]> {
const currentUser = appStorage.getCurrentUser();
if (currentUser === null) {
return [];
}
const achievements = await this.getUserAchievements();
const unlockedEvents: AchievementUnlockedEvent[] = [];
// 检查... | 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 checkAndUpdateAchievements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | public async checkAndUpdateAchievements(): Promise<AchievementUnlockedEvent[]> {
const currentUser = appStorage.getCurrentUser();
if (currentUser === null) {
return [];
}
const achievements = await this.getUserAchievements();
const unlockedEvents: AchievementUnlockedEvent[] = [];
// 检查... | https://github.com/the-wwyang/kids-learning-app | 8f9802080de83e5abbf825f748ecc80dc79ead5c | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Short.ets | arkts | add | Performs shortegral addition of this instance with provided one, returns the result as new instance
@param { Short } other Right hand side of the addition
@returns { Short } Result of the addition
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public add(other: Short): Short {
return new Short((this.value + other.toShort()).toShort())
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left add AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO... | public add(other: Short): Short {
return new Short((this.value + other.toShort()).toShort())
} | https://gitcode.com/iop123123/arkts-static-skills | 93cfcba6d7d58d241f5614bb696d2ea79134987f | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets | arkts | keySet | Returns map keys as set
@returns { Set<K> } A new set instance containing all of the keys
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public keySet(): Set<K> {
let res = new Set<K>()
for (let key of this.keys()) {
res.add(key)
}
return res
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left keySet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#iden... | public keySet(): Set<K> {
let res = new Set<K>()
for (let key of this.keys()) {
res.add(key)
}
return res
} | https://gitcode.com/iop123123/arkts-static-skills | 50859d5be0ad746c4f0c640e09094971b11b326c | gitcode |
Tlntin/home-cloud-shield | entry/src/main/ets/data/DnsLogDb.ets | arkts | maxTs | Newest ts already stored for an origin; used as the ingest watermark so a
full re-scan after launch / log rotation re-inserts only genuinely new rows. | async maxTs(origin: string): Promise<number> {
if (this.store === undefined) {
return 0;
}
try {
const rs = await this.store.querySql(`SELECT COALESCE(MAX(ts), 0) AS m FROM ${TABLE} WHERE origin = ?`, [origin]);
let out: number = 0;
if (rs.goToNextRow()) {
out = rs.getLong(... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left maxTs AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left origin AST#identifier#Right AST#type_an... | async maxTs(origin: string): Promise<number> {
if (this.store === undefined) {
return 0;
}
try {
const rs = await this.store.querySql(`SELECT COALESCE(MAX(ts), 0) AS m FROM ${TABLE} WHERE origin = ?`, [origin]);
let out: number = 0;
if (rs.goToNextRow()) {
out = rs.getLong(... | https://github.com/Tlntin/home-cloud-shield/blob/bfd8d549ccb3e55bdfc30fa7687b31d52e4c1cc0/entry/src/main/ets/data/DnsLogDb.ets#L147-L162 | 3428821ce02c5605f8ccbaddbf424f757f0b41b8 | github |
Tencent-RTC/TUIKit_Harmony | atomic_x/src/main/ets/basecomponent/utils/IMErrorCode.ets | arkts | isNetworkError | Check if error code indicates network issue
@param code Error code
@returns true if it's a network related error | static isNetworkError(code: number): boolean {
return code >= IMErrorCode.ERR_SDK_NET_ENCODE_FAILED &&
code <= IMErrorCode.ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isNetworkError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left n... | static isNetworkError(code: number): boolean {
return code >= IMErrorCode.ERR_SDK_NET_ENCODE_FAILED &&
code <= IMErrorCode.ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK;
} | https://github.com/Tencent-RTC/TUIKit_Harmony | 94a3caf119045b049a78a17774444ae03fd51d89 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | toString | Get session info string for logging | toString(): string {
return `SessionState[instance=${this.instance}, ` +
`state=${ConnectionState[this.connectionState]}, ` +
`${this.desktopWidth}x${this.desktopHeight}@${this.colorDepth}bpp, ` +
`updates=${this.updateCount}]`;
} | 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 `SessionState[instance=${this.instance}, ` +
`state=${ConnectionState[this.connectionState]}, ` +
`${this.desktopWidth}x${this.desktopHeight}@${this.colorDepth}bpp, ` +
`updates=${this.updateCount}]`;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 1d65c6c3a000f4cfb3fd96c4461f997deff88cf7 | github |
zcg741/chengyu-game | entry/src/main/ets/viewmodel/GameViewModel.ets | arkts | loadNextQuestion | 加载下一题(动态难度调整) | loadNextQuestion(): void {
// 根据最近答题表现动态选题型
const randomType = pickDynamicQuestionType(this.recentResults, this.totalGamesBeforeStart);
let chengyuList: ChengyuWithIndex[] = [];
// 接龙模式:找首字匹配的成语
if (randomType === QUESTION_TYPE.DRAGON && this.prevChengyuLastChar) {
const allMatches = getCh... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadNextQuestion AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | loadNextQuestion(): void {
// 根据最近答题表现动态选题型
const randomType = pickDynamicQuestionType(this.recentResults, this.totalGamesBeforeStart);
let chengyuList: ChengyuWithIndex[] = [];
// 接龙模式:找首字匹配的成语
if (randomType === QUESTION_TYPE.DRAGON && this.prevChengyuLastChar) {
const allMatches = getCh... | https://github.com/zcg741/chengyu-game | f18f6f247c4002fb4f9d8728e627ead1ff85ca7c | github |
PollenWang6/HiXD | entry/src/main/ets/pages/MainPage.ets | arkts | loadClassPreview | 加载课表预览数据:读取本地缓存 → 解析classGrid → 提取接下来2节课 | loadClassPreview(): void {
console.error('Preview', 'loadClassPreview called');
try {
const semesterCode: string = SemesterUtil.getCurrentSemesterCode();
const filePath: string = this.context.filesDir + '/class_table_' + semesterCode + '.json';
if (!fileIo.accessSync(filePath)) {
thi... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadClassPreview AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | loadClassPreview(): void {
console.error('Preview', 'loadClassPreview called');
try {
const semesterCode: string = SemesterUtil.getCurrentSemesterCode();
const filePath: string = this.context.filesDir + '/class_table_' + semesterCode + '.json';
if (!fileIo.accessSync(filePath)) {
thi... | https://github.com/PollenWang6/HiXD | 256e82592388333b05d3c53b9a033b1a05eeb2f5 | github |
HarmonyOS_Samples/MusicHome | features/recommendation/src/main/ets/view/HomeFloatingMiniBar.ets | arkts | build | Wraps {@link HomeMiniBarPlayer} with full width and immersive-aware chrome. | build() {
Column() {
HomeMiniBarPlayer({ showPreviousTrack: true, followAppMiniBarExpanded: false })
}
.width(StyleConstants.FULL_WIDTH)
.backgroundColor(
this.windowInfo.immersiveDecor === ImmersiveType.IMMERSIVE ?
$r('app.color.pc_floating_mini_bar_immersive_surface') :
$... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
HomeMiniBarPlayer({ showPreviousTrack: true, followAppMiniBarExpanded: false })
}
.width(StyleConstants.FULL_WIDTH)
.backgroundColor(
this.windowInfo.immersiveDecor === ImmersiveType.IMMERSIVE ?
$r('app.color.pc_floating_mini_bar_immersive_surface') :
$... | https://gitcode.com/HarmonyOS_Samples/MusicHome | 28788a4ae630cb581b7f8f83417af6166d921968 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/ScraperManager.ets | arkts | isSourceEnabled | 检查刮削源是否启用 | public isSourceEnabled(source: ScraperSource): boolean {
return this.enabledSources.has(source);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isSourceEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public isSourceEnabled(source: ScraperSource): boolean {
return this.enabledSources.has(source);
} | https://github.com/DaLongZhuaZi/manxia | 52dc2345cac76c4590d1a20e813d864600643ea9 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test5_original_index.ets | arkts | testSetTimeout | === Timer Patterns === | function testSetTimeout(): number {
let counter: number = 0;
counter = 42;
return counter;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testSetTimeout AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_t... | function testSetTimeout(): number {
let counter: number = 0;
counter = 42;
return counter;
} | https://github.com/miaochiahao/ark-ghidra | 67336b9005c31db991aa51d5c018dc611cb2bd29 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/skill/utils/SkillTestTool.ets | arkts | testRiskAssessment | 测试风险评估意图 | private async testRiskAssessment(): Promise<void> {
const testName = '风险评估';
try {
const result = await this.skill.handleQuickCommand('评估风险');
const passed = result.ttsText.includes('评估') || result.ttsText.includes('风险');
this.addResult(testName, '评估风险', passed, result);
} ca... | 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 testRiskAssessment AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async testRiskAssessment(): Promise<void> {
const testName = '风险评估';
try {
const result = await this.skill.handleQuickCommand('评估风险');
const passed = result.ttsText.includes('评估') || result.ttsText.includes('风险');
this.addResult(testName, '评估风险', passed, result);
} ca... | https://github.com/LJ666-ui/harmony-health-care | 0f664006939c9ae5788ebec97ac510c28c2146d2 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ai/AIOrchestrator.ets | arkts | processRequest | 统一处理请求(主入口) | async processRequest(request: AIRequest): Promise<AIResponse> {
const startTime = Date.now();
console.info(`[AI-Orch] 处理请求: type=${request.type}, source=${request.source || 'unknown'}`);
try {
let response: AIResponse;
switch (request.type) {
case 'voice_command':
response... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left processRequest AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left request AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async processRequest(request: AIRequest): Promise<AIResponse> {
const startTime = Date.now();
console.info(`[AI-Orch] 处理请求: type=${request.type}, source=${request.source || 'unknown'}`);
try {
let response: AIResponse;
switch (request.type) {
case 'voice_command':
response... | https://github.com/LJ666-ui/harmony-health-care | f6db786ab8ca89514fd52b532cb5becf9291ff31 | github |
openharmony/applications_filepicker | audiopicker/src/main/ets/basemvvm/AbsBaseViewData.ets | arkts | isEmpty | 设置数据是否为空,涉及nodata页面展示
@return 数据是否为空 | public isEmpty(): boolean {
return this.liveData.length === 0;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isEmpty 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#boole... | public isEmpty(): boolean {
return this.liveData.length === 0;
} | https://gitee.com/openharmony/applications_filepicker.git | 8caa4c690c32444fc08fc639c0a49d0ef4150fd0 | gitee |
openharmony/arkui_advanced_ui_component | customappbar/source/custom_app_bar.ets | arkts | setAppIcon | 标题栏图标回调
@param pixelMap 元服务的睫毛图 | setAppIcon(pixelMap) {
this.icon = pixelMap;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setAppIcon AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left pixelMap AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expr... | setAppIcon(pixelMap) {
this.icon = pixelMap;
} | https://gitee.com/openharmony/arkui_advanced_ui_component.git | 6a78a882f166b58f7f4c09b1dedb0ad2d66b0a07 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | setMonth | Sets the month for a specified date according to the currently set year.
@param month new month | public setMonth(month: number): void {
this.setMonth(month as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMonth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left month AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number... | public setMonth(month: number): void {
this.setMonth(month as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d80e1080b53456b8f5b401d572a42923b9217107 | gitee |
JackJiang2011/harmonychat | entry/src/main/ets/pages/model/Message.ets | arkts | createChatMsgEntity_INCOME_SYSTEAMINFO | 构建一条系统消息对象。
@param senderId 单聊请填uid、群聊请用gid
@param message 消息内容
@param time 消息时间戳,0表示使用当前系统时间戳
@returns 新的消息对象 | static createChatMsgEntity_INCOME_SYSTEAMINFO(senderId: string, message: string, time: number): Message {
// 生成一个fp吧,这个只用于LayzyForEach时方便ui刷新逻辑时使用,别无他用!
return new Message(senderId, Protocal.genFingerPrint(), time, message, MsgType.TYPE_SYSTEAM$INFO);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createChatMsgEntity_INCOME_SYSTEAMINFO AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left senderId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#strin... | static createChatMsgEntity_INCOME_SYSTEAMINFO(senderId: string, message: string, time: number): Message {
// 生成一个fp吧,这个只用于LayzyForEach时方便ui刷新逻辑时使用,别无他用!
return new Message(senderId, Protocal.genFingerPrint(), time, message, MsgType.TYPE_SYSTEAM$INFO);
} | https://github.com/JackJiang2011/harmonychat | 7238d3cb195bb2a21e28efa841cb290a44e6bf5b | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | getUTCHours | Returns the hours in the specified date according to universal time.
@returns { int } get new date hour value
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public getUTCHours(): int {
return ecmaHourFromTime(this.ms);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getUTCHours 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 int AST#id... | public getUTCHours(): int {
return ecmaHourFromTime(this.ms);
} | https://gitcode.com/iop123123/arkts-static-skills | 75483db075c5bc9124e45d91309381e3edbb6033 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoSourceParser.ets | arkts | validate | 验证书源配置 | validate(source?: LegadoBookSource): boolean {
const s = source || this.source;
if (!s) {
return false;
}
// 必须有书源URL和名称
if (!s.bookSourceUrl || !s.bookSourceName) {
logger.warn(TAG, '书源验证失败: 缺少bookSourceUrl或bookSourceName');
return false;
}
// 必须有搜索URL或发现URL
if (!s... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left validate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left LegadoBookSource AST... | validate(source?: LegadoBookSource): boolean {
const s = source || this.source;
if (!s) {
return false;
}
// 必须有书源URL和名称
if (!s.bookSourceUrl || !s.bookSourceName) {
logger.warn(TAG, '书源验证失败: 缺少bookSourceUrl或bookSourceName');
return false;
}
// 必须有搜索URL或发现URL
if (!s... | https://github.com/DaLongZhuaZi/manxia | fc53abdab85d4701c530fceeac60d4519f10cdc4 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceSelectorEngine.ets | arkts | executeCompositeSelector | 构建复合选择器
支持多个选择器的组合查询 | async executeCompositeSelector(
selectors: Selector[],
operator: 'AND' | 'OR',
context: SelectorContext,
executeJS: (script: string) => Promise<Object>
): Promise<SelectorResult> {
const results: SelectorResult[] = [];
for (const selector of selectors) {
const result = await this.... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left executeCompositeSelector AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left selectors AST#identifier#Right AST#type_annotation#Lef... | async executeCompositeSelector(
selectors: Selector[],
operator: 'AND' | 'OR',
context: SelectorContext,
executeJS: (script: string) => Promise<Object>
): Promise<SelectorResult> {
const results: SelectorResult[] = [];
for (const selector of selectors) {
const result = await this.... | https://github.com/DaLongZhuaZi/manxia | 2e11a2f84b72a851d2d814da9c2d49d41d6d3eeb | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | map | Creates a new Float64Array using fn(arr[i]) over all elements of current Float64Array
@param fn a function to apply for each element of current Float64Array
@returns a new Float64Array where for each element from current Float64Array fn was applied | public map(fn: (val: number) => number): Float64Array {
let newF: (val: double, index: int) => double =
(val: double, index: int): double => { return fn(val as double as number) as double as int as double }
return this.map(newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right... | public map(fn: (val: number) => number): Float64Array {
let newF: (val: double, index: int) => double =
(val: double, index: int): double => { return fn(val as double as number) as double as int as double }
return this.map(newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 14c1cce5056ce00532483165ffaa3e1c593a1a7b | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceManager.ets | arkts | updateSourceGroup | ==================== 分组管理功能 ====================
更新书源分组 | async updateSourceGroup(sourceId: string, group: string): Promise<boolean> {
const source = this.sources.get(sourceId);
if (!source) {
return false;
}
source.bookSourceGroup = group;
// 更新数据库
try {
const dataManager = getNovelDataManager();
await dataManager.saveSou... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateSourceGroup AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#... | async updateSourceGroup(sourceId: string, group: string): Promise<boolean> {
const source = this.sources.get(sourceId);
if (!source) {
return false;
}
source.bookSourceGroup = group;
// 更新数据库
try {
const dataManager = getNovelDataManager();
await dataManager.saveSou... | https://github.com/DaLongZhuaZi/manxia | 85fc3b61c87ad31e82a76570112565f3c17e82ff | github |
arkui-x/samples | CodeLab/Cases/feature/applicationexception/src/main/ets/model/PreferencesManager.ets | arkts | getPreferences | 获取Preferences实例 | public static async getPreferences(faultDataSource: FaultDataSource): Promise<void> {
logger.info(TAG, 'getPreferences start.');
try {
// 获取异常信息
await PreferencesManager.getFaultMessage(faultDataSource);
await PreferencesManager.getFaultSign();
} catch (err) {
logger.error(TAG, "Fa... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left getPreferences AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left fau... | public static async getPreferences(faultDataSource: FaultDataSource): Promise<void> {
logger.info(TAG, 'getPreferences start.');
try {
// 获取异常信息
await PreferencesManager.getFaultMessage(faultDataSource);
await PreferencesManager.getFaultSign();
} catch (err) {
logger.error(TAG, "Fa... | https://gitcode.com/arkui-x/samples | 693e15e4860cd7908a861a9741dbd62a46c35a5c | gitcode |
wuba/omni-ui | omni_component/src/main/ets/components/popup/Builder.ets | arkts | setArrowOffset | 设置箭头偏移量,气泡弹窗有效
@param arrowOffset
@returns | setArrowOffset(arrowOffset: number): Builder {
this.popupConfig.arrowOffset = arrowOffset
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setArrowOffset AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left arrowOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) A... | setArrowOffset(arrowOffset: number): Builder {
this.popupConfig.arrowOffset = arrowOffset
return this
} | https://github.com/wuba/omni-ui | 009cb93db94bc1e7204648799564b1b3f0a08253 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/ThemeService.ets | arkts | getThemeInfo | 获取当前主题信息 | getThemeInfo(): ThemeInfo {
return getThemeById(this.currentTheme)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getThemeInfo 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 ThemeInfo AST#identifier#Right AST#ERROR#Right AS... | getThemeInfo(): ThemeInfo {
return getThemeById(this.currentTheme)
} | https://github.com/LongLiveY96/chatcube | 21eba3ca35a433bdeda9f66ff9d7f829b6c73c2d | github |
Cool_foolisher1/ArkTSRepository | GuardianAssistant/entry/src/main/ets/manager/ThemeManager.ets | arkts | settingStatusBarWhite | 设置状态栏为白色 | settingStatusBarWhite() {
this.settingStatusBar({ statusBarContentColor: '#FFFFFF' })
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left settingStatusBarWhite AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_bl... | settingStatusBarWhite() {
this.settingStatusBar({ statusBarContentColor: '#FFFFFF' })
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | bc58a215e533d476ac512b905ab4143729ca9de7 | gitcode |
openharmony/arkui_ace_engine | advanced_ui_component/multinavigation/source/multinavigation.ets | arkts | isPhone | whether the device type is phone
@returns true if is phone | static isPhone(): boolean {
return (DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_PHONE ||
DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_DEFAULT);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isPhone 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#boole... | static isPhone(): boolean {
return (DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_PHONE ||
DeviceHelper.DEVICE_TYPE === DeviceHelper.TYPE_DEFAULT);
} | https://gitee.com/openharmony/arkui_ace_engine.git | aaffeb491c431be7c85514454757758e3ed1761b | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets | arkts | parseInt | parseInt(String) parses from String an integer of radix 10
@returns the result of parsing
@param { String } s the string to convert
@returns { double } the result of parsing
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static parseInt(s: String): double {
return Double.parseIntCore(s, 0);
} | 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 parseInt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left s AST#identifier#Right AST#:#Left : AST#:#Righ... | public static parseInt(s: String): double {
return Double.parseIntCore(s, 0);
} | https://gitcode.com/iop123123/arkts-static-skills | 5c9aa91487ebda046a248e013b7d9bd87092ed61 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/SmartBudgetService.ets | arkts | generateBudgetAdvices | 生成预算建议(集成个性化阈值) | private static async generateBudgetAdvices(
userId: number,
historicalData: CategoryHistoricalData[],
categoryBudgets: CategoryBudgetAllocation[],
personalizedThresholds?: PersonalizedThresholds
): Promise<BudgetAdvice[]> {
const advices: BudgetAdvice[] = [];
const currentBudgets = await Bud... | 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 generateBudgetAdvices AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifie... | private static async generateBudgetAdvices(
userId: number,
historicalData: CategoryHistoricalData[],
categoryBudgets: CategoryBudgetAllocation[],
personalizedThresholds?: PersonalizedThresholds
): Promise<BudgetAdvice[]> {
const advices: BudgetAdvice[] = [];
const currentBudgets = await Bud... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 0237b8f28f614bf1a61b69e8e4114d041e4250bc | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/StreamingSession.ets | arkts | getEffectiveConfig | ---------------------------------------------------------------------------
配置与状态查询
--------------------------------------------------------------------------- | getEffectiveConfig(): StreamConfig | null {
return this.config;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getEffectiveConfig 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#id... | getEffectiveConfig(): StreamConfig | null {
return this.config;
} | https://github.com/AlkaidLab/moonlight-harmony | 8a0d7f086e02de1da280a71de318a70af9b1b433 | github |
XJTUWYD/ArkDiff | entry/src/main/ets/viewmodel/DiffSessionViewModel.ets | arkts | generateUnifiedDiff | ==================== 导出 ====================
生成 Unified Diff 格式文本 | generateUnifiedDiff(): string {
if (!this.diffResult) return '';
const headerA = this.fileNameA || '文件A';
const headerB = this.fileNameB || '文件B';
let output = `--- ${headerA}\n+++ ${headerB}\n`;
for (let line of this.diffResult.unifiedLines) {
switch (line.type) {
case 0: output +=... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left generateUnifiedDiff 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#st... | generateUnifiedDiff(): string {
if (!this.diffResult) return '';
const headerA = this.fileNameA || '文件A';
const headerB = this.fileNameB || '文件B';
let output = `--- ${headerA}\n+++ ${headerB}\n`;
for (let line of this.diffResult.unifiedLines) {
switch (line.type) {
case 0: output +=... | https://github.com/XJTUWYD/ArkDiff | 9bf210313c3081cc22f5ea0f1757660b8a1e102d | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/components/parts/Homepage/more/MeowWindowInfoBar.ets | arkts | focusInput | Focus input! | focusInput() {
try {
this.getUIContext().getFocusController().requestFocus(this.searchInputId);
} catch (e) {
meow(`this.getUIContext().getFocusController().requestFocus("${this.searchInputId}"); failed: ${e}`, 'MeowWindowInfoBar', meowLevel.ERROR);
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left focusInput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | focusInput() {
try {
this.getUIContext().getFocusController().requestFocus(this.searchInputId);
} catch (e) {
meow(`this.getUIContext().getFocusController().requestFocus("${this.searchInputId}"); failed: ${e}`, 'MeowWindowInfoBar', meowLevel.ERROR);
}
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | ed8cc8737ea1dac8c04d8d17aa59b71e71b7f46d | github |
CLMC2025/Vignette | entry/src/main/ets/manager/UserStateManager.ets | arkts | getUserLevel | 获取用户级别 | getUserLevel(): UserLevel {
return this.currentUserLevel;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getUserLevel 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 UserLevel AST#identifier#Right AST#ERROR#Right AS... | getUserLevel(): UserLevel {
return this.currentUserLevel;
} | https://github.com/CLMC2025/Vignette | 8d7e68534c0bd0231e153d420fd1cf18ee60b9b5 | github |
tdcare/tdwebrtc | src/main/ets/utils/LogUtil.ets | arkts | error | 打印ERROR级别日志
@param args | static error(...args: string[] | object[]): void {
LogUtil.uniLog(args, hilog.LogLevel.ERROR);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left error AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left arg... | static error(...args: string[] | object[]): void {
LogUtil.uniLog(args, hilog.LogLevel.ERROR);
} | https://github.com/tdcare/tdwebrtc | 83a0d61aea4e9bc34a4fe1f6416ce00437db0da4 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | from | Creates an array from an array-like or iterable object.
@param { ArrayLike<number> } arrayLike - An array-like or iterable object to convert to an array.
@returns { Float64Array } - A new Float64Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arrayLike: ArrayLike<number>): Float64Array {
return Float64Array.from<number>(arrayLike, (x: number, k: number): number => x)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arrayLike AST#identifie... | public static from(arrayLike: ArrayLike<number>): Float64Array {
return Float64Array.from<number>(arrayLike, (x: number, k: number): number => x)
} | https://gitcode.com/iop123123/arkts-static-skills | b2cfdf9f610f61adf48fc5df0da6c25ffd37c29e | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/NovelSearchPage.ets | arkts | getSourcesWithResults | 获取有结果的书源列表 | getSourcesWithResults(): SourceSearchResult[] {
return this.sourceResults.filter(s => s.results.length > 0);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getSourcesWithResults AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressi... | getSourcesWithResults(): SourceSearchResult[] {
return this.sourceResults.filter(s => s.results.length > 0);
} | https://github.com/DaLongZhuaZi/manxia | 3fc6002f7ae73f5ea20f85175f735665006723fa | github |
Luxcis/PicACG_Next | entry/src/main/ets/utils/Http.ets | arkts | httpInterceptorsRequest | 请求拦截器 | private static httpInterceptorsRequest() {
HttpUtil.instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
// 对请求数据做点什么
config.headers[StorageKey.TOKEN] = AppStorage.get(StorageKey.TOKEN)
let signUrl = config.url
if (config.params !== undefined) {
signUrl += '?... | 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 httpInterceptorsRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressio... | private static httpInterceptorsRequest() {
HttpUtil.instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
// 对请求数据做点什么
config.headers[StorageKey.TOKEN] = AppStorage.get(StorageKey.TOKEN)
let signUrl = config.url
if (config.params !== undefined) {
signUrl += '?... | https://github.com/Luxcis/PicACG_Next | 27affcd178ccfeffb8529d8473b6e660d27605f6 | github |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.SubHeaderV2.ets | arkts | getStringByResource | get resource string
@Param resourceId resource id
@Param defaultString default value
@returns resource string | public static getStringByResource(resourceId: long, defaultString: string): string {
try {
let resourceString: string = resourceManager.getSysResourceManager().getStringSync(resourceId);
if (resourceString === '') {
return defaultString;
} else {
return resourceString;
}
... | 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 getStringByResource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left resourceId AST#identifier#Right AST#ERROR#Left AST... | public static getStringByResource(resourceId: long, defaultString: string): string {
try {
let resourceString: string = resourceManager.getSysResourceManager().getStringSync(resourceId);
if (resourceString === '') {
return defaultString;
} else {
return resourceString;
}
... | https://gitcode.com/openharmony/arkui_ace_engine | ac6767e9d368e05772dd5c52ee410becabf813d0 | gitcode |
openharmony-tpc/VCard | library/src/main/ets/components/VCardBuilder.ets | arkts | appendUncommonPhoneType | Appends phone type string which may not be available in some devices. | private appendUncommonPhoneType(builder: StringBuilder, type: number): void {
if (this.mIsDoCoMo) {
// The previous implementation for DoCoMo had been conservative
// about miscellaneous types.
builder.append(VCardConstants.PARAM_TYPE_VOICE);
} else {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left appendUncommonPhoneType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left builder AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id... | private appendUncommonPhoneType(builder: StringBuilder, type: number): void {
if (this.mIsDoCoMo) {
// The previous implementation for DoCoMo had been conservative
// about miscellaneous types.
builder.append(VCardConstants.PARAM_TYPE_VOICE);
} else {
... | https://gitee.com/openharmony-tpc/VCard.git | 9095831d3d985508bdf5f047371991d93e88aa34 | gitee |
chendi126/harmonyOS-TCP | entry/src/main/ets/common/GlassStyles.ets | arkts | getBodyTextColor | 获取正文颜色 | static getBodyTextColor(): string {
return '#5D6D7E';
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getBodyTextColor 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 AS... | static getBodyTextColor(): string {
return '#5D6D7E';
} | https://github.com/chendi126/harmonyOS-TCP | df302045ba281d31b032e08e3f5f0a28791bd1a3 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/UserAgentManager.ets | arkts | getDefaultUserAgent | 获取默认User-Agent | getDefaultUserAgent(): string {
return DEFAULT_USER_AGENTS.MOBILE_CHROME;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDefaultUserAgent 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#st... | getDefaultUserAgent(): string {
return DEFAULT_USER_AGENTS.MOBILE_CHROME;
} | https://github.com/DaLongZhuaZi/manxia | f153174a5274b084f6d6b4fcb6dba5e63d145ee4 | github |
wgli-collab/qs-arkts | entry/src/main/ets/pages/Index.ets | arkts | t14_arrayFormats | T14: Array format options | t14_arrayFormats(): void {
const obj: Record<string, Object> = {} as Record<string, Object>;
obj['a'] = ['1', '2', '3'] as Object;
const soptsIdx: StringifyOptions = { arrayFormat: 'indices' };
const soptsBrk: StringifyOptions = { arrayFormat: 'brackets' };
const soptsRep: StringifyOptions = { arr... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left t14_arrayFormats AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | t14_arrayFormats(): void {
const obj: Record<string, Object> = {} as Record<string, Object>;
obj['a'] = ['1', '2', '3'] as Object;
const soptsIdx: StringifyOptions = { arrayFormat: 'indices' };
const soptsBrk: StringifyOptions = { arrayFormat: 'brackets' };
const soptsRep: StringifyOptions = { arr... | https://github.com/wgli-collab/qs-arkts | 16f496d577498751e263320f2ef4326a245c03a1 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/TagDAO.ets | arkts | getBillTagsByUserId | 获取用户的所有账单标签关联
@param userId 用户ID
@returns 账单标签关联数组 | static async getBillTagsByUserId(userId: number): Promise<Array<BillTag>> {
const store = DatabaseManager.getDatabase();
const sql = `
SELECT bt.*
FROM bill_tags bt
INNER JOIN bills b ON bt.bill_id = b.bill_id
WHERE b.user_id = ? AND b.is_deleted = 0
ORDER BY bt.created_at DESC
... | 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 getBillTagsByUserId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Le... | static async getBillTagsByUserId(userId: number): Promise<Array<BillTag>> {
const store = DatabaseManager.getDatabase();
const sql = `
SELECT bt.*
FROM bill_tags bt
INNER JOIN bills b ON bt.bill_id = b.bill_id
WHERE b.user_id = ? AND b.is_deleted = 0
ORDER BY bt.created_at DESC
... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | b1eb917283f3467c8c3f2769f37cef7af235169f | github |
codelably/HCompass | core/network/src/main/ets/AxiosHttpClient.ets | arkts | logRequest | 记录请求日志 | private logRequest(method: string, url: string, options?: RequestOptions, data?: Unknown): void {
if (this.config.enableLog) {
Logger.info(`[${method}] ${url}`, TAG);
if (options?.params) {
Logger.info(`Params: ${JSON.stringify(options.params)}`, TAG);
}
if (data) {
Logger.... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left logRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left method AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | private logRequest(method: string, url: string, options?: RequestOptions, data?: Unknown): void {
if (this.config.enableLog) {
Logger.info(`[${method}] ${url}`, TAG);
if (options?.params) {
Logger.info(`Params: ${JSON.stringify(options.params)}`, TAG);
}
if (data) {
Logger.... | https://github.com/codelably/HCompass | 50bcc2b17c771a0e2ba7b7d7efbc5241356c93da | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/kdbx/KdbxImportService.ets | arkts | importDatabase | 导入数据库文件
@param inputType | public static importDatabase(inputType?: ExportType) {
LocationParam.of({
mode: LocationMode.SELECT,
fileSuffix: KdbxImportService.createFileSuffix(inputType),
onLocation: (locationInfo: LocationInfo) => {
try {
KdbxImportService.handlerImport(locationInfo);
} catch (e)... | 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 importDatabase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inputType AST#identifier#Right AST#?#Lef... | public static importDatabase(inputType?: ExportType) {
LocationParam.of({
mode: LocationMode.SELECT,
fileSuffix: KdbxImportService.createFileSuffix(inputType),
onLocation: (locationInfo: LocationInfo) => {
try {
KdbxImportService.handlerImport(locationInfo);
} catch (e)... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxImportService.ets#L23-L37 | 193c02766eda489190d26e355c32e53f1192fb98 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Adapters/UnifiedContentAdapter.ets | arkts | adapt | 根据内容类型获取适配后的统一内容 | static adapt(
contentType: UnifiedContentType,
originalData: Object,
chapters: Object[],
options: AdapterOptions = {}
): UnifiedContent | null {
try {
switch (contentType) {
case UnifiedContentType.MANGA:
return MangaAdapter.toUnifiedContent(
originalData as M... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left adapt AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left contentType AST#... | static adapt(
contentType: UnifiedContentType,
originalData: Object,
chapters: Object[],
options: AdapterOptions = {}
): UnifiedContent | null {
try {
switch (contentType) {
case UnifiedContentType.MANGA:
return MangaAdapter.toUnifiedContent(
originalData as M... | https://github.com/DaLongZhuaZi/manxia | 67fe995ace50ae3103264ee6c52fb845f28da674 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/UIContextManager.ets | arkts | isUIContextAvailable | 检查UI上下文是否可用 | public isUIContextAvailable(): boolean {
return this.uiContext !== null;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isUIContextAvailable 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 bool... | public isUIContextAvailable(): boolean {
return this.uiContext !== null;
} | https://github.com/DaLongZhuaZi/manxia | 131b489565371f473be8441ee21d54d7ffb95d8d | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getStatistics | 获取事件存储统计 | static async getStatistics(): Promise<EventStoreStats> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
// 获取总数
const countSql = `SELECT COUNT(*) as total FROM ${DomainEvent.tableName}`;
resultSet = await store.querySql(count... | 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 getStatistics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#... | static async getStatistics(): Promise<EventStoreStats> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
// 获取总数
const countSql = `SELECT COUNT(*) as total FROM ${DomainEvent.tableName}`;
resultSet = await store.querySql(count... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 4a04cf375ad7bc3546c8adf94e405c00d5ba07fe | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelSourceExecutor.ets | arkts | hasUnresolvedRuleTokens | 检查URL中是否仍包含未解析模板 | private hasUnresolvedRuleTokens(url: string): boolean {
if (!url) {
return false;
}
return NovelSourceExecutor.UNRESOLVED_RULE_TOKEN_PATTERN.test(url);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left hasUnresolvedRuleTokens AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | private hasUnresolvedRuleTokens(url: string): boolean {
if (!url) {
return false;
}
return NovelSourceExecutor.UNRESOLVED_RULE_TOKEN_PATTERN.test(url);
} | https://github.com/DaLongZhuaZi/manxia | 1e5749d8399e91bb86d277cdcfa486c5ea423bdd | github |
codelably/HCompass | packages/demo/src/main/ets/services/DemoNavSvcImpl.ets | arkts | toSafeAreaDemo | 跳转到安全区示例页
@returns {void} 无返回值 | toSafeAreaDemo(): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(DemoRoutes.SafeAreaDemo);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toSafeAreaDemo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_blo... | toSafeAreaDemo(): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(DemoRoutes.SafeAreaDemo);
} | https://github.com/codelably/HCompass | 575ea7d00e1b2d6f886d2e98962766620d7b1a1a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SuwayomiSource.ets | arkts | isConfigured | 检查是否已配置 | public isConfigured(): boolean {
return !!this.config.serverUrl;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isConfigured 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#... | public isConfigured(): boolean {
return !!this.config.serverUrl;
} | https://github.com/DaLongZhuaZi/manxia | 414d0d6e2c1b04ebf24783af4badd2e3d87d7197 | github |
jiwangyihao/FlameChase | entry/src/main/ets/utils/DesignSystem.ets | arkts | rgbToHex | Converts an RGB color object to a color resource. | static rgbToHex(color: ColorRGB): string {
const toHex = (n: number): string => {
// Clamp the value between 0 and 255
const clamped = Math.max(0, Math.min(255, n));
const hex = clamped.toString(16);
return hex.length === 1 ? '0' + hex : hex;
};
const hexColor = `#${toHex(color.a)... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left rgbToHex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ColorR... | static rgbToHex(color: ColorRGB): string {
const toHex = (n: number): string => {
// Clamp the value between 0 and 255
const clamped = Math.max(0, Math.min(255, n));
const hex = clamped.toString(16);
return hex.length === 1 ? '0' + hex : hex;
};
const hexColor = `#${toHex(color.a)... | https://github.com/jiwangyihao/FlameChase | fd767dc06df40b7dc7147df871f5d7b111c79303 | github |
openharmony-sig/applications_calculator | common/src/main/ets/util/CommonUtil.ets | arkts | checkFoldIsExpanded | Check whether the foldable phone is expanded.
@return {boolean} Whether the foldable phone is expanded. | static checkFoldIsExpanded(): boolean {
return display.getFoldStatus() === FOLD_STATUS_EXPANDED;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkFoldIsExpanded 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 boole... | static checkFoldIsExpanded(): boolean {
return display.getFoldStatus() === FOLD_STATUS_EXPANDED;
} | https://gitee.com/openharmony-sig/applications_calculator.git | 16f68a853f05bd4c8590b47df8658f478bd382dc | gitee |
Kira-Yagami-Light/Kira-Projects | TodoTask/entry/src/main/ets/data/repository/TaskRepository.ets | arkts | updateTask | 更新任务
@param task 任务模型
@returns Promise<boolean> 是否成功 | async updateTask(task: TaskListData): Promise<boolean> {
try {
const valueBucket = this.toValueBucket(task);
const updatedRows = await this.dao.update(task.id, valueBucket);
if (updatedRows > 0) {
Logger.info(this.LOG_TAG, `Task updated: ${task.id}`);
return true;
}
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateTask AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left task AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | async updateTask(task: TaskListData): Promise<boolean> {
try {
const valueBucket = this.toValueBucket(task);
const updatedRows = await this.dao.update(task.id, valueBucket);
if (updatedRows > 0) {
Logger.info(this.LOG_TAG, `Task updated: ${task.id}`);
return true;
}
... | https://github.com/Kira-Yagami-Light/Kira-Projects | e109f46e692db634c5ea925567a37d909afc3b42 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | isKeepPositionOnRotation | Returns true if keeping the position on rotation is enabled and false if not. | public isKeepPositionOnRotation(): boolean {
return this.mKeepPositionOnRotation;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isKeepPositionOnRotation 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 ... | public isKeepPositionOnRotation(): boolean {
return this.mKeepPositionOnRotation;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | fb634802e5368042180e6ff3180d74b9e32a2554 | gitee |
arkui-x/samples | CodeLab/Cases/feature/h5cache/src/main/ets/common/OfflineResourceManager.ets | arkts | fetchFromOfflineResource | 从离线包资源中取回数据
@param url 文件名
@param filesDir 离线包文件路径 | fetchFromOfflineResource(url: string, filesDir: string): null | ResponseDataType {
let srcFile = fs.openSync(filesDir + '/' + url, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
let stat = fs.statSync(filesDir + '/' + url);
let bufSize = stat.size;
// 如果资源不存在,直接返回null
if (bufSize === 0) {
re... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fetchFromOfflineResource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | fetchFromOfflineResource(url: string, filesDir: string): null | ResponseDataType {
let srcFile = fs.openSync(filesDir + '/' + url, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
let stat = fs.statSync(filesDir + '/' + url);
let bufSize = stat.size;
// 如果资源不存在,直接返回null
if (bufSize === 0) {
re... | https://gitcode.com/arkui-x/samples | 1fbe5416f0b91d21b265df929b87d29f6a634f43 | gitcode |
terryma2024/happyword | harmonyos/entry/src/main/ets/services/LearningRecorder.ets | arkts | beginSession | Reset per-session counters. Call when a new battle starts so the
ResultPage footer only counts words learned in THAT battle. | beginSession(): void {
this.sessionStartLearnedIds = this.computeLearnedIdSet();
this.sessionNewlyLearnedIds.clear();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left beginSession 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... | beginSession(): void {
this.sessionStartLearnedIds = this.computeLearnedIdSet();
this.sessionNewlyLearnedIds.clear();
} | https://github.com/terryma2024/happyword | a9488cc20dfbcfcf278826021a0e55a03c307734 | github |
LYM15/FireflyCompanion | entry/src/main/ets/pages/OrderDecPage.ets | arkts | filterOrderData | 单个对象,可能为空 | filterOrderData(orderId: string): OrderItemType | undefined {
return orderListData.find(item => item.orderID === orderId)
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left filterOrderData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left orderId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | filterOrderData(orderId: string): OrderItemType | undefined {
return orderListData.find(item => item.orderID === orderId)
} | https://github.com/LYM15/FireflyCompanion | 5f72780e95d3192b21c6b8396d899d9f919723e3 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/StreamLifecycleManager.ets | arkts | stopBackgroundTask | 停止后台保活服务
在串流结束时调用 | async stopBackgroundTask(): Promise<void> {
try {
await this.backgroundService.stop();
console.info('[StreamPage] 后台保活已停止');
} catch (err) {
console.warn('[StreamPage] 停止后台保活失败:', err);
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left stopBackgroundTask 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#g... | async stopBackgroundTask(): Promise<void> {
try {
await this.backgroundService.stop();
console.info('[StreamPage] 后台保活已停止');
} catch (err) {
console.warn('[StreamPage] 停止后台保活失败:', err);
}
} | https://github.com/AlkaidLab/moonlight-harmony | d7e2ab918cea74e929c55848010a826d57818762 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.