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 |
|---|---|---|---|---|---|---|---|---|---|---|
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/CustomerServiceRepository.ets | arkts | createSession | 创建客服会话
@returns 客服会话信息 | async createSession(): Promise<NetworkResponse<CsSession>> {
return this.networkDataSource.createSession();
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createSession 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#generi... | async createSession(): Promise<NetworkResponse<CsSession>> {
return this.networkDataSource.createSession();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 57006ef5f657942b585263961cd16571e513a357 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | constructor | Creates an Float64Array with respect to data accessed via Iterable<Number> interface
@param { Iterable<Number> } elements - an iterable object
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public constructor(elements: Iterable<Number>) {
const items: Object = elements as Object
if (items instanceof ArrayLike) {
const arr = reflect.internals.Types.identity_cast<Number>(items as ArrayLike<Number>)
this.byteLength = arr.length * Float64Array.BYTES_PER_ELEMENT
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left elements AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_ex... | public constructor(elements: Iterable<Number>) {
const items: Object = elements as Object
if (items instanceof ArrayLike) {
const arr = reflect.internals.Types.identity_cast<Number>(items as ArrayLike<Number>)
this.byteLength = arr.length * Float64Array.BYTES_PER_ELEMENT
... | https://gitcode.com/iop123123/arkts-static-skills | a4d257a463e8f25695d5805c319e854c4c8682be | gitcode |
honjow/Next2V | feature/node/src/main/ets/viewmodel/NodeViewModel.ets | arkts | loadNodeDetail | Load node detail (public API, for showing real topic count when Token is not configured) | async loadNodeDetail(nodeName: string): Promise<void> {
this.nodeDetailError = ''
try {
this.nodeDetail = await this.api.getNodeByName(nodeName)
if (this.nodeDetailCacheSaver) {
this.nodeDetailCacheSaver(this.nodeDetail)
}
} catch (error) {
this.nodeDetail = null
this... | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left loadNodeDetail AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Le... | async loadNodeDetail(nodeName: string): Promise<void> {
this.nodeDetailError = ''
try {
this.nodeDetail = await this.api.getNodeByName(nodeName)
if (this.nodeDetailCacheSaver) {
this.nodeDetailCacheSaver(this.nodeDetail)
}
} catch (error) {
this.nodeDetail = null
this... | https://github.com/honjow/Next2V | d0658b2232c0f73455faf40c1418c0f1cc978c5c | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/historyrecord/HistoryRecordController.ets | arkts | queryAllRecords | query all history records
@returns history records | public queryAllRecords(): Array<LooseObject> {
LogUtil.info(TAG, 'queryAllRecords start');
this.expressionsModel.queryAllRecords((expList: Array<LooseObject>) => {
if (expList !== null && expList.length !== 0) {
this.isEmptyView = false;
}
this.expDataSource.refresh(expList);
});... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left queryAllRecords 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 queryAllRecords(): Array<LooseObject> {
LogUtil.info(TAG, 'queryAllRecords start');
this.expressionsModel.queryAllRecords((expList: Array<LooseObject>) => {
if (expList !== null && expList.length !== 0) {
this.isEmptyView = false;
}
this.expDataSource.refresh(expList);
});... | https://gitee.com/openharmony-sig/applications_calculator.git | c2c6e273fb3930feace4a965b68b094560c29536 | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/SettingsBackupService.ets | arkts | importAll | 从 JSON 字符串导入所有设置
@returns 导入的设置项数量,失败返回 -1 | static async importAll(json: string): Promise<number> {
try {
const backup = JSON.parse(json) as BackupData;
if (!backup.version || !backup.settings) {
console.error(`${TAG} 无效的备份文件格式`);
return -1;
}
const prefs = await PreferencesUtil.getPreferences();
// 保留内... | 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 importAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left json AST#identifier#Right AST#:#Left : AST#:#R... | static async importAll(json: string): Promise<number> {
try {
const backup = JSON.parse(json) as BackupData;
if (!backup.version || !backup.settings) {
console.error(`${TAG} 无效的备份文件格式`);
return -1;
}
const prefs = await PreferencesUtil.getPreferences();
// 保留内... | https://github.com/AlkaidLab/moonlight-harmony | f96bf0b3e3e2b2352d50b7c2645a059c99a0304f | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/TrackpadGestureHandler.ets | arkts | updateConfig | ==================== 公共配置 ==================== | updateConfig(sensitivity?: number, tapTimeThreshold?: number, enableDoubleClickDrag?: boolean): void {
if (sensitivity !== undefined) this.config.sensitivity = sensitivity;
if (tapTimeThreshold !== undefined) this.config.tapTimeThreshold = tapTimeThreshold;
if (enableDoubleClickDrag !== undefined) this.co... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sensitivity AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERR... | updateConfig(sensitivity?: number, tapTimeThreshold?: number, enableDoubleClickDrag?: boolean): void {
if (sensitivity !== undefined) this.config.sensitivity = sensitivity;
if (tapTimeThreshold !== undefined) this.config.tapTimeThreshold = tapTimeThreshold;
if (enableDoubleClickDrag !== undefined) this.co... | https://github.com/AlkaidLab/moonlight-harmony | a8b5c60c4c400846f4621cd28f72fcf854532a10 | github |
honjow/Next2V | shared/src/main/ets/settings/AccountMetaPublisher.ets | arkts | publishCached | Hydrate the holder from the persisted cache, but NEVER downgrade a holder that already carries a live
value for this owner (a peer fetch or a browse-harvest may have set something fresher than the cache). | static publishCached(
ownerKey: string,
balance: V2exBalance | null,
dailyMission: V2exDailyMission | null,
): void {
if (!ownerKey || !balance) {
return
}
const holder = connectAccountMeta()
if (holder.ownerKey === ownerKey && holder.balance) {
return
}
AccountMetaPu... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left publishCached AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left ownerKey AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#... | static publishCached(
ownerKey: string,
balance: V2exBalance | null,
dailyMission: V2exDailyMission | null,
): void {
if (!ownerKey || !balance) {
return
}
const holder = connectAccountMeta()
if (holder.ownerKey === ownerKey && holder.balance) {
return
}
AccountMetaPu... | https://github.com/honjow/Next2V | fcf985dd40b88b39801663f0b1af01c6ba8253a5 | github |
CsCesium/KantaiHomo | entry/src/main/ets/infra/fairy/service/FairyService.ets | arkts | destroy | Destroy the SubWindow on ability teardown. | async destroy(): Promise<void> {
if (!this.subWin) {
return;
}
try {
await this.subWin.destroyWindow();
} catch (e) {
hilog.error(0x1357, TAG, 'destroy failed: %{public}s', String(e));
}
this.subWin = null;
this.alive = false;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left destroy AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#L... | async destroy(): Promise<void> {
if (!this.subWin) {
return;
}
try {
await this.subWin.destroyWindow();
} catch (e) {
hilog.error(0x1357, TAG, 'destroy failed: %{public}s', String(e));
}
this.subWin = null;
this.alive = false;
} | https://github.com/CsCesium/KantaiHomo | 095758e6ddd97923597b31e7d2d43e6cc005807b | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/network/HttpClient.ets | arkts | postFormText | POST 表单并返回文本响应 | async postFormText(
path: string,
form: Record<string, Object>,
extraHeaders: Record<string, string> | null = null,
readTimeoutMs: number = 60000,
connectTimeoutMs: number | null = null,
guardOptions: CfGuardOptions | null = null
): Promise<string> {
await this.cookieStore.init();
co... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left postFormText AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left path AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | async postFormText(
path: string,
form: Record<string, Object>,
extraHeaders: Record<string, string> | null = null,
readTimeoutMs: number = 60000,
connectTimeoutMs: number | null = null,
guardOptions: CfGuardOptions | null = null
): Promise<string> {
await this.cookieStore.init();
co... | https://github.com/Amaz1ny/HarmonyDO-public | 904a4cdfa8321fc5df07e266132ff4039af955c4 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/EventSourcing.ets | arkts | createBillDeletedEvent | 创建账单删除事件 | static createBillDeletedEvent(
userId: number,
billId: number,
version: number,
reason: string = ''
): DomainEvent {
const payloadJson = '{"reason":"' + reason + '","deletedAt":"' + new Date().toISOString() + '"}';
const event = new DomainEvent(
'',
EVENT_TYPE_BILL_DELETED,
... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createBillDeletedEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif... | static createBillDeletedEvent(
userId: number,
billId: number,
version: number,
reason: string = ''
): DomainEvent {
const payloadJson = '{"reason":"' + reason + '","deletedAt":"' + new Date().toISOString() + '"}';
const event = new DomainEvent(
'',
EVENT_TYPE_BILL_DELETED,
... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | bddc3d6a4a9a8b2ebff64b60153683a99a5c912c | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/system/dialogs/classes/meowDialogManager.ets | arkts | registerOpenDialog | Records an opening of a dialog. ONLY Expected to be called by WoofUniFrame.
@param dialog The dialog controller.
@param label The label of the dialog. | registerOpenDialog(dialog: CustomDialogController, label: string = '') {
this.openedDialogs.push(dialog);
meow(`Dialog opened: [${label}]`, 'meowDialogManager', meowLevel.INFO);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left registerOpenDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dialog AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CustomDialogControll... | registerOpenDialog(dialog: CustomDialogController, label: string = '') {
this.openedDialogs.push(dialog);
meow(`Dialog opened: [${label}]`, 'meowDialogManager', meowLevel.INFO);
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 5a4b2495504481a2cdb5a7ea2f99352a41faac24 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/WebViewDataCacheManager.ets | arkts | limitCacheSize | 限制缓存大小(LRU策略) | private limitCacheSize<T>(cache: Map<string, CacheItem<T>>): void {
if (cache.size <= this.config.maxEntries) {
return;
}
// 按访问时间排序,删除最旧的
const entries = Array.from(cache.entries());
entries.sort((a, b) => a[1].timestamp - b[1].timestamp);
const deleteCount = cache.size - this... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#binary_expression#Left AST#identifier#Left limitCacheSize 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 ( A... | private limitCacheSize<T>(cache: Map<string, CacheItem<T>>): void {
if (cache.size <= this.config.maxEntries) {
return;
}
// 按访问时间排序,删除最旧的
const entries = Array.from(cache.entries());
entries.sort((a, b) => a[1].timestamp - b[1].timestamp);
const deleteCount = cache.size - this... | https://github.com/DaLongZhuaZi/manxia | db41d94001c1cf98c91f2fd15f28ece8992c2d4c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ContentFilterManager.ets | arkts | getFilterStats | 获取过滤统计信息 | public getFilterStats<T>(items: T[]): FilterStats {
const total = items.length;
const nsfw = items.filter(item => (item as ESObject).isNSFW === true).length;
const sfw = total - nsfw;
const filtered = this.sfwModeEnabled ? nsfw : 0;
const stats: FilterStats = { total, nsfw, sfw, filtered };
r... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#binary_expression#Left AST#identifier#Left getFilterStats 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#... | public getFilterStats<T>(items: T[]): FilterStats {
const total = items.length;
const nsfw = items.filter(item => (item as ESObject).isNSFW === true).length;
const sfw = total - nsfw;
const filtered = this.sfwModeEnabled ? nsfw : 0;
const stats: FilterStats = { total, nsfw, sfw, filtered };
r... | https://github.com/DaLongZhuaZi/manxia | c0a60f95a56246bc2402b18a8445111d90329a75 | github |
openharmony-sig/flutter_engine | shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets | arkts | skip | Skips the byte offset.
@param byteLength The byte length. | skip(byteLength: number): void {
this.mByteOffset += byteLength
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left skip AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteLength AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#Right ... | skip(byteLength: number): void {
this.mByteOffset += byteLength
} | https://gitee.com/openharmony-sig/flutter_engine.git | 2ec2ba7270019fd2f28f6ba5b954d4f35d581a23 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | with | Creates a copy with replaced value on index
@param { int } index - index to change
@param { float } value - value to set
@returns { Float32Array } - an Float32Array with replaced value on index
@throws { RangeError } - If the index exceeds the array range, throw an exception
@syscap SystemCapability.Utils.Lang
@FaAndSt... | public with(index: int, value: float): Float32Array {
let res = new Float32Array(this)
res.set(index, value)
return res
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST... | public with(index: int, value: float): Float32Array {
let res = new Float32Array(this)
res.set(index, value)
return res
} | https://gitcode.com/iop123123/arkts-static-skills | b112346f73edc13a6e0818571aa6c2963358b487 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets | arkts | size | Gets the number of elements currently stored in the queue.
Returns the current element count without modifying the queue.
@returns { int } The number of elements currently stored in the LinkedConcurrentQueue,
else returns 0 when the queue is empty.
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public get size(): int {
return this.atomicsGetSize();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#identifier#Left size AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#... | public get size(): int {
return this.atomicsGetSize();
} | https://gitcode.com/iop123123/arkts-static-skills | a77f824ed45363e725c1cbf57773943df4bdcb40 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/Node.ets | arkts | previousSibling | 获取前一个兄弟节点 | get previousSibling(): Node | null {
if (!this.parentNode) return null;
const siblings = this.parentNode.childNodes;
const index = siblings.indexOf(this);
return index > 0 ? siblings[index - 1] : null;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left previousSibling AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#iden... | get previousSibling(): Node | null {
if (!this.parentNode) return null;
const siblings = this.parentNode.childNodes;
const index = siblings.indexOf(this);
return index > 0 ? siblings[index - 1] : null;
} | https://github.com/DaLongZhuaZi/manxia | 40e90a33f7f6d32a66e6dd9c2a0d0122885eccb2 | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onConfigurationUpdate | 监听系统主题变化, 同步到 AppStorage | onConfigurationUpdate(newConfig: Configuration): void {
const sysMode: number = this.resolveSystemColorMode(newConfig);
const isDark: boolean = sysMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK;
const follow: boolean = AppStorage.get<boolean>('followSystem') ?? true;
if (follow) {
// 仅... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onConfigurationUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newConfig AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Configuration AST#identifier#... | onConfigurationUpdate(newConfig: Configuration): void {
const sysMode: number = this.resolveSystemColorMode(newConfig);
const isDark: boolean = sysMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK;
const follow: boolean = AppStorage.get<boolean>('followSystem') ?? true;
if (follow) {
// 仅... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | 42337cc216cd04b1429138fe1e31ea2cfbc5c522 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/utils/ColorTemplate.ets | arkts | colorRgb | from Color.rgb()
@param r
@param g
@param b | public static colorRgb(r: number, g: number, b: number): number {
return 0xff000000 | (r << 16) | (g << 8) | b;
} | 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 colorRgb AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left r AST#identifier#Right AST#:#Left : AST#:#Righ... | public static colorRgb(r: number, g: number, b: number): number {
return 0xff000000 | (r << 16) | (g << 8) | b;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | d659414f00b8934ca68feabeb0cf9c81d88bc3f9 | gitee |
Yebingiscn/SweetVideo | entry/src/main/ets/utils/DlpAntiPeepUtil.ets | arkts | closeDlpAntiPeepStatus | 取消订阅防窥保护通知 | static closeDlpAntiPeepStatus() {
if (canIUse('SystemCapability.Security.DlpAntiPeep')) {
try {
dlpAntiPeep.off('dlpAntiPeep', DlpAntiPeepUtil.onStatusChange)
DlpAntiPeepUtil.isDlpAntiPeepStatus = false
} catch (error) {
salmonLogger.addLog(TAG, `Failed to off DlpAntiPeep. Code... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left closeDlpAntiPeepStatus 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... | static closeDlpAntiPeepStatus() {
if (canIUse('SystemCapability.Security.DlpAntiPeep')) {
try {
dlpAntiPeep.off('dlpAntiPeep', DlpAntiPeepUtil.onStatusChange)
DlpAntiPeepUtil.isDlpAntiPeepStatus = false
} catch (error) {
salmonLogger.addLog(TAG, `Failed to off DlpAntiPeep. Code... | https://github.com/Yebingiscn/SweetVideo | 0152f0084d4e1a2060519370b4b6361ea7daf273 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/interop/js/ESError.ets | arkts | cause | Retrieves the cause of the error from the ESValue.
If the property does not exist, returns undefined. | override get cause(): ESValue | undefined {
return this.err_.hasProperty("cause")
? this.err_.getProperty("cause")
: undefined;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#identifier#Left cause AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#... | override get cause(): ESValue | undefined {
return this.err_.hasProperty("cause")
? this.err_.getProperty("cause")
: undefined;
} | https://gitcode.com/iop123123/arkts-static-skills | bfc54db291cc9c81d6b8c127257d4a96d003d615 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoJsExtensions.ets | arkts | unArchiveFile | 通用解压文件方法 | async unArchiveFile(zipPath: string): Promise<string> {
if (!zipPath) return '';
try {
const fullZipPath = this.resolvePath(zipPath);
const key = this.md5Encode16(zipPath);
const outDir = this.resolvePath(`unzip_${key}`);
// 确保输出目录存在
try {
SafeFileUtils.mkdirS... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left unArchiveFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left zipPath AST#identifier#Right AST#type_annotati... | async unArchiveFile(zipPath: string): Promise<string> {
if (!zipPath) return '';
try {
const fullZipPath = this.resolvePath(zipPath);
const key = this.md5Encode16(zipPath);
const outDir = this.resolvePath(`unzip_${key}`);
// 确保输出目录存在
try {
SafeFileUtils.mkdirS... | https://github.com/DaLongZhuaZi/manxia | 14953dfa073da9377615647e1ec804512a9f3571 | github |
Cool_foolisher1/ArkTSRepository | GraphicalCode/commons/src/main/ets/util/GlobalContextUtil.ets | arkts | getObject | 获取对象
@param key 键
@returns Object | undefined | public getObject(key: string): Object | undefined {
return this._objects.get(key)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ... | public getObject(key: string): Object | undefined {
return this._objects.get(key)
} | https://gitcode.com/Cool_foolisher1/ArkTSRepository | 59e0d604a17f03d51b3107b3794adaf360411144 | gitcode |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets | arkts | constructor | Constructs a new StackOverflowError instance with provided message and error specific information
@param { String | undefined } message - Error text
@param { ErrorOptions | undefined } options - Error options
@syscap SystemCapability.Utils.Lang | constructor(message?: String, options?: ErrorOptions) {
super("StackOverflowError", message, options)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi... | constructor(message?: String, options?: ErrorOptions) {
super("StackOverflowError", message, options)
} | https://gitcode.com/iop123123/arkts-static-skills | f69aa76421d1f493ad3fbcc69cb3263f6152bcff | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | constructor | `Date` constructor.
@param year
@param month
@param day
@param hours
@see ECMA-262, 21.4.2.1
@description Initialize `Date` instance with year, month, day and hours given. | constructor(year: long, month: long, day: long, hours: long) {
this.ms = ecmaMakeDate(ecmaMakeDay(year, month, day), ecmaMakeTime(hours, 0 as long, 0 as long, 0 as long))
this.TZOffset = Date.getLocalTimezoneOffset()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left long AST#identifier#Right AST... | constructor(year: long, month: long, day: long, hours: long) {
this.ms = ecmaMakeDate(ecmaMakeDay(year, month, day), ecmaMakeTime(hours, 0 as long, 0 as long, 0 as long))
this.TZOffset = Date.getLocalTimezoneOffset()
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | e5bcfb073ffbadc9a195926309cc0d3859abb7da | gitee |
xblLab/HarmonyProjectTemplate | products/phone/src/main/ets/common/WindowUtils.ets | arkts | onAvoidAreaChange | 窗口避让区域变化监听
@param windowStage | public static onAvoidAreaChange(windowStage: window.WindowStage) {
try {
let windowClass: window.Window = windowStage.getMainWindowSync();
windowClass.on('avoidAreaChange', () => {
WindowUtils.setAvoidArea(windowClass);
});
} catch (e) {
Logger.error(TAG, 'Failed to onAvoidArea... | 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 onAvoidAreaChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifie... | public static onAvoidAreaChange(windowStage: window.WindowStage) {
try {
let windowClass: window.Window = windowStage.getMainWindowSync();
windowClass.on('avoidAreaChange', () => {
WindowUtils.setAvoidArea(windowClass);
});
} catch (e) {
Logger.error(TAG, 'Failed to onAvoidArea... | https://github.com/xblLab/HarmonyProjectTemplate | afe8fadede2e0fcc195fe1d4b7a3a7d80d5c4d31 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | getSourcePinnedList | ==================== 图源置顶管理 ====================
获取置顶图源ID列表 | async getSourcePinnedList(): Promise<number[]> {
try {
const record = await this.getSetting('source:pinned_list');
if (record && record.settingValue) {
const ids = SafeUtils.parseArr(record.settingValue) as number[];
return ids;
}
return [];
} catch (error) {
logg... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getSourcePinnedList 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#... | async getSourcePinnedList(): Promise<number[]> {
try {
const record = await this.getSetting('source:pinned_list');
if (record && record.settingValue) {
const ids = SafeUtils.parseArr(record.settingValue) as number[];
return ids;
}
return [];
} catch (error) {
logg... | https://github.com/DaLongZhuaZi/manxia | cbd41d76c7464ba6e20f2eb56fd0d057c91a6374 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/modules/ModuleContent.ets | arkts | openExternalUrl | Opens an external URL on link actions. Preference order:
1. Integrator-supplied opener (`setExternalUrlOpener`), full override.
2. SDK-default: launch a `viewData` intent against the UIAbility
context the integrator passed to `CountlyConfig`. Works without
any extra wiring in the typical case. | private openExternalUrl(url: string): void {
const opener = this.externalUrlOpener;
if (opener !== null) {
try { opener(url); }
catch (err) { this.config.logger.e(`[ModuleContent] externalUrlOpener threw: ${err}`); }
return;
}
Utils.openExternalUrlViaContext(this.config.context, url,... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left openExternalUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | private openExternalUrl(url: string): void {
const opener = this.externalUrlOpener;
if (opener !== null) {
try { opener(url); }
catch (err) { this.config.logger.e(`[ModuleContent] externalUrlOpener threw: ${err}`); }
return;
}
Utils.openExternalUrlViaContext(this.config.context, url,... | https://github.com/Countly/countly-sdk-hos | c4ec742a9b687780991fc457e3c6fdbcb07d5a19 | github |
openharmony/codelabs | Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets | arkts | deviceStateChangeActionOffline | Device offline.
@param device Information about offline devices. | deviceStateChangeActionOffline(device: deviceManager.DeviceInfo): void {
let list: deviceManager.DeviceInfo[] = [];
for (let i: number = 0; i < this.trustedDeviceList.length; i++) {
if (this.trustedDeviceList[i].networkId !== device.networkId) {
list.push(this.trustedDeviceList[i]);
cont... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deviceStateChangeActionOffline AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left device AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#L... | deviceStateChangeActionOffline(device: deviceManager.DeviceInfo): void {
let list: deviceManager.DeviceInfo[] = [];
for (let i: number = 0; i < this.trustedDeviceList.length; i++) {
if (this.trustedDeviceList[i].networkId !== device.networkId) {
list.push(this.trustedDeviceList[i]);
cont... | https://gitee.com/openharmony/codelabs.git | 5b6be0461b961aca4193ba5972b0a8214015260b | gitee |
openharmony/applications_permission_manager | permissionmanager/src/main/ets/ServiceExtAbility/GrantDialogModel.ets | arkts | terminateWithResult | 销毁模态窗口
@param context ServiceExtensionContext
@param win 窗口对象
@param callerAppInfo 调用方信息
return | public async terminateWithResult(
context: common.ServiceExtensionContext, win: window.Window, callerAppInfo: CallerAppInfo
): Promise<void> {
Log.info(`Perms: ${JSON.stringify(callerAppInfo.reqPerms)}, result: ${JSON.stringify(callerAppInfo.grantResult)}.`);
let option = new rpc.MessageOption();
le... | 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 terminateWithResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#L... | public async terminateWithResult(
context: common.ServiceExtensionContext, win: window.Window, callerAppInfo: CallerAppInfo
): Promise<void> {
Log.info(`Perms: ${JSON.stringify(callerAppInfo.reqPerms)}, result: ${JSON.stringify(callerAppInfo.grantResult)}.`);
let option = new rpc.MessageOption();
le... | https://gitee.com/openharmony/applications_permission_manager.git | 7e2a94b0255bd6d613d7f1da3bbe6252d83341a8 | gitee |
CPF-ApplicationTPC/openharmony_tpc_samples | SwipeMenuListView/entry/src/main/ets/pages/ComprehensiveDemo.ets | arkts | constructor | 内部更新时间戳,用于触发ForEach刷新 | constructor(data: ContactInfoData) {
this.id = data.id;
this.name = data.name;
this.phone = data.phone;
this.email = data.email;
this.avatar = data.avatar;
this.isVip = data.isVip;
this.isOnline = data.isOnline;
this.lastMessage = data.lastMessage;
this.messageTime = data.messageTi... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ContactInfoData AST#identifie... | constructor(data: ContactInfoData) {
this.id = data.id;
this.name = data.name;
this.phone = data.phone;
this.email = data.email;
this.avatar = data.avatar;
this.isVip = data.isVip;
this.isOnline = data.isOnline;
this.lastMessage = data.lastMessage;
this.messageTime = data.messageTi... | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | 6390b34c5ee5b0b655aac33a29afa310e33608b9 | gitcode |
wuba/omni-ui | omni_component/src/main/ets/components/popup/OmniPopup.ets | arkts | setAutoDismiss | 全局设置-操作完成后是否自动关闭弹窗,默认true,比如点击ConfirmPopup的确认按钮,默认自动关闭;如果为false,则不会关闭
@param autoDismiss | static setAutoDismiss(autoDismiss: boolean) {
Config.popupConfig.autoDismiss = autoDismiss
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setAutoDismiss AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left autoDismiss AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#b... | static setAutoDismiss(autoDismiss: boolean) {
Config.popupConfig.autoDismiss = autoDismiss
} | https://github.com/wuba/omni-ui | 168aea80e7ee8b632a15eaf65cd216e7f913377f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Download/DownloadManager.ets | arkts | convertTaskStatusToDownloadStatus | 转换任务状态到数据库状态 | private convertTaskStatusToDownloadStatus(status: TaskStatus): DownloadStatus {
switch (status) {
case TaskStatus.PENDING:
return DownloadStatus.PENDING;
case TaskStatus.DOWNLOADING:
return DownloadStatus.DOWNLOADING;
case TaskStatus.PAUSED:
return DownloadStatus.PAUSED;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertTaskStatusToDownloadStatus AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left status AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Rig... | private convertTaskStatusToDownloadStatus(status: TaskStatus): DownloadStatus {
switch (status) {
case TaskStatus.PENDING:
return DownloadStatus.PENDING;
case TaskStatus.DOWNLOADING:
return DownloadStatus.DOWNLOADING;
case TaskStatus.PAUSED:
return DownloadStatus.PAUSED;
... | https://github.com/DaLongZhuaZi/manxia | 565fa6f912cf21d6fcf0b16cc1fd4950f035956d | github |
tdcare/tdwebrtc | src/main/ets/VideoDecoderH264.ets | arkts | renderToSurface | 手动触发渲染(H264 不需要,此方法仅为了保持接口一致性)
H264 硬件解码器解码后直接输出到 Surface,不需要手动渲染。
此方法始终返回 false,仅为了保持与 VideoDecoderVP8 接口一致。 | public renderToSurface(): boolean {
// H264 硬件解码器不需要手动渲染,解码即自动输出到 Surface
LogUtil.debug('[VideoDecoderH264] renderToSurface() 被调用,但 H264 硬件解码不需要手动渲染');
return false;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left renderToSurface 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 A... | public renderToSurface(): boolean {
// H264 硬件解码器不需要手动渲染,解码即自动输出到 Surface
LogUtil.debug('[VideoDecoderH264] renderToSurface() 被调用,但 H264 硬件解码不需要手动渲染');
return false;
} | https://github.com/tdcare/tdwebrtc | a037270b8026e63aa158cb4b12b4021cf03fd432 | github |
honjow/Next2V | shared/src/main/ets/settings/AccountMetaPublisher.ets | arkts | cookieHash | Cheap FNV-1a fingerprint of the cookie (length + hash). Identifies WHICH account the holder describes
without ever storing the raw cookie. | private static cookieHash(cookie: string): string {
const clean = (cookie || '').trim()
if (!clean) {
return ''
}
let hash = 2166136261
for (let i = 0; i < clean.length; i += 1) {
hash ^= clean.charCodeAt(i)
hash = Math.imul(hash, 16777619) >>> 0
}
return `${clean.length}... | 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 cookieHash AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cookie AST#identifier#Right AST#:#Left : ... | private static cookieHash(cookie: string): string {
const clean = (cookie || '').trim()
if (!clean) {
return ''
}
let hash = 2166136261
for (let i = 0; i < clean.length; i += 1) {
hash ^= clean.charCodeAt(i)
hash = Math.imul(hash, 16777619) >>> 0
}
return `${clean.length}... | https://github.com/honjow/Next2V | 8175fba3f9dd3b6de60a7e0a5fbc5376a12beb57 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/usbdriver/AbstractController.ets | arkts | markInitializing | 将状态标记为 Initializing(由 start() 调用) | protected markInitializing(): void {
this.controllerState = ControllerState.Initializing;
} | AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left markInitializing 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 ... | protected markInitializing(): void {
this.controllerState = ControllerState.Initializing;
} | https://github.com/AlkaidLab/moonlight-harmony | bb04bdc2f94a88681803ef487683fa8b7585b9c8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | getTextPrimaryColor | 获取主要文字颜色 | public getTextPrimaryColor(): string {
return AppColors.textPrimary;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getTextPrimaryColor 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... | public getTextPrimaryColor(): string {
return AppColors.textPrimary;
} | https://github.com/DaLongZhuaZi/manxia | c4444e2b9c5ad57e21b32f0b8f77ec80bdf1e646 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/I18nManager.ets | arkts | setContext | 延迟设置 context(适用于页面组件中补充初始化) | setContext(context: Context): void {
if (!this.resMgr) {
this.resMgr = context.resourceManager;
this.rebuildOverride();
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Context AST#identifier#Right AST#)#Left ) ... | setContext(context: Context): void {
if (!this.resMgr) {
this.resMgr = context.resourceManager;
this.rebuildOverride();
}
} | https://github.com/richshaw2015/nds | 59ba4d3339510ddba6c6de88d028f1045c610482 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/ThemeManager.ets | arkts | notifyListeners | 通知所有主题变更监听器
私有方法,在主题变更时调用 | private notifyListeners(): void {
const currentTheme = this.getCurrentTheme();
const listenerCount = this.listeners.size;
if (listenerCount === 0) {
console.info(`${TAG} No listeners to notify`);
return;
}
console.info(`${TAG} Notifying ${listenerCount} listener(s)`);
this.liste... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyListeners AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#... | private notifyListeners(): void {
const currentTheme = this.getCurrentTheme();
const listenerCount = this.listeners.size;
if (listenerCount === 0) {
console.info(`${TAG} No listeners to notify`);
return;
}
console.info(`${TAG} Notifying ${listenerCount} listener(s)`);
this.liste... | https://github.com/richshaw2015/nds | 9e05a783a7ef03c43ac2629aa52d765151b5fc5a | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets | arkts | acosh | Return a new Decimal whose value is the inverse of the hyperbolic cosine of `n`, rounded to
`precision` significant digits using rounding mode `rounding`.
@param { Value } n {double | string | Decimal}
@returns { Decimal } the Decimal type
@throws { BusinessError } 10200060 - Precision limit exceeded. | static acosh(n: Value): Decimal {
return new Decimal(n).acosh();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left acosh AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left n AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | static acosh(n: Value): Decimal {
return new Decimal(n).acosh();
} | https://gitcode.com/iop123123/arkts-static-skills | bc4868451f92177632f6ee3fd34f0d7f5ed8cf06 | gitcode |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/services/auth/AuthService.ets | arkts | validateSession | 验证当前会话是否有效(数据库中用户仍存在) | static async validateSession(): Promise<boolean> {
const userId = AppStorage.get<string>(AppStorageKeys.CURRENT_USER_ID) || ''
if (userId.length === 0) {
return false
}
try {
const user = await UserDao.findById(userId)
if (user === null) {
return false
}
// 检查加密服务... | 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 validateSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#... | static async validateSession(): Promise<boolean> {
const userId = AppStorage.get<string>(AppStorageKeys.CURRENT_USER_ID) || ''
if (userId.length === 0) {
return false
}
try {
const user = await UserDao.findById(userId)
if (user === null) {
return false
}
// 检查加密服务... | https://github.com/encorexin/WordPressCMS | 66191dccf5818381bbb779dde385ca1f63de2f60 | github |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/GoodsRepository.ets | arkts | getGoodsTypeList | 查询商品分类列表
@returns 商品分类列表 | async getGoodsTypeList(): Promise<NetworkResponse<Category[]>> {
return this.networkDataSource.getGoodsTypeList();
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getGoodsTypeList AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#gen... | async getGoodsTypeList(): Promise<NetworkResponse<Category[]>> {
return this.networkDataSource.getGoodsTypeList();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 82396de3387789b5a6675c0470a4ca8f1b04cec9 | github |
751496032/ZRouter | RouterApi/src/main/ets/api/RouterMgr.ets | arkts | clear | 清空页面栈,返回Navigation 根视图 | public clear(animated: boolean = true) {
if (!this.hideNavbar) {
this.getNavStack().clear(animated)
} else {
const indexes: number[] = this.getIndexesExceptBottom()
this.getNavStack().removeByIndexes(indexes)
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left clear AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left animated AST#identifier#Right AST#:#Left : ... | public clear(animated: boolean = true) {
if (!this.hideNavbar) {
this.getNavStack().clear(animated)
} else {
const indexes: number[] = this.getIndexesExceptBottom()
this.getNavStack().removeByIndexes(indexes)
}
} | https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/RouterMgr.ets#L610-L617 | d2a382a0671aec55166281ce7c265762713a2451 | github |
IoTAccessControl/ArkTSAnalysis | TestApps/Pedometer/entry/src/main/ets/common/utils/StepsUtil.ets | arkts | getStorageValue | Get preferences value.
@param {number} setSteps
@param {Function} callback | async getStorageValue(key: string): Promise<string> {
let ret: preferences.ValueType = '';
const preferences: preferences.Preferences | undefined = await GlobalContext.getContext()
.getObject('getStepsPreferences');
if (preferences) {
ret = await preferences?.get(key, ret);
}
return St... | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getStorageValue AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left key AST#identifier#Right AST#type_annotation#Left AST#... | async getStorageValue(key: string): Promise<string> {
let ret: preferences.ValueType = '';
const preferences: preferences.Preferences | undefined = await GlobalContext.getContext()
.getObject('getStepsPreferences');
if (preferences) {
ret = await preferences?.get(key, ret);
}
return St... | https://github.com/IoTAccessControl/ArkTSAnalysis | 612be5ee1493882a9ce6963f8b4364368564db68 | github |
wuba/omni-ui | omni_component/src/main/ets/components/step/OmniSteps.ets | arkts | _getLineColor | 获取画线的颜色 | _getLineColor(index: number, isLeft: boolean): ResourceColor {
if (index < this.config.currentIndex) {
return this.horizontalStepsStyle.activatedLineColor
} else if (index === this.config.currentIndex && isLeft) {
return this.horizontalStepsStyle.activatedLineColor
}
return this.horizontal... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left _getLineColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , ... | _getLineColor(index: number, isLeft: boolean): ResourceColor {
if (index < this.config.currentIndex) {
return this.horizontalStepsStyle.activatedLineColor
} else if (index === this.config.currentIndex && isLeft) {
return this.horizontalStepsStyle.activatedLineColor
}
return this.horizontal... | https://github.com/wuba/omni-ui | 718956fbf17bcef083881dbafc370bc1bba9fc1e | github |
openharmony/codelabs | ETSUI/MemoTime/entry/src/main/ets/service/DataService.ets | arkts | getPendingReminders | 获取所有未触发的提醒 | async getPendingReminders(): Promise<Reminder[]> {
if (!this.rdbStore) {
return []
}
try {
const predicates = new relationalStore.RdbPredicates(AppConstants.TABLE_REMINDER)
predicates.equalTo('isTriggered', 0)
predicates.orderByAsc('triggerTime')
const resultSet = await this... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getPendingReminders AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#... | async getPendingReminders(): Promise<Reminder[]> {
if (!this.rdbStore) {
return []
}
try {
const predicates = new relationalStore.RdbPredicates(AppConstants.TABLE_REMINDER)
predicates.equalTo('isTriggered', 0)
predicates.orderByAsc('triggerTime')
const resultSet = await this... | https://gitcode.com/openharmony/codelabs | 893bd5b615db12169f6877007a1c635210f21367 | gitcode |
Nekofox-POT/LinMusic | entry/src/main/ets/建筑垃圾堆/Index_old.ets | arkts | onBackPress | 返回操作 // | onBackPress(): boolean {
// ---- 在这里执行你指定的任务 ----
emitter.emit({ eventId: 912 })
// --------------------------------
// 返回 true:表示消费掉该返回事件,原生页面不退出,Web也不后退
// 返回 false:表示放行,原生执行默认的退出页面动作
return true
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackPress 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... | onBackPress(): boolean {
// ---- 在这里执行你指定的任务 ----
emitter.emit({ eventId: 912 })
// --------------------------------
// 返回 true:表示消费掉该返回事件,原生页面不退出,Web也不后退
// 返回 false:表示放行,原生执行默认的退出页面动作
return true
} | https://github.com/Nekofox-POT/LinMusic | 6a268ffbe4489981cbf53d2f29c15289736ab078 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Error.ets | arkts | cause | Sets the cause of the error.
@param { Object | undefined } val - New cause for the Error
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | set cause(val: Object | undefined) {
this.cause_ = val
} | AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left cause AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left val AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifie... | set cause(val: Object | undefined) {
this.cause_ = val
} | https://gitcode.com/iop123123/arkts-static-skills | 3c9559fad1ebcbfb647c349ea3fb33f08b823426 | gitcode |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | subarray | Creates a Uint8ClampedArray with the same underlying ArrayBuffer
@param begin start index, inclusive
@param end last index, exclusive
@returns new Uint8ClampedArray with the same underlying ArrayBuffer | public subarray(begin: number, end: number): Uint8ClampedArray {
return this.subarray(begin as int, end as int)
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left subarray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left begin AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number... | public subarray(begin: number, end: number): Uint8ClampedArray {
return this.subarray(begin as int, end as int)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 201c84a418fd22a79b6d1ae8937828373da3059e | gitee |
xiaofenger_705/protobuf-arkts-generator | runtime/arkpb/Writer.ets | arkts | finish | Finalize and get the composed buffer | finish(): Uint8Array { return Uint8Array.from(this.b) } | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left finish 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 Uint8Array AST#identifier#Right AST#ERROR#Right AST#sta... | finish(): Uint8Array { return Uint8Array.from(this.b) } | https://gitcode.com/xiaofenger_705/protobuf-arkts-generator | 59ac601bf0014258589fb286a6f1e349317a957c | gitcode |
David8Idira/AI-OA | packages/harmonyos/commons/src/main/ets/services/AttendanceService.ets | arkts | checkIn | ============ 打卡相关 ============
打卡
@param data 打卡数据 | async checkIn(data: {
type: 'check_in' | 'check_out'
latitude: number
longitude: number
location: string
wifiName?: string
photoBase64?: string
remark?: string
}): Promise<ApiResponse<CheckInResult>> {
return this.client.post<CheckInResult>('/api/v1/attendance/checkin', data)
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left checkIn AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#R... | async checkIn(data: {
type: 'check_in' | 'check_out'
latitude: number
longitude: number
location: string
wifiName?: string
photoBase64?: string
remark?: string
}): Promise<ApiResponse<CheckInResult>> {
return this.client.post<CheckInResult>('/api/v1/attendance/checkin', data)
} | https://github.com/David8Idira/AI-OA | 292b3db32983aecaee09a662945407492e95c612 | github |
Joker-x-dev/CoolMallArkTS | core/network/src/main/ets/datasource/auth/AuthNetworkDataSourceImpl.ets | arkts | loginByWxApp | 微信 APP 授权登录
@param {Record<string, string>} params - 微信授权参数
@returns {Promise<NetworkResponse<Auth>>} 登录结果 | async loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>> {
const response: AxiosResponse<NetworkResponse<Auth>> =
await NetworkClient.http.post("user/login/wxApp", params);
return response.data;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loginByWxApp AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : ... | async loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>> {
const response: AxiosResponse<NetworkResponse<Auth>> =
await NetworkClient.http.post("user/login/wxApp", params);
return response.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS | e59576dbdcd199924465af1ca522a5447bb51f22 | github |
HarmonyOS_Samples/MusicHome | products/tv/src/main/ets/tvbackupability/TvBackupAbility.ets | arkts | onRestore | Invoked when restoring from backup on TV.
@param bundleVersion Bundle version metadata from the system. | async onRestore(bundleVersion: BundleVersion) {
Logger.info(`TvBackupAbility: onRestore ok ${JSON.stringify(bundleVersion)}`);
await Promise.resolve();
} | AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left onRestore AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left bundleVersion AST#identifier#Right AST#type_annotation#Left ... | async onRestore(bundleVersion: BundleVersion) {
Logger.info(`TvBackupAbility: onRestore ok ${JSON.stringify(bundleVersion)}`);
await Promise.resolve();
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | 7707a9b3e2ed7d9217259ac6f02239df2c506beb | gitcode |
HarmonyOS_Samples/guide-snippets | ArkGraphics3D/entry/src/main/ets/material/pbr_specular.ets | arkts | setSpecularChannel | Adjust the individual RGB channels of the specular color | setSpecularChannel(idx: number, v: number) {
if (this.material) {
const f: Vec4 = (this.material as MetallicRoughnessMaterial).specular.factor;
if (idx === 0) {
f.x = GAIN * v / RESO;
this.x = f.x;
}
if (idx === 1) {
f.y = GAIN * v / RESO;
this.y = f.y;
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setSpecularChannel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left idx AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#R... | setSpecularChannel(idx: number, v: number) {
if (this.material) {
const f: Vec4 = (this.material as MetallicRoughnessMaterial).specular.factor;
if (idx === 0) {
f.x = GAIN * v / RESO;
this.x = f.x;
}
if (idx === 1) {
f.y = GAIN * v / RESO;
this.y = f.y;
... | https://gitcode.com/HarmonyOS_Samples/guide-snippets | 99fea0fd72e76687be20543cd77af48f68703937 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/mapping/EntityData.ets | arkts | isRelatedArray | 检查关联数据是否为数组类型
@param propertyName 关联属性名
@returns 是否为数组类型,如果不存在返回 false | isRelatedArray(propertyName: string): boolean {
const value = this.relatedData.get(propertyName)
if (value) {
return value.isArray
}
return false
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isRelatedArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) ... | isRelatedArray(propertyName: string): boolean {
const value = this.relatedData.get(propertyName)
if (value) {
return value.isArray
}
return false
} | https://github.com/offlinecat-dev/OCNetORM | 1676dbe315e65544dc6c5cbef7fe1e79177bce67 | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/ResourceManager.ets | arkts | getString | 获取字符串
@param resource
@returns | public getString(resource: Resource | number | string, ...args: Array<string | number>): string {
if (typeof resource === 'string') {
return resource;
}
if (!this.context) {
return '';
}
try {
if (typeof resource === 'number') {
return this.context.resourceManager.getStri... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resource AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#... | public getString(resource: Resource | number | string, ...args: Array<string | number>): string {
if (typeof resource === 'string') {
return resource;
}
if (!this.context) {
return '';
}
try {
if (typeof resource === 'number') {
return this.context.resourceManager.getStri... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ResourceManager.ets#L38-L54 | a81c3b6f02d8e35a7e2fa05a00ba9384a6b52756 | github |
HarmonyOS_Samples/HarmonyOSComponentUXExamples | commons/componentuxexamplesbase/src/main/ets/utils/ComponentDataUtil.ets | arkts | loadComponentData | Loads component configuration data from a JSON file in rawfile resources.
This method reads the specified JSON file, parses it, and converts
string references to Resource objects. The resulting data can be used
directly in UI components.
@param context - UIAbilityContext for accessing resource manager
@param jsonFileNa... | public static loadComponentData(context: common.UIAbilityContext, jsonFileName: string): ComponentGroup[] {
try {
const resMgr = context.resourceManager;
const fileData = resMgr.getRawFileContentSync(jsonFileName);
const decoder = util.TextDecoder.create('utf-8', { ignoreBOM: true });
cons... | 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 loadComponentData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Le... | public static loadComponentData(context: common.UIAbilityContext, jsonFileName: string): ComponentGroup[] {
try {
const resMgr = context.resourceManager;
const fileData = resMgr.getRawFileContentSync(jsonFileName);
const decoder = util.TextDecoder.create('utf-8', { ignoreBOM: true });
cons... | https://gitcode.com/HarmonyOS_Samples/HarmonyOSComponentUXExamples | 452d0afb53bf3fe9611874a27a6cc115035e0ea9 | gitcode |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/CryptoUtils.ets | arkts | getGenerateProperties | 生成RSA加密密钥
@returns | private static getGenerateProperties(): huks.HuksOptions {
const properties: huks.HuksOptions = {
properties: [
{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES },
{ tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 },
{ tag... | 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 getGenerateProperties AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#... | private static getGenerateProperties(): huks.HuksOptions {
const properties: huks.HuksOptions = {
properties: [
{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES },
{ tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 },
{ tag... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/CryptoUtils.ets#L22-L31 | 5012f622ddaacb3ca4e340f6ad5303e548cb1c62 | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/utils/PlaySpeedManager.ets | arkts | initPlaySpeed | 初始化播放速度 | initPlaySpeed() {
try {
const currentSpeed = this.getCurrentSpeed()
AppStorage.setOrCreate('preferred_play_speed', currentSpeed)
console.log('初始化播放速度:', currentSpeed)
} catch (error) {
console.error('初始化播放速度失败:', error)
AppStorage.setOrCreate('preferred_play_speed', PlaySpeedMana... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left initPlaySpeed 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... | initPlaySpeed() {
try {
const currentSpeed = this.getCurrentSpeed()
AppStorage.setOrCreate('preferred_play_speed', currentSpeed)
console.log('初始化播放速度:', currentSpeed)
} catch (error) {
console.error('初始化播放速度失败:', error)
AppStorage.setOrCreate('preferred_play_speed', PlaySpeedMana... | https://github.com/SMAT-Lab/PhantomRendering | 0c4e5e63ff0f471614f4fa543502a168e62faaee | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/OCRRecognition.ets | arkts | calculateOverallConfidence | 计算总体置信度 | private static calculateOverallConfidence(data: StructuredReceiptData): number {
const amountWeight = 0.4;
const dateWeight = 0.3;
const merchantWeight = 0.3;
return (
data.totalAmount.confidence * amountWeight +
data.transactionDate.confidence * dateWeight +
data.merchantName.confi... | 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 calculateOverallConfidence AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right... | private static calculateOverallConfidence(data: StructuredReceiptData): number {
const amountWeight = 0.4;
const dateWeight = 0.3;
const merchantWeight = 0.3;
return (
data.totalAmount.confidence * amountWeight +
data.transactionDate.confidence * dateWeight +
data.merchantName.confi... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 1a7987dba97ae45007e51623db0f090d8cd5cf82 | github |
offlinecat-dev/OCNetORM | example/repository/UserRepository.ets | arkts | createUsersInTransaction | 事务操作示例
@param users 用户数据数组
@returns 事务结果 | async createUsersInTransaction(users: Array<UserCreateParams>): Promise<TransactionResult> {
return await this.repository.transaction(async () => {
for (const user of users) {
const result = await this.createUser(user.username, user.email)
if (!result.success) {
throw new Error(`创建... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createUsersInTransaction AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left users AST#identifier#Right AST#type_annotation#Left AS... | async createUsersInTransaction(users: Array<UserCreateParams>): Promise<TransactionResult> {
return await this.repository.transaction(async () => {
for (const user of users) {
const result = await this.createUser(user.username, user.email)
if (!result.success) {
throw new Error(`创建... | https://github.com/offlinecat-dev/OCNetORM | 9043dc24f3e8aea9eace247f7f843fe7e477838b | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | constructor | `Date` constructor.
@param d
@see ECMA-262, 21.4.2.1
@description Initializes `Date` instance with another `Date` instance. | constructor(d: Date) throws {
this.ms = d.valueOf();
this.TZOffset = Date.getLocalTimezoneOffset()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left d AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Date AST#identifier#Right AST#)#Left ) AST#)#Ri... | constructor(d: Date) throws {
this.ms = d.valueOf();
this.TZOffset = Date.getLocalTimezoneOffset()
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 809c4308212b43cc66b55d80dce800de99dcb131 | gitee |
somnio-software/my-bot-pal | entry/src/main/ets/utils/PermissionUtils.ets | arkts | checkMultiplePermissions | Checks multiple permissions and returns a map with the results
@param permissions - List of permissions to check
@param context - The application context
@returns A map where the keys are the permissions and the values indicate if they are granted | public async checkMultiplePermissions(permissions: Permissions[], context: Context): Promise<Map<Permissions, boolean>> {
const results = new Map<Permissions, boolean>();
for (const permission of permissions) {
results.set(permission, await this.checkPermissionGrant(permission, context));
}
... | 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 checkMultiplePermissions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left permissions AST#identifier#Righ... | public async checkMultiplePermissions(permissions: Permissions[], context: Context): Promise<Map<Permissions, boolean>> {
const results = new Map<Permissions, boolean>();
for (const permission of permissions) {
results.set(permission, await this.checkPermissionGrant(permission, context));
}
... | https://github.com/somnio-software/my-bot-pal | 15eb80e1ff1d898764afa7e5d61c0eb5086918fa | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/WebUploadServer.ets | arkts | sendErrorResponse | 发送错误响应 | private sendErrorResponse(connection: socket.TCPSocketConnection, code: number, message: string): void {
const body = `<html><body><h1>${code} ${message}</h1></body></html>`;
const bodyBytes = this.stringToArrayBuffer(body);
const headers = `HTTP/1.1 ${code} ${message}\r\nContent-Type: text/html; charset=... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left sendErrorResponse AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left connection AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Righ... | private sendErrorResponse(connection: socket.TCPSocketConnection, code: number, message: string): void {
const body = `<html><body><h1>${code} ${message}</h1></body></html>`;
const bodyBytes = this.stringToArrayBuffer(body);
const headers = `HTTP/1.1 ${code} ${message}\r\nContent-Type: text/html; charset=... | https://github.com/richshaw2015/nds | a33a311de6dde5a5cd7cc5baf2cfcdf13d29b3d2 | github |
offlinecat-dev/OCNetORM | src/main/ets/core/EntityMetadata.ets | arkts | hasPrimaryKey | 检查是否有主键
@returns 是否有主键 | hasPrimaryKey(): boolean {
return this.getPrimaryKeyColumn() !== null
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasPrimaryKey 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... | hasPrimaryKey(): boolean {
return this.getPrimaryKeyColumn() !== null
} | https://github.com/offlinecat-dev/OCNetORM | 61ea6d2ce0eb604167a76045388c2528e217a4f1 | github |
richshaw2015/nds | ohos/entry/src/main/ets/types/MelonDSNative.ets | arkts | setupAchievements | ============================================================================
RetroAchievements
============================================================================ | static setupAchievements(achievements: Array<RANativeAchievement>,
leaderboards: Array<RANativeLeaderboard>, richPresenceScript?: string): boolean {
return MelonDSNative.native.setupAchievements(achievements, leaderboards, richPresenceScript);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setupAchievements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left achievements AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#... | static setupAchievements(achievements: Array<RANativeAchievement>,
leaderboards: Array<RANativeLeaderboard>, richPresenceScript?: string): boolean {
return MelonDSNative.native.setupAchievements(achievements, leaderboards, richPresenceScript);
} | https://github.com/richshaw2015/nds | 5b3a2778de3c7299f803684c9e03d2419a2e85b9 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/medicalimaging/ImagePreprocessor.ets | arkts | calculateScaleRatio | 计算缩放比例
保持宽高比缩放到目标尺寸内
@param originalWidth 原始宽度
@param originalHeight 原始高度
@param targetWidth 目标宽度
@param targetHeight 目标高度
@returns 缩放比例 | calculateScaleRatio(
originalWidth: number,
originalHeight: number,
targetWidth: number,
targetHeight: number
): number {
const scaleX = targetWidth / originalWidth;
const scaleY = targetHeight / originalHeight;
// 取较小的缩放比例,保持宽高比
return Math.min(scaleX, scaleY);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateScaleRatio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left originalWidth AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#L... | calculateScaleRatio(
originalWidth: number,
originalHeight: number,
targetWidth: number,
targetHeight: number
): number {
const scaleX = targetWidth / originalWidth;
const scaleY = targetHeight / originalHeight;
// 取较小的缩放比例,保持宽高比
return Math.min(scaleX, scaleY);
} | https://github.com/LJ666-ui/harmony-health-care | 193f2b36d10da19eff4e93cd6f7c71be8e5a42db | github |
robotzzh/AgricultureApp | entry/src/main/ets/models/StringUtils.ets | arkts | string2Uint8Array1 | string转Uint8Array
@param value
@returns | string2Uint8Array1(value: string): Uint8Array {
if (!value) return null;
//
let textEncoder = new util.TextEncoder();
//获取点流并发出 UTF-8 字节流 TextEncoder 的所有实例仅支持 UTF-8 编码
return textEncoder.encodeInto(value)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left string2Uint8Array1 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#)#Le... | string2Uint8Array1(value: string): Uint8Array {
if (!value) return null;
//
let textEncoder = new util.TextEncoder();
//获取点流并发出 UTF-8 字节流 TextEncoder 的所有实例仅支持 UTF-8 编码
return textEncoder.encodeInto(value)
} | https://github.com/robotzzh/AgricultureApp | 8658c63702602228f6b13f8c30ea465713643c26 | github |
Countly/countly-sdk-hos | library/src/main/ets/api/EventsApi.ets | arkts | recordPastEvent | Record an event that occurred in the past. `timestamp` is a unix time in
milliseconds. Use this when flushing events from an integrator-owned
buffer (e.g. offline queue) so the original wall-clock time is preserved
instead of being replaced with "now". | public async recordPastEvent(
key: string,
segmentation: SegmentationMap | null,
count: number,
sum: number,
dur: number,
timestamp: number
): Promise<void> {
this.logger.i(`[Events] Calling recordPastEvent, key=[${key}] timestamp=[${timestamp}]`);
await this.module.recordPastEvent(k... | 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 recordPastEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AS... | public async recordPastEvent(
key: string,
segmentation: SegmentationMap | null,
count: number,
sum: number,
dur: number,
timestamp: number
): Promise<void> {
this.logger.i(`[Events] Calling recordPastEvent, key=[${key}] timestamp=[${timestamp}]`);
await this.module.recordPastEvent(k... | https://github.com/Countly/countly-sdk-hos | 8cb96a87271e9f8c10f79cf2b0c4a538b7a10f8f | github |
kumaleap/ArkLuban | library/src/main/ets/luban/LubanUtils.ets | arkts | replaceFileExtension | 替换文件扩展名 | static replaceFileExtension(fileName: string, extension: string): string {
const normalizedName = LubanUtils.stripQueryAndFragment(fileName);
const dotIndex = normalizedName.lastIndexOf('.');
if (dotIndex === -1) {
return `${normalizedName}.${extension}`;
}
return `${normalizedName.substri... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left replaceFileExtension AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fileName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#... | static replaceFileExtension(fileName: string, extension: string): string {
const normalizedName = LubanUtils.stripQueryAndFragment(fileName);
const dotIndex = normalizedName.lastIndexOf('.');
if (dotIndex === -1) {
return `${normalizedName}.${extension}`;
}
return `${normalizedName.substri... | https://github.com/kumaleap/ArkLuban | 792959d889a01108addaa11a10c51158fd02aa96 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/BarLineChartBaseModel.ets | arkts | resetTracking | RESET PERFORMANCE TRACKING FIELDS | public resetTracking(): void {
this.totalTime = 0;
this.drawCycles = 0;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetTracking 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 resetTracking(): void {
this.totalTime = 0;
this.drawCycles = 0;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | bc77172ef4feaa03198776223e6375b6e8f30c8d | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/viewmodel/StreamViewModel.ets | arkts | toggleOverlayLayout | 切换覆盖层布局方向 | toggleOverlayLayout(): void {
this.overlayState.config.isVertical = !this.overlayState.config.isVertical;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggleOverlayLayout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen... | toggleOverlayLayout(): void {
this.overlayState.config.isVertical = !this.overlayState.config.isVertical;
} | https://github.com/AlkaidLab/moonlight-harmony | 5d9572020323301dd58331f37950913feea25a85 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/interop/js/JSRuntime.ets | arkts | getPropertyBoolean | ===================
getProperty<TYPE>()
=================== | public static getPropertyBoolean(object: JSValue, name: String): boolean {
JSRuntime.checkIntrinsicMethod();
} | 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 getPropertyBoolean AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left object AST#identifier#Right AST#:#Le... | public static getPropertyBoolean(object: JSValue, name: String): boolean {
JSRuntime.checkIntrinsicMethod();
} | https://gitcode.com/iop123123/arkts-static-skills | 06d530ee6103306686898149ac688df909e5ca4d | gitcode |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/utils/CartManager.ets | arkts | saveCart | Save cart data to persistent storage | private static async saveCart(): Promise<boolean> {
if (!cartPreferences || !currentCartUsername) return false;
// 强制服务器模式:必须服务器确认后才保存本地
if (SERVER_ENABLED) {
const syncResult = await CartManager.syncToServer();
if (!syncResult) {
console.error('CartManager: Server sync failed, no... | 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 saveCart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Ri... | private static async saveCart(): Promise<boolean> {
if (!cartPreferences || !currentCartUsername) return false;
// 强制服务器模式:必须服务器确认后才保存本地
if (SERVER_ENABLED) {
const syncResult = await CartManager.syncToServer();
if (!syncResult) {
console.error('CartManager: Server sync failed, no... | https://github.com/Harrisonls2004/WaterFlow | 31ed7b92d8490f2fcf68f94edda731736802ad0b | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/charts/PieRadarChartBaseModel.ets | arkts | getRawRotationAngle | gets the raw version of the current rotation angle of the pie chart the
returned value could be any value, negative or positive, outside of the
360 degrees. this is used when working with rotation direction, mainly by
gestures and animations.
@return | public getRawRotationAngle(): number {
return this.mRawRotationAngle;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getRawRotationAngle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number... | public getRawRotationAngle(): number {
return this.mRawRotationAngle;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 2e952dbc6b0218450ecd5200ca052e0b75fba0c8 | gitee |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/core/services/CalendarReminderService.ets | arkts | registerPlanReminder | 全量对账入口。
- 只做“补漏”和版本对齐。
- 对已有 reminderId 的记录,不主动 updateEvent。
- 对已经过期的日程,不因为过期自动删除系统日历事件。 | async registerPlanReminder(): Promise<void> {
if (!UserDatabase.getInstance().isReady()) {
return;
}
const switchEnabled = await this.isPlanReminderSwitchEnabled();
if (!switchEnabled) {
await this.cancelPlanReminder();
return;
}
const plans = await this.planRepository.find... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left registerPlanReminder AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation... | async registerPlanReminder(): Promise<void> {
if (!UserDatabase.getInstance().isReady()) {
return;
}
const switchEnabled = await this.isPlanReminderSwitchEnabled();
if (!switchEnabled) {
await this.cancelPlanReminder();
return;
}
const plans = await this.planRepository.find... | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/services/CalendarReminderService.ets#L272-L291 | 3796ce40bfba1f99b40fe230c6934bea73b108ee | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/AutoPageTurnController.ets | arkts | clearTimer | 清除定时器 | private clearTimer(): void {
if (this.timer !== -1) {
clearTimeout(this.timer);
this.timer = -1;
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left clearTimer 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... | private clearTimer(): void {
if (this.timer !== -1) {
clearTimeout(this.timer);
this.timer = -1;
}
} | https://github.com/DaLongZhuaZi/manxia | b1cfea30face4c42749bf0ff82fb1b77e0d2881d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/DuplicateDetection/DuplicateDetectionService.ets | arkts | getCandidatesForType | 从对应 DataManager 查询候选内容 | private async getCandidatesForType(contentType: DuplicateCheckContentType): Promise<DuplicateCandidateItem[]> {
const candidates: DuplicateCandidateItem[] = [];
try {
if (contentType === DuplicateCheckContentType.MANGA) {
const dataManager = DataManager.getInstance();
const comics = awa... | 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 getCandidatesForType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left contentType AST#identifier#Right... | private async getCandidatesForType(contentType: DuplicateCheckContentType): Promise<DuplicateCandidateItem[]> {
const candidates: DuplicateCandidateItem[] = [];
try {
if (contentType === DuplicateCheckContentType.MANGA) {
const dataManager = DataManager.getInstance();
const comics = awa... | https://github.com/DaLongZhuaZi/manxia | fa2b0e12c4e4c3fd50f419c791ee467a14cd0a8f | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/BaseEntry.ets | arkts | getData | Returns the data, additional information that this Entry represents, or
null, if no data has been specified.
@return | public getData(): Object | null {
return this.mData;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#ide... | public getData(): Object | null {
return this.mData;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 8dd90cf103e6613edb8305e683793c9f80117e65 | gitee |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/StyleUtil.ets | arkts | getTitleStyle | 获取标题文本样式 | static getTitleStyle(level: number = 1) {
const theme = ThemeUtil.getCurrentThemeConfig();
const fontSize = theme.fontSize;
let fontSizeValue: number;
switch (level) {
case 1:
fontSizeValue = fontSize.xxl;
break;
case 2:
fontSizeValue = fontSize.xl;
bre... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getTitleStyle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expres... | static getTitleStyle(level: number = 1) {
const theme = ThemeUtil.getCurrentThemeConfig();
const fontSize = theme.fontSize;
let fontSizeValue: number;
switch (level) {
case 1:
fontSizeValue = fontSize.xxl;
break;
case 2:
fontSizeValue = fontSize.xl;
bre... | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 773aa1c829e92bed16f9b75290aa0198c132b20b | github |
Joker-x-dev/CoolMallArkTS | feature/order/src/main/ets/viewmodel/OrderListViewModel.ets | arkts | toOrderCommentForGoods | 跳转到指定商品的订单评价页面
@param {number} goodsId - 商品 ID
@returns {void} 无返回值 | toOrderCommentForGoods(goodsId: number): void {
const order: Order | null = this.commentCurrentOrder;
if (!order || !goodsId) {
return;
}
OrderNavigator.toComment(order.id, goodsId);
this.hideCommentModal();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toOrderCommentForGoods AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left goodsId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left... | toOrderCommentForGoods(goodsId: number): void {
const order: Order | null = this.commentCurrentOrder;
if (!order || !goodsId) {
return;
}
OrderNavigator.toComment(order.id, goodsId);
this.hideCommentModal();
} | https://github.com/Joker-x-dev/CoolMallArkTS | bdcad6d7161fe31edcd7feb01f298d1b42ffe05e | github |
the-wwyang/kids-learning-app | src/main/ets/services/WrongQuestionService.ets | arkts | getQuestionsForReview | 获取需要复习的错题
@param records 所有错题记录
@param count 返回数量
@returns 需要复习的错题列表 | static getQuestionsForReview(
records: WrongQuestionRecord[],
count: number = 10
): WrongQuestionRecord[] {
// 优先选择:
// 1. 未掌握的
// 2. 错误次数多的
// 3. 最近没有复习过的
const unmastered = records.filter(r => !r.isMastered);
// 按优先级排序
unmastered.sort((a, b) => {
// 首先按错误次数降序
if (... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getQuestionsForReview AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscri... | static getQuestionsForReview(
records: WrongQuestionRecord[],
count: number = 10
): WrongQuestionRecord[] {
// 优先选择:
// 1. 未掌握的
// 2. 错误次数多的
// 3. 最近没有复习过的
const unmastered = records.filter(r => !r.isMastered);
// 按优先级排序
unmastered.sort((a, b) => {
// 首先按错误次数降序
if (... | https://github.com/the-wwyang/kids-learning-app | 83bede26e1948d18279be1a26ade01896859f9d0 | github |
openharmony/vendor_unionman | unionpi_tiger/sample_hzu/WEILIAO/entry/src/main/ets/common/database/Rdb.ets | arkts | getRdbStore | 获取RS对象并接受回调函数 | getRdbStore(callback: Function = () => {
}) {
//如果回调函数返回空或undefined,打印错误日志并退出方法
if (!callback || typeof callback == 'undefined' || callback == undefined) {
Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!');
return;
}
if (this.rdbStore != null) {
Logger.... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getRdbStore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier... | getRdbStore(callback: Function = () => {
}) {
//如果回调函数返回空或undefined,打印错误日志并退出方法
if (!callback || typeof callback == 'undefined' || callback == undefined) {
Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!');
return;
}
if (this.rdbStore != null) {
Logger.... | https://gitee.com/openharmony/vendor_unionman.git | d57272cc6c65102e6f228bfc1f9bc25d2185b5e7 | gitee |
Joker-x-dev/CoolMallArkTS | feature/main/src/main/ets/viewmodel/HomeViewModel.ets | arkts | loadHomeData | 加载首页数据
@returns {void} 无返回值 | loadHomeData(): void {
RequestHelper.repository<Home>(this.pageRepository.getHomeData())
.toast(false)
.execute()
.then((data: Home): void => {
const homeData: Home = new Home(data);
this.pageData = new Home(data);
this.listData = homeData.goods ?? [];
this.uiStat... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadHomeData 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... | loadHomeData(): void {
RequestHelper.repository<Home>(this.pageRepository.getHomeData())
.toast(false)
.execute()
.then((data: Home): void => {
const homeData: Home = new Home(data);
this.pageData = new Home(data);
this.listData = homeData.goods ?? [];
this.uiStat... | https://github.com/Joker-x-dev/CoolMallArkTS | 6da66248afa771b4a40ce6d06e9d0b2c8ff8bb78 | github |
openharmony-sig/flutter_packages | packages/pigeon/example/app/ohos/entry/src/main/ets/plugins/Messages.ets | arkts | setup | Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. | static setup(binaryMessenger: BinaryMessenger, api: ExampleHostApi | null): void {
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage", ExampleHostApi.getCodec());
if (... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left setup AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left binaryMessenger AST#identifier#Right AST#:#Left : AST#:#Ri... | static setup(binaryMessenger: BinaryMessenger, api: ExampleHostApi | null): void {
{
let channel: BasicMessageChannel<Object> =
new BasicMessageChannel(
binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage", ExampleHostApi.getCodec());
if (... | https://gitee.com/openharmony-sig/flutter_packages.git | c25e0efa9bddc565aca78704e98a8a0ba0c41d94 | gitee |
honjow/Next2V | feature/feed/src/main/ets/viewmodel/FeedViewModel.ets | arkts | isEmptyResultError | A successful fetch that yielded zero topics (e.g. the daily hot list before
it fills) throws *_TOPICS_EMPTY. That is "empty", not "failed": the feed must
show a clean empty state instead of resurrecting the previous cache, and a
pull-refresh must not toast a failure. | private static isEmptyResultError(error: object): boolean {
if (!isApiError(error)) {
return false
}
const code: ApiErrorCode = (error as ApiError).code
return code === ApiErrorCode.HOT_TOPICS_EMPTY ||
code === ApiErrorCode.RECENT_TOPICS_EMPTY ||
code === ApiErrorCode.TAB_TOPICS_EMPT... | 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 isEmptyResultError AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left error AST#identifier#Right AST#:#... | private static isEmptyResultError(error: object): boolean {
if (!isApiError(error)) {
return false
}
const code: ApiErrorCode = (error as ApiError).code
return code === ApiErrorCode.HOT_TOPICS_EMPTY ||
code === ApiErrorCode.RECENT_TOPICS_EMPTY ||
code === ApiErrorCode.TAB_TOPICS_EMPT... | https://github.com/honjow/Next2V | d1d4783ece73836f3d0f85d0cc455220fdbcc8d8 | github |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/calculator/UnitSunshineCalculator.ets | arkts | calculateUnitPosition | 计算单元的3D位置 | private calculateUnitPosition(
building: BuildingModel,
floor: number,
unitIndex: number
): Point3D {
const unitWidth = building.width / building.units;
const position: Point3D = {
x: building.x + unitIndex * unitWidth + unitWidth / 2,
y: building.y + building.length / 2,
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left calculateUnitPosition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left building AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ide... | private calculateUnitPosition(
building: BuildingModel,
floor: number,
unitIndex: number
): Point3D {
const unitWidth = building.width / building.units;
const position: Point3D = {
x: building.x + unitIndex * unitWidth + unitWidth / 2,
y: building.y + building.length / 2,
... | https://github.com/qiuhaotc/Sunshine_HarmonyOS | c3d33c83d67e2a3678c46abc72dceb2453e242d3 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.HashMap.ets | arkts | values | Returns elements from the HashMap as an values Iterator
@returns ValueIterator with hash map values | values(): IterableIterator<V> {
return this.buckets.values();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left values AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#... | values(): IterableIterator<V> {
return this.buckets.values();
} | https://gitcode.com/iop123123/arkts-static-skills | 1636e36fce189ba06af05fe2366edba44582f109 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelLoginManager.ets | arkts | getSourceVariable | 获取书源变量(对应Legado的source.getVariable) | getSourceVariable(sourceId: string): string {
return this.sourceVariableStore.get(sourceId) || '';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSourceVariable AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left sourceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) A... | getSourceVariable(sourceId: string): string {
return this.sourceVariableStore.get(sourceId) || '';
} | https://github.com/DaLongZhuaZi/manxia | d6bb3228671add2e1f47bad02179eaac318c3424 | github |
harmonyos/codelabs | FlexLayout/entry/src/main/ets/viewmodel/SearchViewModel.ets | arkts | getSearchArrData | Get search arr data. | getSearchArrData() {
let listItems: Array<string> = [
'Text', 'Button', 'TextField', 'Image',
'Switch', 'Checkbox', 'RadioButton',
'ProgressBar', 'ScrollView'
];
return listItems;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getSearchArrData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#L... | getSearchArrData() {
let listItems: Array<string> = [
'Text', 'Button', 'TextField', 'Image',
'Switch', 'Checkbox', 'RadioButton',
'ProgressBar', 'ScrollView'
];
return listItems;
} | https://gitee.com/harmonyos/codelabs.git | 401e077b97158626a94a0ea8d9496bd9e2681135 | gitee |
openharmony-sig/ohos-beacon-library | library/src/main/ets/components/beacon/logging/LogManager.ets | arkts | e | Send a error log message to the logger.
@param message The message you would like logged. This message may contain string formatting
which will be replaced with values from args.
@param args Arguments for string formatting. | public static e(message: string, ...args: Object[]): void {
LogManager.sLogger.e(message, args);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left e AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right ... | public static e(message: string, ...args: Object[]): void {
LogManager.sLogger.e(message, args);
} | https://gitee.com/openharmony-sig/ohos-beacon-library.git | f9fefa13523e048d4929cf9644357c14c8f21761 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/libs/htmlparser/HTMLElement.ets | arkts | getAttribute | 获取属性值 | getAttribute(name: string): string | undefined {
return this._attrs.get(name);
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getAttribute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left s... | getAttribute(name: string): string | undefined {
return this._attrs.get(name);
} | https://github.com/DaLongZhuaZi/manxia | 17084f93ce0f44567a34cb2e50d5ca6507f08647 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsCategoryViewModel.ets | arkts | convertToTree | 将分类列表转换为分类树
@param {Category[]} categories - 原始分类列表
@returns {CategoryTree[]} 分类树 | private convertToTree(categories: Category[]): CategoryTree[] {
return CategoryTree.buildTree(categories);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left convertToTree AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left categories AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Category ... | private convertToTree(categories: Category[]): CategoryTree[] {
return CategoryTree.buildTree(categories);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 9c67a1d77212d7bed86d9ffc7a779dd82ee81ade | github |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/CalendarPage.ets | arkts | isToday | 检查是否是今天 | isToday(date: Date): boolean {
const today = new Date()
return date.getDate() === today.getDate() &&
date.getMonth() === today.getMonth() &&
date.getFullYear() === today.getFullYear()
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isToday AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Date AST#identifier#Right AST#)#Left ) AST#)#Rig... | isToday(date: Date): boolean {
const today = new Date()
return date.getDate() === today.getDate() &&
date.getMonth() === today.getMonth() &&
date.getFullYear() === today.getFullYear()
} | https://gitcode.com/openharmony/codelabs | f5687ad5cbe9455e49e967087a319a94496cb53e | gitcode |
chendi126/harmonyOS-TCP | entry/src/main/ets/pages/DataTest.ets | arkts | formatData | 格式化数据 | formatData(data: string, format: DataFormat): string {
switch (format) {
case DataFormat.JSON:
// 简单的JSON格式化,避免JSON.parse的any类型
try {
// 基本的JSON格式化,添加缩进
let formatted = data.trim();
if (formatted.startsWith('{') && formatted.endsWith('}')) {
formatte... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left formatData 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#identifier#Left string AST#identifier#Right AST#,#Left , AST#... | formatData(data: string, format: DataFormat): string {
switch (format) {
case DataFormat.JSON:
// 简单的JSON格式化,避免JSON.parse的any类型
try {
// 基本的JSON格式化,添加缩进
let formatted = data.trim();
if (formatted.startsWith('{') && formatted.endsWith('}')) {
formatte... | https://github.com/chendi126/harmonyOS-TCP | f58c10a65c910b3fe9dfa5b12f4cdaef1654c141 | github |
openharmony-sig/applications_calculator | feature/calculation/src/main/ets/model/ExpressionsDataSource.ets | arkts | getRecordList | get record list
@return record list | public getRecordList(): Array<LooseObject> {
return this.expList;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getRecordList 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 getRecordList(): Array<LooseObject> {
return this.expList;
} | https://gitee.com/openharmony-sig/applications_calculator.git | fc5f5e537da0b431b43f036fbfa832967e69347c | gitee |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/view/GoodsCategoryPage.ets | arkts | build | 构建商品分类页面
@returns {void} 无返回值 | build(): void {
AppNavDestination({
viewModel: this.vm,
hideTitleBar: true
}) {
ColumnStart({
fillMaxSize: true,
bgColor: $r("app.color.bg_grey")
}) {
SearchTopAppBar({
value: this.searchValue,
onValueChange: (value: string): void => {
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#... | build(): void {
AppNavDestination({
viewModel: this.vm,
hideTitleBar: true
}) {
ColumnStart({
fillMaxSize: true,
bgColor: $r("app.color.bg_grey")
}) {
SearchTopAppBar({
value: this.searchValue,
onValueChange: (value: string): void => {
... | https://github.com/Joker-x-dev/CoolMallArkTS | becc18f923f642ea3fdc85a989d82a49f8258f88 | github |
the-wwyang/kids-learning-app | src/main/ets/services/WrongQuestionService.ets | arkts | updateWrongQuestionRecord | 更新错题记录(再次答错)
@param record 现有记录
@param userAnswer 新的错误答案
@returns 更新后的记录 | static updateWrongQuestionRecord(
record: WrongQuestionRecord,
userAnswer: string
): WrongQuestionRecord {
return {
id: record.id,
question: record.question,
userAnswer: userAnswer,
correctAnswer: record.correctAnswer,
errorCount: record.errorCount + 1,
firstErrorTime... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left updateWrongQuestionRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden... | static updateWrongQuestionRecord(
record: WrongQuestionRecord,
userAnswer: string
): WrongQuestionRecord {
return {
id: record.id,
question: record.question,
userAnswer: userAnswer,
correctAnswer: record.correctAnswer,
errorCount: record.errorCount + 1,
firstErrorTime... | https://github.com/the-wwyang/kids-learning-app | 5ae191f6ac5425cdfc6b6d23974fa94e89f77f7b | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets | arkts | constructor | Constructor with optional parameters
@param index Segment index
@param input Original input text
@param segment Segment text
@param isWordLike Word-like status | constructor(index?: int, input?: string, segment?: string, isWordLike?: boolean) {
this._index = index ?? 0;
this._input = input ?? '';
this._segment = segment ?? '';
this._isWordLike = isWordLike;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#... | constructor(index?: int, input?: string, segment?: string, isWordLike?: boolean) {
this._index = index ?? 0;
this._input = input ?? '';
this._segment = segment ?? '';
this._isWordLike = isWordLike;
} | https://gitcode.com/iop123123/arkts-static-skills | 09eefe1f029d936bd3298e74c3a64e77bcef234c | gitcode |
lidaixian999/Smart_Car | entry/src/main/ets/model/SsapManager.ets | arkts | registerPropertyChangeCallback | 注册属性变化回调 | private registerPropertyChangeCallback(): void {
if (!this.client) {
hilog.error(this.domainId, this.logTag, 'Client not initialized');
return;
}
hilog.info(this.domainId, this.logTag, 'Registering property change callback...');
try {
this.client.on('propertyChange', (data: ssap.Pro... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left registerPropertyChangeCallback 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#ERRO... | private registerPropertyChangeCallback(): void {
if (!this.client) {
hilog.error(this.domainId, this.logTag, 'Client not initialized');
return;
}
hilog.info(this.domainId, this.logTag, 'Registering property change callback...');
try {
this.client.on('propertyChange', (data: ssap.Pro... | https://github.com/lidaixian999/Smart_Car | 78d51c1bc9cc171f4a280364cd261fdf0c865f67 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.