nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony/codelabs | Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets | arkts | registerDeviceListCallback | 发现设备列表 | function registerDeviceListCallback() {
remoteDeviceModel.registerDeviceListCallback(() => {
localDeviceId = remoteDeviceModel.localDeviceId;
deviceList.length = 0;
for (var i = 0; i < remoteDeviceModel.deviceList.length; i++) {
deviceList.push(remoteDeviceModel.deviceList[i].deviceId);
}
});
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left registerDeviceListCallback AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#... | function registerDeviceListCallback() {
remoteDeviceModel.registerDeviceListCallback(() => {
localDeviceId = remoteDeviceModel.localDeviceId;
deviceList.length = 0;
for (var i = 0; i < remoteDeviceModel.deviceList.length; i++) {
deviceList.push(remoteDeviceModel.deviceList[i].deviceId);
}
});
... | https://gitee.com/openharmony/codelabs.git | 77bb5cd17f68410091ca84b82ad8b3ab1d98e8b1 | gitee |
openharmony/arkcompiler_taihe_ffi_gen | test/ani_optional/user/main.ets | arkts | func_primitive_f32 | 浮点类型测试函数 | function func_primitive_f32() {
let instance: optionalTest.ExampleInterface = optionalTest.getInterface();
instance.funcPrimitiveF32(3.14f) // float 对应 f32
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left func_primitive_f32 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_... | function func_primitive_f32() {
let instance: optionalTest.ExampleInterface = optionalTest.getInterface();
instance.funcPrimitiveF32(3.14f) // float 对应 f32
} | https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen | 357399966173d128a97981282976f0917a3291e4 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/LegadoHtmlBridge.ets | arkts | parseChainRuleToHtmlList | 解析链式规则,返回元素的 outerHTML 列表 | parseChainRuleToHtmlList(rule: string): string[] {
const elements = this.parseChainRuleToElements(rule);
return elements.map((elem: HTMLElement): string => elem.outerHTML);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left parseChainRuleToHtmlList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rule AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#ident... | parseChainRuleToHtmlList(rule: string): string[] {
const elements = this.parseChainRuleToElements(rule);
return elements.map((elem: HTMLElement): string => elem.outerHTML);
} | https://github.com/DaLongZhuaZi/manxia | 3ac8d35551737917763582d52fa583976945a2c6 | github |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/HttpUtil.ets | arkts | setBaseUrl | 设置基础URL
@param baseUrl API基础URL | static setBaseUrl(baseUrl: string): void {
HttpUtil.baseUrl = baseUrl;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setBaseUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left baseUrl AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Righ... | static setBaseUrl(baseUrl: string): void {
HttpUtil.baseUrl = baseUrl;
} | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 949d6f8c155231bbdcee632764c4626cc2db0384 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelCoverGenerator.ets | arkts | getConfig | 获取封面配置 | static getConfig(): CoverConfig {
return NovelCoverGenerator.CONFIG;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getConfig 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 CoverConfig ... | static getConfig(): CoverConfig {
return NovelCoverGenerator.CONFIG;
} | https://github.com/DaLongZhuaZi/manxia | a538e23d935f7041c0301f65ea5cb86cf6b89fef | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.url.ets | arkts | port | Gets the port portion of the URL.
@return {string} Returns the port portion of the URL. | get port(): string {
return this.cPort;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left port 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#ER... | get port(): string {
return this.cPort;
} | https://gitcode.com/iop123123/arkts-static-skills | 7e959ad36764e04c3199ea0065a0e5d64c8d67ab | gitcode |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets | arkts | moveInFixedMode | Moving in fixed mode.
@param offsetX
@param offsetY | private moveInFixedMode(offsetX: number, offsetY: number) {
let x = offsetX;
let y = offsetY;
if (this.isHorizontalSide) {
x = 0;
} else if (this.isVerticalSide) {
y = 0;
}
let offsetHypot = Math.hypot(x, y);
if (this.isLeft && this.isTop) {
// left top conner move
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left moveInFixedMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left offsetX AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#num... | private moveInFixedMode(offsetX: number, offsetY: number) {
let x = offsetX;
let y = offsetY;
if (this.isHorizontalSide) {
x = 0;
} else if (this.isVerticalSide) {
y = 0;
}
let offsetHypot = Math.hypot(x, y);
if (this.isLeft && this.isTop) {
// left top conner move
... | https://gitee.com/openharmony/codelabs.git | ce98ecb11742b81cefb69001fd874f6e6a744851 | gitee |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/common/ThemeManager.ets | arkts | updateSystemColorMode | 更新系统主题状态(由EntryAbility调用) | updateSystemColorMode(isDark: boolean): void {
this.systemColorMode = isDark ? 1 : 0
if (this.themeMode === ThemeMode.AUTO) {
this.updateTheme()
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateSystemColorMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left isDark AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST... | updateSystemColorMode(isDark: boolean): void {
this.systemColorMode = isDark ? 1 : 0
if (this.themeMode === ThemeMode.AUTO) {
this.updateTheme()
}
} | https://github.com/AetheriumSimulator/qemu-hmos | 34d32e40c55905119ffc87b5d3de9db810d90840 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new FormatError instance with provided message and error specific information
@param { String | undefined } message - Error text
@param { ErrorOptions | undefined } options - Error options
@syscap SystemCapability.Utils.Lang | constructor(message?: String, options?: ErrorOptions) {
super("UncaughtExceptionError", message, options)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | constructor(message?: String, options?: ErrorOptions) {
super("UncaughtExceptionError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | 46cb794b9ce7150350300aa44ae58581b7547330 | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/StoragePaths.ets | arkts | deleteVmFiles | 删除 VM 的所有文件(包括磁盘、配置、日志) | static async deleteVmFiles(vmName: string): Promise<boolean> {
try {
const vmDir = StoragePaths.getVmDir(vmName)
const sharedDir = StoragePaths.getVmSharedDir(vmName)
// 删除 VM 目录
try {
await fs.rmdir(vmDir)
hilog.info(0x0000, 'STORAGE', '删除 VM 目录: %{public}s', vmDir)... | 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 deleteVmFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left vmName AST#identifier#Right AST#:#Left : A... | static async deleteVmFiles(vmName: string): Promise<boolean> {
try {
const vmDir = StoragePaths.getVmDir(vmName)
const sharedDir = StoragePaths.getVmSharedDir(vmName)
// 删除 VM 目录
try {
await fs.rmdir(vmDir)
hilog.info(0x0000, 'STORAGE', '删除 VM 目录: %{public}s', vmDir)... | https://github.com/AetheriumSimulator/qemu-hmos | 58bdc557c5b14e6a233b00158320c1882a0c2b4b | github |
Nekofox-POT/LinMusic | entry/src/main/ets/package/audio_player/by_ffmpeg_player.ets | arkts | playing | 播放 // | playing() {nativeModule.playing()} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left playing 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#expression_statement#Left AST... | playing() {nativeModule.playing()} | https://github.com/Nekofox-POT/LinMusic | 3d6aeaa775ea15b9ae297b89e43f2c4c0823e1a3 | github |
HunZiLei/ArkTS_PokePomodoro | entry/src/main/ets/pages/customCpt/home.ets | arkts | touchUpLoadMore | 手指抬起,处理加载更多 | touchUpLoadMore() {
animateTo({
duration: 200, // 动画时长
}, () => {
// 偏移量设置为0
this.offsetY = 0
})
if (this.isCanLoadMore) {
console.info('======执行加载更多========')
// 加载中...
this.isLoading = true
// 耗时操作
this.loadMoreData()
} else {
console.info('=... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left touchUpLoadMore 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... | touchUpLoadMore() {
animateTo({
duration: 200, // 动画时长
}, () => {
// 偏移量设置为0
this.offsetY = 0
})
if (this.isCanLoadMore) {
console.info('======执行加载更多========')
// 加载中...
this.isLoading = true
// 耗时操作
this.loadMoreData()
} else {
console.info('=... | https://github.com/HunZiLei/ArkTS_PokePomodoro | 4e8902354008f30ad85ba420624bc2aae22c1da8 | github |
openharmony-sig/ohos_easyui | easyui/src/main/ets/common/components/CardView.ets | arkts | checkAttribute | 属性检查,设为默认属性 | static checkAttribute(attribute:CardViewAttribute){
if(attribute == undefined){
attribute = new CardViewAttribute()
}
attribute.name = Precondition.check(attribute.name,CardViewAttribute.DEFAULT_NAME)
attribute.icon = Precondition.check(attribute.icon,CardViewAttribute.DEFAULT_ICON)
attribu... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left checkAttribute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left attribute AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | static checkAttribute(attribute:CardViewAttribute){
if(attribute == undefined){
attribute = new CardViewAttribute()
}
attribute.name = Precondition.check(attribute.name,CardViewAttribute.DEFAULT_NAME)
attribute.icon = Precondition.check(attribute.icon,CardViewAttribute.DEFAULT_ICON)
attribu... | https://gitee.com/openharmony-sig/ohos_easyui.git | 2762a59ff4256fd5be4d6677ac314c15eb3ee8c3 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/UIContextManager.ets | arkts | getAbilityContext | 获取Ability上下文 | public getAbilityContext(): common.UIAbilityContext | null {
return this.abilityContext;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAbilityContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Le... | public getAbilityContext(): common.UIAbilityContext | null {
return this.abilityContext;
} | https://github.com/DaLongZhuaZi/manxia | 70b7c6c36c3d9aaa037f24043fa3e109dc9f574d | github |
SMAT-Lab/Homecheck-Sec2026 | test/unittest/sample/PreferReadonlyParametertypes/ets/defaultPass.ets | arkts | object1 | the above examples work the same if you use ReadonlyArray<T> instead | function object1(arg: { readonly prop: string }) {} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left object1 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 object1(arg: { readonly prop: string }) {} | https://github.com/SMAT-Lab/Homecheck-Sec2026 | 77de5e198c02db70468663cbce0740b9e4cf56c0 | github |
openharmony-sig/FastBle | library/src/main/ets/BleManager.ets | arkts | getConnectOverTime | Get operate connect Over Time
@return | public getConnectOverTime(): number {
return this.connectOverTime;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getConnectOverTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number ... | public getConnectOverTime(): number {
return this.connectOverTime;
} | https://gitee.com/openharmony-sig/FastBle.git | 843a3cbba1ef47f4364c84e6eef64ffd0bbd705a | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | constructor | Creates an BigInt64Array with respect to data, byteOffset and length.
@param buf data initializer
@param byteOffset byte offset from begin of the buf
@param length size of elements of type long in newly created BigInt64Array | public constructor(buf: Buffer, byteOffset: int, length: int) {
if (buf.getByteLength() % BigInt64Array.BYTES_PER_ELEMENT != 0) {
throw new RangeError("ArrayBuffer.byteLength should be multiple of 8 as BigInt64Array.BYTES_PER_ELEMENT")
}
if (byteOffset % BigInt64Array.BYTES_PER_E... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Buffe... | public constructor(buf: Buffer, byteOffset: int, length: int) {
if (buf.getByteLength() % BigInt64Array.BYTES_PER_ELEMENT != 0) {
throw new RangeError("ArrayBuffer.byteLength should be multiple of 8 as BigInt64Array.BYTES_PER_ELEMENT")
}
if (byteOffset % BigInt64Array.BYTES_PER_E... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ecc22e57c3b6a1244eb5715914b463b219e04b34 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | convertOnlineComicRecordToComicInfo | 将 online_comic_info 数据库记录转换为 ComicInfo
[修复] 用于支持从 online_comic_info 表查询漫画 | private convertOnlineComicRecordToComicInfo(record: ComicInfoBatchRecord): ComicInfo {
const isPrivateValue: number | undefined | null = record.isPrivate;
const isNSFWValue: number | undefined | null = record.isNSFW;
return {
id: record.id,
title: record.title,
author: record.author... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertOnlineComicRecordToComicInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R... | private convertOnlineComicRecordToComicInfo(record: ComicInfoBatchRecord): ComicInfo {
const isPrivateValue: number | undefined | null = record.isPrivate;
const isNSFWValue: number | undefined | null = record.isNSFW;
return {
id: record.id,
title: record.title,
author: record.author... | https://github.com/DaLongZhuaZi/manxia | 7bec2bedddd53b2c64f0bb9668f40a06881aec24 | github |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/features/discover/src/main/ets/model/DiscoverModel.ets | arkts | getHotList | Load hot list data on search page | getHotList(): void {
this.funNetwork.getHotList()
.then((data: LearningResource[]) => {
this.hotList.length = 0;
this.hotList = data.map((item: LearningResource, index: number) => {
(item as HotListItem).rank = index + 1;
return item as HotListItem;
});
Lo... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getHotList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#L... | getHotList(): void {
this.funNetwork.getHotList()
.then((data: LearningResource[]) => {
this.hotList.length = 0;
this.hotList = data.map((item: LearningResource, index: number) => {
(item as HotListItem).rank = index + 1;
return item as HotListItem;
});
Lo... | https://gitcode.com/HarmonyOS_Samples/hmosworld | 2ef4703008b06dbeb108cbbda2a3732402b4e653 | gitcode |
Dabing-0x19d/berverage_HarmonyOS6.0 | entry/src/main/ets/model/ShopExportImportManager.ets | arkts | getSharePreview | 获取分享文件预览信息 | async getSharePreview(jsonData: string): Promise<ImportPreview | null> {
let shareData: ShopShareData | null = null;
try {
shareData = JSON.parse(jsonData) as ShopShareData;
} catch {
console.error('[ShopExportImport] getSharePreview: Invalid JSON');
return null;
}
if (!this.val... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getSharePreview AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left jsonData AST#identifier#Right AST#type_annotation#Left... | async getSharePreview(jsonData: string): Promise<ImportPreview | null> {
let shareData: ShopShareData | null = null;
try {
shareData = JSON.parse(jsonData) as ShopShareData;
} catch {
console.error('[ShopExportImport] getSharePreview: Invalid JSON');
return null;
}
if (!this.val... | https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0 | dc63d10c210b930065271628b62179f6338691ee | github |
richshaw2015/nds | ohos/entry/src/test/LayoutBackupProperty.test.ets | arkts | generateLayoutArray | Generate a random array of LayoutEntry objects with mixed targets. | function generateLayoutArray(rng: PRNG): LayoutEntry[] {
const length = rng.nextInt(0, 20);
const layouts: LayoutEntry[] = [];
for (let i = 0; i < length; i++) {
const target = rng.pick(TARGETS);
layouts.push(generateLayoutEntry(rng, target));
}
return layouts;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left generateLayoutArray AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rng AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST... | function generateLayoutArray(rng: PRNG): LayoutEntry[] {
const length = rng.nextInt(0, 20);
const layouts: LayoutEntry[] = [];
for (let i = 0; i < length; i++) {
const target = rng.pick(TARGETS);
layouts.push(generateLayoutEntry(rng, target));
}
return layouts;
} | https://github.com/richshaw2015/nds | 91b7795d29bd60a0904f6509de82af02802cde84 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets | arkts | convertEasingToCurve | 转换缓动类型到曲线 | private convertEasingToCurve(easing?: AnimationEasing): Curve {
if (!easing) return Curve.EaseOut;
switch (easing) {
case AnimationEasing.LINEAR:
return Curve.Linear;
case AnimationEasing.EASE:
return Curve.Ease;
case AnimationEasing.EASE_IN:
return Curve.EaseIn;... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertEasingToCurve AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left easing AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right A... | private convertEasingToCurve(easing?: AnimationEasing): Curve {
if (!easing) return Curve.EaseOut;
switch (easing) {
case AnimationEasing.LINEAR:
return Curve.Linear;
case AnimationEasing.EASE:
return Curve.Ease;
case AnimationEasing.EASE_IN:
return Curve.EaseIn;... | https://github.com/DaLongZhuaZi/manxia | 0644a8d90e8ce169f9f2439f785aa849fac43e98 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | entries | Returns an array of key, value pairs for every entry in the Uint32Array
@returns { IterableIterator<[int, Number]> } - key, value pairs for every entry in the array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public entries(): IterableIterator<[int, Number]> {
return new Uint32ArrayIteratorEntries(this)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left entries 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_sta... | public entries(): IterableIterator<[int, Number]> {
return new Uint32ArrayIteratorEntries(this)
} | https://gitcode.com/iop123123/arkts-static-skills | 4a25e6910b171b62af2eb5a045d9420209054a23 | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/managers/QemuVMManager.ets | arkts | getDeviceTypeCode | 转换设备类型为数字码 | private getDeviceTypeCode(deviceType: string): number {
const typeMap: Map<string, number> = new Map([
['phone', 1],
['tablet', 2],
['2in1', 3],
['pc', 4],
['tv', 5],
['wearable', 6]
])
const code = typeMap.get(deviceType.toLowerCase())
return code !== undefined ? c... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getDeviceTypeCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceType AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS... | private getDeviceTypeCode(deviceType: string): number {
const typeMap: Map<string, number> = new Map([
['phone', 1],
['tablet', 2],
['2in1', 3],
['pc', 4],
['tv', 5],
['wearable', 6]
])
const code = typeMap.get(deviceType.toLowerCase())
return code !== undefined ? c... | https://github.com/AetheriumSimulator/qemu-hmos | f6166c240bdebf48779382ded329eabc54f5ee50 | github |
openharmony/distributedhardware_distributed_hardware_fwk | application/entry/src/main/ets/utils/DeviceUtil.ets | arkts | isSmallFoldProduct | 是否是小内折产品(L+V)
@returns boolean | public static isSmallFoldProduct(): boolean {
logger.info(`${TAG} isSmallFoldProduct in.`);
return [FoldPhoneTypeValue.SMALL_FOLD,
FoldPhoneTypeValue.EXPANDING_NEW_FORMS].includes(DeviceUtil.getFoldProductType());
} | 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 isSmallFoldProduct AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | public static isSmallFoldProduct(): boolean {
logger.info(`${TAG} isSmallFoldProduct in.`);
return [FoldPhoneTypeValue.SMALL_FOLD,
FoldPhoneTypeValue.EXPANDING_NEW_FORMS].includes(DeviceUtil.getFoldProductType());
} | https://gitee.com/openharmony/distributedhardware_distributed_hardware_fwk.git | ceb1bd479fad4d1f95b2a73728ff1515cf3055dd | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Scraper/BangumiScraper.ets | arkts | extractFromInfobox | 从infobox提取信息 | private extractFromInfobox(infobox: BangumiInfoboxItem[] | undefined, keys: string[]): string[] {
if (!infobox) return [];
const results: string[] = [];
for (const item of infobox) {
if (keys.includes(item.key)) {
if (typeof item.value === 'string') {
results.push(item.value);
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractFromInfobox AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left infobox AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_... | private extractFromInfobox(infobox: BangumiInfoboxItem[] | undefined, keys: string[]): string[] {
if (!infobox) return [];
const results: string[] = [];
for (const item of infobox) {
if (keys.includes(item.key)) {
if (typeof item.value === 'string') {
results.push(item.value);
... | https://github.com/DaLongZhuaZi/manxia | 2adeb9906e876ecbdcbe361cc12cb744bd284aac | github |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/GlobalDataManager.ets | arkts | initializeApp | 初始化应用 | private async initializeApp(): Promise<void> {
// 检查是否首次启动
const hasShownWelcome: boolean = await StorageUtil.getHasShownWelcome();
this.showWelcomeModal = !hasShownWelcome;
// 从本地存储恢复用户信息和token
const savedUserInfo: UserInfo | null = await StorageUtil.getUserInfo();
const savedToken: string =... | 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 initializeApp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | private async initializeApp(): Promise<void> {
// 检查是否首次启动
const hasShownWelcome: boolean = await StorageUtil.getHasShownWelcome();
this.showWelcomeModal = !hasShownWelcome;
// 从本地存储恢复用户信息和token
const savedUserInfo: UserInfo | null = await StorageUtil.getUserInfo();
const savedToken: string =... | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 0fd04ce1e9b775842460c0ccf92264f7a01dd63f | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/system/windows/classes/meowAppHost.ets | arkts | reportWindowFocus | Report window focus event.
@param windowId The window ID. | reportWindowFocus(windowId: string) {
const idxInHistory = this.windowFocusHistory.indexOf(windowId);
if (idxInHistory !== -1) {
this.windowFocusHistory.splice(idxInHistory, 1);
}
this.windowFocusHistory.push(windowId);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left reportWindowFocus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left windowId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right... | reportWindowFocus(windowId: string) {
const idxInHistory = this.windowFocusHistory.indexOf(windowId);
if (idxInHistory !== -1) {
this.windowFocusHistory.splice(idxInHistory, 1);
}
this.windowFocusHistory.push(windowId);
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | db631a7cadec99f3f6d5341dbc0015a7eda507db | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.HashMap.ets | arkts | isEmpty | Checks if the HashMap is empty
@returns true if the HashMap is empty, false otherwise | isEmpty(): boolean {
return this.buckets.size === 0;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isEmpty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_b... | isEmpty(): boolean {
return this.buckets.size === 0;
} | https://gitcode.com/iop123123/arkts-static-skills | 1544755f64a4d62e2c573b5bac72c8cdbd9252fd | gitcode |
arkui-x/samples | CodeLab/Cases/feature/groupavatar/src/main/ets/utils/ImageCombination.ets | arkts | divideImage2Group | 将选择的头像列表组装为二位数组,用于填充九宫格组件
@param images
@returns | function divideImage2Group(personGroup: (ResourceStr | image.PixelMap)[]): GroupAvatarModel[][] {
let imageGroup: GroupAvatarModel[][] = [];
if (personGroup.length <= 4) {
// 人数少于等于4时,显示两行两列
imageGroup = divideGroupBySize(personGroup, 2);
} else if (personGroup.length <= 9) {
// 人数大于4时,显示三行三列
imag... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left divideImage2Group AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left personGroup AST#identifier#Right AST#type_annotation#Left AST#:#Left... | function divideImage2Group(personGroup: (ResourceStr | image.PixelMap)[]): GroupAvatarModel[][] {
let imageGroup: GroupAvatarModel[][] = [];
if (personGroup.length <= 4) {
// 人数少于等于4时,显示两行两列
imageGroup = divideGroupBySize(personGroup, 2);
} else if (personGroup.length <= 9) {
// 人数大于4时,显示三行三列
imag... | https://gitcode.com/arkui-x/samples | 6290cf88e14682298fc053c25d33b2cae298babd | gitcode |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test24_original_index.ets | arkts | testShortCircuitAssign | --- Short-circuit assignment (&&, ||) --- | function testShortCircuitAssign(): string {
let x: number = 5;
let y: number = 0;
let result: string = '';
// Logical AND: both must be truthy
if (x > 0 && y > 0) {
result = 'both';
} else {
result = 'not both';
}
// Logical OR: at least one truthy
if (x > 0 || y > 0) {
result = result + '... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testShortCircuitAssign 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#pred... | function testShortCircuitAssign(): string {
let x: number = 5;
let y: number = 0;
let result: string = '';
// Logical AND: both must be truthy
if (x > 0 && y > 0) {
result = 'both';
} else {
result = 'not both';
}
// Logical OR: at least one truthy
if (x > 0 || y > 0) {
result = result + '... | https://github.com/miaochiahao/ark-ghidra | 034c8f4264f9a2d41a9620b1d007a958e59cca2b | github |
zmuxuny/ai-guardian-star | entry/src/main/ets/pages/MqttManager.ets | arkts | constructor | 用于定期检查设备在线状态 | private constructor() {
this.initClient();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor 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 ... | private constructor() {
this.initClient();
} | https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/pages/MqttManager.ets#L65-L67 | 1260a6e03b157f0f22650d77a47c19a19b87bf99 | github |
apap6628114/nga_oh | entry/src/main/ets/store/SettingsStore.ets | arkts | settingsKey | ============== Persist ============== | private settingsKey(): string {
return `settings_${this.auth.uid}`
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left settingsKey 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#... | private settingsKey(): string {
return `settings_${this.auth.uid}`
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/SettingsStore.ets#L85-L87 | b4eda48f579af69a3a3a0ac7a1b3a8e7cbf9901f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | evalJS | ==================== JS执行 ====================
执行JavaScript代码(同步版本)
注意:此方法在同步上下文中调用异步的JSVM执行
由于ArkTS不支持同步等待,这里使用Promise.then处理
实际使用时应优先调用evalJSAsync | private evalJS(code: string): string {
// 在同步上下文中,我们无法等待异步结果
// 记录日志并返回空字符串,调用方应使用异步版本
if (LegadoRuleAnalyzer.ENABLE_SELECTOR_TRACE) {
logger.debug(TAG, `JS执行(同步): ${code.substring(0, 50)}... - 建议使用异步版本`);
}
// 启动异步执行但不等待结果(用于预热)
const jsEngine = getLegadoJsEngine();
const conte... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left evalJS AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left code AST#identifier#Right AST#:#Left : AST#:#Right AST#E... | private evalJS(code: string): string {
// 在同步上下文中,我们无法等待异步结果
// 记录日志并返回空字符串,调用方应使用异步版本
if (LegadoRuleAnalyzer.ENABLE_SELECTOR_TRACE) {
logger.debug(TAG, `JS执行(同步): ${code.substring(0, 50)}... - 建议使用异步版本`);
}
// 启动异步执行但不等待结果(用于预热)
const jsEngine = getLegadoJsEngine();
const conte... | https://github.com/DaLongZhuaZi/manxia | b35b5c58458463f8fa186f7e9e0b970f0f9ac907 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GyroAssistService.ets | arkts | setEnabled | ==================== 配置方法 ====================
启用/禁用体感助手 | setEnabled(enabled: boolean): void {
if (this._enabled === enabled) {
// 串流页面退出时 dispose() 会停止传感器监听;如果持久化设置仍为开启,
// 下次进入串流会再次 setEnabled(true)。此时运行态可能是 enabled=true
// 但 sensorListening=false,必须补启动,否则需要用户手动关/开一次才生效。
if (enabled && !this.sensorListening) {
this.startListening();
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right AST#)#Left ) ... | setEnabled(enabled: boolean): void {
if (this._enabled === enabled) {
// 串流页面退出时 dispose() 会停止传感器监听;如果持久化设置仍为开启,
// 下次进入串流会再次 setEnabled(true)。此时运行态可能是 enabled=true
// 但 sensorListening=false,必须补启动,否则需要用户手动关/开一次才生效。
if (enabled && !this.sensorListening) {
this.startListening();
... | https://github.com/AlkaidLab/moonlight-harmony | 71e66cf2aaf5a1358c04ac973c31a864f1e9d810 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/LibFreeRDP.ets | arkts | setTcpKeepalive | Set TCP Keepalive settings (must be called before connect) | static setTcpKeepalive(inst: number, enabled: boolean, delay: number, interval: number, retries: number): boolean {
if (!LibFreeRDP.ensureNativeReady()) {
return false;
}
return freerdpNative!.freerdpSetTcpKeepalive(inst, enabled, delay, interval, retries);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setTcpKeepalive AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inst AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | static setTcpKeepalive(inst: number, enabled: boolean, delay: number, interval: number, retries: number): boolean {
if (!LibFreeRDP.ensureNativeReady()) {
return false;
}
return freerdpNative!.freerdpSetTcpKeepalive(inst, enabled, delay, interval, retries);
} | https://github.com/tangwengang-del/freerdp-harmonyos | 21a40436c835d6203f3cc51841cad5b2187b2ed9 | github |
openharmony/arkui_ace_engine | examples/DrawableDescriptor/entry/src/main/ets/pages/DrawableDescriptorReleaseTest.ets | arkts | Test003 | E2E_003: DrawableDescriptor release() -> release() 不崩溃 | Test003() {
const id = 'E2E_003'
try {
let drawable = this.CreateDrawableFromRes()
if (!drawable) {
this.Fail(id, '无法创建 DrawableDescriptor')
return
}
drawable.release()
drawable.release() // 第二次调用不应崩溃
if (drawable.isReleased()) {
this.Pass(id)
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left Test003 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_declaration#Left AST#... | Test003() {
const id = 'E2E_003'
try {
let drawable = this.CreateDrawableFromRes()
if (!drawable) {
this.Fail(id, '无法创建 DrawableDescriptor')
return
}
drawable.release()
drawable.release() // 第二次调用不应崩溃
if (drawable.isReleased()) {
this.Pass(id)
... | https://gitcode.com/openharmony/arkui_ace_engine | 2a18bb7db77f597c59b27f73f7e33c847d3b907b | gitcode |
codelably/HCompass | packages/main/src/main/ets/viewmodel/NavigationViewModel.ets | arkts | requestNavigationResult | 发起结果回传跳转
@returns {void} 无返回值 | requestNavigationResult(): void {
const DemoNavigator = getContainer().tryResolve<IDemoNavSvc>(DEMO_NAV_SVC_KEY);
DemoNavigator?.toNavigationResult()
.then((result?: DemoNavResult): void => {
const title: string = result?.title?.trim() ?? "";
const description: string = result?.descripti... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left requestNavigationResult 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#stat... | requestNavigationResult(): void {
const DemoNavigator = getContainer().tryResolve<IDemoNavSvc>(DEMO_NAV_SVC_KEY);
DemoNavigator?.toNavigationResult()
.then((result?: DemoNavResult): void => {
const title: string = result?.title?.trim() ?? "";
const description: string = result?.descripti... | https://github.com/codelably/HCompass | a0d09b5c23aa0a60d0e8e80e6b9064bf1954f990 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | some | Checks that at least one element of Int32Array satisfies the passed function
@param fn check function
@returns true if some element satisfies fn | public some(fn: (element: int) => boolean): boolean {
let newF: (element: int, index: int, array: Int32Array) => boolean =
(element: int, index: int, array: Int32Array): boolean => { return fn(element) }
return this.some(newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left some AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ... | public some(fn: (element: int) => boolean): boolean {
let newF: (element: int, index: int, array: Int32Array) => boolean =
(element: int, index: int, array: Int32Array): boolean => { return fn(element) }
return this.some(newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 7dd10fe5d295b31d52d47048a596f68c3675cf07 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/left_shift/left_shift_long.ets | arkts | main | ---
desc: check left shift operation for long integer
--- | function main(): void {
const a: long = {{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: long = {{v.left}}
const b: int = {{v.right}}
assert (a << b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | c3cd2778e65a4485976a7d0bde06e3829c43a467 | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/microphone/MicrophoneStream.ets | arkts | startMicrophoneCapture | 启动麦克风捕获
使用 native 低时延麦克风采集器(OHAudio FAST 模式),
在 C++ 回调线程中直接完成 Opus 编码和网络发送。 | private async startMicrophoneCapture(): Promise<boolean> {
if (this.running) {
return true;
}
try {
// 获取麦克风端口
const micPort = this.moonBridge.getMicPortNumber();
if (micPort === 0) {
console.warn(TAG, '未获取到麦克风端口');
} else {
console.info(TAG, `使用麦克风端口: ${... | 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 startMicrophoneCapture AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#... | private async startMicrophoneCapture(): Promise<boolean> {
if (this.running) {
return true;
}
try {
// 获取麦克风端口
const micPort = this.moonBridge.getMicPortNumber();
if (micPort === 0) {
console.warn(TAG, '未获取到麦克风端口');
} else {
console.info(TAG, `使用麦克风端口: ${... | https://github.com/AlkaidLab/moonlight-harmony | 8bf58b621f0111e099d9d447e3c31e208d71e0dd | github |
HarmonyOS_Codelabs/readerkit_codelab_arkts | entry/src/main/ets/pages/Index.ets | arkts | pageTransition | Remove the page transition animation to speed up the page access speed of the reader | pageTransition() {
PageTransitionEnter({ duration: 0, curve: Curve.Sharp });
PageTransitionExit({ duration: 0, curve: Curve.Sharp });
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left pageTransition 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... | pageTransition() {
PageTransitionEnter({ duration: 0, curve: Curve.Sharp });
PageTransitionExit({ duration: 0, curve: Curve.Sharp });
} | https://gitcode.com/HarmonyOS_Codelabs/readerkit_codelab_arkts | 9bd0ac57dfea6aaafe3cf4a3a6dcf2935f6ed153 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/schema/SchemaBuilder.ets | arkts | createTable | 执行建表操作
@param store RdbStore 实例
@param metadata 实体元数据
@returns Promise<CreateTableResult> | async createTable(store: relationalStore.RdbStore, metadata: EntityMetadata): Promise<CreateTableResult> {
const sqlStatements: Array<string> = [this.generateCreateTableSql(metadata), ...this.generateCreateIndexSql(metadata)]
const mergedSql = sqlStatements.join('; ')
try {
for (let i = 0; i < sqlS... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createTable AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left store AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | async createTable(store: relationalStore.RdbStore, metadata: EntityMetadata): Promise<CreateTableResult> {
const sqlStatements: Array<string> = [this.generateCreateTableSql(metadata), ...this.generateCreateIndexSql(metadata)]
const mergedSql = sqlStatements.join('; ')
try {
for (let i = 0; i < sqlS... | https://github.com/offlinecat-dev/OCNetORM | 8c2b8f994808b0462f680d931c44a3ade087e704 | github |
HarmonyOS_Codelabs/arkts-basic-syntax-demo | entry/src/main/ets/pages/BasicPage.ets | arkts | logicalOperators | 逻辑运算符 | function logicalOperators() {
let a = false && true; // false(首个条件为false,直接短路)
let b = true || false; // true(首个条件为true,直接短路)
let c = !false; // true.
console.log(`a: ${a}`);
console.log(`b: ${b}`);
console.log(`c: ${c}`);
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left logicalOperators AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_de... | function logicalOperators() {
let a = false && true; // false(首个条件为false,直接短路)
let b = true || false; // true(首个条件为true,直接短路)
let c = !false; // true.
console.log(`a: ${a}`);
console.log(`b: ${b}`);
console.log(`c: ${c}`);
} | https://gitcode.com/HarmonyOS_Codelabs/arkts-basic-syntax-demo | 05cb3e2fbd31d3afafaf45fb25e69446f900a535 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Enforcement/UnifiedDetailPageEnforcer.ets | arkts | getLastEnforcementResult | 获取上次执行结果 | getLastEnforcementResult(): EnforcementResult | null {
return this.lastEnforcementResult;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLastEnforcementResult 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 ... | getLastEnforcementResult(): EnforcementResult | null {
return this.lastEnforcementResult;
} | https://github.com/DaLongZhuaZi/manxia | 9a06b2dec0c9ba41ed9f5dcf65a911a01205529a | github |
openharmony-tpc/ImageKnife | library/src/main/ets/ImageKnife.ets | arkts | removeAllMemoryCache | 清除所有内存缓存 | removeAllMemoryCache(): void {
this.memoryCache.removeAll()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeAllMemoryCache 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#stateme... | removeAllMemoryCache(): void {
this.memoryCache.removeAll()
} | https://gitee.com/openharmony-tpc/ImageKnife.git | dfbe69fdd38fc2409f7919106618f09bb09cf1f9 | gitee |
picklerick422/zju-learning-assistant-OH | entry/src/main/ets/services/FileService.ets | arkts | mimeOf | 按扩展名推断 MIME type。 | function mimeOf(path: string): string {
const dot = path.lastIndexOf('.');
const ext = dot >= 0 ? path.slice(dot + 1).toLowerCase() : '';
switch (ext) {
case 'pdf': return 'application/pdf';
case 'doc': return 'application/msword';
case 'docx': return 'application/vnd.openxmlformats-officedocument.wor... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left mimeOf AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | function mimeOf(path: string): string {
const dot = path.lastIndexOf('.');
const ext = dot >= 0 ? path.slice(dot + 1).toLowerCase() : '';
switch (ext) {
case 'pdf': return 'application/pdf';
case 'doc': return 'application/msword';
case 'docx': return 'application/vnd.openxmlformats-officedocument.wor... | https://github.com/picklerick422/zju-learning-assistant-OH | cb4f3dfb7b34faaa517553aa1d5fb70c83d6225f | github |
openharmony-sig/applications_clock | common/src/main/ets/utils/WantAgentUtil.ets | arkts | getMainPageWantAgent | Obtaining the WantAgent for Encapsulating the Home Page
@return WantAgent used to start main page | static async getMainPageWantAgent(alarmId?: number | string, isMissed?: boolean): Promise<WantAgent | undefined> {
try {
const wantAgentInfo: wantAgent.WantAgentInfo = {
wants: [
{
bundleName: TIMER_ALERT_BUNDLE,
abilityName: MAIN_ABILITY,
parameters: {
... | 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 getMainPageWantAgent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alarmId AST#identifier#Right AST#?#... | static async getMainPageWantAgent(alarmId?: number | string, isMissed?: boolean): Promise<WantAgent | undefined> {
try {
const wantAgentInfo: wantAgent.WantAgentInfo = {
wants: [
{
bundleName: TIMER_ALERT_BUNDLE,
abilityName: MAIN_ABILITY,
parameters: {
... | https://gitee.com/openharmony-sig/applications_clock.git | 81c6c90877793f336f6f86990d60d0698089bf20 | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/LineDataSet.ets | arkts | setCircleSize | sets the size (radius) of the circle shpaed value indicators,
default size = 4f
<p/>
This method is deprecated because of unclarity. Use setCircleRadius instead.
@param size
@Deprecated | public setCircleSize(size: number): void {
this.setCircleRadius(size);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCircleSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left size AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu... | public setCircleSize(size: number): void {
this.setCircleRadius(size);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 5efcbca8e57a936eeefa0367d658cfbbe14716d1 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRhinoEngine.ets | arkts | tryInitializeRhinoSandbox | 尝试初始化Rhino沙箱 | private async tryInitializeRhinoSandbox(): Promise<void> {
if (!this.rhinoExecutor) {
return;
}
try {
logger.info(TAG, '尝试初始化Rhino WASM沙箱...');
const ready = await this.rhinoExecutor.initialize();
if (ready && this.rhinoExecutor.isSandboxReady()) {
this.currentE... | 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 tryInitializeRhinoSandbox AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressi... | private async tryInitializeRhinoSandbox(): Promise<void> {
if (!this.rhinoExecutor) {
return;
}
try {
logger.info(TAG, '尝试初始化Rhino WASM沙箱...');
const ready = await this.rhinoExecutor.initialize();
if (ready && this.rhinoExecutor.isSandboxReady()) {
this.currentE... | https://github.com/DaLongZhuaZi/manxia | fa005d1f2b54bee1f59b0ec35ec0ade4a6220ae3 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test25_original_index.ets | arkts | testArrayBuffer | --- ArrayBuffer byte operations --- | function testArrayBuffer(): string {
let buf: ArrayBuffer = new ArrayBuffer(4);
let view: DataView = new DataView(buf);
view.setUint8(0, 72);
view.setUint8(1, 101);
view.setUint8(2, 108);
view.setUint8(3, 111);
let b0: number = view.getUint8(0);
let b1: number = view.getUint8(1);
let b2: number = view... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testArrayBuffer AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_... | function testArrayBuffer(): string {
let buf: ArrayBuffer = new ArrayBuffer(4);
let view: DataView = new DataView(buf);
view.setUint8(0, 72);
view.setUint8(1, 101);
view.setUint8(2, 108);
view.setUint8(3, 111);
let b0: number = view.getUint8(0);
let b1: number = view.getUint8(1);
let b2: number = view... | https://github.com/miaochiahao/ark-ghidra | d7fe76a138196ff5d2cec25ef25c1ba6852db7d0 | github |
openharmony/codelabs | ETSUI/Habit/entry/src/main/ets/pages/HabitDetailPage.ets | arkts | sectionTitleStyle | 板块主标题样式 (如"成就勋章") | @Extend(Text)
function sectionTitleStyle() {
.fontSize(16)
.fontWeight(FontWeight.Bold)
.width('100%')
.margin({ bottom: 15 })
.fontColor('#333')
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#call_expression#Left AST#identifier#Left Extend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left Text AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R... | @Extend(Text)
function sectionTitleStyle() {
.fontSize(16)
.fontWeight(FontWeight.Bold)
.width('100%')
.margin({ bottom: 15 })
.fontColor('#333')
} | https://gitcode.com/openharmony/codelabs | f49812274b46f9ae1f7aedfd2e76b61fb0b5c699 | gitcode |
HarmonyOS_Samples/MultiPictureBeautification | features/multipicturebrowsing/src/main/ets/datasource/PictureListDataSource.ets | arkts | getData | Get data item at specified index | getData(index: number): PictureViewModel {
return this.pictureList[index];
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#... | getData(index: number): PictureViewModel {
return this.pictureList[index];
} | https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification | 054647d435b4e9c91eaa7d2a70800c0f49779e41 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/greater_or_equal/greater_or_equal_ushort.ets | arkts | main | ---
desc: check greater or equal for two unsigned shorts
--- | function main(): void {
const a: ushort = {{v.left}}
const b: ushort = {{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: ushort = {{v.left}}
const b: ushort = {{v.right}}
assert (a >= b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | a6f8e611d0819911692880f1784f3fa2e07687ec | gitee |
LZZLHY/hlib | entry/src/main/ets/api/ZLibraryClient.ets | arkts | search | 搜索 + 筛选 + 分页。
用 POST application/x-www-form-urlencoded(与 olib 内部 _makePostRequest 一致)。
早期 hlib 用 GET,中文 query + languages[] 数组在 URL 中过长 → 触发 400。改 POST 解决。 | async search(options: SearchOptions): Promise<SearchPage> {
const form: FormParams = {};
if (options.message !== undefined) form['message'] = options.message;
if (options.yearFrom !== undefined) form['yearFrom'] = options.yearFrom;
if (options.yearTo !== undefined) form['yearTo'] = options.yearTo;
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left search AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left options AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | async search(options: SearchOptions): Promise<SearchPage> {
const form: FormParams = {};
if (options.message !== undefined) form['message'] = options.message;
if (options.yearFrom !== undefined) form['yearFrom'] = options.yearFrom;
if (options.yearTo !== undefined) form['yearTo'] = options.yearTo;
... | https://github.com/LZZLHY/hlib | 842d513cb7630db7b9e84cb0455a7f2c9ced4e79 | github |
iichen-bycode/ArkTsWanandroid | entry/src/main/ets/utils/StorageUtils.ets | arkts | clear | 清空
@param preferenceName
@returns | static async clear(preferenceName: string = defaultPreferenceName) {
let preferences = await this.getPreferences(preferenceName)
return await preferences.clear()
} | 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 clear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left preferenceName AST#identifier#Right AST#:#Left : A... | static async clear(preferenceName: string = defaultPreferenceName) {
let preferences = await this.getPreferences(preferenceName)
return await preferences.clear()
} | https://github.com/iichen-bycode/ArkTsWanandroid | 392fa3397a482e158b2a798ad2f29785f582b800 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/TabContentCacheManager.ets | arkts | saveBookSourceCache | ==================== 书源缓存 ====================
保存书源Tab缓存 | async saveBookSourceCache(data: BookSourceCacheData): Promise<void> {
try {
this.bookSourceCache = data;
const dataPreferences = await preferences.getPreferences(getContext(), this.PREF_NAME);
await dataPreferences.put(this.BOOK_SOURCE_KEY, JSON.stringify(data));
await dataPreferences.flus... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveBookSourceCache AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Le... | async saveBookSourceCache(data: BookSourceCacheData): Promise<void> {
try {
this.bookSourceCache = data;
const dataPreferences = await preferences.getPreferences(getContext(), this.PREF_NAME);
await dataPreferences.put(this.BOOK_SOURCE_KEY, JSON.stringify(data));
await dataPreferences.flus... | https://github.com/DaLongZhuaZi/manxia | 8363dd10256a0a85757af8321e781ebe84c4eed4 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test5_original_index.ets | arkts | testNumberConstants | === Number Constants === | function testNumberConstants(): string {
let inf: number = Infinity;
let nan: number = NaN;
let maxInt: number = Number.MAX_SAFE_INTEGER;
let minInt: number = Number.MIN_SAFE_INTEGER;
let isSafe: boolean = Number.isSafeInteger(42);
let isNa: boolean = Number.isNaN(NaN);
let isFin: boolean = Number.isFinit... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testNumberConstants 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#predefi... | function testNumberConstants(): string {
let inf: number = Infinity;
let nan: number = NaN;
let maxInt: number = Number.MAX_SAFE_INTEGER;
let minInt: number = Number.MIN_SAFE_INTEGER;
let isSafe: boolean = Number.isSafeInteger(42);
let isNa: boolean = Number.isNaN(NaN);
let isFin: boolean = Number.isFinit... | https://github.com/miaochiahao/ark-ghidra | f935fc7a7a8248b9eb3f7cbce73c7d768189aac6 | github |
arkui-x/samples | CodeLab/Cases/feature/clickanimation/src/main/ets/model/BasicDataSource.ets | arkts | notifyDataDelete | 通知控制器数据删除
@param index 数组索引 | notifyDataDelete(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataDelete(index);
})
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left notifyDataDelete 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 AST#identifier#Right AST#)#Left... | notifyDataDelete(index: number): void {
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataDelete(index);
})
} | https://gitcode.com/arkui-x/samples | 486486c7028b6848d1663180c9acf37146f4507e | gitcode |
zcg741/chengyu-game | entry/src/main/ets/service/SoundService.ets | arkts | getSoundFile | 获取音频文件名 | function getSoundFile(soundType: string): string {
if (soundType === 'correct') {
return 'correct.mp3';
} else if (soundType === 'wrong') {
return 'wrong.mp3';
} else {
return 'timeout.mp3';
}
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getSoundFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left soundType AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function getSoundFile(soundType: string): string {
if (soundType === 'correct') {
return 'correct.mp3';
} else if (soundType === 'wrong') {
return 'wrong.mp3';
} else {
return 'timeout.mp3';
}
} | https://github.com/zcg741/chengyu-game | 759e897c8656b396d1f51e1ad2668cdf6b59ee45 | github |
ibestservices/ibest-ui | library/src/main/ets/components/rate/index.ets | arkts | refreshList | 刷新optionsList | refreshList(){
let value = this.value
this.optionsList.forEach((item: IBestRateOption, i: number) => {
let val = value - i
item.value = val > 1 ? 1 : val > 0 ? val : 0
})
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left refreshList AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A... | refreshList(){
let value = this.value
this.optionsList.forEach((item: IBestRateOption, i: number) => {
let val = value - i
item.value = val > 1 ? 1 : val > 0 ? val : 0
})
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/rate/index.ets#L129-L135 | a53f51303399e805ad7b33d6c4b42a6da1e9dfbc | github |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/NovelSettingsPage.ets | arkts | showConcurrencyPicker | 显示搜索并发数选择器 | showConcurrencyPicker(): void {
const options: number[] = [1, 3, 5, 8, 10, 15, 20];
this.getUIContext().getPromptAction().showActionMenu({
title: '选择搜索并发数',
buttons: [
{ text: '1 个书源', color: $r('sys.color.ohos_id_color_text_primary') },
{ text: '3 个书源', color: $r('sys.color.o... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showConcurrencyPicker 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#statem... | showConcurrencyPicker(): void {
const options: number[] = [1, 3, 5, 8, 10, 15, 20];
this.getUIContext().getPromptAction().showActionMenu({
title: '选择搜索并发数',
buttons: [
{ text: '1 个书源', color: $r('sys.color.ohos_id_color_text_primary') },
{ text: '3 个书源', color: $r('sys.color.o... | https://github.com/DaLongZhuaZi/manxia | be9dec1a12573a1bed6185d261732375d9c7e796 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GamepadManager.ets | arkts | isMouseEmulationActive | 当前是否处于鼠标模拟模式 | isMouseEmulationActive(): boolean {
return this.mouseEmulationService.isActive();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isMouseEmulationActive 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 ... | isMouseEmulationActive(): boolean {
return this.mouseEmulationService.isActive();
} | https://github.com/AlkaidLab/moonlight-harmony | dd70620d3be01a3015be4b418d7b1b189e63f9aa | github |
openharmony/arkcompiler_taihe_ffi_gen | test/ani_namespace/user/main.ets | arkts | testattributeString | attribute | function testattributeString() {
let name = namespace2Test.inner.PrintTestInterfaceName(instance)
console.log("instance.name is " + name)
arktest.assertEQ(name, "String")
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testattributeString AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#lexical... | function testattributeString() {
let name = namespace2Test.inner.PrintTestInterfaceName(instance)
console.log("instance.name is " + name)
arktest.assertEQ(name, "String")
} | https://gitcode.com/openharmony/arkcompiler_taihe_ffi_gen | 129eca61822dc8dd371c7d0c0900d8e0921c0b1d | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/LimitLine.ets | arkts | setLineColor | Sets the linecolor for this LimitLine. Make sure to use
getResources().getColor(...)
@param color | public setLineColor(color: number | string) {
this.mLineColor = color;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setLineColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#... | public setLineColor(color: number | string) {
this.mLineColor = color;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 44634e21ed1013f73e2adecd8a6661dcd21bd6cf | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieChartModel.ets | arkts | setCenterTextSizePixels | Sets the size of the center text of the PieChart in pixels.
@param sizePixels | public setCenterTextSizePixels(sizePixels: number): void {
( /*(PieChartRenderer)*/
this.mRenderer as PieChartRenderer).getPaintCenterText().setTextSize(sizePixels);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCenterTextSizePixels AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sizePixels AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number... | public setCenterTextSizePixels(sizePixels: number): void {
( /*(PieChartRenderer)*/
this.mRenderer as PieChartRenderer).getPaintCenterText().setTextSize(sizePixels);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | f7e488db7dfcc7a86595b89167c1a16a036ef98d | gitee |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/datasource/common/CommonNetworkDataSourceImpl.ets | arkts | getDictData | 获取字典数据
@param {DictDataRequest} request - 字典查询参数
@returns {Promise<NetworkResponse<DictDataResponse>>} 字典数据 | async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> {
const resp: AxiosResponse<NetworkResponse<DictDataResponse>> =
await NetworkClient.http.post("dict/info/data", request);
return resp.data;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getDictData AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left request AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> {
const resp: AxiosResponse<NetworkResponse<DictDataResponse>> =
await NetworkClient.http.post("dict/info/data", request);
return resp.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 311ac237a71643d93ed3aaf32d8b30467fedf773 | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterAbilityAndEntryDelegate.ets | arkts | onRestoreInstanceState | 通过参数,配置flutterEngine
@param want | onRestoreInstanceState(want: Want) {
let frameworkState: Uint8Array = this.getRestorationData(want.parameters as Record<string, Object>);
if (this.host?.shouldRestoreAndSaveState()) {
this.flutterEngine?.getRestorationChannel()?.setRestorationData(frameworkState);
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onRestoreInstanceState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifie... | onRestoreInstanceState(want: Want) {
let frameworkState: Uint8Array = this.getRestorationData(want.parameters as Record<string, Object>);
if (this.host?.shouldRestoreAndSaveState()) {
this.flutterEngine?.getRestorationChannel()?.setRestorationData(frameworkState);
}
} | https://gitee.com/openharmony-sig/flutter_engine.git | d2a84d394034e49fe80faf70dda7772aa61b8ab9 | gitee |
who7708/harmonyos-codelabs | HmosWorld/features/discover/src/main/ets/model/DiscoverModel.ets | arkts | loadMoreArticle | Load next page article data | loadMoreArticle(): Promise<LearningResource[]> {
this.loadingArticleStatus = LoadingStatus.LOADING;
return new Promise((resolve, reject) => {
this.resourcesRepository.getMoreArticle(this.curArticlePage + 1).then((data: ResourcesData) => {
data.resourceList.forEach((res: LearningResource) => {
... | AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left loadMoreArticle 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 AS... | loadMoreArticle(): Promise<LearningResource[]> {
this.loadingArticleStatus = LoadingStatus.LOADING;
return new Promise((resolve, reject) => {
this.resourcesRepository.getMoreArticle(this.curArticlePage + 1).then((data: ResourcesData) => {
data.resourceList.forEach((res: LearningResource) => {
... | https://github.com/who7708/harmonyos-codelabs | 5c2248c2294f95baa1a116f912f79bf78b65adeb | github |
openharmony/codelabs | ETSUI/SimpleApp/entry/src/main/ets/pages/Index.ets | arkts | showRecentUsage | 显示最近使用记录 | showRecentUsage(): void {
this.historyDialogController.open();
console.log('显示最近使用记录');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showRecentUsage 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_bl... | showRecentUsage(): void {
this.historyDialogController.open();
console.log('显示最近使用记录');
} | https://gitcode.com/openharmony/codelabs | ded6153ef1bd4b70d701f6834e1af87eb65b021e | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/WebDavClient.ets | arkts | parseXml | 解析dav xml
@param xmlStr
@returns | private parseXml(xmlStr: string | null): WebDavResource[] {
let textEncoder: util.TextEncoder = new util.TextEncoder();
let arrBuffer: Uint8Array = textEncoder.encodeInto(xmlStr); // 对数据编码,防止包含中文字符乱码
let that: xml.XmlPullParser = new xml.XmlPullParser(arrBuffer.buffer as object as ArrayBuffer, 'UTF-8');
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseXml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left xmlStr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#... | private parseXml(xmlStr: string | null): WebDavResource[] {
let textEncoder: util.TextEncoder = new util.TextEncoder();
let arrBuffer: Uint8Array = textEncoder.encodeInto(xmlStr); // 对数据编码,防止包含中文字符乱码
let that: xml.XmlPullParser = new xml.XmlPullParser(arrBuffer.buffer as object as ArrayBuffer, 'UTF-8');
... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/WebDavClient.ets#L467-L535 | 8b89afb2cdb367025465b1b1fdf83f2e98eb476a | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/ClipboardUtils.ets | arkts | clear | 清理剪切板数据
@param timeout 自动清理时间,单位秒 | public static clear(timeout?: number) {
try {
if (!timeout || timeout <= 0) {
pasteboard.getSystemPasteboard().clearData();
return;
}
if (ClipboardUtils.timeOutObj != -1) {
clearTimeout(ClipboardUtils.timeOutObj);
ClipboardUtils.timeOutObj = -1;
}
Clip... | 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 clear AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left timeout AS... | public static clear(timeout?: number) {
try {
if (!timeout || timeout <= 0) {
pasteboard.getSystemPasteboard().clearData();
return;
}
if (ClipboardUtils.timeOutObj != -1) {
clearTimeout(ClipboardUtils.timeOutObj);
ClipboardUtils.timeOutObj = -1;
}
Clip... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ClipboardUtils.ets#L50-L69 | c316ac87e080b418332bb1de0e871f847a66b909 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Source/SourceManager.ets | arkts | updatePriority | 更新图源优先级 | async updatePriority(sourceId: number, priority: number): Promise<void> {
await this.dataManager.updateComicSource(sourceId, { priority: priority });
logger.info(TAG, `图源优先级已更新: ${sourceId} -> ${priority}`);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updatePriority AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:#Lef... | async updatePriority(sourceId: number, priority: number): Promise<void> {
await this.dataManager.updateComicSource(sourceId, { priority: priority });
logger.info(TAG, `图源优先级已更新: ${sourceId} -> ${priority}`);
} | https://github.com/DaLongZhuaZi/manxia | 0f74c80310c2ad9a085c1b2e3c9f3559b78c64ff | github |
killetom/ktretrofit | ktretrofit/src/main/ets/retrofit/interceptor/RealInterceptorChain.ets | arkts | proceed | Proceed with the request through the next interceptor in the chain.
@param request The request configuration to use.
@returns A Promise that resolves to the response. | async proceed(request: HttpRequestConfig): Promise<Response<any>> {
if (this.index >= this.interceptors.length) {
// No more interceptors, execute the request directly
return this.client.execute<any>(request);
}
// Create a new chain for the next interceptor
const next = new RealIntercept... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left proceed AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left request AST#identifier#Right AST#type... | async proceed(request: HttpRequestConfig): Promise<Response<any>> {
if (this.index >= this.interceptors.length) {
// No more interceptors, execute the request directly
return this.client.execute<any>(request);
}
// Create a new chain for the next interceptor
const next = new RealIntercept... | https://github.com/killetom/ktretrofit | 8afa611664e19ffa71ab6a4a477e49acd8aa5084 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/services/TerminalManager.ets | arkts | getTerminalConfig | 获取终端配置
@param terminalType 终端类型 | getTerminalConfig(terminalType: TerminalType): TerminalConfig | undefined {
return this.terminalConfigs.get(terminalType);
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getTerminalConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left terminalType AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden... | getTerminalConfig(terminalType: TerminalType): TerminalConfig | undefined {
return this.terminalConfigs.get(terminalType);
} | https://github.com/LJ666-ui/harmony-health-care | cf84dfe8ba4ae14d9efcb9a1b12c563e83d7ec7e | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/EBookDataManager.ets | arkts | getEBooksWithReadingProgress | 获取所有有阅读记录的电子书及其阅读进度
用于阅读报告统计 | public async getEBooksWithReadingProgress(): Promise<EBook[]> {
try {
const allEbooks = await this.getEBookList();
// 筛选有阅读进度的电子书
const ebooksWithProgress = allEbooks.filter((ebook: EBook) => {
if (!ebook.readingProgress) {
return false;
}
// 检查是否有真正的阅读进度
... | 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 getEBooksWithReadingProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressi... | public async getEBooksWithReadingProgress(): Promise<EBook[]> {
try {
const allEbooks = await this.getEBookList();
// 筛选有阅读进度的电子书
const ebooksWithProgress = allEbooks.filter((ebook: EBook) => {
if (!ebook.readingProgress) {
return false;
}
// 检查是否有真正的阅读进度
... | https://github.com/DaLongZhuaZi/manxia | d3be960a26276723405b3a663b609cf7237dbb18 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/template/TemplateConstants.ets | arkts | getTemplatesByCategory | 根据分类获取模板列表 | static getTemplatesByCategory(category: TemplateCategory): IPresetTemplate[] {
return TemplateConstants.getAllTemplates().filter(t => t.category === category);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTemplatesByCategory 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#ident... | static getTemplatesByCategory(category: TemplateCategory): IPresetTemplate[] {
return TemplateConstants.getAllTemplates().filter(t => t.category === category);
} | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/template/TemplateConstants.ets#L590-L592 | d3789ccf817737affeb41659161b434cd3b84b43 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/GlobalSearchService.ets | arkts | searchLocalEbooks | 搜索本地电子书 | async searchLocalEbooks(keyword: string): Promise<UnifiedSearchItem[]> {
try {
const ebooks = await this.ebookDataManager.searchEBooks(keyword);
return ebooks.map((ebook: EBook): UnifiedSearchItem => ({
id: `local-ebook-${ebook.id}`,
title: ebook.metadata.title,
author: ebook.m... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left searchLocalEbooks AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyword AST#identifier#Right AST#type_annotation#Left AST#:#L... | async searchLocalEbooks(keyword: string): Promise<UnifiedSearchItem[]> {
try {
const ebooks = await this.ebookDataManager.searchEBooks(keyword);
return ebooks.map((ebook: EBook): UnifiedSearchItem => ({
id: `local-ebook-${ebook.id}`,
title: ebook.metadata.title,
author: ebook.m... | https://github.com/DaLongZhuaZi/manxia | 469aee5ad44a9024da322b6cdd9d836bf1ff1591 | github |
tdcare/tdwebrtc | src/main/ets/AudioPlayback.ets | arkts | fillBuffer | AudioRenderer writeData 回调:将缓冲队列中的数据填入播放缓冲区 | private fillBuffer(targetBuffer: ArrayBuffer): void {
const targetView: Uint8Array = new Uint8Array(targetBuffer);
let offset: number = 0;
const targetLen: number = targetBuffer.byteLength;
while (offset < targetLen && this.pendingBuffers.length > 0) {
const srcBuf: ArrayBuffer | undefined = th... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left fillBuffer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left targetBuffer AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left ArrayBuffe... | private fillBuffer(targetBuffer: ArrayBuffer): void {
const targetView: Uint8Array = new Uint8Array(targetBuffer);
let offset: number = 0;
const targetLen: number = targetBuffer.byteLength;
while (offset < targetLen && this.pendingBuffers.length > 0) {
const srcBuf: ArrayBuffer | undefined = th... | https://github.com/tdcare/tdwebrtc | 82c6769851b9c97ff2a69e099420ab5d5f13dd21 | github |
Coke0807/NewsAPP-HarmonyOS | NewsApp/entry/src/main/ets/utils/AuthUtil.ets | arkts | hasToken | 检查是否有Token | static hasToken(): boolean {
const token = AuthUtil.getToken();
return token !== null && token !== '';
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left hasToken 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#bool... | static hasToken(): boolean {
const token = AuthUtil.getToken();
return token !== null && token !== '';
} | https://github.com/Coke0807/NewsAPP-HarmonyOS | 889dab37f1c9c796ee944ea852021bed61c7b160 | github |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/stores/AppStore.ets | arkts | initBreakpoint | 初始化断点状态 | private static initBreakpoint(): void {
AppStorage.setOrCreate<string>(AppStorageKeys.CURRENT_BREAKPOINT, 'sm')
} | 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 initBreakpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | private static initBreakpoint(): void {
AppStorage.setOrCreate<string>(AppStorageKeys.CURRENT_BREAKPOINT, 'sm')
} | https://github.com/encorexin/WordPressCMS | bc777a918aa6dd81b16101420c50eddb03b0a755 | github |
openharmony-sig/applications_clock | feature/timer/src/main/ets/controller/TimerController.ets | arkts | setStateUpdateListener | Set listening for state changes
@param listener | public setStateUpdateListener(listener: (TimerState) => void) {
LogUtil.info(`${TAG} setStateUpdateListener`);
this.stateUpdateListener = listener;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setStateUpdateListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expressi... | public setStateUpdateListener(listener: (TimerState) => void) {
LogUtil.info(`${TAG} setStateUpdateListener`);
this.stateUpdateListener = listener;
} | https://gitee.com/openharmony-sig/applications_clock.git | e06ed5b2dd8b83d5c1001fdea5ac3780442f20d3 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ancientimage/AncientOCRService.ets | arkts | generateMockTextBlocks | 生成模拟文字块 | private generateMockTextBlocks(): RecognizedText[] {
const sampleTexts = [
'人参味甘微寒',
'主补五脏安精神',
'定魂魄止惊悸',
'除邪气明目',
'开心益智',
'久服轻身延年',
'黄芪甘温',
'补气固表',
'当归甘辛温',
'补血活血'
];
const textBlocks: RecognizedText[] = [];
for (let i = 0; i < sampleTexts... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateMockTextBlocks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#L... | private generateMockTextBlocks(): RecognizedText[] {
const sampleTexts = [
'人参味甘微寒',
'主补五脏安精神',
'定魂魄止惊悸',
'除邪气明目',
'开心益智',
'久服轻身延年',
'黄芪甘温',
'补气固表',
'当归甘辛温',
'补血活血'
];
const textBlocks: RecognizedText[] = [];
for (let i = 0; i < sampleTexts... | https://github.com/LJ666-ui/harmony-health-care | 1c150ca3d6910ab344306300272c0c1d0da0e98b | github |
Open-Tech-Project/OpenBoard | entry/src/main/ets/InputMethodExtensionAbility/model/PredictionModel.ets | arkts | triKey | Create a composite key for trigram lookups | private triKey(prev1: string, prev2: string): string {
return `${prev1}|${prev2}`;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left triKey AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left prev1 AST#identifier#Right AST#:#Left : AST#:#Right AST#... | private triKey(prev1: string, prev2: string): string {
return `${prev1}|${prev2}`;
} | https://github.com/Open-Tech-Project/OpenBoard/blob/bb49f3c9e04bdcc0d5b6d40e9a7cd3a3790da74a/entry/src/main/ets/InputMethodExtensionAbility/model/PredictionModel.ets#L68-L70 | 80faaac9595da15f9f1a5758c4d85772235995c2 | github |
bhengubv/aether-protocol | harmonyos/teal/entry/src/main/ets/pages/Index.ets | arkts | build | ── Build ────────────────────────────────────────────────────────────── | build() {
Column({ space: 0 }) {
// ── Header ─────────────────────────────────────────────────────────
Column({ space: 4 }) {
Text('Aether Teal')
.fontSize(28).fontWeight(FontWeight.Bold).width('100%')
Text('NearLink (SLE) Transport Node')
.fontSize(14).fontColor(... | 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#expression_statement#Left AST#c... | build() {
Column({ space: 0 }) {
// ── Header ─────────────────────────────────────────────────────────
Column({ space: 4 }) {
Text('Aether Teal')
.fontSize(28).fontWeight(FontWeight.Bold).width('100%')
Text('NearLink (SLE) Transport Node')
.fontSize(14).fontColor(... | https://github.com/bhengubv/aether-protocol | 8d3c30b7345f7c074d6eab25b5057a878b9f2c8f | github |
Joker-x-dev/CoolMallArkTS | feature/main/src/main/ets/viewmodel/HomeViewModel.ets | arkts | aboutToAppear | 页面出现时初始化页面数据
@returns {void} 无返回值 | aboutToAppear(): void {
this.loadHomeData();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
this.loadHomeData();
} | https://github.com/Joker-x-dev/CoolMallArkTS | a62f4f8cb20e51baf48b040fe51f14a8baebf70f | github |
daugf2527/harmonyos-libretro-emulator | entry/src/main/ets/pages/TestGambatte.ets | arkts | getAvailableRoms | 获取当前核心可用的 ROM 列表 | getAvailableRoms(): RomConfig[] {
const currentCore = this.cores[this.selectedCoreIndex];
return this.roms.filter(rom => rom.core === currentCore.id);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getAvailableRoms AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left RomConfig AST#i... | getAvailableRoms(): RomConfig[] {
const currentCore = this.cores[this.selectedCoreIndex];
return this.roms.filter(rom => rom.core === currentCore.id);
} | https://github.com/daugf2527/harmonyos-libretro-emulator | 2c2019c805d6872a351ccdbccad909ceab20a3e1 | github |
midori52000/ArkPilot | Agent/entry/src/main/ets/skills/SkillsBackendService.ets | arkts | getRepos | ================================================================
仓库管理
================================================================ | async getRepos(): Promise<SkillRepo[]> {
const json = getSkillsRepos(this.codexHome);
const parsed: SkillsRepoListJson = JSON.parse(json) as SkillsRepoListJson;
return (parsed.repos ?? []).map((repo: SkillRepoEntryJson) => SkillRepo.fromJSON(repo));
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getRepos AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generic_typ... | async getRepos(): Promise<SkillRepo[]> {
const json = getSkillsRepos(this.codexHome);
const parsed: SkillsRepoListJson = JSON.parse(json) as SkillsRepoListJson;
return (parsed.repos ?? []).map((repo: SkillRepoEntryJson) => SkillRepo.fromJSON(repo));
} | https://github.com/midori52000/ArkPilot | c450eef887a8631477c21400c7d7cf0db2936c37 | github |
Nekofox-POT/LinMusic | entry/src/main/ets/package/audio_player/class_audio_player.ets | arkts | constructor | 构建 // | constructor(global_config: class_global_config) {
// 导入全局配置文件 //
this.global_config = global_config
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left global_config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left class_global_config ... | constructor(global_config: class_global_config) {
// 导入全局配置文件 //
this.global_config = global_config
} | https://github.com/Nekofox-POT/LinMusic | 53549a798aece8bdbf1d4859771c1a510fb53c77 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/unary_minus/unary_minus_int.ets | arkts | main | ---
desc: check unary minus operation for integer operand
--- | function main(): void {
const value: int = {{v.value}}
assert -(value) == {{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 value: int = {{v.value}}
assert -(value) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 4301239093c17a16a580595b5d788fff8a6c88ac | gitee |
the-wwyang/kids-learning-app | src/main/ets/common/MathPageStrings.ets | arkts | getCorrectAnswer | 正确答案消息
@param answer 正确答案
@returns 完整消息 | static getCorrectAnswer(answer: number | string): string {
return `${MathPageStrings.CORRECT_ANSWER_PREFIX}${answer}`;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCorrectAnswer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left answer AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expres... | static getCorrectAnswer(answer: number | string): string {
return `${MathPageStrings.CORRECT_ANSWER_PREFIX}${answer}`;
} | https://github.com/the-wwyang/kids-learning-app | 0d338519f012c5e381cdf59b5ad2f452febfac05 | github |
xblLab/HarmonyProjectTemplate | commons/lib_api/src/main/ets/services/MineService.ets | arkts | addToHistory | 添加到浏览历史
@param label | public addToHistory(label: string) {
this.deleteFromHistory(label);
const mineUserInfo = this.queryAuthorRaw() as MyAuthor;
mineUserInfo?.myHistory.splice(0, 0, label);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addToHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left label AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st... | public addToHistory(label: string) {
this.deleteFromHistory(label);
const mineUserInfo = this.queryAuthorRaw() as MyAuthor;
mineUserInfo?.myHistory.splice(0, 0, label);
} | https://github.com/xblLab/HarmonyProjectTemplate | 61d9d5e7a6e466e9438f7aa5dbd00fa66857eb2c | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/NativeHidParserService.ets | arkts | getGamepadName | 获取手柄名称
@param vendorId 设备厂商 ID
@param productId 设备产品 ID
@returns 手柄名称 | getGamepadName(vendorId: number, productId: number): string {
if (!this.gamepadModule) {
return 'Unknown Gamepad';
}
try {
return this.gamepadModule.getGamepadName(vendorId, productId);
} catch (err) {
return 'Unknown Gamepad';
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getGamepadName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left vendorId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#... | getGamepadName(vendorId: number, productId: number): string {
if (!this.gamepadModule) {
return 'Unknown Gamepad';
}
try {
return this.gamepadModule.getGamepadName(vendorId, productId);
} catch (err) {
return 'Unknown Gamepad';
}
} | https://github.com/AlkaidLab/moonlight-harmony | 5587ab6147fdf05ce3c52c6a17aceb5b86535ecd | github |
openharmony/codelabs | Distributed/DistributeDraw/entry/src/main/ets/pages/Index.ets | arkts | updateCanvas | Update canvas. | updateCanvas(): void {
this.redraw();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateCanvas 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... | updateCanvas(): void {
this.redraw();
} | https://gitee.com/openharmony/codelabs.git | e9e44504fef0aed0ff0d94197b0e21bb25c6798b | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Parsers/PdfToMangaImporter.ets | arkts | createOutputDirectories | 创建输出目录结构
结构: outputDir/manga_id/chapter_id/ | private async createOutputDirectories(mangaId: string, chapterId: string): Promise<string> {
const mangaDir = `${this.config.outputDir}/${mangaId}`;
const chapterDir = `${mangaDir}/${chapterId}`;
try {
// 创建漫画目录
try {
SafeFileUtils.mkdirSync(mangaDir, true);
} catch (e) {
... | 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 createOutputDirectories AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left mangaId AST#identifier#Right AST#ERROR#Left ... | private async createOutputDirectories(mangaId: string, chapterId: string): Promise<string> {
const mangaDir = `${this.config.outputDir}/${mangaId}`;
const chapterDir = `${mangaDir}/${chapterId}`;
try {
// 创建漫画目录
try {
SafeFileUtils.mkdirSync(mangaDir, true);
} catch (e) {
... | https://github.com/DaLongZhuaZi/manxia | dc53ef465055c5279530cad672757dbb363b2b29 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/ToastQueue.ets | arkts | clear | 清空队列(仅清待播队列,不能关闭当前正在显示的 toast) | static clear(): void {
ToastQueue.queue = [];
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left clear AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Rig... | static clear(): void {
ToastQueue.queue = [];
} | https://github.com/AlkaidLab/moonlight-harmony | 0a141390302d91513b70b20b2c075bac68e9b3b1 | github |
HarmonyOS_Samples/sample_in_harmonyos | features/devpractices/src/main/ets/model/ImageModel.ets | arkts | offsetReset | Offset reset. | offsetReset(): void {
this.curOffsetX = 0;
this.curOffsetY = 0;
this.lastOffsetX = 0;
this.lastOffsetY = 0;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left offsetReset 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#... | offsetReset(): void {
this.curOffsetX = 0;
this.curOffsetY = 0;
this.lastOffsetX = 0;
this.lastOffsetY = 0;
} | https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos | 093cbed7e2e21243b5b6e9cc5e850adc9b756e9d | gitcode |
Nekofox-POT/LinMusic | entry/src/main/ets/package/files_manager/download_manager.ets | arkts | get_dir | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
文件夹处理 //
//////////// | get_dir(path: string = ''): string[][] {
// 环境准备 //
let dir: string[] = []
let files: string[] = []
let play_list: string[] = []
let raw_path: string = song_path + '/' + path
try {
// 判断类型 //
// 文件夹
if (fs.statSync(raw_path).isDirectory()) {
// 扫描文件夹 //
for... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left get_dir AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#Left st... | get_dir(path: string = ''): string[][] {
// 环境准备 //
let dir: string[] = []
let files: string[] = []
let play_list: string[] = []
let raw_path: string = song_path + '/' + path
try {
// 判断类型 //
// 文件夹
if (fs.statSync(raw_path).isDirectory()) {
// 扫描文件夹 //
for... | https://github.com/Nekofox-POT/LinMusic | 3247ec803f6afaab9ba370437f911e6514818679 | github |
PollenWang6/HiXD | entry/src/main/ets/services/UserInfoService.ets | arkts | fetchChaoxingUid | 超星平台 UID 获取(纯 HTTP,不走 WebView)
流程:CAS SSO → loginToLearning → HTTP GET i.chaoxing.com/base → 正则提取 UID | async fetchChaoxingUid(): Promise<string> {
const cached: string = PreferenceUtil.getString('cx_uid');
if (cached.length > 0) {
console.info(TAG, 'fetchChaoxingUid: from cache, uid=' + cached);
return cached;
}
console.info(TAG, 'fetchChaoxingUid: no cache, fetching via HTTP...');
try... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left fetchChaoxingUid 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#gen... | async fetchChaoxingUid(): Promise<string> {
const cached: string = PreferenceUtil.getString('cx_uid');
if (cached.length > 0) {
console.info(TAG, 'fetchChaoxingUid: from cache, uid=' + cached);
return cached;
}
console.info(TAG, 'fetchChaoxingUid: no cache, fetching via HTTP...');
try... | https://github.com/PollenWang6/HiXD | 4fb3502eb4e56ef453b958197f355cad47f644cf | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/pages/Index.ets | arkts | onDragFromSideArea | Drag drop side area
Something is dragged away from the side area.
We set the drag block. | onDragFromSideArea() {
this.myUi.sideAreaShrinkBlock_drag = true;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onDragFromSideArea 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... | onDragFromSideArea() {
this.myUi.sideAreaShrinkBlock_drag = true;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 4ac791342908b1b3b8ea52dff69cc4f0480f47bb | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.