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 |
|---|---|---|---|---|---|---|---|---|---|---|
HarmonyOS_Samples/MultiVideoApplication | features/multivideosearch/src/main/ets/view/SearchHeader.ets | arkts | mainWindowInfoChange | Updates layout when window info changes. | mainWindowInfoChange() {
this.topAvoidHeight = this.getUIContext().px2vp(this.mainWindowInfo.avoidSystem?.topRect.height);
this.topAvoidHeight = Math.max(this.topAvoidHeight, 8);
if (this.windowUtil !== undefined) {
try {
this.decorWidth = this.windowUtil.mainWindow.getTitleButtonRect().widt... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left mainWindowInfoChange 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_blo... | mainWindowInfoChange() {
this.topAvoidHeight = this.getUIContext().px2vp(this.mainWindowInfo.avoidSystem?.topRect.height);
this.topAvoidHeight = Math.max(this.topAvoidHeight, 8);
if (this.windowUtil !== undefined) {
try {
this.decorWidth = this.windowUtil.mainWindow.getTitleButtonRect().widt... | https://gitcode.com/HarmonyOS_Samples/MultiVideoApplication | 32034665cc7ab738b70c7da4634435e0bdeb82be | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/core/CallButtonController.ets | arkts | sendCommand | 发送控制命令到呼叫按钮设备 | public async sendCommand(deviceId: string, command: DeviceCommand): Promise<void> {
console.log(`CallButtonController: Sending command to ${deviceId}`, command);
// 解析命令参数
const params = command.params;
let isPressed: boolean = false;
let isAcknowledge: boolean = false;
if ('isPressed' in pa... | 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 sendCommand AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | public async sendCommand(deviceId: string, command: DeviceCommand): Promise<void> {
console.log(`CallButtonController: Sending command to ${deviceId}`, command);
// 解析命令参数
const params = command.params;
let isPressed: boolean = false;
let isAcknowledge: boolean = false;
if ('isPressed' in pa... | https://github.com/LJ666-ui/harmony-health-care | e6113396920de1a7e78242e0dc1bf50d2aae7591 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | sort | TODO: can't distinguish `=> number` and `=> int`
Reorders elements of `this` using comparator function.
@param comparator function that defines the sort order.
@note Mutating method
TODO clarify UTF-16 or UTF-8 | public sort(comparator: (a: T, b: T) => int): void {
let res = this.copyArray();
this.doSort(res, 0, res.length-1, comparator);
this.data = res;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left comparator AST#identif... | public sort(comparator: (a: T, b: T) => int): void {
let res = this.copyArray();
this.doSort(res, 0, res.length-1, comparator);
this.data = res;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 8bf352d4103d7b6188afb89706e0e7a8fe629e6b | gitee |
Joker-x-dev/CoolMallArkTS | core/ui/src/main/ets/component/empty/EmptyCart.ets | arkts | build | 构建购物车缺省页视图
@returns {void} 无返回值 | build(): void {
Empty({
description: $r("app.string.empty_cart"),
imageRes: $r("app.media.ic_empty_cart")
});
} | 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#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
Empty({
description: $r("app.string.empty_cart"),
imageRes: $r("app.media.ic_empty_cart")
});
} | https://github.com/Joker-x-dev/CoolMallArkTS | ea5cafbaf9056947fffd3e43d97fa1d5ea89ac28 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/utils/Transformer.ets | arkts | pointValuesToPixel | Transform an array of points with all matrices. VERY IMPORTANT: Keep
matrix order "value-touch-offset" when transforming.
@param pts | public pointValuesToPixel(pts: number[]) {
this.mMatrixValueToPx.mapPoints(pts);
this.mViewPortHandler.getMatrixTouch().mapPoints(pts);
this.mMatrixOffset.mapPoints(pts);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left pointValuesToPixel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pts AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expr... | public pointValuesToPixel(pts: number[]) {
this.mMatrixValueToPx.mapPoints(pts);
this.mViewPortHandler.getMatrixTouch().mapPoints(pts);
this.mMatrixOffset.mapPoints(pts);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | cb088bf1370895932d70f5c757925abb7b5115fe | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/network/MdnsDiscovery.ets | arkts | isSearching | 是否正在发现 | isSearching(): boolean {
return this.isDiscovering;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isSearching 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#stateme... | isSearching(): boolean {
return this.isDiscovering;
} | https://github.com/AlkaidLab/moonlight-harmony | 6c2ee618c5f7c2af0842f2058dd7cfdca5d3e02a | github |
arkui-x/samples | CodeLab/Cases/feature/clickanimation/src/main/ets/model/BasicDataSource.ets | arkts | addData | 在指定索引位置增加一个元素
@param index 数组索引 | public addData(index: number, data: T): void {
this.originDataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number ... | public addData(index: number, data: T): void {
this.originDataArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | https://gitcode.com/arkui-x/samples | c6e0916c3c913dedb204ba7a93685d3883940408 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets | arkts | createInteger | Creates a new JSON element containing an integer value.
@param {int} value - The integer value to store
@returns {JsonElement} A new JsonElement containing the integer value | static createInteger(value: int): JsonElement {
const element = new JsonElement()
element.maybeLongValue = value.toLong()
return element
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createInteger AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifie... | static createInteger(value: int): JsonElement {
const element = new JsonElement()
element.maybeLongValue = value.toLong()
return element
} | https://gitcode.com/iop123123/arkts-static-skills | 7ffc63bccfc4436853524940501c2c9262dcd936 | gitcode |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | indicate | indicate
@param bleDevice
@param uuid_service
@param uuid_indicate
@param useCharacteristicDescriptor
@param callback | public indicate(bleDevice: BleDevice, uuid_service: string, uuid_indicate: string, useCharacteristicDescriptor: boolean = false, callback: BleIndicateCallback) {
if (callback == null) {
throw new EvalError("BleIndicateCallback can not be Null!");
}
if (this.multipleBluetoothController !== null) {
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left indicate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bleDevice AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Bl... | public indicate(bleDevice: BleDevice, uuid_service: string, uuid_indicate: string, useCharacteristicDescriptor: boolean = false, callback: BleIndicateCallback) {
if (callback == null) {
throw new EvalError("BleIndicateCallback can not be Null!");
}
if (this.multipleBluetoothController !== null) {
... | https://gitee.com/openharmony-sig/FastBle.git | 79438962278b8cd85e9d227eeed3d01faab3a418 | gitee |
AGenUI/AGenUI | playground/harmony/entry/src/main/ets/stability/StabilityScenarioEngine.ets | arkts | executeSessionStorm | S1: Rapid create/destroy SurfaceManager instances | private executeSessionStorm(): string | null {
for (let i = 0; i < 10; i++) {
const sm = new SurfaceManager(this.context);
sm.beginTextStream();
sm.receiveTextChunk(this.buildCreateSurfaceJSON(`storm-${i}`));
sm.endTextStream();
this.sleepSync(10);
sm.destroy();
this.slee... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left executeSessionStorm 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_expressi... | private executeSessionStorm(): string | null {
for (let i = 0; i < 10; i++) {
const sm = new SurfaceManager(this.context);
sm.beginTextStream();
sm.receiveTextChunk(this.buildCreateSurfaceJSON(`storm-${i}`));
sm.endTextStream();
this.sleepSync(10);
sm.destroy();
this.slee... | https://github.com/AGenUI/AGenUI | 943aef663c53283343b45beb88ead6a937cbb5ff | github |
AGenUI/AGenUI | playground/harmony/entry/src/main/ets/pages/AGenUIDemoPage.ets | arkts | aboutToDisappear | Lifecycle: tears down page-owned native resources and demo registrations. | aboutToDisappear(): void {
if (this.errorBannerTimer !== -1) {
clearTimeout(this.errorBannerTimer);
this.errorBannerTimer = -1;
}
this.destroySurfaceManager();
this.unregisterDemoExtensions();
this.runtimeLogger = null;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | aboutToDisappear(): void {
if (this.errorBannerTimer !== -1) {
clearTimeout(this.errorBannerTimer);
this.errorBannerTimer = -1;
}
this.destroySurfaceManager();
this.unregisterDemoExtensions();
this.runtimeLogger = null;
} | https://github.com/AGenUI/AGenUI | 8801e1d0912066b94d43c3a4e95013838ea5d764 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsCategoryViewModel.ets | arkts | onSearch | 搜索
@param {string} keyword - 搜索关键词
@returns {void} 无返回值 | onSearch(keyword: string): void {
this.searchKeyword = keyword;
this.onRefresh();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onSearch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)#Right... | onSearch(keyword: string): void {
this.searchKeyword = keyword;
this.onRefresh();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 619995934e251f759dd90fcce86833aa8f3df225 | github |
offlinecat-dev/OCNetORM | src/main/ets/query/SubQuery.ets | arkts | orWhere | 添加 OR 过滤条件
@param column 列名
@param operator 操作符
@param value 值
@returns 当前实例(支持链式调用) | orWhere(column: string, operator: ConditionOperator, value: ValueType): SubQuery {
const condition = new WhereCondition()
condition.column = column
condition.operator = operator
condition.value = value
condition.logicalOperator = LogicalOperator.OR
this.conditions.push(condition)
return th... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left orWhere AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left column AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,... | orWhere(column: string, operator: ConditionOperator, value: ValueType): SubQuery {
const condition = new WhereCondition()
condition.column = column
condition.operator = operator
condition.value = value
condition.logicalOperator = LogicalOperator.OR
this.conditions.push(condition)
return th... | https://github.com/offlinecat-dev/OCNetORM | 8de01f3290d0d0049ea09aad5abd1aa52644dfcf | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/StatisticsDAO.ets | arkts | bulkInsertMonthly | 批量插入月度统计 - 使用 DAOHelper 统一事务处理 | static async bulkInsertMonthly(stats: MonthlyStatistics[]) {
await DAOHelper.transaction(async () => {
for (const s of stats) await StatisticsDAO.insertMonthly(s);
}, '[StatisticsDAO] 批量插入月度统计');
} | 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 bulkInsertMonthly AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stats AST#identifier#Right AST#:#Left ... | static async bulkInsertMonthly(stats: MonthlyStatistics[]) {
await DAOHelper.transaction(async () => {
for (const s of stats) await StatisticsDAO.insertMonthly(s);
}, '[StatisticsDAO] 批量插入月度统计');
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | e621a80fbc58c6929c3dfe82377bd818c312034f | github |
cduestc-course/ArkLearn | entry/src/main/ets/pages/07/7.1.1-c.ets | arkts | onWillApplyTheme | onWillApplyTheme中可获取当前组件上下文的Theme对象。
此处在onWillApplyTheme中将状态变量textColor、columBgColor,
赋值为当前使用的Theme对象(BlueColorsTheme)中的配色。 | onWillApplyTheme(theme: Theme) {
this.textColor = theme.colors.fontPrimary;
this.columBgColor = theme.colors.backgroundPrimary;
console.info('IndexComponent onWillApplyTheme');
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onWillApplyTheme AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left theme AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Theme AST#identifier#Ri... | onWillApplyTheme(theme: Theme) {
this.textColor = theme.colors.fontPrimary;
this.columBgColor = theme.colors.backgroundPrimary;
console.info('IndexComponent onWillApplyTheme');
} | https://github.com/cduestc-course/ArkLearn | 0efa3a5ab3347d11ea9110e6b8582ec9ea1823a5 | github |
jjjjjjava/ffmpeg_tools | src/main/ets/ffmpeg/FFmpegFactory.ets | arkts | remux | ============================================================
零拷贝类(不需要解码,最快)
============================================================
封装格式转换(零拷贝) | public static remux(input: string, output: string, format: ContainerFormat = ContainerFormat.MP4): string[] {
const audioCodec = format === ContainerFormat.FLV ? 'aac' : 'copy';
return ['ffmpeg', '-i', input, '-c:v', 'copy', '-c:a', audioCodec, '-f', format, '-y', output];
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left remux AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#... | public static remux(input: string, output: string, format: ContainerFormat = ContainerFormat.MP4): string[] {
const audioCodec = format === ContainerFormat.FLV ? 'aac' : 'copy';
return ['ffmpeg', '-i', input, '-c:v', 'copy', '-c:a', audioCodec, '-f', format, '-y', output];
} | https://github.com/jjjjjjava/ffmpeg_tools | 2ff6eb799253032591d9a4e2da7969a490bac6a4 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets | arkts | getFavorites | 获取用户收藏(需要登录) | async getFavorites(page: number = 1): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法获取收藏');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
);
}
const startTime = Date.now();
logger.info(TAG, `开始获取收藏:... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getFavorites AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left page AST#identifier#Right AST#ty... | async getFavorites(page: number = 1): Promise<EngineResult<SearchResult>> {
if (!this.config) {
logger.error(TAG, '配置未加载,无法获取收藏');
throw new MangaSourceError(
MangaSourceErrorCode.CONFIG_NOT_LOADED,
'配置未加载'
);
}
const startTime = Date.now();
logger.info(TAG, `开始获取收藏:... | https://github.com/DaLongZhuaZi/manxia | c5df4dd8b77303a689df08c2a26c70190ec60d45 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/DependencyContainer.ets | arkts | resolveInternal | 内部解析逻辑 | private async resolveInternal<T>(token: string, context: ResolutionContext): Promise<T> {
// 检查循环依赖
if (context.resolving.has(token)) {
const circularError = new Error(`检测到循环依赖: ${Array.from(context.resolving).join(' -> ')} -> ${token}`);
logger.error('DI', circularError.message);
throw circ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#binary_expression#Left AST#identifier#Left resolveInternal AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>... | private async resolveInternal<T>(token: string, context: ResolutionContext): Promise<T> {
// 检查循环依赖
if (context.resolving.has(token)) {
const circularError = new Error(`检测到循环依赖: ${Array.from(context.resolving).join(' -> ')} -> ${token}`);
logger.error('DI', circularError.message);
throw circ... | https://github.com/DaLongZhuaZi/manxia | b9e306e15266394c39d618f8edffc0d75e9eb102 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/pages/CategoryManagement.ets | arkts | openEditDialog | 打开编辑分类弹窗 | openEditDialog(category: Category) {
this.currentEditingCategory = category.clone()
// 创建弹窗
this.dialogController = new CustomDialogController({
builder: CategoryEditDialog({
editingCategory: this.currentEditingCategory,
availableParents: this.getAvailableParents(),
onSa... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openEditDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left category AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Category AST#identifie... | openEditDialog(category: Category) {
this.currentEditingCategory = category.clone()
// 创建弹窗
this.dialogController = new CustomDialogController({
builder: CategoryEditDialog({
editingCategory: this.currentEditingCategory,
availableParents: this.getAvailableParents(),
onSa... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 2046b74f4baecfa9b28e00073194d39b3a00f6db | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | getSettingsAnalyticsCardBackground | 构建书源内容(已暂时注释)
@Builder
buildBookSourceContent() {
Column() {
BookSourceManagementPage()
}
.width('100%')
.height('100%')
.backgroundColor(Color.Transparent)
}
构建设置内容 | private getSettingsAnalyticsCardBackground(): ResourceColor {
return SettingsPageSurfaceManager.getFeaturedCardStyle(this.themeState.currentTheme).surface.backgroundColor;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getSettingsAnalyticsCardBackground 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#... | private getSettingsAnalyticsCardBackground(): ResourceColor {
return SettingsPageSurfaceManager.getFeaturedCardStyle(this.themeState.currentTheme).surface.backgroundColor;
} | https://github.com/DaLongZhuaZi/manxia | 2b39c2bd9d2825cc75a38beb0d29dbd3c502282a | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/TrackpadGestureHandler.ets | arkts | onMove | ==================== Move ==================== | private onMove(touches: TouchObject[]): void {
if (touches.length === 1 && this.maxCountInGesture === 1) {
this.onSingleFingerMove(touches[0]);
} else if (touches.length === 2) {
this.onTwoFingerMove(touches);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left onMove AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left touches AST#identifier#Right AST#:#Left : AST#:#Right AS... | private onMove(touches: TouchObject[]): void {
if (touches.length === 1 && this.maxCountInGesture === 1) {
this.onSingleFingerMove(touches[0]);
} else if (touches.length === 2) {
this.onTwoFingerMove(touches);
}
} | https://github.com/AlkaidLab/moonlight-harmony | 85a1c192a52461dd20cb3a038f9abba43016ea58 | github |
openharmony-tpc/mp4parser | library/src/main/ets/mp4parser/MP4Parser.ets | arkts | audioMultMerge | Batch audio synthesis
@param sourcePath
@param outPath
@param callBack | static audioMultMerge(sourcePath: string, outPath: string, callBack: ICallBack): void {
mp4parser_napi.exeFFmpegCmd("ffmpeg -y -f concat -safe 0 -i " + sourcePath + " -c copy " + outPath)
.then((res: number) => {
callBack.callBackResult(res)
});
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left audioMultMerge AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourcePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | static audioMultMerge(sourcePath: string, outPath: string, callBack: ICallBack): void {
mp4parser_napi.exeFFmpegCmd("ffmpeg -y -f concat -safe 0 -i " + sourcePath + " -c copy " + outPath)
.then((res: number) => {
callBack.callBackResult(res)
});
} | https://gitee.com/openharmony-tpc/mp4parser.git | 26498d9dc15dc0e4a2d92cd404bcae5db071d709 | gitee |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/pages/GoalEditPage.ets | arkts | getGoalTypeName | 获取目标类型名称 | getGoalTypeName(type: GoalType): string {
switch (type) {
case GoalType.WEIGHT:
return '目标体重';
case GoalType.STEPS:
return '每日步数';
case GoalType.WATER:
return '每日饮水';
case GoalType.SLEEP:
return '睡眠时长';
case GoalType.EXERCISE:
return '运动时长';
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getGoalTypeName 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 GoalType AST#identifier#Right AST#)#Left... | getGoalTypeName(type: GoalType): string {
switch (type) {
case GoalType.WEIGHT:
return '目标体重';
case GoalType.STEPS:
return '每日步数';
case GoalType.WATER:
return '每日饮水';
case GoalType.SLEEP:
return '睡眠时长';
case GoalType.EXERCISE:
return '运动时长';
... | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | 88dc2f66f7f2e7f73ee71560a0f8048502c3a9f0 | github |
xblLab/HarmonyProjectTemplate | commons/lib_account/src/main/ets/services/AccountApi.ets | arkts | getPersonalInfoCollection | 查询个人信息收集清单
@returns | public getPersonalInfoCollection() {
return ProtocolData.personalInfoCollection;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPersonalInfoCollection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left ... | public getPersonalInfoCollection() {
return ProtocolData.personalInfoCollection;
} | https://github.com/xblLab/HarmonyProjectTemplate | e463b5a112a8925dded589dbf0b9694757e04e16 | github |
HarmonyOS_Samples/BestPracticeSnippets | OptimizationAppDelay/entry/src/main/ets/pages/CityListPage.ets | arkts | computeTask | [Start city_list_page] | @Concurrent
function computeTask(): string[] {
let array: string[] = []
// AppConstant.CITYS is the data to be loaded.
for (let t of AppConstant.CITYS) {
array.push(t.trim())
}
let collator = new Intl.Collator("zh-CN", { localeMatcher: "lookup", usage: "sort" });
array.sort((a, b) => collator.compare(a,... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left computeTask AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#... | @Concurrent
function computeTask(): string[] {
let array: string[] = []
// AppConstant.CITYS is the data to be loaded.
for (let t of AppConstant.CITYS) {
array.push(t.trim())
}
let collator = new Intl.Collator("zh-CN", { localeMatcher: "lookup", usage: "sort" });
array.sort((a, b) => collator.compare(a,... | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 2cadfae5d01883b0f15a2d6a533f3e0547c785bc | gitcode |
Cool_foolisher1/ArkTSRepository | GraphicalCode/commons/src/main/ets/util/ResourceUtil.ets | arkts | getResourceString | 获取与指定资源ID对应的字符串
@param context Context
@param resource Resource
@returns string | public static getResourceString(context: Context, resource: Resource): string {
if (ResourceUtil.isEmptyObj(resource)) {
Logger.error(TAG, `获取资源字符串为空`)
return ''
}
let resourceString: string = ''
try {
resourceString = context.resourceManager.getStringSync(resource.id)
} 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 getResourceString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Le... | public static getResourceString(context: Context, resource: Resource): string {
if (ResourceUtil.isEmptyObj(resource)) {
Logger.error(TAG, `获取资源字符串为空`)
return ''
}
let resourceString: string = ''
try {
resourceString = context.resourceManager.getStringSync(resource.id)
} catch (e... | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 3097d16f5c63da6ab554a2ffb8ef8d6915af03d4 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Enforcement/UnifiedDetailPageEnforcer.ets | arkts | isAllUnified | 检查当前所有设置是否都是统一详情页 | isAllUnified(): boolean {
if (!this.settingsManager) {
return false;
}
const keys = [
PageSettingKeys.MANGA_DETAIL_PAGE_TYPE,
PageSettingKeys.EBOOK_DETAIL_PAGE_TYPE,
PageSettingKeys.NOVEL_DETAIL_PAGE_TYPE
];
for (const key of keys) {
const value = this.settingsManag... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isAllUnified 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#statem... | isAllUnified(): boolean {
if (!this.settingsManager) {
return false;
}
const keys = [
PageSettingKeys.MANGA_DETAIL_PAGE_TYPE,
PageSettingKeys.EBOOK_DETAIL_PAGE_TYPE,
PageSettingKeys.NOVEL_DETAIL_PAGE_TYPE
];
for (const key of keys) {
const value = this.settingsManag... | https://github.com/DaLongZhuaZi/manxia | 04d114ca39cfe37d3da9ee732cb1113404f5f342 | github |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/model/MediaService.ets | arkts | play | Starts or resumes playback; triggers prepare if the player is not prepared yet. | public async play() {
Logger.info(TAG, 'AVPlayer play() isPrepared:' + this.isPrepared + ', state:' + this.state);
this.ensureBackgroundAudioTask();
if (!this.isPrepared) {
this.start(0);
} else if (this.avPlayer) {
try {
this.avPlayer.play().then(() => {
Logger.info(TAG,... | 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 play AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right... | public async play() {
Logger.info(TAG, 'AVPlayer play() isPrepared:' + this.isPrepared + ', state:' + this.state);
this.ensureBackgroundAudioTask();
if (!this.isPrepared) {
this.start(0);
} else if (this.avPlayer) {
try {
this.avPlayer.play().then(() => {
Logger.info(TAG,... | https://gitcode.com/HarmonyOS_Samples/MusicHome | d7b2d00471197db9b66ab932c0f70e0c6471c6f3 | gitcode |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/VibratorManager.ets | arkts | vibrateResult | 结果揭晓 — 中等力度双振,通用结果反馈 | static vibrateResult(): void {
VibratorManager.logExecution('vibrateResult');
VibratorManager.vibratePreset(HapticEffect.HARD, 2, 70, VibrationUsage.TOUCH);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressi... | static vibrateResult(): void {
VibratorManager.logExecution('vibrateResult');
VibratorManager.vibratePreset(HapticEffect.HARD, 2, 70, VibrationUsage.TOUCH);
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | e127c06191c54c7889075b1f6c36fde9177f1bdf | github |
CPF-ApplicationTPC/openharmony_tpc_samples | SwipeMenuListView/library/src/main/ets/model/SwipeMenuItem.ets | arkts | setTitle | 设置菜单项标题 (支持资源ID)
@param title 标题文本或资源ID | public setTitle(title: string | ResourceStr): void {
this.title = title as string;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTitle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left title AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left... | public setTitle(title: string | ResourceStr): void {
this.title = title as string;
} | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | 1974c06ef0c4266ceafc5abe759577da6d13f896 | gitcode |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/index.ets | arkts | screenRotateListener | 监听屏幕旋转 | private static screenRotateListener() {
display.on("change", () => {
setTimeout(() => {
TnUIInitializer.getScreenAndAvoidSize()
}, 300)
})
} | 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 screenRotateListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R... | private static screenRotateListener() {
display.on("change", () => {
setTimeout(() => {
TnUIInitializer.getScreenAndAvoidSize()
}, 300)
})
} | https://github.com/codelably/tuniao-ui | bcd9c09cf1496304fcb642d8d3ed5fd956b4cf60 | github |
harmonyos/codelabs | HarmonyOS_NEXT/OxHornCampus/entry/src/main/ets/controller/MapController.ets | arkts | getResourceString | Obtains the resource name.
@param resource Resource file.
@returns Resource File Name. | getResourceString(resource: Resource): string {
let resourceString: string = '';
try {
resourceString = getContext(this).resourceManager.getStringSync(resource.id);
} catch (error) {
Logger.error(TAG, `getResourceString failed, error code: ${(error as BusinessError).code},
message: ${(e... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getResourceString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resource AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Resource AST#identifier#Right AST#... | getResourceString(resource: Resource): string {
let resourceString: string = '';
try {
resourceString = getContext(this).resourceManager.getStringSync(resource.id);
} catch (error) {
Logger.error(TAG, `getResourceString failed, error code: ${(error as BusinessError).code},
message: ${(e... | https://gitee.com/harmonyos/codelabs.git | c3c0453684ae49ae65d5745d2e621b98ac6f331d | gitee |
the-wwyang/kids-learning-app | src/main/ets/storage/LearningRecordStorageService.ets | arkts | saveAnswerRecords | 保存答题记录列表
@param records 答题记录列表 | static async saveAnswerRecords(records: AnswerRecord[]): Promise<void> {
try {
// 限制数量,只保留最新的记录
const trimmedRecords = records.length > LearningRecordStorageService.MAX_RECORDS
? records.slice(records.length - LearningRecordStorageService.MAX_RECORDS)
: records;
await dataStorag... | 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 saveAnswerRecords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Lef... | static async saveAnswerRecords(records: AnswerRecord[]): Promise<void> {
try {
// 限制数量,只保留最新的记录
const trimmedRecords = records.length > LearningRecordStorageService.MAX_RECORDS
? records.slice(records.length - LearningRecordStorageService.MAX_RECORDS)
: records;
await dataStorag... | https://github.com/the-wwyang/kids-learning-app | d32176acba5d43a5dae1d306cfbb533de5d33e3a | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/WeakMap.ets | arkts | delete | The delete() method removes the specified element from
a WeakMap object. | delete(k: K): boolean {
throw new Error("Not implemented");
return false;
} | AST#program#Left AST#ERROR#Left AST#delete#Left delete AST#delete#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left k AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier#Left K AST#type_identifier#Right AST#type_annotation#Ri... | delete(k: K): boolean {
throw new Error("Not implemented");
return false;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 333d7f8854550bce5210f24208130e89d701ea7a | gitee |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | isConnected | Check if session is connected | isConnected(): boolean {
return this.connectionState === ConnectionState.CONNECTED;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isConnected 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#stateme... | isConnected(): boolean {
return this.connectionState === ConnectionState.CONNECTED;
} | https://github.com/tangwengang-del/freerdp-harmonyos | ff912a9c7713da258cc8e40ed0ad2f42f97b2ce2 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Parsers/ReaderKitParser.ets | arkts | parseFallback | 降级解析方案(当 Reader Kit 不可用时) | private async parseFallback(): Promise<EBook> {
logger.warn(TAG, `使用降级方案解析: ${this.format}`);
const fileName = this.getFileNameFromPath(this.filePath);
const title = this.extractTitleFromFileName(fileName);
const now = Date.now();
const bookId = `ebook_${this.format.toLowerCase()}_${now}_${Ma... | 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 parseFallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | private async parseFallback(): Promise<EBook> {
logger.warn(TAG, `使用降级方案解析: ${this.format}`);
const fileName = this.getFileNameFromPath(this.filePath);
const title = this.extractTitleFromFileName(fileName);
const now = Date.now();
const bookId = `ebook_${this.format.toLowerCase()}_${now}_${Ma... | https://github.com/DaLongZhuaZi/manxia | cd5abe81e36b45f4719e4d39cced7cf6e219820f | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | small | The small() method creates a string that embeds a string in a <small> element (<small>str</small>), which causes a string to be displayed in a big font. | public small(): String{
return this.CreateHTMLString("small", "")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left small AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Rig... | public small(): String{
return this.CreateHTMLString("small", "")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 1bbdce4940854c8bdccb314fc0510d4b1738447f | gitee |
CLMC2025/Vignette | entry/src/main/ets/database/repositories/WordRepository.ets | arkts | getTotalHistoryCount | Get total history entry count across all words | async getTotalHistoryCount(): Promise<number> {
this.ensureInitialized();
const words = await this.getAllWords();
let total = 0;
for (const word of words) {
total += word.history.getReviewCount();
}
return total;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getTotalHistoryCount AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameter... | async getTotalHistoryCount(): Promise<number> {
this.ensureInitialized();
const words = await this.getAllWords();
let total = 0;
for (const word of words) {
total += word.history.getReviewCount();
}
return total;
} | https://github.com/CLMC2025/Vignette | 1978fd23345dae414fb9e9bd5010cfcc7b4b5d20 | github |
ZestBox-18/kitebook-frontend | features/home/src/main/ets/components/WeeklyBillListSectionComponent.ets | arkts | build | 构建周账单列表区,支持扁平排序和按天分组两种展示方式。 | build() {
if (this.sortedWeekBills.length === 0 && this.sortedWeekBillGroups.length === 0) {
ListItem() {
EmptyStateComponent({ text: '本周暂无账单记录', themeState: this.themeState })
}
} else if (this.isAmountSortMode) {
ListItemGroup({
header: this.FlatListHeader(),
style:... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#if_statement#Left AST#if#Left i... | build() {
if (this.sortedWeekBills.length === 0 && this.sortedWeekBillGroups.length === 0) {
ListItem() {
EmptyStateComponent({ text: '本周暂无账单记录', themeState: this.themeState })
}
} else if (this.isAmountSortMode) {
ListItemGroup({
header: this.FlatListHeader(),
style:... | https://github.com/ZestBox-18/kitebook-frontend | 802d9f5c1f1f247e08ba0e58d465598299e4cd17 | github |
arkui-x/samples | CodeLab/Cases/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets | arkts | getTitleTranslateOptions | 获取标题展开时,继续下拉的标题栏Translate参数
@returns {TranslateOptions} 标题展开后继续下拉的标题栏Translate参数 | getTitleTranslateOptions(): TranslateOptions {
return {y: Math.max(-this.curOffset, 0)};
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getTitleTranslateOptions 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 TranslateOptions AST#identifier#Right... | getTitleTranslateOptions(): TranslateOptions {
return {y: Math.max(-this.curOffset, 0)};
} | https://gitcode.com/arkui-x/samples | 7b95fcbc8ac54db6e6f808ab36f433f7f1bfb690 | gitcode |
arkui-x/samples | CodeLab/Cases/feature/calendarswitch/src/main/ets/customcalendar/view/MonthViewItem.ets | arkts | updateMonthData | 更新月数据 | updateMonthData() {
const PARTS: string[] = this.yearMonth.split('-');
this.year = Number(PARTS[0]);
this.month = Number(PARTS[1]);
this.getMonthViewData(this.year, this.month);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateMonthData 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#Le... | updateMonthData() {
const PARTS: string[] = this.yearMonth.split('-');
this.year = Number(PARTS[0]);
this.month = Number(PARTS[1]);
this.getMonthViewData(this.year, this.month);
} | https://gitcode.com/arkui-x/samples | 4b785cc5424ddda2f3ef6f7753944b8ca9357fe6 | gitcode |
honjow/Next2V | shared/src/main/ets/utils/V2exRouteNavigator.ets | arkts | pushRoute | Push the native page for an already-parsed route. Returns false for a kind without a native page. | static pushRoute(stack: NavPathStack, route: V2exRoute): boolean {
if (route.kind === 'topic' && route.topicId && route.topicId > 0) {
const p: TopicDetailParams =
route.targetFloor && route.targetFloor > 0
? { topicId: route.topicId, targetFloor: route.targetFloor }
: { topicId:... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left pushRoute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stack AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left NavPa... | static pushRoute(stack: NavPathStack, route: V2exRoute): boolean {
if (route.kind === 'topic' && route.topicId && route.topicId > 0) {
const p: TopicDetailParams =
route.targetFloor && route.targetFloor > 0
? { topicId: route.topicId, targetFloor: route.targetFloor }
: { topicId:... | https://github.com/honjow/Next2V | 8a181047ed5e3ac58b8a45bf984a2b1f8f6a8a64 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | startsWith | Checks that this string starts with the specified prefix.
@param prefix prefix string
@throws NullPointerException if prefix param is null
@returns true if this string begins with prefix | public startsWith(prefix: String): boolean {
return this.startsWith(prefix, 0);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startsWith AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left prefix AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Str... | public startsWith(prefix: String): boolean {
return this.startsWith(prefix, 0);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | a87666de6df4be168e739669693d6d849877256b | gitee |
HarmonyOS_Samples/MusicHome | products/watch/src/main/ets/watchability/WatchAbility.ets | arkts | onBackground | Logs transition to background. | onBackground(): void {
Logger.info('WatchAbility: Ability onBackground');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block... | onBackground(): void {
Logger.info('WatchAbility: Ability onBackground');
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | 4d4fdb1a86d722836b0f3ae8e50ae168dfe12ad8 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/01.type_of_expression/typ.ets | arkts | foo | ---
desc: >-
The type of a standalone expression (like just a + b) can be determined entirely
from the content of the expression; the type of any other expression may be
influenced by its target type
--- | function foo(a: byte): int {
return 1;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left foo AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left a AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_... | function foo(a: byte): int {
return 1;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 5a78fc9d6fa70165d63e13f8b2b727799cfb05d0 | gitee |
openharmony/arkui_ace_engine | advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.TreeView.ets | arkts | addNode | add nodeItem in params
@param parentNodeId parent node id
@param currentNodeId current node id
@param data node param
@param initBuild whether in initialization process | public addNode(parentNodeId: int, currentNodeId: int, data: NodeParam, initBuild: boolean): boolean {
if (this._root === null) {
this._root = new NodeItem(emptyNodeInfo);
this._root.nodeLevel = -1;
this.nodeIdNodeItemMap.set(-1, this._root);
this.nodeIdNodeParamMap.set(-1, emptyNodeInfo);
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left parentNodeId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifi... | public addNode(parentNodeId: int, currentNodeId: int, data: NodeParam, initBuild: boolean): boolean {
if (this._root === null) {
this._root = new NodeItem(emptyNodeInfo);
this._root.nodeLevel = -1;
this.nodeIdNodeItemMap.set(-1, this._root);
this.nodeIdNodeParamMap.set(-1, emptyNodeInfo);
... | https://gitcode.com/openharmony/arkui_ace_engine | 9a25a6ed0fa17d51f26efafa78d8461720fb6aca | gitcode |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/dao/StepDao.ets | arkts | deleteStepRecordByDate | 删除指定日期的步数记录 | async deleteStepRecordByDate(date: string): Promise<boolean> {
const rdbStore = await this.initDatabase();
try {
const predicates = new relationalStore.RdbPredicates('step_records');
predicates.equalTo('date', date);
const deletedRows = await rdbStore.delete(predicates);
return delet... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteStepRecordByDate AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left date AST#identifier#Right AST#type_annotation#Left AST#:... | async deleteStepRecordByDate(date: string): Promise<boolean> {
const rdbStore = await this.initDatabase();
try {
const predicates = new relationalStore.RdbPredicates('step_records');
predicates.equalTo('date', date);
const deletedRows = await rdbStore.delete(predicates);
return delet... | https://gitcode.com/openharmony/codelabs | 7384f57a70b196c1b18df54f6262aa6ac047bf0b | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | from | Creates an array from an array of the same type.
@param { Uint8Array } arr - An array to convert to a new array.
@returns { Uint8Array } - A new Uint8Array
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arr: Uint8Array): Uint8Array {
let result = new Uint8Array(arr.length)
result.set(arr)
return result
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ... | public static from(arr: Uint8Array): Uint8Array {
let result = new Uint8Array(arr.length)
result.set(arr)
return result
} | https://gitcode.com/iop123123/arkts-static-skills | e4b33f85e44bcbfda1e6b48280dd816c6adc6b86 | gitcode |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/common/constants/ApiConstants.ets | arkts | badge | 获取单个徽章详情 | static badge(id: number): string {
return `/badges/${id}.json`;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left badge AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR... | static badge(id: number): string {
return `/badges/${id}.json`;
} | https://github.com/Amaz1ny/HarmonyDO-public | 30f21381bf5893de3af41a38e764178022c4d2df | github |
Countly/countly-sdk-hos | library/src/main/ets/CountlyConfig.ets | arkts | setSDKBehaviorSettings | Provide an initial SDK Behavior Settings JSON object so the SDK has a
working configuration before the first server fetch (or on networks
where the SBS endpoint is unreachable). Validated + parsed at module
init time; an invalid string is logged and ignored. Per dev guide
§SDK Behavior Settings, dev-supplied settings r... | public setSDKBehaviorSettings(sdkBehaviorSettings: string): CountlyConfig {
if (sdkBehaviorSettings && sdkBehaviorSettings.trim().length > 0) {
this.sdkBehaviorSettings = sdkBehaviorSettings;
} else {
console.warn('[Countly] CountlyConfig setSDKBehaviorSettings, empty value, ignored');
}
r... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setSDKBehaviorSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sdkBehaviorSettings AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Lef... | public setSDKBehaviorSettings(sdkBehaviorSettings: string): CountlyConfig {
if (sdkBehaviorSettings && sdkBehaviorSettings.trim().length > 0) {
this.sdkBehaviorSettings = sdkBehaviorSettings;
} else {
console.warn('[Countly] CountlyConfig setSDKBehaviorSettings, empty value, ignored');
}
r... | https://github.com/Countly/countly-sdk-hos | 0660a064a7e1bbd216b90fd8ddb31a572101371b | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | findAllElements | 查找所有元素 | private findAllElements(html: string): string[] {
const results: string[] = [];
const tagRegex = /<([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g;
let match = tagRegex.exec(html);
let pos = 0;
while (match !== null) {
if (match.index < pos) {
match = tagRegex.exec(html);
continue;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left findAllElements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private findAllElements(html: string): string[] {
const results: string[] = [];
const tagRegex = /<([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g;
let match = tagRegex.exec(html);
let pos = 0;
while (match !== null) {
if (match.index < pos) {
match = tagRegex.exec(html);
continue;
... | https://github.com/DaLongZhuaZi/manxia | ff842db2c30db0ed3bc71e296cb5c1e48736a32b | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test8_original_index.ets | arkts | testStringMethods | --- String methods: indexOf, includes, slice, repeat --- | function testStringMethods(): string {
let s: string = 'hello world';
let idx: number = s.indexOf('world');
let has: boolean = s.includes('hello');
let sub: string = s.slice(0, 5);
let rep: string = 'ab'.repeat(3);
return String(idx) + '|' + String(has) + '|' + sub + '|' + rep;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testStringMethods 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#predefine... | function testStringMethods(): string {
let s: string = 'hello world';
let idx: number = s.indexOf('world');
let has: boolean = s.includes('hello');
let sub: string = s.slice(0, 5);
let rep: string = 'ab'.repeat(3);
return String(idx) + '|' + String(has) + '|' + sub + '|' + rep;
} | https://github.com/miaochiahao/ark-ghidra | d61d9d79ed21e563dd149f8a159fdb5c6b7b62b6 | github |
XJTUWYD/ArkDiff | entry/src/main/ets/services/BinaryFileHandler.ets | arkts | isBinaryByExtension | 通过文件路径判断是否为二进制 | static isBinaryByExtension(filePath: string): boolean {
const ext = filePath.split('.').pop()?.toLowerCase() || '';
return this.BINARY_EXTENSIONS.has(ext);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isBinaryByExtension AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s... | static isBinaryByExtension(filePath: string): boolean {
const ext = filePath.split('.').pop()?.toLowerCase() || '';
return this.BINARY_EXTENSIONS.has(ext);
} | https://github.com/XJTUWYD/ArkDiff | 3f7eaa00595d3cc26d730b0a3388057f712fac2b | github |
erosTeam/NextE | shared/src/main/ets/settings/AccountListSettings.ets | arkts | load | Mirror the persisted list into the reactive state (no mutation). | static async load(context: common.UIAbilityContext): Promise<void> {
try {
AccountListSettings.syncState(await AccountListSettings.read(context))
} catch (error) {
DiagnosticLogger.warn('auth', 'account_list_load_failed', (error as Error).message)
}
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Rig... | static async load(context: common.UIAbilityContext): Promise<void> {
try {
AccountListSettings.syncState(await AccountListSettings.read(context))
} catch (error) {
DiagnosticLogger.warn('auth', 'account_list_load_failed', (error as Error).message)
}
} | https://github.com/erosTeam/NextE | 8e32a93ef38dd13f1a290a90e4c2f62e0ef8859c | github |
Explore-In-HMOS-Wearable/unit-calculator | entry/src/main/ets/utils/UnitConversion.ets | arkts | convertSpeed | SPEED | static convertSpeed(value: number, from: SpeedUnit, to: SpeedUnit): number {
const toMps: Record<SpeedUnit, number> = {
[SpeedUnit.METER_PER_SECOND]: 1,
[SpeedUnit.KILOMETER_PER_HOUR]: 0.277778,
[SpeedUnit.MILE_PER_HOUR]: 0.44704,
[SpeedUnit.FOOT_PER_SECOND]: 0.3048,
[SpeedUnit.KNOT]... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left convertSpeed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu... | static convertSpeed(value: number, from: SpeedUnit, to: SpeedUnit): number {
const toMps: Record<SpeedUnit, number> = {
[SpeedUnit.METER_PER_SECOND]: 1,
[SpeedUnit.KILOMETER_PER_HOUR]: 0.277778,
[SpeedUnit.MILE_PER_HOUR]: 0.44704,
[SpeedUnit.FOOT_PER_SECOND]: 0.3048,
[SpeedUnit.KNOT]... | https://github.com/Explore-In-HMOS-Wearable/unit-calculator | 21448a3e9c0a60e0ba1acb3fe280c9e6bb5c289a | github |
CLMC2025/Vignette | entry/src/main/ets/context/ContextValidator.ets | arkts | getMaxSentenceLength | 获取最大句长(根据用户级别) | private getMaxSentenceLength(userLevel: DifficultyLevel): number {
switch (userLevel) {
case DifficultyLevel.CET4:
return 10;
case DifficultyLevel.CET6:
return 15;
case DifficultyLevel.IELTS:
return 20;
case DifficultyLevel.TOEFL:
return 25;
case Diffi... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getMaxSentenceLength AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userLevel AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ide... | private getMaxSentenceLength(userLevel: DifficultyLevel): number {
switch (userLevel) {
case DifficultyLevel.CET4:
return 10;
case DifficultyLevel.CET6:
return 15;
case DifficultyLevel.IELTS:
return 20;
case DifficultyLevel.TOEFL:
return 25;
case Diffi... | https://github.com/CLMC2025/Vignette | 22757f9a9e0e12600b6330f8b9ba207b3463a421 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Debug/PerformanceAnalyzer.ets | arkts | clearWarnings | 清除性能警告 | public clearWarnings(): void {
this.warnings = [];
logger.info(PERFORMANCE_ANALYZER_TAG, 'Performance warnings cleared');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearWarnings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressi... | public clearWarnings(): void {
this.warnings = [];
logger.info(PERFORMANCE_ANALYZER_TAG, 'Performance warnings cleared');
} | https://github.com/DaLongZhuaZi/manxia | 885b54bf27eab03df50feca22c6ab4b76c9530ba | github |
Joker-x-dev/CoolMallArkTS | core/navigation/src/main/ets/user/UserNavigator.ets | arkts | toFootprint | 跳转到用户足迹
@returns {void} 无返回值 | static toFootprint(): void {
navigateTo(UserRoutes.Footprint);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toFootprint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression... | static toFootprint(): void {
navigateTo(UserRoutes.Footprint);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 6a7249dd8b9213618aa78390076852b0573ae11d | github |
Delsin-Yu/JustPDF | entry/src/main/ets/components/PageInfo.ets | arkts | evictAllViewerCaches | 释放全部阅读器光栅缓存与 pending(离开文档或内存危急)。 | public evictAllViewerCaches(): void {
if (this.associatedSource !== undefined && this.globalPageIndex !== undefined) {
this.associatedSource.clearPreviewLruSlot(this.globalPageIndex);
}
for (const cache of this.caches.values()) {
try {
cache.pixelMap.release();
} catch (error) {
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left evictAllViewerCaches 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 AS... | public evictAllViewerCaches(): void {
if (this.associatedSource !== undefined && this.globalPageIndex !== undefined) {
this.associatedSource.clearPreviewLruSlot(this.globalPageIndex);
}
for (const cache of this.caches.values()) {
try {
cache.pixelMap.release();
} catch (error) {
... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/components/PageInfo.ets#L533-L546 | b7c5be95153ed376007ec59266bbecb4b3f88c38 | github |
CPF-ApplicationTPC/openharmony_tpc_samples | Spine/entry/src/main/ets/pages/Example4.ets | arkts | end | 当此条目不再是当前条目并且永远不会再次应用时调用 | end(entry: TrackEntry) {
console.info('spine listener loadAnimation end entry:', entry)
}, | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left end AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left TrackEntry AST#identifier#Right AST#... | end(entry: TrackEntry) {
console.info('spine listener loadAnimation end entry:', entry)
}, | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | a9968644a960108eea75f49ffecb3085321fdba6 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets | arkts | ajax | ==================== 网络请求 ====================
发送GET请求 | async ajax(url: string | string[]): Promise<string> {
// 支持数组形式的URL
const urlStr = Array.isArray(url) ? (url[0] || '') : url;
if (!urlStr) return '';
try {
const httpRequest = http.createHttp();
const response = await httpRequest.request(urlStr, {
method: http.RequestMethod.GET,
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left ajax 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 : AST#:#Right... | async ajax(url: string | string[]): Promise<string> {
// 支持数组形式的URL
const urlStr = Array.isArray(url) ? (url[0] || '') : url;
if (!urlStr) return '';
try {
const httpRequest = http.createHttp();
const response = await httpRequest.request(urlStr, {
method: http.RequestMethod.GET,
... | https://github.com/DaLongZhuaZi/manxia | 6ba7b97559a0e038a17048c589192586732a696d | github |
harmonyos/codelabs | HarmonyOS_NEXT/DistributedContacts/entry/src/main/ets/common/database/ContactsDataBase.ets | arkts | deleteBatch | Delete key-value pairs from the KVStore database in batches.
@param keys Indicates the key-value pairs to be deleted in batches.
@param callback Callback function. | deleteBatch(keys: string[], callback: AsyncCallback<void>): void {
try {
this.kvStore?.deleteBatch(keys, callback);
} catch (err) {
Logger.error(TAG, `DeleteKVStore an unexpected error occurred, error message is ${JSON.stringify(err)}`);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteBatch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left keys AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left string AST#ide... | deleteBatch(keys: string[], callback: AsyncCallback<void>): void {
try {
this.kvStore?.deleteBatch(keys, callback);
} catch (err) {
Logger.error(TAG, `DeleteKVStore an unexpected error occurred, error message is ${JSON.stringify(err)}`);
}
} | https://gitee.com/harmonyos/codelabs.git | e46e668dc13a615b2b5df50a9a4dc0a193916f27 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/unsigned_right_shift/unsigned_right_shift_char.ets | arkts | main | ---
desc: check unsigned right shift operation for char
--- | function main(): void {
const a: char = {{v.left}}
const b: int = {{v.right}}
assert (a >>> b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main 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_type#Left A... | function main(): void {
const a: char = {{v.left}}
const b: int = {{v.right}}
assert (a >>> b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 287c53689d4bc5bbdbec08dc77f9edd4a7ba21d7 | gitee |
openharmony-sig/fluttertpc_wakelock_plus | wakelock_plus/ohos/ohos/src/main/ets/components/plugin/WakelockApi.ets | arkts | getCodec | The codec used by WakelockApi. | static getCodec(): MessageCodec<Object> {
return WakelockApiCodec.INSTANCE;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCodec AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_st... | static getCodec(): MessageCodec<Object> {
return WakelockApiCodec.INSTANCE;
} | https://gitee.com/openharmony-sig/fluttertpc_wakelock_plus.git | 483cfc351bf5b3c4d06e10d9f34d3fec6ec8cbd0 | gitee |
ibestservices/ibest-ui | library/src/main/ets/components/tree/index.ets | arkts | dealChildren | 递归处理子节点选中状态 | dealChildren(children: IBestTreeNodeData[], selected: boolean){
children.forEach(e => {
if(!selected || !e.disabled){
e.selected = selected
}
if(e.children){
this.dealChildren(e.children, selected)
}
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left dealChildren AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left children AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier... | dealChildren(children: IBestTreeNodeData[], selected: boolean){
children.forEach(e => {
if(!selected || !e.disabled){
e.selected = selected
}
if(e.children){
this.dealChildren(e.children, selected)
}
})
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/tree/index.ets#L383-L392 | a1fdabfbcb2ed949d43107a4e873bbfa35df7430 | github |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/common/utils/DateUtils.ets | arkts | now | 获取当前时间戳
@returns number 当前毫秒级时间戳 | public static now(): number {
// ❌ Fix: this.logger -> DateUtils.logger
DateUtils.logger.info('DateUtils.now() called');
return new Date().getTime();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left now AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AS... | public static now(): number {
// ❌ Fix: this.logger -> DateUtils.logger
DateUtils.logger.info('DateUtils.now() called');
return new Date().getTime();
} | https://gitcode.com/openharmony/codelabs | 02d3f1cd2e0bd7cade03eeb813d1b898b0aa4e97 | gitcode |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/model/BaseDataSource.ets | arkts | registerDataChangeListener | Register data change listener.
@param listener DataChangeListener | registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
LogUtil.info(TAG, 'add listener');
this.listeners.push(listener);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerDataChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DataChangeListener AST#id... | registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(listener) < 0) {
LogUtil.info(TAG, 'add listener');
this.listeners.push(listener);
}
} | https://gitee.com/openharmony-sig/applications_calculator.git | ca76f3b9bc7c1e9f49aab28dbe8d27d75f85fd05 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/query/SubQuery.ets | arkts | getDescription | 获取条件描述(用于调试)
@returns 条件描述字符串 | getDescription(): string {
if (this.conditions.length === 0) {
return `SubQuery(${this.relationName}): 无条件`
}
const conditionStrs: Array<string> = []
for (let i = 0; i < this.conditions.length; i++) {
const cond = this.conditions[i]
if (i > 0) {
conditionStrs.push(cond.logic... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#stateme... | getDescription(): string {
if (this.conditions.length === 0) {
return `SubQuery(${this.relationName}): 无条件`
}
const conditionStrs: Array<string> = []
for (let i = 0; i < this.conditions.length; i++) {
const cond = this.conditions[i]
if (i > 0) {
conditionStrs.push(cond.logic... | https://github.com/offlinecat-dev/OCNetORM | 3c9cd757cd4701bfb35a3cda469a138ac7079549 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsDetailViewModel.ets | arkts | loadGoodsSpecs | 加载商品规格 | loadGoodsSpecs() {
// 如果 ui 状态为成功,则不重复加载
if (this.specUiState === BaseNetWorkUiState.SUCCESS) {
return;
}
const params: GoodsIdRequest = new GoodsIdRequest();
params.goodsId = this.goodsId;
RequestHelper.repository <GoodsSpec[]>(this.goodsRepository.getGoodsSpecList(params))
.toas... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left loadGoodsSpecs AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef... | loadGoodsSpecs() {
// 如果 ui 状态为成功,则不重复加载
if (this.specUiState === BaseNetWorkUiState.SUCCESS) {
return;
}
const params: GoodsIdRequest = new GoodsIdRequest();
params.goodsId = this.goodsId;
RequestHelper.repository <GoodsSpec[]>(this.goodsRepository.getGoodsSpecList(params))
.toas... | https://github.com/Joker-x-dev/CoolMallArkTS | 38c51632073cd6b75646c433718ac4c1ae2a7ec2 | github |
LongLiveY96/chatcube | entry/src/main/ets/state/AppSettingsStore.ets | arkts | loadAllAssistants | ============================================================================
Assistant —— 加载
============================================================================
从 DB 拉一遍 assistants,更新内存 state | async loadAllAssistants(): Promise<Assistant[]> {
const list = await this.db.getAllAssistants()
this.setAssistants(list)
return list
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadAllAssistants 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#ge... | async loadAllAssistants(): Promise<Assistant[]> {
const list = await this.db.getAllAssistants()
this.setAssistants(list)
return list
} | https://github.com/LongLiveY96/chatcube | a99c314d77938bcab578b20a9ee1a7718ac48b11 | github |
openharmony-sig/applications_clock | feature/alarmclock/src/main/ets/utils/NotificationUtil.ets | arkts | cancel | Cancel notification by alarmId
@param alarmId Alarm id | static async cancel(alarmId: number | string): Promise<void> {
if (!alarmId) {
LogUtil.error(TAG, 'Execute method cancel failed, alarmId is incorrect.');
}
try {
await notificationManager.cancel(typeof alarmId === 'string' ? Number(alarmId) : alarmId);
LogUtil.info(TAG, 'publish Cancel a... | 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 cancel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alarmId AST#identifier#Right AST#:#Left : AST#:#R... | static async cancel(alarmId: number | string): Promise<void> {
if (!alarmId) {
LogUtil.error(TAG, 'Execute method cancel failed, alarmId is incorrect.');
}
try {
await notificationManager.cancel(typeof alarmId === 'string' ? Number(alarmId) : alarmId);
LogUtil.info(TAG, 'publish Cancel a... | https://gitee.com/openharmony-sig/applications_clock.git | 7ded1f275b4101f7cc85e3b7d6dea79b518e7b88 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets | arkts | operatorIncrement | Increments the BigInt value by 1.
@returns { BigInt } The incremented value.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public operatorIncrement(): BigInt {
return new BigInt("1") + this
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left operatorIncrement 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 BigI... | public operatorIncrement(): BigInt {
return new BigInt("1") + this
} | https://gitcode.com/iop123123/arkts-static-skills | 7f344bb11591d6914a76527c98212f30fc7f2250 | gitcode |
Joker-x-dev/CoolMallArkTS | feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets | arkts | shouldLoadAddress | 是否需要请求地址详情
@returns {boolean} 是否请求 | private shouldLoadAddress(): boolean {
return this.isEditMode && this.addressId > 0;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left shouldLoadAddress 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... | private shouldLoadAddress(): boolean {
return this.isEditMode && this.addressId > 0;
} | https://github.com/Joker-x-dev/CoolMallArkTS | fd9ecaebc30b2d0af66062f6f15f2705fae11e13 | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbility.ets | arkts | onCreate | onCreate
1、create and attach delegate
2、config windows transparent noNeed?
3、lifecycle.onCreate
4. setContentView() noNeed | async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
// 冷启动通过上下文环境获取到系统当前文字大小,并进行键值存储
AppStorage.setOrCreate('fontSizeScale', this.context.config.fontSizeScale);
Log.i(TAG, "this.context.config.fontSizeScale = " + this.context.config.fontSizeScale);
Log.i(TAG, "bundleCodeDir=" + thi... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left onCreate AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left want AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
// 冷启动通过上下文环境获取到系统当前文字大小,并进行键值存储
AppStorage.setOrCreate('fontSizeScale', this.context.config.fontSizeScale);
Log.i(TAG, "this.context.config.fontSizeScale = " + this.context.config.fontSizeScale);
Log.i(TAG, "bundleCodeDir=" + thi... | https://gitee.com/openharmony-sig/flutter_engine.git | a81e3f3357a5ff29737e268d44825ec868f30c7b | gitee |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/datasource/order/OrderNetworkDataSourceImpl.ets | arkts | getOrderPage | 获取订单分页列表
@param {OrderPageRequest} params - 分页查询参数
@returns {Promise<NetworkResponse<NetworkPageData<Order>>>} 订单分页数据 | async getOrderPage(params: OrderPageRequest): Promise<NetworkResponse<NetworkPageData<Order>>> {
const resp: AxiosResponse<NetworkResponse<NetworkPageData<Order>>> =
await NetworkClient.http.post("order/info/page", params);
return resp.data;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getOrderPage AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async getOrderPage(params: OrderPageRequest): Promise<NetworkResponse<NetworkPageData<Order>>> {
const resp: AxiosResponse<NetworkResponse<NetworkPageData<Order>>> =
await NetworkClient.http.post("order/info/page", params);
return resp.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 9762f143e034ec85e2f3f284edb10d4afa6d8169 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/AnomalyDetection.ets | arkts | calculateBaselinesByCategory | 按分类分组计算基线
@param bills 账单列表
@param userId 用户ID | static calculateBaselinesByCategory(bills: Bill[], userId: number): UserSpendingBaseline[] {
// 收集所有分类ID
const categoryIds: number[] = [];
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId === userId && bill.isDeleted === 0 && bill.type === 'expense') {
le... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateBaselinesByCategory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bills AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#su... | static calculateBaselinesByCategory(bills: Bill[], userId: number): UserSpendingBaseline[] {
// 收集所有分类ID
const categoryIds: number[] = [];
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId === userId && bill.isDeleted === 0 && bill.type === 'expense') {
le... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 85b70577ca5cb88ee5a3d81c602622d80549e07c | github |
openharmony-sig/online_event | solution_student_challenge/基于OpenHarmony的OpenGit_潘骏翔/OpenGit/entry/src/main/ets/MainAbility/common/models/repo/BranchModel.ets | arkts | fromJSON | 从json获取数据 | fromJSON(json: string) {
let obj = JSON.parse(json)
this._label = obj.label
let owner = new UserLite()
owner.fromJSON(JSON.stringify(obj.repo.owner))
this._owner = owner
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fromJSON AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left json AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#... | fromJSON(json: string) {
let obj = JSON.parse(json)
this._label = obj.label
let owner = new UserLite()
owner.fromJSON(JSON.stringify(obj.repo.owner))
this._owner = owner
} | https://gitee.com/openharmony-sig/online_event.git | a1acdfb76adedd38f3cb8bc1432dda0da37b3cee | gitee |
dingzhilin1990/zhilinclaw | src/agents/HanwudiWorkflow.ets | arkts | addLog | 添加日志条目 | private addLog(
step: number,
agent: string,
action: string,
status: WorkflowLogEntry['status'],
details?: any
): void {
this.log.push({
step,
agent,
action,
status,
timestamp: Date.now(),
details
});
if (this.config.enableLogging) {
console... | 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 private AST#identifier#Right AST#ERROR#Left AST#identifier#Left addLog AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Rig... | private addLog(
step: number,
agent: string,
action: string,
status: WorkflowLogEntry['status'],
details?: any
): void {
this.log.push({
step,
agent,
action,
status,
timestamp: Date.now(),
details
});
if (this.config.enableLogging) {
console... | https://github.com/dingzhilin1990/zhilinclaw | e802f15dc38fc54d56e3c88ece4d2583da66f074 | github |
Joker-x-dev/CoolMallArkTS | core/navigation/src/main/ets/feedback/FeedbackNavigator.ets | arkts | toList | 跳转到反馈列表
@returns {void} 无返回值 | static toList(): void {
navigateTo(FeedbackRoutes.List);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_stat... | static toList(): void {
navigateTo(FeedbackRoutes.List);
} | https://github.com/Joker-x-dev/CoolMallArkTS | ed3a80e69d6ed8e9c81fac055714f837567f126a | github |
SMAT-Lab/Homecheck-Sec2026 | test/unittest/sample/PreferReadonlyParametertypes/ets/defaultError.ets | arkts | object2 | property is not readonly | function object2(arg: { readonly prop: string; prop2: string[] }) {} // not all properties are readonly | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left object2 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arg AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | function object2(arg: { readonly prop: string; prop2: string[] }) {} // not all properties are readonly | https://github.com/SMAT-Lab/Homecheck-Sec2026 | 9458422a647962dab08c6aacbcb7cc250b2242b5 | github |
codelably/tuniao-ui | core/tuniaoui/src/main/ets/components/toast/TnToast.ets | arkts | message | 动态更新提示文本
利用 @ObservedV2 + @Trace 实现响应式更新 | set message(msg: string) {
if (this.toastParams !== null) {
this.toastParams.message = msg;
}
} | AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left message AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left msg AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identif... | set message(msg: string) {
if (this.toastParams !== null) {
this.toastParams.message = msg;
}
} | https://github.com/codelably/tuniao-ui | cdf3a1e33784ddd28cd1e01c5f2f06cedba58b86 | github |
PollenWang6/HiXD | entry/src/main/ets/services/ClassService.ets | arkts | getClassTable | 获取课程表数据 | async getClassTable(semCode: string, sid: string, forceRefresh: boolean = false): Promise<string> {
if (PreferenceUtil.getBool('role')) {
const key: string = 'ct_' + semCode;
return this.cache.getOrFetch<string>(key, async (): Promise<string> => {
return this.getClassTableYjspt(semCode, sid);
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getClassTable AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left semCode AST#identifier#Right AS... | async getClassTable(semCode: string, sid: string, forceRefresh: boolean = false): Promise<string> {
if (PreferenceUtil.getBool('role')) {
const key: string = 'ct_' + semCode;
return this.cache.getOrFetch<string>(key, async (): Promise<string> => {
return this.getClassTableYjspt(semCode, sid);
... | https://github.com/PollenWang6/HiXD | 70e641d746493b134914ba0304e636f4b5a74699 | github |
honjow/Next2V | shared/src/main/ets/network/ApiService.ets | arkts | getTopicWebReplies | Get actual replies from public topic page, as fallback when legacy replies API is empty or stale. | async getTopicWebReplies(topicId: number, cookie: string = ''): Promise<V2exReply[]> {
return this.topicWebRepliesClient().getReplies(topicId, cookie)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getTopicWebReplies AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left topicId AST#identifier#Right AST#type_annotation#Left AST#:#... | async getTopicWebReplies(topicId: number, cookie: string = ''): Promise<V2exReply[]> {
return this.topicWebRepliesClient().getReplies(topicId, cookie)
} | https://github.com/honjow/Next2V | 8c067da21b664c4406872eab1c4d378983c9a0d4 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Components/BridgeJsBuilder.ets | arkts | buildAnnotationBridgeJs | Build annotation/highlight/seek/read-aloud bridge JS.
Pure string — zero interpolations. | static buildAnnotationBridgeJs(): string {
return `
window.__mnxAnnotationLayerId = '__mnx_epub_highlight_layer';
window.__mnxHighlightHitRects = [];
window.__mnxIsAnnotationIgnoredNode = function(node) {
var current = node;
while (current) {
if (current.nodeType === 1 ... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left buildAnnotationBridgeJs 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 st... | static buildAnnotationBridgeJs(): string {
return `
window.__mnxAnnotationLayerId = '__mnx_epub_highlight_layer';
window.__mnxHighlightHitRects = [];
window.__mnxIsAnnotationIgnoredNode = function(node) {
var current = node;
while (current) {
if (current.nodeType === 1 ... | https://github.com/DaLongZhuaZi/manxia | 00fc34fc02997166058bb15de98f96fa0bcf239d | github |
openharmony-sig/node_pool | nodepool/src/main/ets/lib/NodePool.ets | arkts | cleanupExpiredNodes | 清理nodePool中过期的节点 | private cleanupExpiredNodes() {
const now = Date.now();
this.nodePool.forEach((offlineNodes, type) => {
if (offlineNodes) {
let typeReuseConfig = this.typeReuseConfigMap.get(type);
let expirationTime = (typeReuseConfig && typeReuseConfig.expirationTime > 0)
? typeReuseConfig.e... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cleanupExpiredNodes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST... | private cleanupExpiredNodes() {
const now = Date.now();
this.nodePool.forEach((offlineNodes, type) => {
if (offlineNodes) {
let typeReuseConfig = this.typeReuseConfigMap.get(type);
let expirationTime = (typeReuseConfig && typeReuseConfig.expirationTime > 0)
? typeReuseConfig.e... | https://gitee.com/openharmony-sig/node_pool.git | 5e01210278ef6dc265d0fccf6f47a68270c13e29 | gitee |
LongLiveY96/chatcube | entry/src/main/ets/services/WebSearchService.ets | arkts | bingSearch | ========== Bing 搜索功能 ==========
执行 Bing 搜索(公开接口,兼容旧调用) | async bingSearch(
query: string,
resultCount: number = 5,
runtimeConfig?: SearchRuntimeConfigSnapshot,
options?: WebSearchExecutionOptions
): Promise<BingSearchResponse> {
const runtime = runtimeConfig !== undefined ? runtimeConfig : await this.getRuntimeConfigSnapshot()
const requestId = op... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left bingSearch AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left query AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | async bingSearch(
query: string,
resultCount: number = 5,
runtimeConfig?: SearchRuntimeConfigSnapshot,
options?: WebSearchExecutionOptions
): Promise<BingSearchResponse> {
const runtime = runtimeConfig !== undefined ? runtimeConfig : await this.getRuntimeConfigSnapshot()
const requestId = op... | https://github.com/LongLiveY96/chatcube | 98a4aa1e2b01a665c4f8dd64ad6460cc6febde71 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | fill | Fills the Int32Array with specified value
@param { int } value - new value
@param { int } [start] - start index to begin fill from
@param { int } [end] - last index to end fill from, excluded
@returns { this } - modified Int32Array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public fill(value: int, start?: int, end?: int): this {
const k = normalizeIndex(start ?? 0, this.lengthInt)
const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt)
this.fillInternal(value, k, finalPos)
return this
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left fill AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ide... | public fill(value: int, start?: int, end?: int): this {
const k = normalizeIndex(start ?? 0, this.lengthInt)
const finalPos = normalizeIndex(end ?? this.lengthInt, this.lengthInt)
this.fillInternal(value, k, finalPos)
return this
} | https://gitcode.com/iop123123/arkts-static-skills | 7ab796b5de62a1507e4369dbfb7ae2e952613b97 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ContentFilterManager.ets | arkts | setSFWMode | 设置SFW模式 | public async setSFWMode(enabled: boolean): Promise<void> {
try {
await this.settingsManager.setBoolean(SettingKeys.SFW_MODE_ENABLED, enabled);
this.sfwModeEnabled = enabled;
logger.info(TAG, `SFW模式已${enabled ? '启用' : '禁用'}`);
// 通知所有监听器
this.notifyListeners(enabled);
} cat... | 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 setSFWMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST... | public async setSFWMode(enabled: boolean): Promise<void> {
try {
await this.settingsManager.setBoolean(SettingKeys.SFW_MODE_ENABLED, enabled);
this.sfwModeEnabled = enabled;
logger.info(TAG, `SFW模式已${enabled ? '启用' : '禁用'}`);
// 通知所有监听器
this.notifyListeners(enabled);
} cat... | https://github.com/DaLongZhuaZi/manxia | c16a76fad6cb32d03f74e76eccfd414a41811cb7 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets | arkts | isMangaDetailPayload | 判断脚本结果是否为漫画详情对象 | private isMangaDetailPayload(data: Object): boolean {
if (Array.isArray(data) || typeof data !== 'object') {
return false;
}
const item = data as Record<string, Object>;
const itemKeys = Object.keys(item);
const detailKeys: string[] = [
'id',
'title',
'url',
'cover',... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isMangaDetailPayload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifi... | private isMangaDetailPayload(data: Object): boolean {
if (Array.isArray(data) || typeof data !== 'object') {
return false;
}
const item = data as Record<string, Object>;
const itemKeys = Object.keys(item);
const detailKeys: string[] = [
'id',
'title',
'url',
'cover',... | https://github.com/DaLongZhuaZi/manxia | 213d61807051418bc806d885e632ddc31b2e32ff | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/UndefinableStringArray.ets | arkts | at | Returns an element at the specified index
@param { int } index - Element position
@returns { UndefinableString } An element at the specified index
@throws { RangeError } When index is out of bounds
@syscap SystemCapability.Utils.Lang | public at(index: int): UndefinableString {
return this.data[index]
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left at AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ident... | public at(index: int): UndefinableString {
return this.data[index]
} | https://gitcode.com/iop123123/arkts-static-skills | 63e72a2a158e19624c14109c4e8d5d16e007b026 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/SharedLedger.ets | arkts | getTags | 获取标签列表 | getTags(): string[] {
try {
const parsed = JSON.parse(this.tagsJson) as string[];
return parsed;
} catch (e) {
return [];
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getTags 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#string#Left string AST#string#Right AST#... | getTags(): string[] {
try {
const parsed = JSON.parse(this.tagsJson) as string[];
return parsed;
} catch (e) {
return [];
}
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | dc3b326038211992bdeb0be3e8c75b7f685393a5 | github |
azhu0001/localsend-harmony | entry/src/main/ets/service/WebClient.ets | arkts | register | 像其他设备发送当前设备信息
@param alias
@param port | static register(target: DeviceModel) {
if (!target.hostname) {
logger.warn('WebClient', 'invalid hostname')
return
}
const device: DeviceModel = DeviceProvider.getCurrentDevice()
const url = WebClient.getCombinedURL(target.hostname, target.port, ApiConstant.REGISTER)
HttpRequest.post<D... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left register AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left target AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Devic... | static register(target: DeviceModel) {
if (!target.hostname) {
logger.warn('WebClient', 'invalid hostname')
return
}
const device: DeviceModel = DeviceProvider.getCurrentDevice()
const url = WebClient.getCombinedURL(target.hostname, target.port, ApiConstant.REGISTER)
HttpRequest.post<D... | https://gitcode.com/azhu0001/localsend-harmony | 82a73a5ef018f54e058ddaf5a83fb59641909c82 | gitcode |
LongLiveY96/chatcube | entry/src/main/ets/services/ModelCapabilityMatcher.ets | arkts | findLogoProvider | 将 models.dev 条目的能力映射到 ModelInfo
已废弃:能力走 ModelInfo 派生,不再写回 ModelInfo
从模型 ID 推断原厂供应商 key,用于获取正确的 logo | private findLogoProvider(modelId: string): string {
// 1. 通过模型条目的 family 字段查找
const entry = this.findEntry(modelId)
if (entry !== null && entry.family !== undefined && entry.family !== '') {
const provider = this.familyLogoMap.get(entry.family)
if (provider !== undefined) {
return prov... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left findLogoProvider AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left modelId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | private findLogoProvider(modelId: string): string {
// 1. 通过模型条目的 family 字段查找
const entry = this.findEntry(modelId)
if (entry !== null && entry.family !== undefined && entry.family !== '') {
const provider = this.familyLogoMap.get(entry.family)
if (provider !== undefined) {
return prov... | https://github.com/LongLiveY96/chatcube | f2008669d9ba3aa3714db039639de214086af143 | github |
Joker-x-dev/CoolMallArkTS | core/designsystem/src/main/ets/component/Scroll.ets | arkts | build | 构建带小内边距的水平滚动布局
@returns {void} 无返回值 | build(): void {
HorizontalScroll({
scroller: this.scroller,
fillMaxSize: this.fillMaxSize,
fillMaxWidth: this.fillMaxWidth,
widthValue: this.widthValue,
heightValue: this.heightValue,
scrollBarState: this.scrollBarState,
paddingValue: $r("app.float.space_padding_small"),
... | 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#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
HorizontalScroll({
scroller: this.scroller,
fillMaxSize: this.fillMaxSize,
fillMaxWidth: this.fillMaxWidth,
widthValue: this.widthValue,
heightValue: this.heightValue,
scrollBarState: this.scrollBarState,
paddingValue: $r("app.float.space_padding_small"),
... | https://github.com/Joker-x-dev/CoolMallArkTS | 3871da14571d18265d997603f028b7ecf7004688 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.HashMap.ets | arkts | forEach | Executes a provided function once per each key/value pair in the HashMap, in insertion order
@param callbackFn to apply | forEach(callbackFn: HashMapCbFn<K, V>): void {
this.buckets.forEach((value: V, key: K) => {
callbackFn(value, key, this);
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left forEach AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callbackFn AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left HashMapC... | forEach(callbackFn: HashMapCbFn<K, V>): void {
this.buckets.forEach((value: V, key: K) => {
callbackFn(value, key, this);
});
} | https://gitcode.com/iop123123/arkts-static-skills | e48dee6d4bfaa5613b0b69180769d61908eb9bbd | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/components/BookTransitionOverlay.ets | arkts | startCloseTransition | 开始关闭过渡动画
@param coverPosition 封面在屏幕上的目标位置
@param readerContentPixelMap 阅读器当前内容截图(可选,已弃用)
@param onComplete 动画完成回调
@param readerContentImagePath 压缩后的截图临时文件路径(推荐使用) | public startCloseTransition(
coverPosition: CoverPosition,
readerContentPixelMap?: image.PixelMap,
onComplete?: () => void,
readerContentImagePath?: string,
closeCoverComponentId?: string
): void {
this.clearOpenReadyHideTimer();
// 检查动画是否启用
const animationSettingsManager = Animatio... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left startCloseTransition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left coverPosition AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#id... | public startCloseTransition(
coverPosition: CoverPosition,
readerContentPixelMap?: image.PixelMap,
onComplete?: () => void,
readerContentImagePath?: string,
closeCoverComponentId?: string
): void {
this.clearOpenReadyHideTimer();
// 检查动画是否启用
const animationSettingsManager = Animatio... | https://github.com/DaLongZhuaZi/manxia | 74b165ae379b0cbdc106fc579f13cd789561c608 | github |
Zhiyilang074811/enterprise-ai-assistant | harmony_app/entry/src/main/ets/services/ApiService.ets | arkts | get | 发送HTTP GET请求 | private async get<T>(url: string, params?: Record<string, string>): Promise<T> {
const httpRequest = http.createHttp();
try {
let requestUrl = url;
if (params) {
const queryString = Object.entries(params)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponen... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left async AST#identifier#Right AST#binary_expression#Left AST#identifier#Left get AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#f... | private async get<T>(url: string, params?: Record<string, string>): Promise<T> {
const httpRequest = http.createHttp();
try {
let requestUrl = url;
if (params) {
const queryString = Object.entries(params)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponen... | https://github.com/Zhiyilang074811/enterprise-ai-assistant | 1a346a1a12f7d20073aaf4f7708933f582b3dfa5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/ScraperManager.ets | arkts | searchAniList | 搜索AniList | private async searchAniList(
keyword: string,
contentType?: ScraperContentType,
limit: number = 25
): Promise<ScraperSearchResult> {
let anilistType = AniListMediaType.MANGA;
if (contentType === ScraperContentType.ANIME) {
anilistType = AniListMediaType.ANIME;
}
return th... | 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 searchAniList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left... | private async searchAniList(
keyword: string,
contentType?: ScraperContentType,
limit: number = 25
): Promise<ScraperSearchResult> {
let anilistType = AniListMediaType.MANGA;
if (contentType === ScraperContentType.ANIME) {
anilistType = AniListMediaType.ANIME;
}
return th... | https://github.com/DaLongZhuaZi/manxia | 625385d8b37cc4f0c85024bd07d6fe8f61245270 | github |
CsCesium/KantaiHomo | entry/src/main/ets/app/pages/components/panel/bottom/FloatOverlayPanel.ets | arkts | formatFleetSpeed | Fleet unified speed (min of all ship speeds): 0=陸上, 5=低速, 10=高速, 15=高速+, 20=最速. | function formatFleetSpeed(speed: number): string {
if (speed < 0 || !Number.isFinite(speed)) return '--';
if (speed >= 20) return '最速';
if (speed >= 15) return '高速+';
if (speed >= 10) return '高速';
if (speed >= 5) return '低速';
return '陸上';
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left formatFleetSpeed AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left speed AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function formatFleetSpeed(speed: number): string {
if (speed < 0 || !Number.isFinite(speed)) return '--';
if (speed >= 20) return '最速';
if (speed >= 15) return '高速+';
if (speed >= 10) return '高速';
if (speed >= 5) return '低速';
return '陸上';
} | https://github.com/CsCesium/KantaiHomo | ea4662257d0efec5bd14996a4e31a88d73f9a3d7 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | includes | Checks if specified argument is in Float64Array
@param e search element
@returns true if e is in Float64Array, false otherwise | public includes(e: double): boolean {
return this.includes(e, 0)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes 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 double AST... | public includes(e: double): boolean {
return this.includes(e, 0)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d8ed3442916ff276f211e4d702984b574d5ad15f | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.