nwo stringclasses 449
values | path stringlengths 9 173 | language stringclasses 1
value | identifier stringlengths 1 53 | docstring stringlengths 5 4.13k | function stringlengths 10 87.2k | ast_function stringlengths 351 354k | obf_function stringlengths 10 87.2k | url stringlengths 30 175 | function_sha stringlengths 40 40 | source stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|
openharmony-sig/ohos_danmaku_flame_master | library/src/main/ets/components/common/master/flame/danmaku/danmaku/model/ohos/DanmakuContext.ets | arkts | getFTDanmakuVisibility | @return �Ƿ���ʾ������Ļ | public getFTDanmakuVisibility(): boolean {
return this.FTDanmakuVisibility;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getFTDanmakuVisibility AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left bo... | public getFTDanmakuVisibility(): boolean {
return this.FTDanmakuVisibility;
} | https://gitee.com/openharmony-sig/ohos_danmaku_flame_master.git | 576c87d62360e53f7855264441de2bbf3fbe328c | gitee |
arkui-x/samples | CodeLab/Cases/feature/customdrawtabbar/src/main/ets/components/tabsConcaveCircle/TabsConcaveCircle.ets | arkts | initCanvas | 初始化 canvas 数据 | initCanvas() {
this.circleInfo = new ConcaveCircle(this.context, this.tabsMenu.length);
// 图片宽度比凹槽小取圆直径的 70%
let ratio = 0.7;
this.imageWH = this.circleInfo.circleDiameter * ratio;
this.createAnimation()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initCanvas AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | initCanvas() {
this.circleInfo = new ConcaveCircle(this.context, this.tabsMenu.length);
// 图片宽度比凹槽小取圆直径的 70%
let ratio = 0.7;
this.imageWH = this.circleInfo.circleDiameter * ratio;
this.createAnimation()
} | https://gitcode.com/arkui-x/samples | 7dd20da13f8db3b92e61efefacc9c2f0f0ca94c0 | gitcode |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/SVGXMLChecker.ets | arkts | _readContentReference | 读取引用
@see https://www.w3.org/TR/xml/ 4.1节 [67] Reference
@return 是否读取到了引用 | private _readContentReference(): boolean{
let ref = this._readReference();
if (ref) {
return true;
}
return false;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left _readContentReference 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 ... | private _readContentReference(): boolean{
let ref = this._readReference();
if (ref) {
return true;
}
return false;
} | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | 6c1471470d5ddef7a3d48b61017faf02511e58cb | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewImageLoader.ets | arkts | setTimeoutValue | 设置超时时间 | setTimeoutValue(timeout: number): ImageRequestBuilder {
this.timeout = timeout;
return this;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setTimeoutValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left timeout AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#... | setTimeoutValue(timeout: number): ImageRequestBuilder {
this.timeout = timeout;
return this;
} | https://github.com/DaLongZhuaZi/manxia | 04172cad88ea9b14150231f2879254020ab6d422 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets | arkts | setDate | Changes the day of the month of a given Date instance, based on local time.
@param { int } value new day.
@returns { long }
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public setDate(value: int): long {
let day = this.getDate();
this.ms -= day * msPerDay;
this.ms += value * msPerDay;
return this.ms;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Righ... | public setDate(value: int): long {
let day = this.getDate();
this.ms -= day * msPerDay;
this.ms += value * msPerDay;
return this.ms;
} | https://gitcode.com/iop123123/arkts-static-skills | 70a3a90aad5d27940b2b10cd7888763d930a6816 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelReplaceRuleManager.ets | arkts | generateId | 生成唯一ID | private generateId(): string {
return `rule_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateId 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#s... | private generateId(): string {
return `rule_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
} | https://github.com/DaLongZhuaZi/manxia | dafc7f3b4ec863915e586ea7a95369992a16f9a0 | github |
honjow/Next2V | shared/src/main/ets/services/AutoDailyCheckinService.ets | arkts | handleWebResult | Called by the nav-shell runner when the hidden Web check-in finishes. This owns ONLY the background reach
(a system notification when the app is not foreground) plus notification-consent bootstrap. The
FOREGROUND toast is rendered by the nav shell (Index) through its own UIContext PromptAction — a toast
posted from thi... | static async handleWebResult(
context: common.UIAbilityContext,
status: string,
rewardCoins: number,
): Promise<void> {
DiagnosticLogger.info('auto_daily_checkin', 'auto_daily_checkin_web_result', {
status: status,
rewardCoins: rewardCoins,
foreground: connectAppForeground().foregr... | 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 handleWebResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left ... | static async handleWebResult(
context: common.UIAbilityContext,
status: string,
rewardCoins: number,
): Promise<void> {
DiagnosticLogger.info('auto_daily_checkin', 'auto_daily_checkin_web_result', {
status: status,
rewardCoins: rewardCoins,
foreground: connectAppForeground().foregr... | https://github.com/honjow/Next2V | 86abcf6f53d899a366d14e54cd81997339f83d99 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/FontManager.ets | arkts | addFontChangeListener | 注册字体变更回调 | addFontChangeListener(id: string, callback: FontChangeCallback): void {
this.callbacks.set(id, callback);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addFontChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Le... | addFontChangeListener(id: string, callback: FontChangeCallback): void {
this.callbacks.set(id, callback);
} | https://github.com/DaLongZhuaZi/manxia | 313079e10e28cba1d014537676b781edce964f8b | github |
openharmony/codelabs | Media/AudioPlayer/entry/src/main/ets/controller/PlayBarController.ets | arkts | getPreviousMusic | Previous song.
@param musicList
@param playState | getPreviousMusic(musicList: Array<MusicItem>, playState: number) {
if (this.playBarModel.playMode === PlayMode.RANDOM_PLAY) {
// Obtain the previous song in the random list.
let preIndex = 0;
let randomList = GlobalContext.getContext().getObject('randomList') as number[];
randomList.forEac... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getPreviousMusic AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left musicList AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left A... | getPreviousMusic(musicList: Array<MusicItem>, playState: number) {
if (this.playBarModel.playMode === PlayMode.RANDOM_PLAY) {
// Obtain the previous song in the random list.
let preIndex = 0;
let randomList = GlobalContext.getContext().getObject('randomList') as number[];
randomList.forEac... | https://gitee.com/openharmony/codelabs.git | a933227ddd543fc24568ca36fdd933def608ae3d | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/SmartBudgetPlan.ets | arkts | createForecastResult | 创建预测结果对象 | static createForecastResult(
period: string,
predictedAmount: number,
lowerBound: number,
upperBound: number,
confidence: number,
algorithm: string
): ForecastResult {
const result: ForecastResult = {
period: period,
predictedAmount: predictedAmount,
lowerBound: lowerBo... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createForecastResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left period AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifie... | static createForecastResult(
period: string,
predictedAmount: number,
lowerBound: number,
upperBound: number,
confidence: number,
algorithm: string
): ForecastResult {
const result: ForecastResult = {
period: period,
predictedAmount: predictedAmount,
lowerBound: lowerBo... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | f18d58c97050bde74b337b0a631820a9be2619bb | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new EvalError instance with provided message and error specific information
@param { String } [message] - Error text
@param { ErrorOptions } [options] - Error options
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | constructor(message?: String, options?: ErrorOptions) {
super("EvalError", 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("EvalError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | 2a32f7be2ef5c30bdebf351c5add810d7d4763ab | gitcode |
XHXYT/Pixark | entry/src/main/ets/view/more/UserSettings.ets | arkts | pushTo | 路由跳转辅助函数 | pushTo(name: string, params?: Object) {
if (PixState.widthBp > 1) {
this.pageStack.pushPathByName(name, params, true);
} else {
PixState.pageStack.pushPathByName(name, params, true);
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left pushTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#... | pushTo(name: string, params?: Object) {
if (PixState.widthBp > 1) {
this.pageStack.pushPathByName(name, params, true);
} else {
PixState.pageStack.pushPathByName(name, params, true);
}
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/view/more/UserSettings.ets#L291-L297 | a821deb05157f85a40ce68dd0e482e97f427bab9 | github |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/commons/utils/src/main/ets/utils/WebUtil.ets | arkts | makeNode | Used to construct the number of nodes and return the node mount in the corresponding NodeContainer.
This API is called when the corresponding NodeContainer is created or by using the rebuild method. | makeNode(uiContext: UIContext): FrameNode | null {
Logger.info(TAG, ' uiContext is undifined : ' + (uiContext === undefined));
if (this.isRemove) {
return null;
}
if (this.rootNode != undefined) {
return this.rootNode.getFrameNode();
}
return null;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left makeNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | makeNode(uiContext: UIContext): FrameNode | null {
Logger.info(TAG, ' uiContext is undifined : ' + (uiContext === undefined));
if (this.isRemove) {
return null;
}
if (this.rootNode != undefined) {
return this.rootNode.getFrameNode();
}
return null;
} | https://gitcode.com/HarmonyOS_Samples/hmosworld | 33368059cea1b2ee6368a0b173f71a4bd517383d | gitcode |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test46_original_index.ets | arkts | arraysEqual | --- Array equality check (deep compare) --- | function arraysEqual(a: number[], b: number[]): boolean {
if (a.length !== b.length) {
return false;
}
for (let i: number = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left arraysEqual AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left a AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right A... | function arraysEqual(a: number[], b: number[]): boolean {
if (a.length !== b.length) {
return false;
}
for (let i: number = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
} | https://github.com/miaochiahao/ark-ghidra | 6498a9a27623feb201cb4cfc32c29d8a29e76e91 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/SettingsService.ets | arkts | shouldShowOnscreenControls | 是否显示屏幕控制器 | async shouldShowOnscreenControls(): Promise<boolean> {
return await this.getBoolean(SettingsKeys.ENABLE_ONSCREEN_CONTROLS, false);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left shouldShowOnscreenControls 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#:#Rig... | async shouldShowOnscreenControls(): Promise<boolean> {
return await this.getBoolean(SettingsKeys.ENABLE_ONSCREEN_CONTROLS, false);
} | https://github.com/AlkaidLab/moonlight-harmony | 7c66d426a8fd269db0220d9983580cc35fe9e329 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/UsbDriverService.ets | arkts | enumerateDevices | 枚举 USB 设备 | private async enumerateDevices(): Promise<void> {
try {
const devices: usbManager.USBDevice[] = usbManager.getDevices();
console.info(`${TAG} 发现 ${devices.length} 个 USB 设备`);
for (let i: number = 0; i < devices.length; i++) {
const device: usbManager.USBDevice = devices[i];
... | 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 enumerateDevices AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ... | private async enumerateDevices(): Promise<void> {
try {
const devices: usbManager.USBDevice[] = usbManager.getDevices();
console.info(`${TAG} 发现 ${devices.length} 个 USB 设备`);
for (let i: number = 0; i < devices.length; i++) {
const device: usbManager.USBDevice = devices[i];
... | https://github.com/AlkaidLab/moonlight-harmony | fad9660b1dfbb37df1176bcb0d8573de2a6512a8 | github |
openharmony-sig/ostest_integration_test | function/communication/wifi/p2ptest/entry/src/main/ets/pages/Index.ets | arkts | intToIp | 转IP地址 | intToIp(int: number) {
// 将整数转换为32位二进制字符串
const binaryString = int.toString(2).padStart(32, '0');
// 分割二进制字符串为四个8位的段
const octet1 = binaryString.substring(0, 8);
const octet2 = binaryString.substring(8, 16);
const octet3 = binaryString.substring(16, 24);
const octet4 = binaryString.substr... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left intToIp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left int AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#... | intToIp(int: number) {
// 将整数转换为32位二进制字符串
const binaryString = int.toString(2).padStart(32, '0');
// 分割二进制字符串为四个8位的段
const octet1 = binaryString.substring(0, 8);
const octet2 = binaryString.substring(8, 16);
const octet3 = binaryString.substring(16, 24);
const octet4 = binaryString.substr... | https://gitee.com/openharmony-sig/ostest_integration_test.git | 3d88937e47b6ad494c2ac9928176f04b350500f4 | gitee |
erosTeam/NextE | shared/src/main/ets/model/EhMytags.ets | arkts | namespace | Namespace part of `ns:tag` (e.g. 'artist'); 'misc' when the tag has no namespace. EH may write
the short prefix ('a:dittaya'), so expand it to the full name (eros_fe) for stable grouping. | namespace(): string {
const idx: number = this.tag.indexOf(':')
const raw: string = idx > 0 ? this.tag.substring(0, idx) : 'misc'
return EhConstants.expandNamespace(raw)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left namespace AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statement_bl... | namespace(): string {
const idx: number = this.tag.indexOf(':')
const raw: string = idx > 0 ? this.tag.substring(0, idx) : 'misc'
return EhConstants.expandNamespace(raw)
} | https://github.com/erosTeam/NextE | c522bca072555122acef7c59d5edf13f9f38c71c | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/CandleDataSet.ets | arkts | setShadowWidth | Sets the width of the candle-shadow-line in pixels. Default 3f.
@param width | public setShadowWidth(width: number): void {
this.mShadowWidth = Utils.handleDataValues(width);
// this.mShadowWidth = width;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setShadowWidth AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public setShadowWidth(width: number): void {
this.mShadowWidth = Utils.handleDataValues(width);
// this.mShadowWidth = width;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 66a1509d8c51003f2ab57b1a0b35dd47b7b8e755 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Array.ets | arkts | $_iterator | Returns an iterator over all values
@returns { IterableIterator<T> } An iterator over all values.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public override $_iterator(): IterableIterator<T> {
return this.values()
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left $_iterator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#... | public override $_iterator(): IterableIterator<T> {
return this.values()
} | https://gitcode.com/iop123123/arkts-static-skills | f4975afd048c786ded339f34e63a637f8a0c756a | gitcode |
honjow/Next2V | shared/src/main/ets/settings/ThemeSettings.ets | arkts | seedSystemColorMode | Called once by EntryAbility early in onCreate (before any setColorMode):
snapshots context.config.colorMode as the real system value into AppStorage.
The EnvironmentCallback later updates this cache with new colorMode values. | static seedSystemColorMode(context: common.UIAbilityContext): void {
setAppStorageValue<number>(StorageKeys.SYSTEM_COLOR_MODE, context.config.colorMode as number)
connectThemeDisplay().systemColorMode = context.config.colorMode as number
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left seedSystemColorMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_ex... | static seedSystemColorMode(context: common.UIAbilityContext): void {
setAppStorageValue<number>(StorageKeys.SYSTEM_COLOR_MODE, context.config.colorMode as number)
connectThemeDisplay().systemColorMode = context.config.colorMode as number
} | https://github.com/honjow/Next2V | 851da6f770e042bd9943368ba4e1fc8ba4e4214d | github |
751496032/ZRouter | RouterApi/src/main/ets/template/ZLifecycleObserver.ets | arkts | onPageShow | @Entry页面的生命周期函数 | onPageShow(): void {
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onPageShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left... | onPageShow(): void {
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/template/ZLifecycleObserver.ets#L23-L24 | 906c1f909463a36f1967d49a605ff52d97edccae | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/utils/NavigationManager.ets | arkts | logNavigation | 记录导航日志
@param action 导航动作
@param url 目标URL
@param params 参数(可选) | private logNavigation(action: string, url: string, params?: NavigationParams): void {
if (!NavigationConfig.ENABLE_NAVIGATION_LOG) {
return;
}
const logEntry = {
timestamp: new Date().toISOString(),
action: action,
url: url,
hasParams: !!params,
currentHistory: this.na... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left logNavigation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private logNavigation(action: string, url: string, params?: NavigationParams): void {
if (!NavigationConfig.ENABLE_NAVIGATION_LOG) {
return;
}
const logEntry = {
timestamp: new Date().toISOString(),
action: action,
url: url,
hasParams: !!params,
currentHistory: this.na... | https://github.com/LJ666-ui/harmony-health-care | 528c4b4f5c7a021bd4c3ed63fe94dec55ee02280 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Diagnostics/StartupTest.ets | arkts | logTestResults | 输出测试结果 | private logTestResults(results: Record<string, boolean>): void {
// 构建完整的测试报告
const reportLines: string[] = [];
reportLines.push('🧪 ========== 启动流程测试报告 ==========');
Object.entries(results).forEach(([testName, success]) => {
const status = success ? '✅ 通过' : '❌ 失败';
reportLines.push(... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left logTestResults AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left results AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiati... | private logTestResults(results: Record<string, boolean>): void {
// 构建完整的测试报告
const reportLines: string[] = [];
reportLines.push('🧪 ========== 启动流程测试报告 ==========');
Object.entries(results).forEach(([testName, success]) => {
const status = success ? '✅ 通过' : '❌ 失败';
reportLines.push(... | https://github.com/DaLongZhuaZi/manxia | 8c449eac65e4a05f3d7b4e67739586e5289b2edb | github |
HarmonyOS_Samples/MusicHome | features/player/src/main/ets/view/LrcView.ets | arkts | startAnimator | Animates canvas vertical offset toward desOffsetY over a short duration. | startAnimator(desOffsetY: number) {
if (this.animator) {
this.animator.finish();
}
this.animator = this.getUIContext().createAnimator({
duration: 400,
easing: 'linear',
delay: 0,
fill: 'forwards',
direction: 'normal',
iterations: 1,
begin: this.curCanvasOff... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startAnimator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left desOffsetY AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right A... | startAnimator(desOffsetY: number) {
if (this.animator) {
this.animator.finish();
}
this.animator = this.getUIContext().createAnimator({
duration: 400,
easing: 'linear',
delay: 0,
fill: 'forwards',
direction: 'normal',
iterations: 1,
begin: this.curCanvasOff... | https://gitcode.com/HarmonyOS_Samples/MusicHome | 32c15e5a44ded107b7edb6968a03f97fcd38c783 | gitcode |
richshaw2015/nds | ohos/entry/src/main/ets/utils/CheatManager.ets | arkts | syncToNative | ========================================================================
Native 同步
========================================================================
将启用的金手指同步到 Native AREngine
对齐 Android: CheatsActivity -> MelonEmulator.setCodeList() | syncToNative(folders: MergedCheatFolder[]): void {
const nativeCheats: Array<Array<number>> = [];
for (const folder of folders) {
for (const cheat of folder.cheats) {
if (!cheat.enabled) continue;
const codes: number[] = [];
// 对齐 Android: 按空格拆分,每个 8 位 hex 转 u32
const p... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left syncToNative AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left folders AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left MergedChea... | syncToNative(folders: MergedCheatFolder[]): void {
const nativeCheats: Array<Array<number>> = [];
for (const folder of folders) {
for (const cheat of folder.cheats) {
if (!cheat.enabled) continue;
const codes: number[] = [];
// 对齐 Android: 按空格拆分,每个 8 位 hex 转 u32
const p... | https://github.com/richshaw2015/nds | d9f3580bb512d4cfa08e636366c83860be5b9199 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/components/BookTransitionOverlay.ets | arkts | setStateChangeCallback | 设置状态变化回调(由覆盖层组件调用) | public setStateChangeCallback(callback: (state: GlobalTransitionState) => void): number {
this.nextStateListenerId = this.nextStateListenerId + 1;
const listener: TransitionStateListener = {
id: this.nextStateListenerId,
callback: callback
};
this.stateListeners.push(listener);
return ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left setStateChangeCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right A... | public setStateChangeCallback(callback: (state: GlobalTransitionState) => void): number {
this.nextStateListenerId = this.nextStateListenerId + 1;
const listener: TransitionStateListener = {
id: this.nextStateListenerId,
callback: callback
};
this.stateListeners.push(listener);
return ... | https://github.com/DaLongZhuaZi/manxia | 4e1b7b59c9b1388ef760ce880e45671d7ea44390 | github |
openharmony/codelabs | Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets | arkts | imageCropCompare | Image crop compare. | imageCropCompare(): void {
let imageRect = this.getImageRect();
let cropRect = this.getCropRect();
let imageRectWidth = imageRect.getWidth();
let imageRectHeight = imageRect.getHeight();
let cropRectWidth = cropRect.getWidth();
let cropRectHeight = cropRect.getHeight();
if (imageRectWidth ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left imageCropCompare AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | imageCropCompare(): void {
let imageRect = this.getImageRect();
let cropRect = this.getCropRect();
let imageRectWidth = imageRect.getWidth();
let imageRectHeight = imageRect.getHeight();
let cropRectWidth = cropRect.getWidth();
let cropRectHeight = cropRect.getHeight();
if (imageRectWidth ... | https://gitee.com/openharmony/codelabs.git | d4f237757dae35e04fe0c5320336a1a77a796511 | gitee |
arkui-x/samples | CodeLab/Cases/feature/collapsemenu/src/main/ets/model/BasicDataSource.ets | arkts | totalCount | // 获取数组长度 | public totalCount(): number {
return this.articleData.length;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left totalCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#numb... | public totalCount(): number {
return this.articleData.length;
} | https://gitcode.com/arkui-x/samples | 34838a7657acbb770532cd4650b96b7109b83789 | gitcode |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/userdata/keyshortcuts/classes/meowKeyboardMan.ets | arkts | initFromSettings | Load from settings. | initFromSettings() {
const settingsStrings = keyShortcutsString();
if (!settingsStrings) {
meow(`No settings found for key shortcuts.`, 'meowKeyboardMan][initFromSettings', meowLevel.WARN);
return;
}
// Process each shortcut.
for (let i = 0; i < settingsStrings.length; i++) {
co... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initFromSettings 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#L... | initFromSettings() {
const settingsStrings = keyShortcutsString();
if (!settingsStrings) {
meow(`No settings found for key shortcuts.`, 'meowKeyboardMan][initFromSettings', meowLevel.WARN);
return;
}
// Process each shortcut.
for (let i = 0; i < settingsStrings.length; i++) {
co... | https://github.com/awaLiny2333/LinysBrowser_NEXT | c6c49a37a700e9018d808db778ac0f2c250b266c | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | initializeVideoReceiver | ============================================================
视频 — 完整接收链路
============================================================
初始化视频接收端
RTP → H.264 解码 → Surface 渲染 | public async initializeVideoReceiver(): Promise<boolean> {
try {
// v32-fix: 解码器分辨率必须与编码器输出一致 (1280x720),不能使用 config.video 可能被低端设备逻辑覆盖的值
// 实际显示分辨率由解码器输出的 Surface 决定,这里只需要保证编解码器参数匹配
const width: number = 1280; // 固定与 Android 端对齐
const height: number = 720;
// v36: 根据设备解码能力动态选择接收编解码器... | AST#ERROR#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 initializeVideoReceiver AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | public async initializeVideoReceiver(): Promise<boolean> {
try {
// v32-fix: 解码器分辨率必须与编码器输出一致 (1280x720),不能使用 config.video 可能被低端设备逻辑覆盖的值
// 实际显示分辨率由解码器输出的 Surface 决定,这里只需要保证编解码器参数匹配
const width: number = 1280; // 固定与 Android 端对齐
const height: number = 720;
// v36: 根据设备解码能力动态选择接收编解码器... | https://github.com/tdcare/tdwebrtc | 54f72719e855554e36a8482ed4a86be7458f8114 | github |
openharmony/applications_notes | features/src/main/ets/components/NoteListComp.ets | arkts | modifyAllData | 修改列表中所有对象 | public modifyAllData(data: NoteData[]): void {
LogUtil.info(TAG, `all data modified`);
this.noteList = data;
this.notifyDataReload();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left modifyAllData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expressi... | public modifyAllData(data: NoteData[]): void {
LogUtil.info(TAG, `all data modified`);
this.noteList = data;
this.notifyDataReload();
} | https://gitee.com/openharmony/applications_notes.git | 0c2e7d156de09364c4b4b2be58b80a40736227ca | gitee |
OSpark-Team/Free-PCM | library/src/main/ets/utils/AudioRendererPlayer.ets | arkts | stop | 停止播放并释放资源
@returns Promise<void> 停止完成后 resolve
@remarks
- 停止解码器
- 停止并释放 AudioRenderer
- 清理所有内部状态
- 调用后需要重新调用 play() 才能播放 | public async stop(): Promise<void> {
// 停止时间更新定时器
this.stopTimeUpdate();
this.isPlaying_ = false;
try {
if (this.decoder) {
this.decoder.close();
}
} catch (err) {
// ignore
} finally {
this.decoder = null;
}
try {
if (this.renderer) {
aw... | 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 stop AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS... | public async stop(): Promise<void> {
// 停止时间更新定时器
this.stopTimeUpdate();
this.isPlaying_ = false;
try {
if (this.decoder) {
this.decoder.close();
}
} catch (err) {
// ignore
} finally {
this.decoder = null;
}
try {
if (this.renderer) {
aw... | https://github.com/OSpark-Team/Free-PCM/blob/3440e7220d07d28815d172b4b3237145434075ee/library/src/main/ets/utils/AudioRendererPlayer.ets#L657-L683 | cb4167266cb8587dfb496052a7bd284cc3473851 | github |
RoooyHe/toona-ohos | toona/src/main/ets/network/clients/DeviceHttpClient.ets | arkts | updateDevice | ✅ 修复 Error 10: 允许接收 UpdateDeviceRequest 或 Record 对象 | async updateDevice(deviceId: string, request: UpdateDeviceRequest | Record<string, Object>): Promise<void> {
await this.put<Record<string, Object>>(`/devices/${deviceId}`, request as Record<string, string | object>);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateDevice AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left deviceId AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async updateDevice(deviceId: string, request: UpdateDeviceRequest | Record<string, Object>): Promise<void> {
await this.put<Record<string, Object>>(`/devices/${deviceId}`, request as Record<string, string | object>);
} | https://github.com/RoooyHe/toona-ohos | cdef72e81693bd0af0da124f5fd09ddb89a6d642 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GamepadManager.ets | arkts | loadGCButtonMappingSettings | 加载 Game Controller Kit 按键映射设置
根据用户设置动态调整 2313 兼容键的动作 | private async loadGCButtonMappingSettings(): Promise<void> {
try {
const action = await PreferencesUtil.get<string>(SettingsKeys.GC_BUTTON_HOME_MAPPING, 'guide');
this.updateGCButton2313Action(action as GCButton2313Action);
} catch (e) {
this.updateGCButton2313Action('guide');
}
} | 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 loadGCButtonMappingSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expres... | private async loadGCButtonMappingSettings(): Promise<void> {
try {
const action = await PreferencesUtil.get<string>(SettingsKeys.GC_BUTTON_HOME_MAPPING, 'guide');
this.updateGCButton2313Action(action as GCButton2313Action);
} catch (e) {
this.updateGCButton2313Action('guide');
}
} | https://github.com/AlkaidLab/moonlight-harmony | efdfcbab51e186a096159ee78bc1d6a9670c642c | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/ChartModel.ets | arkts | setMaxHighlightDistance | Sets the maximum distance in screen dp a touch can be away from an entry to cause it to get highlighted.
Default: 500dp
@param distDp | public setMaxHighlightDistance(distDp: number) {
this.mMaxHighlightDistance = Utils.handleDataValues(distDp);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setMaxHighlightDistance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left distDp AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identi... | public setMaxHighlightDistance(distDp: number) {
this.mMaxHighlightDistance = Utils.handleDataValues(distDp);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 9915a36749511ff7898c9551f78df6bbc60a1a1f | gitee |
ibestservices/ibest-ui | library/src/main/ets/components/dateTimePicker/index.ets | arkts | getSecondList | 获取秒列表 | getSecondList(): IBestPickerOption[] {
let secondsList: IBestPickerOption[] = []
let year = this.getValue("year")
let month = this.getValue("month")
let day = this.getValue("day")
let hour = this.getValue("hour")
let minute = this.getValue("minute")
let min = this.isMinYear(year) && this.isMinMonth(month... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSecondList 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 IBestPickerOption AST#identifier#Right AST#[#Lef... | getSecondList(): IBestPickerOption[] {
let secondsList: IBestPickerOption[] = []
let year = this.getValue("year")
let month = this.getValue("month")
let day = this.getValue("day")
let hour = this.getValue("hour")
let minute = this.getValue("minute")
let min = this.isMinYear(year) && this.isMinMonth(month... | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/dateTimePicker/index.ets#L279-L295 | fb79b79a6358847513f773ca7190cf0aef17fa43 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.Deque.ets | arkts | constructor | Creates a new instance of Deque. | public constructor() {
this.capacity = this.DEFAULT_CAPACITY;
this.buffer = Array.create<T | undefined>(this.capacity, undefined);
} | 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#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { A... | public constructor() {
this.capacity = this.DEFAULT_CAPACITY;
this.buffer = Array.create<T | undefined>(this.capacity, undefined);
} | https://gitcode.com/iop123123/arkts-static-skills | ad0f6fdeddae38cd020c25c555fd344f6b78cef3 | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/utils/StringUtil.ets | arkts | arrayBufferToString | 将 ArrayBuffer 转换为字符串
@param buffer ArrayBuffer
@returns UTF-8 字符串 | static arrayBufferToString(buffer: ArrayBuffer): string {
return StringUtil.getTextDecoder().decodeToString(new Uint8Array(buffer));
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left arrayBufferToString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buffer AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | static arrayBufferToString(buffer: ArrayBuffer): string {
return StringUtil.getTextDecoder().decodeToString(new Uint8Array(buffer));
} | https://github.com/AlkaidLab/moonlight-harmony | c4c3946e8c0f9631215d336fef1698a61a353141 | github |
honjow/Next2V | entry/src/main/ets/model/IndexTitleBarCoordinator.ets | arkts | nodeTopicIdentity | Scroll-reveal node title identity (mirrors userProfileIdentity): empty title until the node-info
card's name scrolls under the app bar, then the per-route reveal ledger supplies icon + name. | static nodeTopicIdentity(
nodeName: string,
titleRouteNodeName: string,
currentTitleNodeName: string,
currentAvatarUrl: string,
titleNameStatesJson: string,
titleAvatarStatesJson: string,
): NodeTopicTitleBarIdentity {
const routeNodeName = (nodeName || '').trim()
const nameFromState... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left nodeTopicIdentity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left nodeName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str... | static nodeTopicIdentity(
nodeName: string,
titleRouteNodeName: string,
currentTitleNodeName: string,
currentAvatarUrl: string,
titleNameStatesJson: string,
titleAvatarStatesJson: string,
): NodeTopicTitleBarIdentity {
const routeNodeName = (nodeName || '').trim()
const nameFromState... | https://github.com/honjow/Next2V | 296f8a5f54333f4cbeddec0b80e5a04500a5614f | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/PanZoomHandler.ets | arkts | cancelActiveGesture | 取消当前缩放/平移手势,但保留已经应用的视频缩放状态。 | cancelActiveGesture(): void {
this.pointers.clear();
this.initialPinchDistance = 0;
this.initialScaleFactor = this.scaleFactor;
this.initialTranslateX = this.translateX;
this.initialTranslateY = this.translateY;
this.lastPanX = 0;
this.lastPanY = 0;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cancelActiveGesture AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen... | cancelActiveGesture(): void {
this.pointers.clear();
this.initialPinchDistance = 0;
this.initialScaleFactor = this.scaleFactor;
this.initialTranslateX = this.translateX;
this.initialTranslateY = this.translateY;
this.lastPanX = 0;
this.lastPanY = 0;
} | https://github.com/AlkaidLab/moonlight-harmony | a0c0ba86278b2afdc7fa71642d5c0b8baf41d3a0 | github |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/SearchHistoryRepository.ets | arkts | removeSearchHistory | 根据关键词删除搜索历史记录
@param {string} keyword 搜索关键词
@returns {Promise<void>} Promise<void> | removeSearchHistory(keyword: string): Promise<void> {
return this.dataSource.removeSearchHistory(keyword);
} | AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left removeSearchHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left keyword AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left stri... | removeSearchHistory(keyword: string): Promise<void> {
return this.dataSource.removeSearchHistory(keyword);
} | https://github.com/Joker-x-dev/CoolMallArkTS | ee4c70e246c7d6beac89db3237a43b0551223bbc | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | precision | Return the number of significant digits of the value of this Decimal.
@returns { double } the number type | public precision(): double {
let result: double;
if (this.digits) {
result = Utils.getPrecision(this.digits!);
} else {
result = NaN;
}
return result;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left precision 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 double AST#i... | public precision(): double {
let result: double;
if (this.digits) {
result = Utils.getPrecision(this.digits!);
} else {
result = NaN;
}
return result;
} | https://gitcode.com/iop123123/arkts-static-skills | b3785eb77e77ea1969d140843014d87cafdfd319 | gitcode |
XHXYT/Pixark | entry/src/main/ets/common/utils/JumpUtils.ets | arkts | handleMail | 拉起邮件类应用(Want方式,支持更丰富的参数)
@param email 收件人邮箱
@param subject 邮件主题
@param content 邮件正文 | static handleMail(email: string, subject: string, content: string): void {
let wantParam: Record<string, Object> = {
'sceneType': 1,
// 收件人邮箱地址,多值以逗号分隔,对数组内容使用encodeURI()方法进行url编码
'email': [encodeURI(email)],
// 抄收人邮箱地址,多值以逗号分隔
// 'cc': [encodeURI('xxx@example.com'),encodeURI('xxx@ex... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left handleMail AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left email AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri... | static handleMail(email: string, subject: string, content: string): void {
let wantParam: Record<string, Object> = {
'sceneType': 1,
// 收件人邮箱地址,多值以逗号分隔,对数组内容使用encodeURI()方法进行url编码
'email': [encodeURI(email)],
// 抄收人邮箱地址,多值以逗号分隔
// 'cc': [encodeURI('xxx@example.com'),encodeURI('xxx@ex... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/common/utils/JumpUtils.ets#L75-L109 | 13f9b9a89070557c4567ad2248a23dced5331b6d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/components/PreloadManager.ets | arkts | setPreloadRange | 设置预加载范围 | setPreloadRange(range: number): void {
this.preloadRange = range;
this.updateDebugInfo();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setPreloadRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left range AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ... | setPreloadRange(range: number): void {
this.preloadRange = range;
this.updateDebugInfo();
} | https://github.com/DaLongZhuaZi/manxia | 4bd734b780c3881d8d3ef4013cfe641be6ffaa0d | github |
HarmonyOS_Codelabs/arkts-intermediate-syntax | entry/src/main/ets/services/LocalDeviceService.ets | arkts | getFilteredDevices | 获取筛选后的设备列表
@returns T[] 筛选后的设备 | getFilteredDevices(): T[] {
return [...this.filteredDevices]; // 返回拷贝,确保数据安全性
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getFilteredDevices 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 T AST#identif... | getFilteredDevices(): T[] {
return [...this.filteredDevices]; // 返回拷贝,确保数据安全性
} | https://gitcode.com/HarmonyOS_Codelabs/arkts-intermediate-syntax | ddc037dbae85fd93e0001b59b24080da867b4262 | gitcode |
openharmony-tpc/MMKV | entry/src/main/ets/pages/index.ets | arkts | testPreference | test storage | testPreference() {
LogUtil.i('testPreference start')
let kv = MMKV.getMMKVWithMMapID('imported', MMKV.SINGLE_PROCESS_MODE, "", undefined);
// kv.clearAll()
// kv.preferencesToMMKV(fileName)
LogUtil.i('testPreference allKeys = ' + kv.getAllKeys())
LogUtil.i('testPreference string = ' + ... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left testPreference 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... | testPreference() {
LogUtil.i('testPreference start')
let kv = MMKV.getMMKVWithMMapID('imported', MMKV.SINGLE_PROCESS_MODE, "", undefined);
// kv.clearAll()
// kv.preferencesToMMKV(fileName)
LogUtil.i('testPreference allKeys = ' + kv.getAllKeys())
LogUtil.i('testPreference string = ' + ... | https://gitee.com/openharmony-tpc/MMKV.git | ba9c158c0e67c75e13f9497bf6f031ee62cb06ba | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets | arkts | postTaskToMain | Post task to main worker
Note: it has no effect if EAWorker was stoped | private static postTaskToMain<R>(coroFun: Function, args: FixedArray<Any>, abort: boolean) : Promise<R> {
let wrappedTask = (): R => {
return coroFun.unsafeCall(...args) as R;
}
let lParams: LaunchParams = {
workerGroupId: WorkerGroup.generateGroupId(WorkerDomain.EXAC... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left postTaskToMain AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#L... | private static postTaskToMain<R>(coroFun: Function, args: FixedArray<Any>, abort: boolean) : Promise<R> {
let wrappedTask = (): R => {
return coroFun.unsafeCall(...args) as R;
}
let lParams: LaunchParams = {
workerGroupId: WorkerGroup.generateGroupId(WorkerDomain.EXAC... | https://gitcode.com/iop123123/arkts-static-skills | 7c3d6f64cd2c53dd06c4b137c1d60f2589b1bc0d | gitcode |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/VibratorManager.ets | arkts | vibrateTap | ═══════════════════════════════════════════════════════════════
预设效果快捷法
═══════════════════════════════════════════════════════════════
轻触反馈 — 预设轻柔效果 | static vibrateTap(): void {
VibratorManager.logExecution('vibrateTap');
VibratorManager.vibratePreset(HapticEffect.SOFT, 1, 30, VibrationUsage.TOUCH);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateTap AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_... | static vibrateTap(): void {
VibratorManager.logExecution('vibrateTap');
VibratorManager.vibratePreset(HapticEffect.SOFT, 1, 30, VibrationUsage.TOUCH);
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | bae44525e448d68bd24f1cd87b8ab135c836072f | github |
iHongRen/harmony-study-demo | entry/src/main/ets/pages/oss/OssUploader.ets | arkts | generateFileUrl | 生成上传后的文件访问 URL
@param bucket 桶名
@param endpoint 端点
@param objectKey 文件 key | private generateFileUrl(bucket: string, endpoint: string, objectKey: string): string {
return `https://${bucket}.${endpoint}/${objectKey}`;
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateFileUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bucket AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | private generateFileUrl(bucket: string, endpoint: string, objectKey: string): string {
return `https://${bucket}.${endpoint}/${objectKey}`;
} | https://github.com/iHongRen/harmony-study-demo | ea7914ee7b4a586717da19fe080417c66cdf5410 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/PersonalizedBudgetService.ets | arkts | evaluateAdviceAccuracy | 评估建议准确性
在建议生效一段时间后,对比实际支出和预测值 | static async evaluateAdviceAccuracy(userId: number): Promise<number> {
try {
// 获取待评估的反馈
const pendingFeedbacks = await AdviceFeedbackDAO.getPendingEvaluations(userId);
if (pendingFeedbacks.length === 0) {
hilog.info(HILOG_DOMAIN, LOG_TAG, '没有待评估的建议');
return 0;
}
l... | 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 evaluateAdviceAccuracy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:... | static async evaluateAdviceAccuracy(userId: number): Promise<number> {
try {
// 获取待评估的反馈
const pendingFeedbacks = await AdviceFeedbackDAO.getPendingEvaluations(userId);
if (pendingFeedbacks.length === 0) {
hilog.info(HILOG_DOMAIN, LOG_TAG, '没有待评估的建议');
return 0;
}
l... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 0c2abd95171edc50b05b4d77a82a84cc2448c708 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Compress/ComicArchiveManager.ets | arkts | extractTitleFromPath | 从路径提取标题 | private extractTitleFromPath(path: string): string {
const fileName = path.substring(path.lastIndexOf('/') + 1, path.lastIndexOf('.'));
return fileName.replace(/_/g, ' ');
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractTitleFromPath 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#identifi... | private extractTitleFromPath(path: string): string {
const fileName = path.substring(path.lastIndexOf('/') + 1, path.lastIndexOf('.'));
return fileName.replace(/_/g, ' ');
} | https://github.com/DaLongZhuaZi/manxia | c2034e0763bd89fc4ddda0eb50f1258f8f3621ff | github |
dingzhilin1990/zhilinclaw | src/security/CredentialVault.ets | arkts | list | 列出所有凭证(不包含值) | public list(): CredentialMetadata[] {
return Array.from(this.credentials.values()).map(cred => ({
id: cred.id,
name: cred.name,
type: cred.type,
createdAt: cred.createdAt,
expiresAt: cred.expiresAt,
lastUsedAt: cred.lastUsedAt,
usageCount: cred.usageCount,
tags: cre... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left list 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#:#Righ... | public list(): CredentialMetadata[] {
return Array.from(this.credentials.values()).map(cred => ({
id: cred.id,
name: cred.name,
type: cred.type,
createdAt: cred.createdAt,
expiresAt: cred.expiresAt,
lastUsedAt: cred.lastUsedAt,
usageCount: cred.usageCount,
tags: cre... | https://github.com/dingzhilin1990/zhilinclaw | e24decd2dd44a9ac4525232cc6ab4d5f6633df2c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Parsers/EBookParser.ets | arkts | createParser | 根据文件路径创建对应的解析器
解析策略:
- MOBI/AZW/AZW3: 优先使用 MobiEBookParser 转换为伪 EPUB 目录,WebView 引擎渲染
- Kindle 系本地转换失败时保留 WebView 懒转换记录,Reader Kit 只作为用户显式兜底入口
- EPUB: 使用 Reader Kit(官方 API)
- PDF: 使用 Web 组件预览方案
- TXT: 使用文件读取 + 自定义解析 | public static createParser(filePath: string): EBookParser | null {
const format = EBookParserFactory.detectFormat(filePath);
if (!format) {
logger.warn(TAG, `无法识别的电子书格式: ${filePath}`);
return null;
}
// MOBI/AZW/AZW3: use MobiEBookParser for WebView-based rendering first
if (MobiEBoo... | 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 createParser AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left :... | public static createParser(filePath: string): EBookParser | null {
const format = EBookParserFactory.detectFormat(filePath);
if (!format) {
logger.warn(TAG, `无法识别的电子书格式: ${filePath}`);
return null;
}
// MOBI/AZW/AZW3: use MobiEBookParser for WebView-based rendering first
if (MobiEBoo... | https://github.com/DaLongZhuaZi/manxia | 97c40cd75eb3b12772ef60cf138760ff9e50f41c | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | logStreamDiag | 每3秒打一次流管线诊断日志 | private logStreamDiag(): void {
const now: number = Date.now();
if (now - this.lastStreamDiagTime >= 3000) {
LogUtil.info(`[MediaStream] 管线诊断: 采集=${this.videoCaptureCount}, 丢弃=${this.videoFrameDropCount}, 编码发送=${this.videoSendFrameCount}, RTP发送=${this.videoRtpSendCount}, 视频RTP收=${this.videoRtpRecvCount}... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left logStreamDiag 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#vo... | private logStreamDiag(): void {
const now: number = Date.now();
if (now - this.lastStreamDiagTime >= 3000) {
LogUtil.info(`[MediaStream] 管线诊断: 采集=${this.videoCaptureCount}, 丢弃=${this.videoFrameDropCount}, 编码发送=${this.videoSendFrameCount}, RTP发送=${this.videoRtpSendCount}, 视频RTP收=${this.videoRtpRecvCount}... | https://github.com/tdcare/tdwebrtc | d971920ae83374ca8ba1961c118b185fdb627446 | github |
751496032/ZRouter | RouterApi/src/main/ets/api/Router.ets | arkts | pushByTopName | @deprecated
@param remove | public static pushByTopName(remove: boolean = true) {
ZRouter.getRouterMgr().pushByTopName(remove)
} | 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 pushByTopName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left remove AST#identifier#Right AST#:#Left : ... | public static pushByTopName(remove: boolean = true) {
ZRouter.getRouterMgr().pushByTopName(remove)
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L605-L607 | fca2ea0cd4c73f448fa2f524aa97ad8233214637 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/DatabaseService.ets | arkts | deleteSession | 删除会话及其消息 | async deleteSession(sessionId: string): Promise<void> {
await this.waitForInitialization()
if (this.rdbStore === null) {
return
}
try {
const messageIds: string[] = []
const queryPredicates = new relationalStore.RdbPredicates(TableNames.MESSAGES)
queryPredicates.equalTo('sessio... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteSession AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sessionId AST#identifier#Right AST#type_annotation#Left AST#:#Lef... | async deleteSession(sessionId: string): Promise<void> {
await this.waitForInitialization()
if (this.rdbStore === null) {
return
}
try {
const messageIds: string[] = []
const queryPredicates = new relationalStore.RdbPredicates(TableNames.MESSAGES)
queryPredicates.equalTo('sessio... | https://github.com/LongLiveY96/chatcube | 61fc71e8e652f91eaa2845d94fe94e9f95403287 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/DataValidator.ets | arkts | validateMangaStatus | 验证漫画状态
@param value - 要验证的状态
@param fieldName - 字段名称
@returns 验证结果 | static validateMangaStatus(value: string | undefined | null, fieldName: string = 'status'): ValidationResult {
const errors: string[] = [];
if (value === null || value === undefined) {
errors.push(`${fieldName} 不能为空`);
} else if (typeof value !== 'string') {
errors.push(`${fieldName} 必须是字... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left validateMangaStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expr... | static validateMangaStatus(value: string | undefined | null, fieldName: string = 'status'): ValidationResult {
const errors: string[] = [];
if (value === null || value === undefined) {
errors.push(`${fieldName} 不能为空`);
} else if (typeof value !== 'string') {
errors.push(`${fieldName} 必须是字... | https://github.com/DaLongZhuaZi/manxia | 3f72285ffca14404e32392c167601fc95d97448e | github |
offlinecat-dev/OCNetORM | src/main/ets/mapping/EntityData.ets | arkts | addProperty | 添加属性值
@param propertyName 属性名
@param value 属性值
@param propertyType 属性类型 | addProperty(propertyName: string, value: ValueType, propertyType: string): void {
const prop = new EntityPropertyValue(propertyName, value, propertyType)
this.properties.push(prop)
// 同步到 propertyMap 以支持响应式
this.propertyMap.set(propertyName, value)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addProperty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST... | addProperty(propertyName: string, value: ValueType, propertyType: string): void {
const prop = new EntityPropertyValue(propertyName, value, propertyType)
this.properties.push(prop)
// 同步到 propertyMap 以支持响应式
this.propertyMap.set(propertyName, value)
} | https://github.com/offlinecat-dev/OCNetORM | 0e8bd87009330b4bbe7d210afbbcffe2adb270b9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | deleteComic | ==================== 漫画删除 ====================
删除漫画及其所有相关数据
@param comicId 漫画ID
@returns Promise<void> | public async deleteComic(comicId: string): Promise<void> {
try {
logger.info(TAG, `开始删除漫画: ${comicId}`);
// 1. 获取漫画信息,用于确定文件存储路径和类型
const comicInfo = await this.getComicById(comicId);
const onlineComicInfo = await this.getOnlineComicInfoById(comicId);
if (!comicInfo && !onlin... | 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 deleteComic AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left comicId AST#identifier#Right AST#ERROR#Left AST#:#Left : AS... | public async deleteComic(comicId: string): Promise<void> {
try {
logger.info(TAG, `开始删除漫画: ${comicId}`);
// 1. 获取漫画信息,用于确定文件存储路径和类型
const comicInfo = await this.getComicById(comicId);
const onlineComicInfo = await this.getOnlineComicInfoById(comicId);
if (!comicInfo && !onlin... | https://github.com/DaLongZhuaZi/manxia | c174b5822ef35a779d559533e82bde580430265a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/UserAgentManager.ets | arkts | getSourceUserAgent | 获取图源级别的自定义User-Agent
@param sourceId 图源ID
@returns User-Agent字符串,如果未启用则返回null | async getSourceUserAgent(sourceId: number): Promise<string | null> {
try {
// 检查缓存
if (this.sourceUACache.has(sourceId)) {
return this.sourceUACache.get(sourceId) || null;
}
// 从数据库加载
const enabledRecord: UserSettingsDatabaseRecord | null =
await this.dataManager.ge... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSourceUserAgent AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Left AST#:... | async getSourceUserAgent(sourceId: number): Promise<string | null> {
try {
// 检查缓存
if (this.sourceUACache.has(sourceId)) {
return this.sourceUACache.get(sourceId) || null;
}
// 从数据库加载
const enabledRecord: UserSettingsDatabaseRecord | null =
await this.dataManager.ge... | https://github.com/DaLongZhuaZi/manxia | f7305b45c89bf1ff08f25a93344740c955b096bd | github |
LongLiveY96/chatcube | entry/src/main/ets/viewmodels/ChatViewModel.ets | arkts | updateMessageContentAndAttachments | 更新消息内容和附件 | async updateMessageContentAndAttachments(
messageId: string,
content: string,
attachments: MessageAttachment[]
): Promise<void> {
// 更新数据库
await this.databaseService.updateMessageContent(messageId, content)
await this.databaseService.updateMessageAttachments(messageId, attachments)
// 更... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateMessageContentAndAttachments AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left messageId AST#identifier#Right AST#type_anno... | async updateMessageContentAndAttachments(
messageId: string,
content: string,
attachments: MessageAttachment[]
): Promise<void> {
// 更新数据库
await this.databaseService.updateMessageContent(messageId, content)
await this.databaseService.updateMessageAttachments(messageId, attachments)
// 更... | https://github.com/LongLiveY96/chatcube | 467bccf3ce0c90c49892eb29691425ac26c1f46a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/AutoPageTurnController.ets | arkts | isRunning | 是否正在运行 | public isRunning(): boolean {
return this.state === AutoPageTurnState.RUNNING;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isRunning AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boo... | public isRunning(): boolean {
return this.state === AutoPageTurnState.RUNNING;
} | https://github.com/DaLongZhuaZi/manxia | e23a22faace0c22702b7ac925e50eceb5d24ab33 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | map | Creates a new `Array` object and populates
it with the results of calling a provided function on every element in `this` instance of `Array` class.
@param fn mapping function, applied to each element of an array.
@returns `Array` instance, constructed from `this` and given function. | public map<U>(fn: (v: T, k: number) => U): Array<U> {
let res = this.mapArray<U>(fn);
return new Array<U>(res);
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left U AST#identifier#Right AST#binary_expression#Right AST#ERROR#Left AST#>#Left ... | public map<U>(fn: (v: T, k: number) => U): Array<U> {
let res = this.mapArray<U>(fn);
return new Array<U>(res);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ce15857bb6610c745ad8f0991c8006c9068726b9 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | getHospitalInfo | 获取医院基本信息 | public getHospitalInfo(): object {
return HOSPITAL_INFO;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getHospitalInfo 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#object#Left object AST... | public getHospitalInfo(): object {
return HOSPITAL_INFO;
} | https://github.com/LJ666-ui/harmony-health-care | 27070cac9b62f8759cca75f23c1a3294323fe6a8 | github |
PollenWang6/HiXD | entry/src/main/ets/services/AttendanceService.ets | arkts | isLogin | 检查是否已登录超星 | async isLogin(): Promise<boolean> {
try {
const checkUrl: string = buildUrl(COURSE_DETAIL_URL, {
'classId': '123',
'courseId': '1',
'page': '1',
'pageSize': '999',
'puid': ''
});
const resp: HttpResponse = await this.http.get(checkUrl);
const data = ... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left isLogin 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_type... | async isLogin(): Promise<boolean> {
try {
const checkUrl: string = buildUrl(COURSE_DETAIL_URL, {
'classId': '123',
'courseId': '1',
'page': '1',
'pageSize': '999',
'puid': ''
});
const resp: HttpResponse = await this.http.get(checkUrl);
const data = ... | https://github.com/PollenWang6/HiXD | 341ea44c598741c94449cc0713a1f6a08da0a292 | github |
apap6628114/nga_oh | entry/src/main/ets/parser/nga/html-thread/index.ets | arkts | extractIntVar | 从 HTML 中提取 `varName = <数字>` 形式的整型变量。
@param html 源 HTML
@param varName 变量名
@param defaultValue 未找到时的默认值
@returns 变量值;未找到时返回 defaultValue | function extractIntVar(html: string, varName: string, defaultValue: number): number {
const regex: RegExp = new RegExp(varName + '\\s*=\\s*(\\d+)');
const match: RegExpExecArray | null = regex.exec(html);
if (match) {
return parseInt(match[1], 10);
}
return defaultValue;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left extractIntVar AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left html AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri... | function extractIntVar(html: string, varName: string, defaultValue: number): number {
const regex: RegExp = new RegExp(varName + '\\s*=\\s*(\\d+)');
const match: RegExpExecArray | null = regex.exec(html);
if (match) {
return parseInt(match[1], 10);
}
return defaultValue;
} | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/parser/nga/html-thread/index.ets#L27-L34 | e7240dcac309b6683da58436befdad9441d71ae6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Types/StatusEnums.ets | arkts | isValidMangaStatus | 验证MangaStatus是否有效 | static isValidMangaStatus(status: string): boolean {
return MANGA_STATUS_VALUES.includes(status as MangaStatus);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isValidMangaStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left status AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | static isValidMangaStatus(status: string): boolean {
return MANGA_STATUS_VALUES.includes(status as MangaStatus);
} | https://github.com/DaLongZhuaZi/manxia | a350c665cdef0111a7bd16c9dedf9c879141fa72 | github |
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_char.ets | arkts | main | ---
desc: check greater or equal for two chars
--- | function main(): void {
const a: char = {{v.left}}
const b: char = {{v.right}}
assert (a >= b) == {{v.result}} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left A... | function main(): void {
const a: char = {{v.left}}
const b: char = {{v.right}}
assert (a >= b) == {{v.result}} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | c334d2a45a56a2896bb03de6411a8d4748d3aa39 | gitee |
Joker-x-dev/HarmonyKit | feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets | arkts | selectItem | 选择记录进行编辑
@param {DemoEntity} item - 记录数据
@returns {void} 无返回值 | selectItem(item: DemoEntity): void {
this.editingId = item.id ?? 0;
this.titleInput = item.title ?? "";
this.descInput = item.description ?? "";
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left selectItem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DemoEntity AST#identifier#Right AST#)#Left ) ... | selectItem(item: DemoEntity): void {
this.editingId = item.id ?? 0;
this.titleInput = item.title ?? "";
this.descInput = item.description ?? "";
} | https://github.com/Joker-x-dev/HarmonyKit | 83ae181ce0cacf8ac0a8824241af1114a7741ae9 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/02.lexical_elements/09.literals/03.bigint_literals/bigint_literals.ets | arkts | main | ---
desc: >-
BigInt literals use decimal base only. It is a sequence of digits which ends with symbol 'n'.
BigInt literals are always of the type bigint.
params: '{{lit}}'
--- | function main() {
let x = {{lit}};
assert x == {{lit}}
} | 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#statement_block#Left AST#{#Left { AST#{#Right AST#lexical_declaration#Le... | function main() {
let x = {{lit}};
assert x == {{lit}}
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ba6c084c7b1488fc6416a789d4707c46763395b7 | gitee |
HarmonyOS_Samples/BestPracticeSnippets | AvoidTimeComsume/entry/src/main/ets/views/UseTaskPool.ets | arkts | build | [Start use_task_pool] | build() {
Column({ space: 2 }) {
Row({ space: 5 }) {
Column() {
Image($r('app.media.chevron_left'))
.width(16)
.height(16)
}
.width(40)
.height(40)
.justifyContent(FlexAlign.Center)
.backgroundColor('#E8E8E8')
.borderR... | 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: 2 }) {
Row({ space: 5 }) {
Column() {
Image($r('app.media.chevron_left'))
.width(16)
.height(16)
}
.width(40)
.height(40)
.justifyContent(FlexAlign.Center)
.backgroundColor('#E8E8E8')
.borderR... | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 711f13bf41f3f55052e41bedb42c1e99c25f9e53 | gitcode |
openharmony/codelabs | Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets | arkts | firstPlay | This method is triggered when the video playback page is displayed on the video list page.
@param index Video object subscript in the video list.
@param url Playback Path.
@param surfaceId Indicates the surface ID of the surfaceId. | async firstPlay(index: number, url: resourceManager.RawFileDescriptor, iUrl: string, surfaceId: string) {
this.index = index;
this.url = url;
this.iUrl = iUrl;
this.surfaceId = surfaceId;
if (this.avPlayer === null) {
await this.createAVPlayer();
}
if (this.avPlayer !== null) {
... | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left firstPlay AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left in... | async firstPlay(index: number, url: resourceManager.RawFileDescriptor, iUrl: string, surfaceId: string) {
this.index = index;
this.url = url;
this.iUrl = iUrl;
this.surfaceId = surfaceId;
if (this.avPlayer === null) {
await this.createAVPlayer();
}
if (this.avPlayer !== null) {
... | https://gitee.com/openharmony/codelabs.git | 922f728363a00fd597cca15bdd640a33d492fd74 | gitee |
CLMC2025/Vignette | entry/src/main/ets/vocabulary/VocabularyTracker.ets | arkts | getAccuracy | 计算准确率 | getAccuracy(): number {
if (this.correctCount + this.incorrectCount === 0) {
return 0;
}
return this.correctCount / (this.correctCount + this.incorrectCount);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAccuracy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_... | getAccuracy(): number {
if (this.correctCount + this.incorrectCount === 0) {
return 0;
}
return this.correctCount / (this.correctCount + this.incorrectCount);
} | https://github.com/CLMC2025/Vignette | 858874785a4f0e8d3df7c53ae5fbe9bd2afdb62f | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | tan | Return a new Decimal whose value is the tangent of `n`, rounded to `precision` significant
digits using rounding mode `rounding`.
@param { Value } n {double | string | Decimal} A value in radians.
@returns { Decimal } the Decimal type | static tan(n: Value): Decimal {
return new Decimal(n).tan();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left tan AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Ri... | static tan(n: Value): Decimal {
return new Decimal(n).tan();
} | https://gitcode.com/iop123123/arkts-static-skills | 50973d13d39e569167966fe0dde14fd5366615a8 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/WaitersList.ets | arkts | suspend | creates promise and pushes to the queue
caller should await on this promise | public async suspend(): Promise<void> {
// NOTE(alimovilya. #34831) workaround
let pResolver : CallbackT = (x: undefined) => {};
let promise = new Promise<void>((resolve, reject) => {
pResolver = (x: undefined) => {
resolve(undefined)
};
})
... | 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 suspend AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left :... | public async suspend(): Promise<void> {
// NOTE(alimovilya. #34831) workaround
let pResolver : CallbackT = (x: undefined) => {};
let promise = new Promise<void>((resolve, reject) => {
pResolver = (x: undefined) => {
resolve(undefined)
};
})
... | https://gitcode.com/iop123123/arkts-static-skills | 82238f071d5844d0b8d989d190ccb0e22a5969a5 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/AnimationSettingsManager.ets | arkts | removeListener | 移除设置变化监听器 | public removeListener(listener: AnimationSettingsListener): void {
this.listeners.delete(listener);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left removeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | public removeListener(listener: AnimationSettingsListener): void {
this.listeners.delete(listener);
} | https://github.com/DaLongZhuaZi/manxia | 8d0d69ff2e3b531d6328ef17494663dda57fb0cd | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/ComputerManager.ets | arkts | unregisterNetworkListener | 取消注册网络变化监听 | private unregisterNetworkListener(): void {
if (this.netConnection) {
try {
this.netConnection.unregister((err) => {
if (err) {
console.error(`ComputerManager: 取消网络监听失败: ${JSON.stringify(err)}`);
} else {
console.info('ComputerManager: 网络变化监听已取消');
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left unregisterNetworkListener 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#Rig... | private unregisterNetworkListener(): void {
if (this.netConnection) {
try {
this.netConnection.unregister((err) => {
if (err) {
console.error(`ComputerManager: 取消网络监听失败: ${JSON.stringify(err)}`);
} else {
console.info('ComputerManager: 网络变化监听已取消');
... | https://github.com/AlkaidLab/moonlight-harmony | b850ecfc743acd9744f8e3fbe3d08ad2ef7a0557 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/RegExp.ets | arkts | constructor | Constructs a new RegExp using pattern and flags
@param pattern description of a pattern
@param flags description of flags to be used | public constructor(pattern: String, flags: String) {
this.pattern = pattern;
this.flags = flags;
this.source = RegExp.escapePattern(pattern);
this.initializeFlags();
this.compile();
} | 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#identifier#Left pattern AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | public constructor(pattern: String, flags: String) {
this.pattern = pattern;
this.flags = flags;
this.source = RegExp.escapePattern(pattern);
this.initializeFlags();
this.compile();
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e17cc95029c2b979a082544ef2dc45c58b26838f | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Parameter.ets | arkts | isRest | Determines whether this parameter is a rest parameter.
@returns { boolean } Returns true if it is a rest parameter, otherwise returns false.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public isRest(): boolean {
return (this.attributes & Attributes.REST) != 0
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isRest 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#boolea... | public isRest(): boolean {
return (this.attributes & Attributes.REST) != 0
} | https://gitcode.com/iop123123/arkts-static-skills | 8619d7e4649aae38a9769904bef12833fc8f93ee | gitcode |
the-wwyang/kids-learning-app | src/main/ets/services/WrongQuestionService.ets | arkts | filterWrongQuestions | 筛选错题
@param records 所有错题记录
@param filter 筛选条件
@returns 符合条件的错题列表 | static filterWrongQuestions(
records: WrongQuestionRecord[],
filter?: WrongQuestionFilter
): WrongQuestionRecord[] {
let filtered = [...records];
// 按题型筛选
if (filter?.type) {
filtered = filtered.filter(r => r.question.type === filter.type);
}
// 按难度筛选(需要从题目中获取难度信息)
// 注意:当前Ma... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left filterWrongQuestions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscrip... | static filterWrongQuestions(
records: WrongQuestionRecord[],
filter?: WrongQuestionFilter
): WrongQuestionRecord[] {
let filtered = [...records];
// 按题型筛选
if (filter?.type) {
filtered = filtered.filter(r => r.question.type === filter.type);
}
// 按难度筛选(需要从题目中获取难度信息)
// 注意:当前Ma... | https://github.com/the-wwyang/kids-learning-app | 817b14f9f6ec5d36710f0d74e0a7ef471c73abf0 | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/network/ApiService.ets | arkts | setToken | 设置 Token(用于恢复会话) | static setToken(token: string): void {
console.info('[AuthApi.setToken] Setting token: ' + (token.length > 0 ? token.substring(0, 20) + '...' : 'EMPTY'));
httpClient.setToken(token);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string... | static setToken(token: string): void {
console.info('[AuthApi.setToken] Setting token: ' + (token.length > 0 ? token.substring(0, 20) + '...' : 'EMPTY'));
httpClient.setToken(token);
} | https://github.com/Harrisonls2004/WaterFlow | 543c834d0afda50c09d957afc82d6392144dfe79 | github |
the-wwyang/kids-learning-app | src/main/ets/storage/UserSettingsStorageService.ets | arkts | updateThemeMode | 更新主题模式
@param mode 主题模式 | static async updateThemeMode(mode: 'light' | 'dark' | 'auto'): Promise<void> {
try {
const settings = await UserSettingsStorageService.loadSettings();
settings.themeMode = mode;
await UserSettingsStorageService.saveSettings(settings);
console.log(`[UserSettingsStorage] Theme mode updated: ... | 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 updateThemeMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left : A... | static async updateThemeMode(mode: 'light' | 'dark' | 'auto'): Promise<void> {
try {
const settings = await UserSettingsStorageService.loadSettings();
settings.themeMode = mode;
await UserSettingsStorageService.saveSettings(settings);
console.log(`[UserSettingsStorage] Theme mode updated: ... | https://github.com/the-wwyang/kids-learning-app | d1d0dc5c0ae84558f3068af5f016d0fd19ba5397 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/AccountDAO.ets | arkts | softDelete | 软删除账户 - 使用 DAOHelper 统一方法 | static async softDelete(accountId: number): Promise<void> {
await DAOHelper.softDelete('accounts', 'account_id', accountId, '[AccountDAO]');
} | 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 softDelete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left accountId AST#identifier#Right AST#ERROR#Left AST#:#Left : A... | static async softDelete(accountId: number): Promise<void> {
await DAOHelper.softDelete('accounts', 'account_id', accountId, '[AccountDAO]');
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | bd442474404df4b21dda8c148e0c3966959eec5a | github |
AGenUI/AGenUI | platforms/harmony/agenui/src/main/ets/agenui/AGenEngineUI.ets | arkts | unRegisterComponent | Unregisters a custom component factory | static unRegisterComponent(type: string): void {
HybridViewManager.getInstance().unregisterViewCreator(type);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left unRegisterComponent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L... | static unRegisterComponent(type: string): void {
HybridViewManager.getInstance().unregisterViewCreator(type);
} | https://github.com/AGenUI/AGenUI | ab73cb3197d7abebb9fa0922af713894195c53db | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentHashMap.ets | arkts | keys | Returns elements from the ConcurrentHashMap as an keys Iterator
@returns { IterableIterator<K> } iterator with ConcurrentHashMap keys | public override keys(): IterableIterator<K> {
return this.mappedIterator<K>((e: MapNode<K, V>): K => e.key);
} | AST#program#Left AST#ERROR#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#identifier#Left keys AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#... | public override keys(): IterableIterator<K> {
return this.mappedIterator<K>((e: MapNode<K, V>): K => e.key);
} | https://gitcode.com/iop123123/arkts-static-skills | b515408af72b31286af68882c6f016000934d17b | gitcode |
YANGZX22/Voot | entry/src/main/ets/services/PipSubtitleManager.ets | arkts | isPipEnabled | Check if PiP is available | isPipEnabled(): boolean {
try {
return PiPWindow.isPiPEnabled();
} catch (e) {
console.error(`${TAG} isPipEnabled check failed: ${JSON.stringify(e)}`);
return false;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isPipEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statem... | isPipEnabled(): boolean {
try {
return PiPWindow.isPiPEnabled();
} catch (e) {
console.error(`${TAG} isPipEnabled check failed: ${JSON.stringify(e)}`);
return false;
}
} | https://github.com/YANGZX22/Voot | 46b5b339bc3e216818e8e4a047338f810ad26738 | github |
Vincent-Leon/zotero-harmony | entry/src/main/ets/data/SecureStorage.ets | arkts | put | ---- internals ----
asset.add() throws DUPLICATED when the alias already has a stored value.
We catch that one specific error and switch to asset.update() so the
caller gets simple "save or replace" semantics. | private static async put(alias: string, value: string): Promise<void> {
const addAttrs: asset.AssetMap = new Map<asset.Tag, asset.Value>();
addAttrs.set(asset.Tag.SECRET, stringToBytes(value));
addAttrs.set(asset.Tag.ALIAS, stringToBytes(alias));
addAttrs.set(asset.Tag.ACCESSIBILITY, asset.Accessibili... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left put AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alias AST#i... | private static async put(alias: string, value: string): Promise<void> {
const addAttrs: asset.AssetMap = new Map<asset.Tag, asset.Value>();
addAttrs.set(asset.Tag.SECRET, stringToBytes(value));
addAttrs.set(asset.Tag.ALIAS, stringToBytes(alias));
addAttrs.set(asset.Tag.ACCESSIBILITY, asset.Accessibili... | https://github.com/Vincent-Leon/zotero-harmony | 3a1db184c7d5ef07b8754d753d54146d1fc914cc | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/ARRenderer.ets | arkts | drawCameraBackground | 绘制相机背景
简化实现:使用渐变色模拟 | private drawCameraBackground(): void {
if (!this.canvasContext) return;
const ctx = this.canvasContext;
// 创建渐变背景(模拟相机画面)
const gradient = ctx.createLinearGradient(
0,
0,
0,
this.canvasHeight
);
gradient.addColorStop(0, '#1a1a1a');
gradient.addColorStop(0.5, '#2a2... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left drawCameraBackground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void... | private drawCameraBackground(): void {
if (!this.canvasContext) return;
const ctx = this.canvasContext;
// 创建渐变背景(模拟相机画面)
const gradient = ctx.createLinearGradient(
0,
0,
0,
this.canvasHeight
);
gradient.addColorStop(0, '#1a1a1a');
gradient.addColorStop(0.5, '#2a2... | https://github.com/LJ666-ui/harmony-health-care | 136b84ec1e4190fe48fd75e2ebe5f245fc91b27d | github |
wodekouwei/qlog | qloglib/src/main/ets/qlog/upload/UploadManager.ets | arkts | zipFiles | 压缩一组文件到压缩文件中,并分片,最大分片为4M,分片方式是直接截断式分片
@return 压缩后的文件,考虑到分片压缩的可能性,返回值放在数组中,压缩失败,返回空数组,不返回null | private async zipFiles(filesPath: string): Promise<string | undefined> {
// crash, 将对应包名打成zip放到 sd/homelink_logs/log_push目录下
let zipDir = LogFileUtil.getPushDir();
// app名_手机类型(android,ios)_账号_时间_日志类型(crash,常规?)_deviceid_n(计数位,防止文件名重复)
// 0代表android,1代表ios
// 1代表crash,0代表非crash
let desName: st... | 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 zipFiles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filesPath AST#identifier#Right AST#ERROR#Left AST#:#Left : ... | private async zipFiles(filesPath: string): Promise<string | undefined> {
// crash, 将对应包名打成zip放到 sd/homelink_logs/log_push目录下
let zipDir = LogFileUtil.getPushDir();
// app名_手机类型(android,ios)_账号_时间_日志类型(crash,常规?)_deviceid_n(计数位,防止文件名重复)
// 0代表android,1代表ios
// 1代表crash,0代表非crash
let desName: st... | https://gitcode.com/wodekouwei/qlog | 727e7807fc14426f09d185f78767fcdd682efe8d | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewImageLoader.ets | arkts | notifyLoadStart | 通知加载开始 | private notifyLoadStart(request: ImageRequestInfo): void {
this.loadListeners.forEach(listener => {
try {
listener.onLoadStart(request);
} catch (error) {
logger.error(TAG, `通知加载开始失败: ${error instanceof Error ? error.message : String(error)}`);
}
});
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyLoadStart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | private notifyLoadStart(request: ImageRequestInfo): void {
this.loadListeners.forEach(listener => {
try {
listener.onLoadStart(request);
} catch (error) {
logger.error(TAG, `通知加载开始失败: ${error instanceof Error ? error.message : String(error)}`);
}
});
} | https://github.com/DaLongZhuaZi/manxia | c546c92693d182010b89a931d7283b79cc7b4b8c | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/model/ExpressionsModel.ets | arkts | deleteRecordById | delete current records
@param callback callback delete count | deleteRecordById(id: string, callback: Function): void {
LogUtil.info(TAG, 'deleteRecords start');
this.rdbHelper.deleteItemById(id, callback);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteRecordById AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , ... | deleteRecordById(id: string, callback: Function): void {
LogUtil.info(TAG, 'deleteRecords start');
this.rdbHelper.deleteItemById(id, callback);
} | https://gitee.com/openharmony-sig/applications_calculator.git | dd5750d394d53e4226665a6248b58ace1cab0281 | gitee |
CarGuo/GSYGithubAppOH | entry/src/main/ets/entryability/EntryAbility.ets | arkts | handleBootWebInjection | 测试通道:want.parameters.bootWeb=<http(s) url>,
HomePage 启动后会读取该值并 push 到 WebPage,方便对通用 Web 页做真机回归。
与 [handleBootPhotoInjection](https://github.com/CarGuo/GSYGithubAppOH/blob/main/entry/src/main/ets/entryability/EntryAbility.ets) 同款做法。 | private handleBootWebInjection(want: Want): void {
const params: Record<string, Object> | undefined = want.parameters as Record<string, Object> | undefined;
if (!params) {
return;
}
const raw: Object | undefined = params[PARAM_BOOT_WEB];
if (typeof raw !== 'string') {
return;
}
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleBootWebInjection 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#identi... | private handleBootWebInjection(want: Want): void {
const params: Record<string, Object> | undefined = want.parameters as Record<string, Object> | undefined;
if (!params) {
return;
}
const raw: Object | undefined = params[PARAM_BOOT_WEB];
if (typeof raw !== 'string') {
return;
}
... | https://github.com/CarGuo/GSYGithubAppOH | 9268504b88f73518b52c3b6e29207aed89c51f63 | github |
m-harmongos/harmongos-projects | AlarmClock/entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | fillZero | 时间填充0 | public fillZero(val: number): string {
return val > 9 ? val.toString() : `0${val}`
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left fillZero AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left val AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number A... | public fillZero(val: number): string {
return val > 9 ? val.toString() : `0${val}`
} | https://github.com/m-harmongos/harmongos-projects | dc71fc37b7e707d0d37194d9651b60ab59429dee | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Storage/StorageAnalyzer.ets | arkts | analyzeSuwayomiChapters | 分析Suwayomi章节页面缓存
路径: /Download/com.dlzz.manxia/suwayomi/chapters/ | private async analyzeSuwayomiChapters(): Promise<StorageItem> {
try {
const dirInfo = await this.getDownloadSubdirInfo('suwayomi/chapters');
const basePath = DownloadDirManager.isReady() ? `${DownloadDirManager.getPath()}/suwayomi/chapters` : '';
return {
type: StorageType.SUWAYOM... | 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 analyzeSuwayomiChapters AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression... | private async analyzeSuwayomiChapters(): Promise<StorageItem> {
try {
const dirInfo = await this.getDownloadSubdirInfo('suwayomi/chapters');
const basePath = DownloadDirManager.isReady() ? `${DownloadDirManager.getPath()}/suwayomi/chapters` : '';
return {
type: StorageType.SUWAYOM... | https://github.com/DaLongZhuaZi/manxia | 58c85025f7131257e014af20e794e3ce8aa5c6ea | github |
openharmony-sig/applications_clock | common/src/main/ets/manager/AlarmStateManager.ets | arkts | setStateFiring | set alarm state firing
@param alarmId alarm id | async setStateFiring(alarmId: string): Promise<void> {
if (!alarmId) {
LogUtil.error(TAG, 'Execute method setStateFiring failed, params is incorrect.');
return;
}
await this.setState(STATE_FIRING, alarmId);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left setStateFiring AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alarmId AST#identifier#Right A... | async setStateFiring(alarmId: string): Promise<void> {
if (!alarmId) {
LogUtil.error(TAG, 'Execute method setStateFiring failed, params is incorrect.');
return;
}
await this.setState(STATE_FIRING, alarmId);
} | https://gitee.com/openharmony-sig/applications_clock.git | 8c0a86349b611ea72823388e30849db949fc1e7b | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | fromAsync | Creates a new Array from array-like or iterable
@param arrLike array-like or an iterable object
@param mapFn a function to apply over all elements of arrLike
@returns a new instance of an Array | public static fromAsync<T, U>(arrLike: T[], mapFn: (a: T, i: number) => U): Array<U> {
let mappedArr: U[] = new U[arrLike.length]
for (let i = 0; i < arrLike.length; ++i) {
mappedArr[i] = mapFn(arrLike[i], i)
}
return new Array<U>(mappedArr)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#ERROR#Right AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#identifier#Left fromAsync AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T ... | public static fromAsync<T, U>(arrLike: T[], mapFn: (a: T, i: number) => U): Array<U> {
let mappedArr: U[] = new U[arrLike.length]
for (let i = 0; i < arrLike.length; ++i) {
mappedArr[i] = mapFn(arrLike[i], i)
}
return new Array<U>(mappedArr)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 88936b2bc7dc4486ac56926b97aca0926fdafb3a | gitee |
Luxcis/Pokedex_Next | entry/src/main/ets/util/AppUtil.ets | arkts | getContext | 获取上下文,common.UIAbilityContext
@returns | static getContext(): common.UIAbilityContext {
if (!AppUtil.context) {
AppUtil.context = getContext() as common.UIAbilityContext; //兜底
Log.error("context为空,请在UIAbility的onWindowStageCreate方法中调用AppUtil的init方法初始化!");
}
return AppUtil.context;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getContext 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#member_expression#Left AST#... | static getContext(): common.UIAbilityContext {
if (!AppUtil.context) {
AppUtil.context = getContext() as common.UIAbilityContext; //兜底
Log.error("context为空,请在UIAbility的onWindowStageCreate方法中调用AppUtil的init方法初始化!");
}
return AppUtil.context;
} | https://github.com/Luxcis/Pokedex_Next | 7cbe583652395f24d46fb35892a7bfdde49449ac | github |
erosTeam/NextE | shared/src/main/ets/constants/EhConstants.ets | arkts | ratingStarColor | Rating-star fill colour for a gallery's `colorRating` variant (eros_fe ThemeColors.colorRatingMap):
community/default 'ir' → orange #FF962E; personally-rated variants use EH's red/green/blue/yellow
classes. Returned as an app.color resource so dark mode resolves too. | static ratingStarColor(colorRating: string): ResourceColor {
const v: string = colorRating.trim()
if (v === 'irr' || v.indexOf(' irr') >= 0) {
return $r('app.color.rating_star_red')
}
if (v === 'irg' || v.indexOf(' irg') >= 0) {
return $r('app.color.rating_star_green')
}
if (v === ... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left ratingStarColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left colorRating AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | static ratingStarColor(colorRating: string): ResourceColor {
const v: string = colorRating.trim()
if (v === 'irr' || v.indexOf(' irr') >= 0) {
return $r('app.color.rating_star_red')
}
if (v === 'irg' || v.indexOf(' irg') >= 0) {
return $r('app.color.rating_star_green')
}
if (v === ... | https://github.com/erosTeam/NextE | 465a6553f77d28dd2ccc8acae156c5bb66226e32 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.Queue.ets | arkts | pop | Removes and returns the first element in the Queue.
@returns The first element in the Queue, or undefined if the Queue is empty. | public pop(): T {
return this.buffer.popFirst();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left pop 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#:#Right... | public pop(): T {
return this.buffer.popFirst();
} | https://gitcode.com/iop123123/arkts-static-skills | 0088c16bd3320f15113815b2dfd73c12f9222ae2 | gitcode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.