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 |
|---|---|---|---|---|---|---|---|---|---|---|
webabcd/HarmonyDemo | entry/src/main/ets/pages/basic/BuilderDemo.ets | arkts | myBuilder1 | @Builder 表示函数会返回一个或多个组件(可以在组件内部定义,也可以在全局定义) | @Builder function myBuilder1(param:MyInterface) {
Text(`myBuilder1 ${param.message}`)
.fontSize(24)
.fontColor(Color.Orange)
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left myBuilder1 AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#requir... | @Builder function myBuilder1(param:MyInterface) {
Text(`myBuilder1 ${param.message}`)
.fontSize(24)
.fontColor(Color.Orange)
} | https://github.com/webabcd/HarmonyDemo | 27f16b12e6cd17bbea1e863fc4e9e72435f6e6d1 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieChartModel.ets | arkts | isDrawCenterTextEnabled | returns true if drawing the center text is enabled
@return | public isDrawCenterTextEnabled(): boolean {
return this.mDrawCenterText;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDrawCenterTextEnabled 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 b... | public isDrawCenterTextEnabled(): boolean {
return this.mDrawCenterText;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 6b7b0370b138eacdc50f68ca09460dca6ee3c96b | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/EventSourcing.ets | arkts | filterEventsByDateRange | 获取指定时间范围内的事件
@param events 所有事件
@param startDate 开始日期
@param endDate 结束日期 | static filterEventsByDateRange(
events: DomainEvent[],
startDate: string,
endDate: string
): DomainEvent[] {
const filtered: DomainEvent[] = [];
for (let i = 0; i < events.length; i++) {
const event = events[i];
if (event.occurredAt >= startDate && event.occurredAt <= endDate) {
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left filterEventsByDateRange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left events AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscr... | static filterEventsByDateRange(
events: DomainEvent[],
startDate: string,
endDate: string
): DomainEvent[] {
const filtered: DomainEvent[] = [];
for (let i = 0; i < events.length; i++) {
const event = events[i];
if (event.occurredAt >= startDate && event.occurredAt <= endDate) {
... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 99955ffa762fbc5af4562c34fb1f121726661e57 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/UsbDriverService.ets | arkts | subscribeUsbEvents | 订阅 USB 设备插拔事件 | private async subscribeUsbEvents(): Promise<void> {
try {
const subscribeInfo: commonEventManager.CommonEventSubscribeInfo = {
events: [USB_DEVICE_ATTACHED, USB_DEVICE_DETACHED]
};
this.usbSubscriber = await commonEventManager.createSubscriber(subscribeInfo);
commonEv... | 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 subscribeUsbEvents AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async subscribeUsbEvents(): Promise<void> {
try {
const subscribeInfo: commonEventManager.CommonEventSubscribeInfo = {
events: [USB_DEVICE_ATTACHED, USB_DEVICE_DETACHED]
};
this.usbSubscriber = await commonEventManager.createSubscriber(subscribeInfo);
commonEv... | https://github.com/AlkaidLab/moonlight-harmony | 3d9cdf61f82cf6bdd96bb03fd687ec19ccb58186 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelDictRuleManager.ets | arkts | applyShowRule | 应用显示规则提取内容 | private applyShowRule(content: string, showRule: string): string {
// 简单的正则提取
try {
const regex = new RegExp(showRule, 's');
const match = content.match(regex);
if (match && match[1]) {
return match[1];
} else if (match && match[0]) {
return match[0];
}
} catc... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left applyShowRule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left content AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#strin... | private applyShowRule(content: string, showRule: string): string {
// 简单的正则提取
try {
const regex = new RegExp(showRule, 's');
const match = content.match(regex);
if (match && match[1]) {
return match[1];
} else if (match && match[0]) {
return match[0];
}
} catc... | https://github.com/DaLongZhuaZi/manxia | 4752de7739d96047a1e6dbda0a5076302301444c | github |
OHPG/FinMusic | entry/src/main/ets/player/AppPlaybackManager.ets | arkts | onPageDisappear | 音乐播放页销毁时不销毁播放器(音乐持续播放) | public onPageDisappear(): void {
// no-op: 退出播放页不销毁播放器
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onPageDisappear 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#expres... | public onPageDisappear(): void {
// no-op: 退出播放页不销毁播放器
} | https://github.com/OHPG/FinMusic | b0be6cc0175d6c064a4362eeb95be32e76d66824 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | getBookmark | Get the bookmark associated with this session | getBookmark(): BookmarkBase {
return this.bookmark;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getBookmark 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 BookmarkBase AST#identifier#Right AST#ERROR#Right ... | getBookmark(): BookmarkBase {
return this.bookmark;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 90451503923c1cd3a881748d790afd880277a99f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Storage/DownloadDirManager.ets | arkts | getManagedRootPath | 获取应用专属Download根目录。
如果用户授权的是系统Download根目录,则实际业务目录为 Download/com.dlzz.manxia。 | public getManagedRootPath(ensureExists: boolean = false): string {
if (!this.isReady()) {
return '';
}
const rawRoot = this.normalizeDirectoryPath(this.downloadDirPath);
if (rawRoot.length <= 0) {
return '';
}
const root = this.pathEndsWithSegment(rawRoot, MANXIA_DOWNLOAD_APP_DIR)
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getManagedRootPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ensureExists AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assig... | public getManagedRootPath(ensureExists: boolean = false): string {
if (!this.isReady()) {
return '';
}
const rawRoot = this.normalizeDirectoryPath(this.downloadDirPath);
if (rawRoot.length <= 0) {
return '';
}
const root = this.pathEndsWithSegment(rawRoot, MANXIA_DOWNLOAD_APP_DIR)
... | https://github.com/DaLongZhuaZi/manxia | f74b6ad60d78b7d66c104c28a575b9a42b2fab98 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | keys | Returns an list of keys in Int16Array
@returns { IterableIterator<int> } - iterator over keys
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public keys(): IterableIterator<int> {
return new Int16ArrayIteratorKeys(this)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left keys 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 keys(): IterableIterator<int> {
return new Int16ArrayIteratorKeys(this)
} | https://gitcode.com/iop123123/arkts-static-skills | 1e61f7befbd589ca7ffb3749ae4b70d059111672 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/Double.ets | arkts | isInteger | Checks if double is similar to an integer value
@param v the double to test
@returns true if the argument is similar to an integer value | public static isInteger(v: double): boolean {
// In the language % works as C fmod that differs with IEEE-754 % definition
return Double.compare(v % (1.0 as double), 0.0 as double);
} | 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 isInteger AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#Left : AST#:#Rig... | public static isInteger(v: double): boolean {
// In the language % works as C fmod that differs with IEEE-754 % definition
return Double.compare(v % (1.0 as double), 0.0 as double);
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | f80617411e00454b22cd11979c8d6c01190f450d | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets | arkts | atomicsGetSize | Reads the current queue size atomically.
Returns the latest visible element count without modifying the queue.
@returns { int } The current queue size observed from the atomic counter,
else returns 0 when the queue is empty.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | private atomicsGetSize(): int {
return this.actualSize.load();
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left atomicsGetSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left int ... | private atomicsGetSize(): int {
return this.actualSize.load();
} | https://gitcode.com/iop123123/arkts-static-skills | 4ad55ad919a6da60861ac5d779bea0b854a270f8 | gitcode |
openharmony/applications_contacts | entry/src/main/ets/model/ContactAbilityModel.ets | arkts | moveSortFavorite | Move Favorite Data Sorting
@param {string} DAHelper
@param {Object} addParams Contact Information
@param {Object} callBack favoriteOrder | async moveSortFavorite(daHelper: dataShare.DataShareHelper | null, addParams: LooseObject,
callBack: Function, context?: common.UIAbilityContext | Context) {
HiLog.i(TAG, 'moveSortFavorite start.');
if (daHelper == undefined || daHelper == null) {
daHelper = await dataShare.createDataShareHelper(con... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left moveSortFavorite AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left daHelper AST#identifier#Right AST#type_annotation#Lef... | async moveSortFavorite(daHelper: dataShare.DataShareHelper | null, addParams: LooseObject,
callBack: Function, context?: common.UIAbilityContext | Context) {
HiLog.i(TAG, 'moveSortFavorite start.');
if (daHelper == undefined || daHelper == null) {
daHelper = await dataShare.createDataShareHelper(con... | https://gitee.com/openharmony/applications_contacts.git | f77fcd762d0deb4097ebee079f98344f190de976 | gitee |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/models/DataSource.ets | arkts | reload | 重新赋值
@param data 原始数据 | public reload(data: T[]) {
this.DataArray = data
this.notifyDataReload()
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left reload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left data AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right AS... | public reload(data: T[]) {
this.DataArray = data
this.notifyDataReload()
} | https://github.com/SMAT-Lab/PhantomRendering | 9aa9756a333b8711c41289be7cd6c4607bfb051e | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/02.lexical_elements/09.literals/08.undefined_literal/undef_literal.ets | arkts | main | x type is expected to be inferred to Object|undefined type | function main() {
assert x === undefined
} | 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#expression_statement#L... | function main() {
assert x === undefined
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 691d7405ab16a3f5ee72231d2acfae5e5ea43ce8 | gitee |
openharmony-tpc/openharmony_tpc_samples | GSYVideoPlayer-filters/library/src/main/ets/components/mainpage/BaseVideoPlayer.ets | arkts | onPauseStatus | 状态切换为暂停播放 | public onPauseStatus() {
if (this.playStatus == PlayStatus.PLAY) {
this.playStatus = PlayStatus.PAUSE;
}
this.onPauseListener();
let eventData: emitter.EventData = {
data: {
"xid": this.xComponentId
}
}
emitter.emit(this.videoPauseEvent, eventData);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onPauseStatus 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 {... | public onPauseStatus() {
if (this.playStatus == PlayStatus.PLAY) {
this.playStatus = PlayStatus.PAUSE;
}
this.onPauseListener();
let eventData: emitter.EventData = {
data: {
"xid": this.xComponentId
}
}
emitter.emit(this.videoPauseEvent, eventData);
} | https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git | 7351face52593f981cd6689a526253819f4350f7 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/WidgetDataSync.ets | arkts | loadRecentReads | 加载最近阅读列表(合并漫画、电子书、小说,按最后阅读时间排序) | private async loadRecentReads(): Promise<RecentReadItem[]> {
const items: RecentReadItem[] = [];
try {
// 1. 加载最近阅读的漫画
const dataService: DataService = DataService.getInstance();
const readHistory = await dataService.getReadingHistory(50);
// 按漫画ID去重,取最新记录
const manga... | 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 loadRecentReads AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | private async loadRecentReads(): Promise<RecentReadItem[]> {
const items: RecentReadItem[] = [];
try {
// 1. 加载最近阅读的漫画
const dataService: DataService = DataService.getInstance();
const readHistory = await dataService.getReadingHistory(50);
// 按漫画ID去重,取最新记录
const manga... | https://github.com/DaLongZhuaZi/manxia | a665afaa2a74c88492f2f360b6646ac765bb07c5 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | map | Creates a new Uint16Array using fn(arr[i]) over all elements of current Uint16Array.
@param fn a function to apply for each element of current Uint16Array
@returns a new Uint16Array where for each element from current Uint16Array fn was applied | public map(fn: (val: number, index: int) => number): Uint16Array {
let resBuf = new ArrayBuffer(this.length * Uint16Array.BYTES_PER_ELEMENT)
let res = new Uint16Array(resBuf)
for (let i = 0; i < this.length; ++i) {
res.set(i, fn(this.at(i), i))
}
return res
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right... | public map(fn: (val: number, index: int) => number): Uint16Array {
let resBuf = new ArrayBuffer(this.length * Uint16Array.BYTES_PER_ELEMENT)
let res = new Uint16Array(resBuf)
for (let i = 0; i < this.length; ++i) {
res.set(i, fn(this.at(i), i))
}
return res
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | de8d0761c9698ffb41a2452b75db26162d1d7aab | gitee |
2763981847/Accounting-app | entry/src/main/ets/pages/MainPage.ets | arkts | selectListItem | 选中列表项 | selectListItem(item: Account) {
this.index = this.filteredAccounts.indexOf(item);
this.newAccount = item;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left selectListItem 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 Account AST#identifier#Rig... | selectListItem(item: Account) {
this.index = this.filteredAccounts.indexOf(item);
this.newAccount = item;
} | https://github.com/2763981847/Accounting-app | cda582da44119023b7754b0b2fc05c289b0e94b6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/FontManager.ets | arkts | copyDefaultSettings | 复制默认设置 | private copyDefaultSettings(): FontSettings {
return {
appFontType: DEFAULT_FONT_SETTINGS.appFontType,
appSystemFontId: DEFAULT_FONT_SETTINGS.appSystemFontId,
appCustomFontId: DEFAULT_FONT_SETTINGS.appCustomFontId,
appFontSize: DEFAULT_FONT_SETTINGS.appFontSize,
novelFontType: DEFAUL... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left copyDefaultSettings 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... | private copyDefaultSettings(): FontSettings {
return {
appFontType: DEFAULT_FONT_SETTINGS.appFontType,
appSystemFontId: DEFAULT_FONT_SETTINGS.appSystemFontId,
appCustomFontId: DEFAULT_FONT_SETTINGS.appCustomFontId,
appFontSize: DEFAULT_FONT_SETTINGS.appFontSize,
novelFontType: DEFAUL... | https://github.com/DaLongZhuaZi/manxia | 932e4a26b7a9afec6dd53604b49d03e2f117d15f | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/ExtensionLoader.ets | arkts | sendData | ====== SSH 终端专用 ====== | sendData(sessionId: number, data: string): void {
try {
rdpnapi.sendText(sessionId, data);
} catch (err) {
hilog.error(DOMAIN, TAG, '[ExtensionLoader] sendData: ' + JSON.stringify(err));
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left sendData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sessionId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , AST#,#Rig... | sendData(sessionId: number, data: string): void {
try {
rdpnapi.sendText(sessionId, data);
} catch (err) {
hilog.error(DOMAIN, TAG, '[ExtensionLoader] sendData: ' + JSON.stringify(err));
}
} | https://github.com/Mydstiny/RemoteDeskHarmonyOS | e5d32f923d0fdde72f75e05051ab9f0a15532df2 | github |
HarmonyOS_Samples/HarmonyOSComponentUXExamples | products/phone/src/main/ets/components/presentation/progress/components/CircleProgress.ets | arkts | getHollowSquarePathStr | Helper method: Generates an SVG path string
@returns an SVG path | getHollowSquarePathStr(): string {
const s = this.shapeSize;
const cr = this.cornerRadius;
const hr = this.hollowCircleRadius;
const center = s / 2;
// --- First part: Outer rounded square (drawn clockwise) ---
// M: Move to (move to start point)
// H: Horizontal line (horizontal line)
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getHollowSquarePathStr 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... | getHollowSquarePathStr(): string {
const s = this.shapeSize;
const cr = this.cornerRadius;
const hr = this.hollowCircleRadius;
const center = s / 2;
// --- First part: Outer rounded square (drawn clockwise) ---
// M: Move to (move to start point)
// H: Horizontal line (horizontal line)
... | https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples | 638669f971373bd011c39ab49a5f5e48a12ec622 | gitcode |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/AnomalyDetectionService.ets | arkts | detectFrequencyAnomaly | 频率异常检测 | private static async detectFrequencyAnomaly(
bill: Bill,
userId: number,
baseline: UserSpendingBaseline
): Promise<AnomalyDetectionResult> {
try {
// 获取当天的账单数量
const today = new Date();
const startOfDay = new Date(today.getFullYear(), today.getMonth(), today.getDate());
const... | 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 detectFrequencyAnomaly AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifi... | private static async detectFrequencyAnomaly(
bill: Bill,
userId: number,
baseline: UserSpendingBaseline
): Promise<AnomalyDetectionResult> {
try {
// 获取当天的账单数量
const today = new Date();
const startOfDay = new Date(today.getFullYear(), today.getMonth(), today.getDate());
const... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | a1ecef39a71dd141cf0a95083c74d5a56c081673 | github |
AGenUI/AGenUI | playground/harmony/entry/src/main/ets/stability/CrashTracker.ets | arkts | isBlacklisted | Check if a scenario is blacklisted | isBlacklisted(scenario: string): boolean {
return (this.crashCounts.get(scenario) || 0) >= this.threshold;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isBlacklisted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left scenario AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)... | isBlacklisted(scenario: string): boolean {
return (this.crashCounts.get(scenario) || 0) >= this.threshold;
} | https://github.com/AGenUI/AGenUI | 613db7c45759f7700c4a2d9a307e1f6b9b8dc782 | github |
HarmonyOS_Samples/guide-snippets | ArkGraphics3D/entry/src/main/ets/material/pbr_clearcoat.ets | arkts | changeClearcoatRoughTex | [End pbr_clearcoat_setClearcoat]
Switch between available textures for clearcoat roughness
[Start pbr_clearcoat_changeRoughnessTexture] | changeClearcoatRoughTex() {
if (this.textures.length > 0) {
let i = ++this.textureInUse % this.textures.length;
(this.material as MetallicRoughnessMaterial).clearCoatRoughness.image = this.textures[i];
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left changeClearcoatRoughTex 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_... | changeClearcoatRoughTex() {
if (this.textures.length > 0) {
let i = ++this.textureInUse % this.textures.length;
(this.material as MetallicRoughnessMaterial).clearCoatRoughness.image = this.textures[i];
}
} | https://gitcode.com/HarmonyOS_Samples/guide-snippets | 6517e773286ce0ba56b798a0b73a7804b43dd157 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/ResponsiveLayout.ets | arkts | getTitleBarHeight | 获取标题栏高度 | public static getTitleBarHeight(): number {
return ResponsiveLayoutHelper.isExpandedLayout() ? 64 : 56;
} | 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 getTitleBarHeight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A... | public static getTitleBarHeight(): number {
return ResponsiveLayoutHelper.isExpandedLayout() ? 64 : 56;
} | https://github.com/DaLongZhuaZi/manxia | 0f591449858711ad47f666ef572fceff71269023 | github |
kumaleap/ArkLuban | entry/src/main/ets/utils/PhotoHelper.ets | arkts | select | 通过选择模式拉起photoPicker界面,用户可以选择一个或多个图片/视频。
@param options
@returns | static async select(options?: photoAccessHelper.PhotoSelectOptions): Promise<Array<string>> {
try {
if (!options) {
options = new photoAccessHelper.PhotoSelectOptions();
}
if (!options.MIMEType) { //可选择的媒体文件类型,若无此参数,则默认为图片和视频类型。
options.MIMEType = photoAccessHelper.PhotoViewMIMET... | 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 select AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left options AST#identifier#Right AST#?#Left ? AST#?#R... | static async select(options?: photoAccessHelper.PhotoSelectOptions): Promise<Array<string>> {
try {
if (!options) {
options = new photoAccessHelper.PhotoSelectOptions();
}
if (!options.MIMEType) { //可选择的媒体文件类型,若无此参数,则默认为图片和视频类型。
options.MIMEType = photoAccessHelper.PhotoViewMIMET... | https://github.com/kumaleap/ArkLuban | 575ed5f513a758a2fa0d9ff2fb23703041f1f4f1 | github |
2763981847/Clock-Alarm | entry/src/main/ets/pages/AddCityPage.ets | arkts | pageTransition | 页面过渡效果配置。 | pageTransition() {
// 定义页面进入时的效果,从底侧滑入,时长为300ms,无论页面栈发生push还是pop操作均可生效
PageTransitionEnter({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
// 定义页面退出时的效果,向底侧滑出,时长为300ms,无论页面栈发生push还是pop操作均可生效
PageTransitionExit({ type: RouteType.None, dura... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left pageTransition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Lef... | pageTransition() {
// 定义页面进入时的效果,从底侧滑入,时长为300ms,无论页面栈发生push还是pop操作均可生效
PageTransitionEnter({ type: RouteType.None, duration: CommonConstants.ANIMATION_SHORT_DURATION })
.slide(SlideEffect.Bottom);
// 定义页面退出时的效果,向底侧滑出,时长为300ms,无论页面栈发生push还是pop操作均可生效
PageTransitionExit({ type: RouteType.None, dura... | https://github.com/2763981847/Clock-Alarm | 809f973fa0930d8d691ccd20d58007d93181ffed | github |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnIconViewModel.ets | arkts | reloadData | 替换全部数据并通知刷新
@param data 新数据 | reloadData(data: string[]): void {
this.dataArray = data;
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataReloaded();
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left reloadData 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_expression#Left AST#identifier#Left string AST#iden... | reloadData(data: string[]): void {
this.dataArray = data;
this.listeners.forEach((listener: DataChangeListener) => {
listener.onDataReloaded();
});
} | https://github.com/codelably/tuniao-ui | 814e93d0ab232ccba33636ed33a21dda479ff68f | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/String.ets | arkts | bold | The bold() method creates a string that embeds a string in a <bold> element (<bold>str</bold>), which causes a string to be displayed in a big font. | public bold(): String{
return this.CreateHTMLString("bold", "")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left bold 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 bold(): String{
return this.CreateHTMLString("bold", "")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 832d4197de91e9d9c170edf6df13d7798946b22a | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/ChartData.ets | arkts | getDataSetCount | ONLY GETTERS AND SETTERS BELOW THIS
returns the number of LineDataSets this object contains
@return | public getDataSetCount(): number {
if (this.mDataSets == null) {
return 0;
}
return this.mDataSets.listSize;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDataSetCount 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... | public getDataSetCount(): number {
if (this.mDataSets == null) {
return 0;
}
return this.mDataSets.listSize;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | d6c501f6c50e169e848446eb2e25cdb41bb56849 | gitee |
OHPG/FinMusic | entry/src/main/ets/data/Repository.ets | arkts | loadFavourite | 查询收藏列表
@param includeItemTypes
@returns | public async loadFavourite(includeItemTypes?: Array<BaseItemKind>): Promise<Array<BaseItemDto>> {
return this.requireApi().loadFavourite(includeItemTypes)
} | 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 loadFavourite AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left includeItemTypes AST#id... | public async loadFavourite(includeItemTypes?: Array<BaseItemKind>): Promise<Array<BaseItemDto>> {
return this.requireApi().loadFavourite(includeItemTypes)
} | https://github.com/OHPG/FinMusic | 3479f35c04245d514a3d3bed729b59b97141b1fc | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/UserProfileDAO.ets | arkts | upsert | 创建或更新用户画像 | static async upsert(profile: UserProfile): Promise<boolean> {
const existing = await UserProfileDAO.getByUserId(profile.userId);
if (existing) {
profile.profileId = existing.profileId;
return await UserProfileDAO.update(profile);
} else {
const id = await UserProfileDAO.insert(profi... | 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 upsert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left profile AST#identifier#Right AST#:#Left : AST#:#R... | static async upsert(profile: UserProfile): Promise<boolean> {
const existing = await UserProfileDAO.getByUserId(profile.userId);
if (existing) {
profile.profileId = existing.profileId;
return await UserProfileDAO.update(profile);
} else {
const id = await UserProfileDAO.insert(profi... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | b1dbeab193ca5901e35b3ffb23c353cbba4083c3 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/StreamWindowManager.ets | arkts | calculateXComponentSize | ==================== 视频尺寸计算 ====================
计算 XComponent 尺寸以保持视频宽高比(全屏模式下使用屏幕尺寸计算 letterbox/pillarbox)
窗口模式下应直接使用 '100%' 填满窗口,无需调用此方法。
@param stretchVideo 是否拉伸视频填满全屏
@returns XComponent 尺寸 | calculateXComponentSize(stretchVideo: boolean = false): XComponentSize {
if (stretchVideo) {
return { width: '100%', height: '100%' };
}
try {
const displayInfo = display.getDefaultDisplaySync();
const screenWidth = displayInfo.width;
const screenHeight = displayInfo.height;
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateXComponentSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stretchVideo AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifie... | calculateXComponentSize(stretchVideo: boolean = false): XComponentSize {
if (stretchVideo) {
return { width: '100%', height: '100%' };
}
try {
const displayInfo = display.getDefaultDisplaySync();
const screenWidth = displayInfo.width;
const screenHeight = displayInfo.height;
... | https://github.com/AlkaidLab/moonlight-harmony | 1051613804b5923cb198d69a8a81adead1eb7644 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/service/SeasonalityDetectionService.ets | arkts | calculateACF | 计算自相关函数(ACF)
@param data 时间序列数据
@param maxLag 最大滞后期
@returns 自相关系数数组 | private static calculateACF(data: number[], maxLag: number): number[] {
const n = data.length;
const mean = data.reduce((acc: number, val: number) => acc + val, 0) / n;
const acf: number[] = [];
// 计算方差(lag=0的自协方差)
let variance = 0;
for (let i = 0; i < n; i++) {
variance += Math.pow(dat... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left calculateACF AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : ... | private static calculateACF(data: number[], maxLag: number): number[] {
const n = data.length;
const mean = data.reduce((acc: number, val: number) => acc + val, 0) / n;
const acf: number[] = [];
// 计算方差(lag=0的自协方差)
let variance = 0;
for (let i = 0; i < n; i++) {
variance += Math.pow(dat... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 8f3cf45c186519c819a09cfe09d4591cc8d58f74 | github |
openharmony/codelabs | Media/VideoPlayer/entry/src/main/ets/controller/VideoController.ets | arkts | onVolumeActionUpdate | Gesture method onActionUpdate.
@param event Gesture event. | onVolumeActionUpdate(event?: GestureEvent) {
if (!event) {
return;
}
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
if (this.playerModel.brightShow === false) {
this.playerModel.volumeShow =... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onVolumeActionUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier... | onVolumeActionUpdate(event?: GestureEvent) {
if (!event) {
return;
}
if (this.avPlayer === null) {
return;
}
if (CommonConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
return;
}
if (this.playerModel.brightShow === false) {
this.playerModel.volumeShow =... | https://gitee.com/openharmony/codelabs.git | b6824dc0945e031e611d21da1a8a6da508c20ca0 | gitee |
the-wwyang/kids-learning-app | src/main/ets/services/LearningService.ets | arkts | getInstance | 获取单例实例
@returns LearningService 单例对象 | public static getInstance(): LearningService {
return LearningService.instance;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left getInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L... | public static getInstance(): LearningService {
return LearningService.instance;
} | https://github.com/the-wwyang/kids-learning-app | 2ba7f7c1fdafcbee06ec8be5c6d05888bf58912b | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GamepadManager.ets | arkts | releaseSlotForDevice | 释放 USB 设备槽位 | private releaseSlotForDevice(deviceKey: string): void {
this.releaseSlot(deviceKey, this.deviceKeyToSlot, 'GAMEPAD');
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left releaseSlotForDevice AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceKey AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string ... | private releaseSlotForDevice(deviceKey: string): void {
this.releaseSlot(deviceKey, this.deviceKeyToSlot, 'GAMEPAD');
} | https://github.com/AlkaidLab/moonlight-harmony | a35e016c93b463833a0e40324e21bc6a443cdf47 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/smartward/core/checkers/TimeChecker.ets | arkts | stopTimeCheck | 停止时间检查 | public stopTimeCheck(): void {
if (this.timerId !== null) {
clearInterval(this.timerId);
this.timerId = null;
console.log('TimeChecker: Stopped');
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left stopTimeCheck AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expressi... | public stopTimeCheck(): void {
if (this.timerId !== null) {
clearInterval(this.timerId);
this.timerId = null;
console.log('TimeChecker: Stopped');
}
} | https://github.com/LJ666-ui/harmony-health-care | 8f7711dff7e6c67749e9d50e9e0de53204b4f856 | github |
CLMC2025/Vignette | entry/src/main/ets/manager/SessionPlanner.ets | arkts | shouldReinforce | 检查是否需要为单词生成强化任务 | shouldReinforce(word: WordItem, rating: Rating): boolean {
return rating === Rating.AGAIN || rating === Rating.HARD;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left shouldReinforce AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left word AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left WordItem AST#identifier#Right AST#,#Left... | shouldReinforce(word: WordItem, rating: Rating): boolean {
return rating === Rating.AGAIN || rating === Rating.HARD;
} | https://github.com/CLMC2025/Vignette | 1713c613c0a4645fe2337ca7fd0d01d7af6327b0 | github |
openharmony/arkui_ace_engine | examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets | arkts | numCharCountBits | -- Method --
(Package-private) Returns the bit width of the character count field for a segment in
this mode in a QR Code at the given version number. The result is in the range [0, 16]. | public numCharCountBits(ver: int): int {
return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left numCharCountBits AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ver AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | public numCharCountBits(ver: int): int {
return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
} | https://gitee.com/openharmony/arkui_ace_engine.git | 00eb8e99e5e7c0a7d97de8bda28adf20be6306ed | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/Legend.ets | arkts | setEntries | This method sets the automatically computed colors for the legend. Use setCustom(...) to set custom colors.
@param entries | public setEntries(entries: JArrayList<LegendEntry>): void {
// this.mEntries = entries.toArray(new Array(entries.size()));
this.mEntries = entries.dataSource;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setEntries AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entries AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expr... | public setEntries(entries: JArrayList<LegendEntry>): void {
// this.mEntries = entries.toArray(new Array(entries.size()));
this.mEntries = entries.dataSource;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | e4a7f80b234459e8e42da0124d1f22a2fb94d4ab | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentHashMap.ets | arkts | forEach | Executes a provided function once per each key/value pair in the ConcurrentHashMap, in insertion order
@param callbackfn to apply | public override forEach(callbackfn: (value: V, key: K, map: ConcurrentHashMap<K, V>) => void): void {
const entriesIter = this.mappedIterator<MapNode<K, V>>((e: MapNode<K, V>): MapNode<K, V> => e);
iteratorForEach<MapNode<K, V>>(entriesIter, (e: MapNode<K, V>): void => {
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#identifier#Left forEach AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callbackfn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERR... | public override forEach(callbackfn: (value: V, key: K, map: ConcurrentHashMap<K, V>) => void): void {
const entriesIter = this.mappedIterator<MapNode<K, V>>((e: MapNode<K, V>): MapNode<K, V> => e);
iteratorForEach<MapNode<K, V>>(entriesIter, (e: MapNode<K, V>): void => {
... | https://gitcode.com/iop123123/arkts-static-skills | 6c9508c3e8f801e1e2684bbea5bf6c23b9a913ab | gitcode |
LZZLHY/hlib | entry/src/main/ets/api/AppStorageDomainFailover.ets | arkts | pickFallback | 从 SPEED_RESULTS(已按延迟升序)挑第一个 alive、未排除、非当前的域名。 | pickFallback(current: string, exclude: Set<string>): string | null {
const results: DomainTestResult[] | undefined =
AppStorage.get<DomainTestResult[]>(AppStorageKeys.SPEED_RESULTS);
if (results === undefined || results.length === 0) {
return null;
}
for (let i = 0; i < results.length; i++... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left pickFallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left current AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#... | pickFallback(current: string, exclude: Set<string>): string | null {
const results: DomainTestResult[] | undefined =
AppStorage.get<DomainTestResult[]>(AppStorageKeys.SPEED_RESULTS);
if (results === undefined || results.length === 0) {
return null;
}
for (let i = 0; i < results.length; i++... | https://github.com/LZZLHY/hlib | 0f7a0d8bf7be5ff03f2ee6ac9d20fca1034ea8a8 | github |
arkui-x/samples | CodeLab/Cases/feature/customanimationtab/src/main/ets/view/CustomAnimationTabView.ets | arkts | testBuilder | 功能说明: 本示例介绍使用List、Text等组件,以及animateTo等接口实现自定义Tab效果
推荐场景: 需要自定义动效的tab场景
核心组件:
1. CustomAnimationTab: 自定义动效tab构建组件
2. AnimationAttribute: 动效属性,可通过继承扩展动效属性
3. TabInfo: 设置TabBar的标题、TabContent以及TabBar样式的类
4. CustomAnimationTabController: 自定义动效Tab控制器,用于控制自定义动效Tab组件进行页签切换
5. IndicatorBarAttribute: 设置背景条属性
6. TabBarAttribute: ... | @Builder
function testBuilder() {
Column(){
}
.height("100%")
.width("100%")
.backgroundColor(Color.Gray)
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left testBuilder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Lef... | @Builder
function testBuilder() {
Column(){
}
.height("100%")
.width("100%")
.backgroundColor(Color.Gray)
} | https://gitcode.com/arkui-x/samples | 21f5e7e72cf1749ba008da2eaf66609160ec4614 | gitcode |
CarGuo/GSYGithubAppOH | entry/src/main/ets/entryability/EntryAbility.ets | arkts | handleBootSearchHistoryInjection | 测试通道:want.parameters.bootSearchHistory=react|flutter,
用于 Search 首屏/聚焦态对照截图。生产路径不会带该参数。 | private handleBootSearchHistoryInjection(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_SEARCH_HISTORY];
if (typeof raw !== 'string') {
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left handleBootSearchHistoryInjection 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 ... | private handleBootSearchHistoryInjection(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_SEARCH_HISTORY];
if (typeof raw !== 'string') {
... | https://github.com/CarGuo/GSYGithubAppOH | bd3ea142ea7e7302cc68cf1b0424bf1667671932 | github |
arkui-x/samples | CodeLab/Cases/feature/customdrawtabbar/src/main/ets/components/tabsRaisedCircle/TabsRaisedCircle.ets | arkts | getCountOffsetY | 计算选中图时图片所需 Y 轴偏移量
@returns | getCountOffsetY() {
if (this.selectImageInfo && this.chamfer) {
return this.selectImageInfo.getCenterOffsetY() -
(this.chamfer.circleRadius - this.chamfer.circleOffsetY)
}
return 0
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getCountOffsetY AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Le... | getCountOffsetY() {
if (this.selectImageInfo && this.chamfer) {
return this.selectImageInfo.getCenterOffsetY() -
(this.chamfer.circleRadius - this.chamfer.circleOffsetY)
}
return 0
} | https://gitcode.com/arkui-x/samples | 6ba3c00b52dfcef32f39296315f3838533115a66 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | slice | Creates a slice of current BigUint64Array using range [begin, end)
@param begin start index to be taken into slice
@param end last index to be taken into slice
@returns a new BigUint64Array with elements of current BigUint64Array[begin;end) where end index is excluded
@link https://developer.mozilla.org/en-US/docs/Web/... | public slice(begin: number, end: number): BigUint64Array {
return this.slice(begin as int, end as int)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left begin AST#identifier#Right AST#:#Left : AST#:#Right AST#ER... | public slice(begin: number, end: number): BigUint64Array {
return this.slice(begin as int, end as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | ccebfebcda5ab0129487f931320ed128ce65998b | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/YAxis.ets | arkts | getMinWidth | @return the minimum width that the axis should take (in vp). | public getMinWidth(): number {
return this.mMinWidth;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getMinWidth 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#num... | public getMinWidth(): number {
return this.mMinWidth;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 95ca32dd587ad8a66dedc5874b326046106dd21c | gitee |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/StepManager.ets | arkts | getStepGoalStatus | 获取步数目标状态 | async getStepGoalStatus(date: string): Promise<StepGoal> {
try {
const record = await this.getStepRecordByDate(date);
if (!record.success || !record.data) {
return {
dailyGoal: 8000,
isActive: true,
goalMet: false
};
}
const stepRecord = reco... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getStepGoalStatus AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left date AST#identifier#Right AST#type_annotation#Left AST#:#Left... | async getStepGoalStatus(date: string): Promise<StepGoal> {
try {
const record = await this.getStepRecordByDate(date);
if (!record.success || !record.data) {
return {
dailyGoal: 8000,
isActive: true,
goalMet: false
};
}
const stepRecord = reco... | https://gitcode.com/openharmony/codelabs | 42ef7c2fc3bebac9233d512874c6a51bd35f08dc | gitcode |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/utils/RDPPerformanceManager.ets | arkts | performNetworkTest | 执行网络测试 - 使用 TCP socket 测量 RTT | private async performNetworkTest(): Promise<number> {
const startTime = Date.now()
try {
// 创建 TCP socket
const tcpSocket = socket.constructTCPSocketInstance()
// 尝试连接(测量连接时间作为 RTT 估算)
await new Promise<void>((resolve, reject) => {
const timeout = setTimeout(() => {... | 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 performNetworkTest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ... | private async performNetworkTest(): Promise<number> {
const startTime = Date.now()
try {
// 创建 TCP socket
const tcpSocket = socket.constructTCPSocketInstance()
// 尝试连接(测量连接时间作为 RTT 估算)
await new Promise<void>((resolve, reject) => {
const timeout = setTimeout(() => {... | https://github.com/AetheriumSimulator/qemu-hmos | 2b5fd73de92c46bd5f39aade5c76257491d00532 | github |
the-wwyang/kids-learning-app | src/main/ets/services/DataBackupService.ets | arkts | generateBackupFileName | 生成备份文件名 | private generateBackupFileName(): string {
const date = new Date();
const dateStr = `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`;
const timeStr = `${date.getHours().toString().padStart(2, '0')}${date.getMinutes().toString().padSta... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateBackupFileName 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 ... | private generateBackupFileName(): string {
const date = new Date();
const dateStr = `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`;
const timeStr = `${date.getHours().toString().padStart(2, '0')}${date.getMinutes().toString().padSta... | https://github.com/the-wwyang/kids-learning-app | bfc49bb516028331d53b9512660a44a57f6c2816 | github |
Joker-x-dev/CoolMallArkTS | core/util/src/main/ets/toast/ToastUtils.ets | arkts | show | 显示普通 Toast
@param {string | ResourceStr} message - 提示内容
@returns {void} 无返回值 | static show(message: string | ResourceStr): void {
IBestToast.show(message);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left show AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#E... | static show(message: string | ResourceStr): void {
IBestToast.show(message);
} | https://github.com/Joker-x-dev/CoolMallArkTS | fbaf362f102b9098079907bec5f67c995537ae20 | github |
erosTeam/NextE | shared/src/main/ets/network/EhApiService.ets | arkts | fetchFavoritesBody | Build the favorites.php URL and return the page body. Favorites uses page+from when the
searchnav exposes page numbers; otherwise it falls back to next cursor paging like normal lists. | private async fetchFavoritesBody(
base: string,
query: FavoritesQuery,
inlineSet: string,
): Promise<string> {
const params: string[] = []
if (query.favcat.length > 0 && query.favcat !== 'a') {
params.push(`favcat=${query.favcat}`)
}
if (query.search.length > 0) {
params.push... | 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 fetchFavoritesBody AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left base AST#identifier#Right AST#:#Le... | private async fetchFavoritesBody(
base: string,
query: FavoritesQuery,
inlineSet: string,
): Promise<string> {
const params: string[] = []
if (query.favcat.length > 0 && query.favcat !== 'a') {
params.push(`favcat=${query.favcat}`)
}
if (query.search.length > 0) {
params.push... | https://github.com/erosTeam/NextE | 71d22df54646208dda7718ce6183b9c941774550 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/FinancialHealth.ets | arkts | calculateMonthlyIncomeExpense | ==================== Bill/Budget 集成方法 ====================
从账单列表计算月度收支数据
@param bills 账单列表
@param userId 用户ID | static calculateMonthlyIncomeExpense(
bills: Bill[],
userId: number
): Map<string, MonthlyIncomeExpense> {
const monthlyData: Map<string, MonthlyIncomeExpense> = new Map();
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId === userId && bill.isDeleted === 0... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left calculateMonthlyIncomeExpense AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bills AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#s... | static calculateMonthlyIncomeExpense(
bills: Bill[],
userId: number
): Map<string, MonthlyIncomeExpense> {
const monthlyData: Map<string, MonthlyIncomeExpense> = new Map();
for (let i = 0; i < bills.length; i++) {
const bill = bills[i];
if (bill.userId === userId && bill.isDeleted === 0... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 0ebff012e043c2b793ab304098bc13800eefc629 | github |
LongLiveY96/chatcube | entry/src/main/ets/services/ImageGenerationRcpClient.ets | arkts | postJson | 发送 JSON POST 请求 | async postJson(
url: string,
headers: Record<string, string>,
body: string,
controller?: HttpRequestController
): Promise<HttpResponse> {
return await this.executeRequest(url, 'POST', headers, body, controller)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left postJson AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | async postJson(
url: string,
headers: Record<string, string>,
body: string,
controller?: HttpRequestController
): Promise<HttpResponse> {
return await this.executeRequest(url, 'POST', headers, body, controller)
} | https://github.com/LongLiveY96/chatcube | 18bbe0d361b1f754eb854b0c6b83ca291a92754f | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GamepadVibrationService.ets | arkts | rumbleUsbControllers | 向 USB 控制器发送震动 | private rumbleUsbControllers(
controllers: AbstractController[],
controllerNumber: number,
lowFreqMotor: number,
highFreqMotor: number,
applyGain: boolean = true
): void {
const controller = this.findControllerBySlot(controllers, controllerNumber);
const lowValue = applyGain ? this.apply... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left rumbleUsbControllers AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left controllers AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#s... | private rumbleUsbControllers(
controllers: AbstractController[],
controllerNumber: number,
lowFreqMotor: number,
highFreqMotor: number,
applyGain: boolean = true
): void {
const controller = this.findControllerBySlot(controllers, controllerNumber);
const lowValue = applyGain ? this.apply... | https://github.com/AlkaidLab/moonlight-harmony | 1c90f36db068456622dc47d000ba2717fc2dc8d1 | github |
openharmony-sig/applications_clock | common/src/main/ets/manager/FormManager.ets | arkts | saveFormToSp | save formInfo to preferences
@param formInfo 被保存的卡片信息 | public async saveFormToSp(formInfo: FormInfo): Promise<void> {
const preferences = await this.getPreferences();
LogUtil.info(TAG, 'saveFormToSp formInfo:' + JSON.stringify(formInfo));
await preferences.put(formInfo.formId, JSON.stringify(formInfo));
await preferences.flush();
} | 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 saveFormToSp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left formInfo AST#identifier#Right AST#:#Left : ... | public async saveFormToSp(formInfo: FormInfo): Promise<void> {
const preferences = await this.getPreferences();
LogUtil.info(TAG, 'saveFormToSp formInfo:' + JSON.stringify(formInfo));
await preferences.put(formInfo.formId, JSON.stringify(formInfo));
await preferences.flush();
} | https://gitee.com/openharmony-sig/applications_clock.git | cc8a7d1a8ef9f6b2e6c2c17438058171a2fa74ac | gitee |
LJ666-ui/harmony-health-care | 5-skill离线包/星云智联–分布式AI全周期智慧健康管理平台_skills/skills/AIConsultationSkill.ets | arkts | execute | 执行AI智能问诊 | static async execute(query: string): Promise<ConsultationResult> {
// 步骤1:提取症状信息
const symptomInfo = this.extractSymptoms(query);
// 步骤2:紧急情况检测
if (this.isEmergency(symptomInfo)) {
return this.generateEmergencyResponse();
}
// 步骤3:调用DeepSeek分析
try {
const analysisResu... | 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 execute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AST#:#Left : AST#:#Ri... | static async execute(query: string): Promise<ConsultationResult> {
// 步骤1:提取症状信息
const symptomInfo = this.extractSymptoms(query);
// 步骤2:紧急情况检测
if (this.isEmergency(symptomInfo)) {
return this.generateEmergencyResponse();
}
// 步骤3:调用DeepSeek分析
try {
const analysisResu... | https://github.com/LJ666-ui/harmony-health-care | dad454bdb8c0b1ccb4308e2b2e60df208d003aa9 | github |
richshaw2015/nds | ohos/entry/src/main/ets/types/MelonDSNative.ets | arkts | getGameCodeFromRom | 从 ROM 文件头提取 GameCode
@param romPath ROM 文件路径
@returns 4 字符 GameCode,自制程序返回空字符串 | static getGameCodeFromRom(romPath: string): string {
return MelonDSNative.native.getGameCodeFromRom(romPath);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getGameCodeFromRom AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left romPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str... | static getGameCodeFromRom(romPath: string): string {
return MelonDSNative.native.getGameCodeFromRom(romPath);
} | https://github.com/richshaw2015/nds | 7567819cf3afc938018af70d772f73d28fd0e57a | github |
YDYm233/EasyRandom_HarmonyNextApp | common/SystemUtils/src/main/ets/utils/VibratorManager.ets | arkts | vibrateHeartbeat | ═══════════════════════════════════════════════════════════════
振动序列快捷法
═══════════════════════════════════════════════════════════════
心跳振动 — 模拟心跳节奏 (咚咚) | static vibrateHeartbeat(): void {
VibratorManager.logExecution('vibrateHeartbeat');
VibratorManager.vibratePattern([80, 200, 80], 1, VibrationUsage.PHYSICAL_FEEDBACK);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left vibrateHeartbeat 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#expre... | static vibrateHeartbeat(): void {
VibratorManager.logExecution('vibrateHeartbeat');
VibratorManager.vibratePattern([80, 200, 80], 1, VibrationUsage.PHYSICAL_FEEDBACK);
} | https://github.com/YDYm233/EasyRandom_HarmonyNextApp | 7d4df097178bc6f72007dfb603fc2c562f88db2e | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets | arkts | indexOf | Finds the first occurrence of another String in this String
@param { String } str to find
@param { int } [fromIndex] to start searching from
@returns { int } index of the str from the beginning of this string, or -1 if not found
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public indexOf(str: String, fromIndex?: int): int {
return this.indexOfImpl(str, fromIndex ?? 0)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left indexOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left String AS... | public indexOf(str: String, fromIndex?: int): int {
return this.indexOfImpl(str, fromIndex ?? 0)
} | https://gitcode.com/iop123123/arkts-static-skills | 30a214cf3fa77e93180a94cba7bad8dc43edb93c | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | sort | TODO(kprokopenko): this may be not skipped
Sorts in-place
@param fn comparator
@returns sorted Float32Array | public sort(fn: (a: float, b: float) => int): Float32Array {
let arr: float[] = new float[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
/*
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ... | public sort(fn: (a: float, b: float) => int): Float32Array {
let arr: float[] = new float[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
/*
... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 459cd2630cf1da193e9b0066f17218a58e4b14f2 | gitee |
CLMC2025/Vignette | entry/src/main/ets/context/TemplateBuilder.ets | arkts | getTemplate | 根据参数获取模板 | getTemplate(params: TemplateParams, seed: number = -1): ContextTemplate | null {
const resolvedStyle = params.style === ContextStyle.RANDOM
? this.pickRandomBuiltInStyle(seed)
: params.style;
const styleTemplates = this.templates.get(resolvedStyle);
if (styleTemplates === undefined) {
r... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getTemplate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left params AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ... | getTemplate(params: TemplateParams, seed: number = -1): ContextTemplate | null {
const resolvedStyle = params.style === ContextStyle.RANDOM
? this.pickRandomBuiltInStyle(seed)
: params.style;
const styleTemplates = this.templates.get(resolvedStyle);
if (styleTemplates === undefined) {
r... | https://github.com/CLMC2025/Vignette | c37a9bc25b959aacf8586868bddbeb75f0b6a455 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | setAxisMinValue | Use setAxisMinimum(...) instead.
@param min | public setAxisMinValue(min: number): void {
this.setAxisMinimum(min);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setAxisMinValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left min AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left n... | public setAxisMinValue(min: number): void {
this.setAxisMinimum(min);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 05e15dee916194ef12c1a2e377f13c7a4f1de40c | gitee |
aimilin6688/KeePassHO | entry/src/main/ets/storage/cache/CacheStorage.ets | arkts | saveToCacheAsync | 异步保存到本地缓存
@param cachePath 缓存文件路径
@param content 文件内容 | private async saveToCacheAsync(cachePath: string, content: ArrayBuffer): Promise<void> {
try {
await this.writeToCache(cachePath, content);
hilog.debug(DOMAIN, TAG, 'Save to cache async success: %{public}s', cachePath);
} catch (error) {
hilog.error(DOMAIN, TAG, 'Save to cache async failed: ... | 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 saveToCacheAsync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cachePath AST#identifier#Right AST#ERROR#Left AST#:... | private async saveToCacheAsync(cachePath: string, content: ArrayBuffer): Promise<void> {
try {
await this.writeToCache(cachePath, content);
hilog.debug(DOMAIN, TAG, 'Save to cache async success: %{public}s', cachePath);
} catch (error) {
hilog.error(DOMAIN, TAG, 'Save to cache async failed: ... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/cache/CacheStorage.ets#L281-L289 | 433964dc5e62501a1b500c1d277bf04d4adfcc22 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Task/BackgroundTaskManager.ets | arkts | sendTaskProgressNotification | 发送任务进度通知 | private async sendTaskProgressNotification(task: InternalTask, force: boolean = false): Promise<void> {
if (!task.options?.notification) {
return;
}
const snapshot = this.buildProgressNotificationSnapshot(task);
const samePercentage = task.lastProgressNotificationPercentage === snapshot.percent... | 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 sendTaskProgressNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left task AST#identifier#Righ... | private async sendTaskProgressNotification(task: InternalTask, force: boolean = false): Promise<void> {
if (!task.options?.notification) {
return;
}
const snapshot = this.buildProgressNotificationSnapshot(task);
const samePercentage = task.lastProgressNotificationPercentage === snapshot.percent... | https://github.com/DaLongZhuaZi/manxia | 1b845def3ae7b38f203c8496ff7cd48964bcd929 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/DataValidator.ets | arkts | createRule | 创建自定义验证规则
@param validator - 验证函数
@param message - 错误消息
@returns 验证规则 | static createRule<T>(validator: (value: T) => boolean, message: string): ValidationRule<T> {
return new ValidationRuleImpl<T>(validator, message);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#binary_expression#Left AST#identifier#Left createRule AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Ri... | static createRule<T>(validator: (value: T) => boolean, message: string): ValidationRule<T> {
return new ValidationRuleImpl<T>(validator, message);
} | https://github.com/DaLongZhuaZi/manxia | 94accfe74e8703562e2d480d991a285806c037ad | github |
Xiwei753/xiezuoruanjian | apps/harmony/entry/src/main/ets/bridge/NativeWriterCoreBridge.ets | arkts | listProjects | ── Project ── | async listProjects(): Promise<ResultEnvelope<Project[]>> {
try {
const jsonStr: string = this.getNativeModule().nativeListProjects()
return this.parseEnvelope<Project[]>(jsonStr)
} catch (e) {
return { success: false, errorCode: 'NATIVE_ERROR', messageKey: 'error.native_error', messageArgs: ... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left listProjects 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... | async listProjects(): Promise<ResultEnvelope<Project[]>> {
try {
const jsonStr: string = this.getNativeModule().nativeListProjects()
return this.parseEnvelope<Project[]>(jsonStr)
} catch (e) {
return { success: false, errorCode: 'NATIVE_ERROR', messageKey: 'error.native_error', messageArgs: ... | https://github.com/Xiwei753/xiezuoruanjian | 71fc4ddacb1f1e6a953c90ff2ce0215155aa184a | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/SharedLedgerDAO.ets | arkts | remove | 移除成员(按成员ID) | static async remove(memberId: number): Promise<boolean> {
try {
await DAOHelper.softDelete(LedgerMember.tableName, 'member_id', memberId);
return true;
} catch (error) {
throw DAOHelper.toError('[LedgerMemberDAO] 移除成员失败', error);
}
} | 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 remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left memberId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#... | static async remove(memberId: number): Promise<boolean> {
try {
await DAOHelper.softDelete(LedgerMember.tableName, 'member_id', memberId);
return true;
} catch (error) {
throw DAOHelper.toError('[LedgerMemberDAO] 移除成员失败', error);
}
} | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | c26e25b8ccf83b2d26efc18e9ca0adac5b3194bc | github |
arkui-x/samples | CodeLab/Cases/feature/foldablescreencases/src/main/ets/model/AVPlayerModel.ets | arkts | play | 开始播放
@returns {void} | play(): void {
if (!this.avPlayer) {
logger.error('avPlayer no create.');
return;
}
this.avPlayer.play();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left play AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left AS... | play(): void {
if (!this.avPlayer) {
logger.error('avPlayer no create.');
return;
}
this.avPlayer.play();
} | https://gitcode.com/arkui-x/samples | ee258d53314ff6783d49b7594cd56ae4dd3c6cdc | gitcode |
openharmony-sig/applications_compass | feature/compass/src/main/ets/controller/CompassController.ets | arkts | getLocation | Subscribe location changed. | public async getLocation() {
LogUtil.info('parameters in configuration location');
let requestInfo: geolocation.LocationRequest = {
priority: geolocation.LocationRequestPriority.FIRST_FIX, // 快速获取位置优先,如果应用希望快速拿到1个位置,可以将优先级设置为该字段
scenario: geolocation.LocationRequestScenario.UNSET, // 未设置场景信息
... | 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 getLocation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERRO... | public async getLocation() {
LogUtil.info('parameters in configuration location');
let requestInfo: geolocation.LocationRequest = {
priority: geolocation.LocationRequestPriority.FIRST_FIX, // 快速获取位置优先,如果应用希望快速拿到1个位置,可以将优先级设置为该字段
scenario: geolocation.LocationRequestScenario.UNSET, // 未设置场景信息
... | https://gitee.com/openharmony-sig/applications_compass.git | c9f095bbf79280483b85903eec26be8996fc1ae1 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | constructor | Creates an Uint32Array with respect to length.
@param length data initializer | public constructor(length: int)
{
this.length = length
this.byteLength = length * Uint32Array.BYTES_PER_ELEMENT
this.byteOffset = 0
this.buffer = new ArrayBuffer(this.byteLength)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left length AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#... | public constructor(length: int)
{
this.length = length
this.byteLength = length * Uint32Array.BYTES_PER_ELEMENT
this.byteOffset = 0
this.buffer = new ArrayBuffer(this.byteLength)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | f75f7582000c11c4269057298e3a971e261922f2 | gitee |
openharmony/codelabs | Security/StringCipherArkTS/entry/src/main/ets/model/RdbModel.ets | arkts | insertData | Save data to the database.
@param user Data objects of the user type to be saved. | insertData(user: User) {
try {
(this.rdbStore as dataRdb.RdbStore).insert(this.tableName, JSON.parse(JSON.stringify(user)));
} catch (err) {
Logger.error(`insert data failed due to ${JSON.stringify(err)}`);
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left insertData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left user AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left User AST#identifier#Right AST#... | insertData(user: User) {
try {
(this.rdbStore as dataRdb.RdbStore).insert(this.tableName, JSON.parse(JSON.stringify(user)));
} catch (err) {
Logger.error(`insert data failed due to ${JSON.stringify(err)}`);
}
} | https://gitee.com/openharmony/codelabs.git | e1df3424cc94f702c988a8ea72c5e897975b06f0 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets | arkts | createScaleState | 创建缩放动画状态 | public createScaleState(scale: number): AnimationState {
return {
isPlaying: false,
isCompleted: false,
currentIteration: 0,
progress: 0,
scaleX: scale,
scaleY: scale
};
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left createScaleState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left scale AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public createScaleState(scale: number): AnimationState {
return {
isPlaying: false,
isCompleted: false,
currentIteration: 0,
progress: 0,
scaleX: scale,
scaleY: scale
};
} | https://github.com/DaLongZhuaZi/manxia | ad105c25be976d01b899083287062023278214e5 | github |
tdcare/tdwebrtc | src/main/ets/MediaStream.ets | arkts | stopPlaceholderTimer | 停止占位画面定时器 | private stopPlaceholderTimer(): void {
if (this.placeholderTimerId !== -1) {
clearInterval(this.placeholderTimerId);
this.placeholderTimerId = -1;
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left stopPlaceholderTimer 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 AS... | private stopPlaceholderTimer(): void {
if (this.placeholderTimerId !== -1) {
clearInterval(this.placeholderTimerId);
this.placeholderTimerId = -1;
}
} | https://github.com/tdcare/tdwebrtc | 1e9809ad59b2656bfaec1b4c17bf05a33d378929 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/FinancialHealth.ets | arkts | getGradeDescription | 获取等级对应的描述 | getGradeDescription(): string {
if (this.grade === GRADE_EXCELLENT) {
return '您的财务状况非常健康,继续保持!';
} else if (this.grade === GRADE_GOOD) {
return '您的财务状况良好,还有提升空间。';
} else if (this.grade === GRADE_FAIR) {
return '您的财务状况一般,建议关注改进建议。';
} else if (this.grade === GRADE_POOR) {
retur... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getGradeDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#st... | getGradeDescription(): string {
if (this.grade === GRADE_EXCELLENT) {
return '您的财务状况非常健康,继续保持!';
} else if (this.grade === GRADE_GOOD) {
return '您的财务状况良好,还有提升空间。';
} else if (this.grade === GRADE_FAIR) {
return '您的财务状况一般,建议关注改进建议。';
} else if (this.grade === GRADE_POOR) {
retur... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | e2cb9c42679829363764e4d3391eab575dbd8307 | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets | arkts | setIsolateServiceIdListener | Set a listener that will be notified when an isolate identifier is available for this
executor's primary isolate. | setIsolateServiceIdListener(listener: IsolateServiceIdListener): void {
this.isolateServiceIdListener = listener;
if (this.isolateServiceIdListener != null && this.isolateServiceId != null) {
this.isolateServiceIdListener.onIsolateServiceIdAvailable(this.isolateServiceId);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setIsolateServiceIdListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left IsolateServiceIdListener... | setIsolateServiceIdListener(listener: IsolateServiceIdListener): void {
this.isolateServiceIdListener = listener;
if (this.isolateServiceIdListener != null && this.isolateServiceId != null) {
this.isolateServiceIdListener.onIsolateServiceIdAvailable(this.isolateServiceId);
}
} | https://gitee.com/openharmony-sig/flutter_engine.git | b4ceae31798f66c6290d85d46b1c518a3fb9b947 | gitee |
honjow/Next2V | shared/src/main/ets/utils/FoldScreenUtil.ets | arkts | notifyCallbacks | Notify all callbacks | private notifyCallbacks(): void {
this.callbacks.forEach(callback => {
try {
callback(this.isFoldedAndOuterScreen)
} catch (error) {
console.error('FoldScreenUtil callback error:', error)
}
})
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyCallbacks 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#exp... | private notifyCallbacks(): void {
this.callbacks.forEach(callback => {
try {
callback(this.isFoldedAndOuterScreen)
} catch (error) {
console.error('FoldScreenUtil callback error:', error)
}
})
} | https://github.com/honjow/Next2V | 1d5162e84e26ebccfa85a562f5e30f89486c9bc6 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/RuntimeLinker.ets | arkts | loadClassSafe | Version of loadClass which does not throw LinkerClassNotFoundError. | protected final loadClassSafe(clsName: string, init: boolean): Class | undefined {
let optClass = this.findLoadedClass(clsName)
if (optClass) {
if (init) {
// No-op if class is already initialized
optClass.initialize()
}
return optC... | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#identifier#Left final AST#identifier#Right AST#call_expression#Left AST#identifier#Left loadClassSafe AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left clsName AST#identifier#Right AST#ERROR#Left AST#... | protected final loadClassSafe(clsName: string, init: boolean): Class | undefined {
let optClass = this.findLoadedClass(clsName)
if (optClass) {
if (init) {
// No-op if class is already initialized
optClass.initialize()
}
return optC... | https://gitcode.com/iop123123/arkts-static-skills | db9e2ae9f0fe40c5439359c9bdbdb3cc381e5cc6 | gitcode |
LZZLHY/hlib | entry/src/main/ets/viewmodel/download/DownloadRepository.ets | arkts | loadHistoryToStorage | ─── 已完成历史 ───
从持久层加载历史 → AppStorage(按时间倒序)。返回排序后的列表。 | static async loadHistoryToStorage(): Promise<DownloadHistoryItem[]> {
const map = await DownloadHistoryStore.loadAll();
const items: DownloadHistoryItem[] = [];
const keys: string[] = Object.keys(map);
for (let i = 0; i < keys.length; i++) {
items.push(map[keys[i]]);
}
items.sort((a: Dow... | 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 loadHistoryToStorage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | static async loadHistoryToStorage(): Promise<DownloadHistoryItem[]> {
const map = await DownloadHistoryStore.loadAll();
const items: DownloadHistoryItem[] = [];
const keys: string[] = Object.keys(map);
for (let i = 0; i < keys.length; i++) {
items.push(map[keys[i]]);
}
items.sort((a: Dow... | https://github.com/LZZLHY/hlib | 44be058fe7288769b4b586c6934bcefb39a80983 | github |
offlinecat-dev/OCNetORM | src/main/ets/core/MetadataStorage.ets | arkts | getRelations | 获取实体的所有关联关系
@param entityName 实体名称
@returns 关联关系数组,如果没有则返回空数组 | getRelations(entityName: string): Array<RelationMetadata> {
const entityRelations = this.relations.get(entityName)
if (entityRelations) {
return entityRelations
}
return []
} | AST#program#Left AST#ERROR#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getRelations AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ER... | getRelations(entityName: string): Array<RelationMetadata> {
const entityRelations = this.relations.get(entityName)
if (entityRelations) {
return entityRelations
}
return []
} | https://github.com/offlinecat-dev/OCNetORM | 86e793a4763c57536a3c98904d9b4595a5c231cf | github |
openharmony/multimedia_camera_framework | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/pages/Index.ets | arkts | blurFirstAnim | 向外翻转90°同时 | blurFirstAnim() {
Logger.info(TAG, 'blurFirstAnim E');
// 初始化动效参数
this.shotImgBlur = 0; //无模糊
this.shotImgOpacity = 1; //不透明
this.shotImgScale = { x: 1, y: 1 };
animateToImmediately(
{
duration: BlurAnimateUtil.ROTATION_DURATION,
curve: Curve.Sharp,
onFinish: () =... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left blurFirstAnim 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... | blurFirstAnim() {
Logger.info(TAG, 'blurFirstAnim E');
// 初始化动效参数
this.shotImgBlur = 0; //无模糊
this.shotImgOpacity = 1; //不透明
this.shotImgScale = { x: 1, y: 1 };
animateToImmediately(
{
duration: BlurAnimateUtil.ROTATION_DURATION,
curve: Curve.Sharp,
onFinish: () =... | https://gitee.com/openharmony/multimedia_camera_framework.git | 63d77f60d3fc484639fac5117f8cf37dda5195df | gitee |
harmonyos/codelabs | HarmonyOS_NEXT/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets | arkts | publishReminder | publishReminder | function publishReminder(params: PublishReminderInfo, context: Context) {
if (!params) {
Logger.error(Const.REMINDER_AGENT_TAG, 'publishReminder params is empty');
return;
}
let notifyId: string = params.notificationId.toString();
hasPreferencesValue(context, notifyId, (preferences: preferences.Preferen... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left publishReminder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#... | function publishReminder(params: PublishReminderInfo, context: Context) {
if (!params) {
Logger.error(Const.REMINDER_AGENT_TAG, 'publishReminder params is empty');
return;
}
let notifyId: string = params.notificationId.toString();
hasPreferencesValue(context, notifyId, (preferences: preferences.Preferen... | https://gitee.com/harmonyos/codelabs.git | 5cd5b07dbd6328967fdcdfca3c14303865847b74 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/TabContentCacheManager.ets | arkts | hasKomgaCache | 是否有Komga缓存数据 | hasKomgaCache(): boolean {
return this.komgaCache !== null;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasKomgaCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#state... | hasKomgaCache(): boolean {
return this.komgaCache !== null;
} | https://github.com/DaLongZhuaZi/manxia | a1d9f08a026aa8726dc50189fbf7438291c5edae | github |
OHPG/FinVideo | entry/src/main/ets/data/Repository.ets | arkts | getLibraryLatestMedia | 获取媒体库最近媒体
@param id
@returns | public getLibraryLatestMedia(id?: string): Promise<Array<FinItem>> {
return this.requireApi().getLatestItems(id)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLibraryLatestMedia 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#:#Left : AST#:#Right AST#ERR... | public getLibraryLatestMedia(id?: string): Promise<Array<FinItem>> {
return this.requireApi().getLatestItems(id)
} | https://github.com/OHPG/FinVideo | 4dc0a41341b13933ab27c9a2a9f14fdbbfc50dfb | github |
offlinecat-dev/OCNetORM | src/main/ets/mapping/ViewModelMapper.ets | arkts | setReverseMapper | 设置反向属性映射器(用于 ViewModel 转 EntityData)
@param mapper 反向属性映射器
@param propertyNames 需要映射的属性名列表
@returns 当前配置实例(支持链式调用) | setReverseMapper(mapper: ReversePropertyMapper<T>, propertyNames: Array<string>): ViewModelMappingConfig<T> {
this.reverseMapper = mapper
this.propertyNames = propertyNames
return this
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left setReverseMapper AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mapper AST#identifier#Right AST#:#Left : AST#:#Right AST#... | setReverseMapper(mapper: ReversePropertyMapper<T>, propertyNames: Array<string>): ViewModelMappingConfig<T> {
this.reverseMapper = mapper
this.propertyNames = propertyNames
return this
} | https://github.com/offlinecat-dev/OCNetORM | 11c6f3bf10847903b1491766a6cbddb5a7b642da | github |
openharmony/applications_call | entry/src/main/ets/model/CallServiceProxy.ets | arkts | unRegisterCallEventCallback | unRegister call event callback | public unRegisterCallEventCallback() {
call.off('callEventChange', (data) => {
if (!data) {
LogUtils.i(TAG, prefixLog + 'call.off unRegisterCallEventCallback : %s')
} else {
LogUtils.i(TAG, prefixLog + 'call.off unRegisterCallEventCallback : %s')
}
});
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unRegisterCallEventCallback 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#Lef... | public unRegisterCallEventCallback() {
call.off('callEventChange', (data) => {
if (!data) {
LogUtils.i(TAG, prefixLog + 'call.off unRegisterCallEventCallback : %s')
} else {
LogUtils.i(TAG, prefixLog + 'call.off unRegisterCallEventCallback : %s')
}
});
} | https://gitee.com/openharmony/applications_call.git | a39bdb86c8df2a799897167caf2e98a35b260076 | gitee |
codelably/tuniao-ui | packages/main/src/main/ets/viewmodel/TnInputViewModel.ets | arkts | setInputValue1 | 设置输入框1的文本内容
@param value 新的输入值 | setInputValue1(value: string): void {
this.inputValue1 = value;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setInputValue1 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left )... | setInputValue1(value: string): void {
this.inputValue1 = value;
} | https://github.com/codelably/tuniao-ui | 4064bf254506cdaeb3e36b7f1f162180650809a3 | github |
offlinecat-dev/OCNetORM | src/main/ets/mapping/ResultSetUtils.ets | arkts | toRowArray | 将 ResultSet 所有行转换为 ResultSetRow 数组
@param resultSet 查询结果集
@param metadata 实体元数据
@returns ResultSetRow 数组 | static toRowArray(resultSet: relationalStore.ResultSet, metadata: EntityMetadata): Array<ResultSetRow> {
const rows: Array<ResultSetRow> = []
try {
while (resultSet.goToNextRow()) {
rows.push(ResultSetUtils.toRow(resultSet, metadata))
}
} catch (e) {
// 遍历结果集失败,返回已处理的行
con... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toRowArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expressio... | static toRowArray(resultSet: relationalStore.ResultSet, metadata: EntityMetadata): Array<ResultSetRow> {
const rows: Array<ResultSetRow> = []
try {
while (resultSet.goToNextRow()) {
rows.push(ResultSetUtils.toRow(resultSet, metadata))
}
} catch (e) {
// 遍历结果集失败,返回已处理的行
con... | https://github.com/offlinecat-dev/OCNetORM | f63b1e8a52a3a8ac735e291a5d676da22341a648 | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/view/PriceDetailDialog.ets | arkts | build | Original Sum | build() {
Column() {
// Header
Row() {
Text('优惠明细')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.layoutWeight(1)
Text('✕')
.fontSize(20)
.fontColor(Color.Gray)
.onClick(() => {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
// Header
Row() {
Text('优惠明细')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.layoutWeight(1)
Text('✕')
.fontSize(20)
.fontColor(Color.Gray)
.onClick(() => {
... | https://github.com/Harrisonls2004/WaterFlow | d34729a0c0c9c24c4978dd441df69e297b9be0bc | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getByUserId | 按用户ID查询事件 | static async getByUserId(userId: number, limit: number = 100): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.equalTo('... | 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 getByUserId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST... | static async getByUserId(userId: number, limit: number = 100): Promise<DomainEvent[]> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(DomainEvent.tableName);
predicates.equalTo('... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 350af7366722a8bd6938cecfceeca0d965a75316 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | sort | TODO(kprokopenko): this may be not skipped
Sorts in-place
@param fn comparator
@returns sorted Int32Array | public sort(fn: (a: int, b: int) => int): Int32Array {
let arr: int[] = new int[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
/*
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ... | public sort(fn: (a: int, b: int) => int): Int32Array {
let arr: int[] = new int[this.length]
for (let i = 0; i < this.length; ++i) {
arr[i] = this.at(i)
}
// TODO(ivan-tyulyandin): unresolved reference i in for loop, blocked by internal issue 12961
/*
... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | d3f78a511ae8d1f69d02a446a24c0fb2f60f52ef | gitee |
Joker-x-dev/CoolMallArkTS | feature/auth/src/main/ets/viewmodel/RegisterViewModel.ets | arkts | updateVerificationCode | 更新验证码
@param {string} value - 验证码
@returns {void} 无返回值 | updateVerificationCode(value: string): void {
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateVerificationCode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#... | updateVerificationCode(value: string): void {
} | https://github.com/Joker-x-dev/CoolMallArkTS | aaae2211edb5038b6c2e741d01b94f7f27b526d6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceSelectorEngine.ets | arkts | validateSelector | 验证选择器配置 | validateSelector(selector: Selector): boolean {
if (!selector.type) {
return false;
}
// 不同类型的选择器有不同的必需字段
switch (selector.type) {
case SelectorType.CSS:
case SelectorType.XPATH:
return !!(selector as CSSSelector | XPathSelector).value;
case SelectorType.TEXT:
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left validateSelector AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left selector AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Selector AST#identifier#Right AST#)... | validateSelector(selector: Selector): boolean {
if (!selector.type) {
return false;
}
// 不同类型的选择器有不同的必需字段
switch (selector.type) {
case SelectorType.CSS:
case SelectorType.XPATH:
return !!(selector as CSSSelector | XPathSelector).value;
case SelectorType.TEXT:
... | https://github.com/DaLongZhuaZi/manxia | 83a4cd401068f5acc77cd083397a77e3251cf0f8 | github |
honjow/Next2V | shared/src/main/ets/parser/V2exTabParser.ets | arkts | isValid | 验证提取结果是否合理
V2EX 首页正常每页约 20 条 | static isValid(ids: number[]): boolean {
return ids.length > 0 && ids.length <= 100
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isValid AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ids AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left... | static isValid(ids: number[]): boolean {
return ids.length > 0 && ids.length <= 100
} | https://github.com/honjow/Next2V | cb23f791652fa1842ddb53f97c7388af0ccd4fc2 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | filter | Creates a new Int32Array from current Int32Array based on a condition fn.
@param { function } fn - the condition to apply for each element
@returns { Int32Array } - a new Int32Array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public filter(fn: (val: number, index: int, array: Int32Array) => boolean): Int32Array {
let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt)
let resLen = 0
for (let i = 0; i < this.lengthInt; ++i) {
markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this)
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left filter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R... | public filter(fn: (val: number, index: int, array: Int32Array) => boolean): Int32Array {
let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt)
let resLen = 0
for (let i = 0; i < this.lengthInt; ++i) {
markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this)
... | https://gitcode.com/iop123123/arkts-static-skills | b0a80bda2229524cf67d865a6ca27fad0d7f5a7e | gitcode |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/services/RdpSessionManager.ets | arkts | stopKeepaliveTimer | Stop keepalive timer | private stopKeepaliveTimer(): void {
if (keepaliveTimerId !== -1) {
clearInterval(keepaliveTimerId);
keepaliveTimerId = -1;
console.info(`${TAG}: Keepalive timer stopped`);
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left stopKeepaliveTimer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#... | private stopKeepaliveTimer(): void {
if (keepaliveTimerId !== -1) {
clearInterval(keepaliveTimerId);
keepaliveTimerId = -1;
console.info(`${TAG}: Keepalive timer stopped`);
}
} | https://github.com/tangwengang-del/freerdp-harmonyos | 4aa5ddd8023899747ec49dd8148c074490068d6b | github |
JackJiang2011/harmonychat | entry/src/main/ets/pages/model/Message.ets | arkts | isOutgoing | 是否"我"发出的消息 | isOutgoing(): boolean {
return Message.isOutgoing(this.senderId);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isOutgoing AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statemen... | isOutgoing(): boolean {
return Message.isOutgoing(this.senderId);
} | https://github.com/JackJiang2011/harmonychat | 60b9b23c2c470bc41cc82cb57e33c1eac1ce9801 | github |
banggx/account_app_harmonyos | entry/src/main/ets/service/account.ets | arkts | getRangeAccountByType | 查询指定日期范围内收入/支出的账单数据 | getRangeAccountByType(startTime: number, endTime: number, type: AccountType) {
return AccountModel.queryRangeAndType(startTime, endTime, type);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getRangeAccountByType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left startTime AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#... | getRangeAccountByType(startTime: number, endTime: number, type: AccountType) {
return AccountModel.queryRangeAndType(startTime, endTime, type);
} | https://github.com/banggx/account_app_harmonyos | 0c8a118d36532f55b1a262545c822b2c847c747b | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/dialogs/settings/WoofMeowButtons/ButtonsManager.ets | arkts | verifyLegal | Returns true if there is at least ONE meowButtons.SETTINGS item in any of the temp lists.
@returns ...
@author CodeGenie in DevEco Studio Preview 6.0.5.433 @ Apr 26 2026. | verifyLegal(): boolean {
return this.tempButtonsControl.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.tempButtonsAddressBarOnFocus.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.tempButtonsAddressBar.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left verifyLegal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#stateme... | verifyLegal(): boolean {
return this.tempButtonsControl.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.tempButtonsAddressBarOnFocus.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.tempButtonsAddressBar.some(button => button === UnifiedButtonsType.SETTINGS) ||
this.... | https://github.com/awaLiny2333/LinysBrowser_NEXT | 1bb571f1c88311197a8d0fa4837745033cd28781 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.