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 |
|---|---|---|---|---|---|---|---|---|---|---|
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/network/PairingManager.ets | arkts | getServerCert | 获取服务器证书 | getServerCert(): Uint8Array | null {
return this.serverCertDer;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getServerCert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identif... | getServerCert(): Uint8Array | null {
return this.serverCertDer;
} | https://github.com/AlkaidLab/moonlight-harmony | 2ddd76359897c49109eb469a861c7090efb68661 | github |
harmonyos-dev/arkui-codelabs | 006-custom_component/entry/src/main/ets/pages/Index.ets | arkts | aboutToAppear | 组件生命周期:挂载
See: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V2/arkts-page-custom-components-lifecycle-0000001524296665-V2 | aboutToAppear() {
// 通过 setInterval 来模拟异步请求
setInterval(() => {
this.autoCounter += 1;
}, 1000);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
// 通过 setInterval 来模拟异步请求
setInterval(() => {
this.autoCounter += 1;
}, 1000);
} | https://github.com/harmonyos-dev/arkui-codelabs | ab25246e0ce98dc607d16624da0db2bf62f5c101 | github |
aimilin6688/KeePassHO | entry/src/main/ets/common/utils/ImagePickerUtils.ets | arkts | selectImage | 选择图片
@param context 上下文
@returns 选择的图片的base64编码 | public static async selectImage(context: common.UIAbilityContext, size: number): Promise<string[] | null> {
const photoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
photoSelectOptions.maxSelectNumber = 9;
let... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left selectImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left contex... | public static async selectImage(context: common.UIAbilityContext, size: number): Promise<string[] | null> {
const photoSelectOptions = new photoAccessHelper.PhotoSelectOptions();
photoSelectOptions.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
photoSelectOptions.maxSelectNumber = 9;
let... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ImagePickerUtils.ets#L21-L36 | 4a43d6d0fc32c2d1d712895b10fa97b9d3bdf2d3 | github |
qiuhaotc/Sunshine_HarmonyOS | entry/src/main/ets/model/BuildingModel.ets | arkts | getFloorCount | 获取楼层数 | getFloorCount(): number {
return Math.max(1, Math.floor(this.height / this.floorHeight));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getFloorCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statemen... | getFloorCount(): number {
return Math.max(1, Math.floor(this.height / this.floorHeight));
} | https://github.com/qiuhaotc/Sunshine_HarmonyOS | 2a92a3cd88e161b3f8dbb19eb0ae5d0d5430383a | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/FontManager.ets | arkts | syncToAppStorage | 同步字体设置到AppStorage | syncToAppStorage(): void {
try {
const appFont = this.getFontFamily(FontScene.APP_UI);
const novelFont = this.getFontFamily(FontScene.NOVEL);
const ebookFont = this.getFontFamily(FontScene.EBOOK);
// APP界面字体
AppStorage.setOrCreate('appFontFamily', appFont);
AppStorage.se... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left syncToAppStorage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | syncToAppStorage(): void {
try {
const appFont = this.getFontFamily(FontScene.APP_UI);
const novelFont = this.getFontFamily(FontScene.NOVEL);
const ebookFont = this.getFontFamily(FontScene.EBOOK);
// APP界面字体
AppStorage.setOrCreate('appFontFamily', appFont);
AppStorage.se... | https://github.com/DaLongZhuaZi/manxia | c8a760eee818c1db9a048143b356e9001b6dcf97 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Services/CacheStatusService.ets | arkts | clearContentCache | 清理指定内容的缓存
[改进] 同时清理文件系统和数据库中的缓存记录 | async clearContentCache(
contentType: CacheContentType,
contentId: string,
sourceId?: number
): Promise<boolean> {
try {
if (contentType === CacheContentType.MANGA && sourceId !== undefined) {
this.invalidateCacheStatus(CacheContentType.MANGA, sourceId, contentId, 'clear_manga_cache_st... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearContentCache AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left contentType AST#identifier#Right AST#type_annotation#Left AST... | async clearContentCache(
contentType: CacheContentType,
contentId: string,
sourceId?: number
): Promise<boolean> {
try {
if (contentType === CacheContentType.MANGA && sourceId !== undefined) {
this.invalidateCacheStatus(CacheContentType.MANGA, sourceId, contentId, 'clear_manga_cache_st... | https://github.com/DaLongZhuaZi/manxia | 766b405bf484e49477730e0407c653b8ad18063a | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Map.ets | arkts | clear | Deletes all elements from the Map | clear(): void {
const capacity = this.initialCapacity
if (this.sizeVal === 0 && this.cap === capacity) {
return
}
let alloc = this.allocDataAndBuckets(capacity)
const oldData = this.data
this.data = alloc[0]
if (this.buckets.getItersCounter() != 0... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left A... | clear(): void {
const capacity = this.initialCapacity
if (this.sizeVal === 0 && this.cap === capacity) {
return
}
let alloc = this.allocDataAndBuckets(capacity)
const oldData = this.data
this.data = alloc[0]
if (this.buckets.getItersCounter() != 0... | https://gitcode.com/iop123123/arkts-static-skills | ec8bdec56b615db70f62fafce90a26b38a1f4c2c | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | getPopupBlurOptions | 便捷方法:获取弹窗/对话框建议的玻璃效果参数 | public getPopupBlurOptions(): GlassEffectOptions {
return this.getGlassEffectOptions(GlassEffectContext.POPUP);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getPopupBlurOptions 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 Gl... | public getPopupBlurOptions(): GlassEffectOptions {
return this.getGlassEffectOptions(GlassEffectContext.POPUP);
} | https://github.com/DaLongZhuaZi/manxia | eb2f99abf8ffe11e893ce554fb2fcbaca441ae42 | github |
openeuler-mirror/arkui-linux | ace_engine/adapter/fangtian/services/uiservice/dialog_ui/share_picker_dialog/entry/src/main/ets/pages/share.ets | arkts | onBackPress | 全局返回按键 | onBackPress() {
console.info(this.TAG, "onBackPress")
// 触发全局返回按键销毁窗口和服务
globalThis.context.terminateSelf()
} | AST#program#Left AST#expression_statement#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#expression_statement#Right AST#statement_block#Left A... | onBackPress() {
console.info(this.TAG, "onBackPress")
// 触发全局返回按键销毁窗口和服务
globalThis.context.terminateSelf()
} | https://github.com/openeuler-mirror/arkui-linux | 8966cb91109dba4d0d70f697d4a1d83d9b0378e4 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/viewmodel/GoodsDetailViewModel.ets | arkts | showCouponModal | 显示优惠券弹窗
@returns {void} 无返回值 | showCouponModal(): void {
this.showCouponModalVisible = true;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left showCouponModal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bl... | showCouponModal(): void {
this.showCouponModalVisible = true;
} | https://github.com/Joker-x-dev/CoolMallArkTS | 4a96dd5d5a6d07b652cf6438909fda9121c11d61 | github |
PollenWang6/HiXD | entry/src/main/ets/services/SportService.ets | arkts | authenticatedRequire | 带认证的请求 (失败自动重试一次) | private async authenticatedRequire(subWebsite: string, body: Record<string, string>): Promise<Record<string, Object>> {
const resp: Record<string, Object> = await this.require(subWebsite, body);
if (this.isAuthFailure(resp)) {
// 重新登录后重试
this.userId = '';
this.token = '';
await this.lo... | 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 authenticatedRequire AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left subWebsite AST#identifier#Right AST#ERROR#Left ... | private async authenticatedRequire(subWebsite: string, body: Record<string, string>): Promise<Record<string, Object>> {
const resp: Record<string, Object> = await this.require(subWebsite, body);
if (this.isAuthFailure(resp)) {
// 重新登录后重试
this.userId = '';
this.token = '';
await this.lo... | https://github.com/PollenWang6/HiXD | 3c2d8128fab2854f8eef86b844298465f9ea831a | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/MoonBridge.ets | arkts | getPerformanceModeEnabled | 获取性能模式是否启用 | getPerformanceModeEnabled(): boolean {
return nativeLib.getPerformanceModeEnabled();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPerformanceModeEnabled 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#Rig... | getPerformanceModeEnabled(): boolean {
return nativeLib.getPerformanceModeEnabled();
} | https://github.com/AlkaidLab/moonlight-harmony | bf21603e69a80cb2f542f5ffe3aa1163311a22b6 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/ARRenderer.ets | arkts | updateNavigationInfo | 更新导航信息
@param info 导航信息 | public updateNavigationInfo(info: NavigationInfo): void {
this.navigationInfo = info;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateNavigationInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left info AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#... | public updateNavigationInfo(info: NavigationInfo): void {
this.navigationInfo = info;
} | https://github.com/LJ666-ui/harmony-health-care | f52509db49512ca1627e0501f40090ac21ed0461 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/CryptoService.ets | arkts | isEncrypted | 检查数据是否为加密格式(MLBK 魔数) | static isEncrypted(data: Uint8Array): boolean {
return CryptoService.getVersion(data) > 0;
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isEncrypted 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 Uint... | static isEncrypted(data: Uint8Array): boolean {
return CryptoService.getVersion(data) > 0;
} | https://github.com/AlkaidLab/moonlight-harmony | bc1a3ffc0388f3f89c19616cb7781fb8f35e2e7f | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/AnomalyDetection.ets | arkts | getStatistics | 获取统计摘要 | getStatistics(): StatisticalSummary {
const result: StatisticalSummary = {
mean: this.mean,
median: this.median,
stdDev: this.stdDev,
variance: this.variance,
min: this.min,
max: this.max,
q1: this.q1,
q3: this.q3,
iqr: this.iqr,
sampleSize: this.sampleS... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getStatistics 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 StatisticalSummary AST#identifier#Right AST#ERRO... | getStatistics(): StatisticalSummary {
const result: StatisticalSummary = {
mean: this.mean,
median: this.median,
stdDev: this.stdDev,
variance: this.variance,
min: this.min,
max: this.max,
q1: this.q1,
q3: this.q3,
iqr: this.iqr,
sampleSize: this.sampleS... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 3dbfb0550c899213721ca716e3253a337ab0f756 | github |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/pages/aiinsight/AIInsightState.ets | arkts | cancelStream | 取消当前流式请求。 | private cancelStream(): void {
if (this.streamRequest !== null) {
this.streamRequest.destroy();
this.streamRequest = null;
}
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cancelStream 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... | private cancelStream(): void {
if (this.streamRequest !== null) {
this.streamRequest.destroy();
this.streamRequest = null;
}
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/pages/aiinsight/AIInsightState.ets#L495-L500 | 08eebae70f3e31b1d71e9e4f43ca68298b18a6e6 | github |
Joker-x-dev/CoolMallArkTS | feature/goods/src/main/ets/view/GoodsCategoryPage.ets | arkts | aboutToAppear | 页面显示前设置键盘避让模式
@returns {void} 无返回值 | aboutToAppear(): void {
const uiContext: UIContext = this.getUIContext();
this.vm.snapshotKeyboardAvoidMode(uiContext.getKeyboardAvoidMode());
uiContext.setKeyboardAvoidMode(KeyboardAvoidMode.NONE);
this.searchValue = this.vm.getCurrentSearchKeyword();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | aboutToAppear(): void {
const uiContext: UIContext = this.getUIContext();
this.vm.snapshotKeyboardAvoidMode(uiContext.getKeyboardAvoidMode());
uiContext.setKeyboardAvoidMode(KeyboardAvoidMode.NONE);
this.searchValue = this.vm.getCurrentSearchKeyword();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 80afafd0ebbaa356f5e67616ad7750f7bb31b97a | github |
openharmony-sig/ohos_highlightguide | library/src/main/ets/highlightguide/core/HighLightGuideBuilder.ets | arkts | setLabel | 设置引导页名称,必须设置,用于存储引导页显示次数
@param label 引导页标签名称
@returns 引导页组件的配置项 | public setLabel(label: string): HighLightGuideBuilder {
this.label = label;
return this;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setLabel AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left label AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string... | public setLabel(label: string): HighLightGuideBuilder {
this.label = label;
return this;
} | https://gitee.com/openharmony-sig/ohos_highlightguide.git | 01432ae938fbcdc8c646921d0482613cd3faeea7 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | from | Creates an Int8Array from array-like argument
@param o array-like object to initialize Int8Array
@returns new Int8Array | public from(o: Object): Int8Array {
throw new Error("Int8Array.from: not implemented")
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left o AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#R... | public from(o: Object): Int8Array {
throw new Error("Int8Array.from: not implemented")
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | f53a0fbca51b3286bdc7d81655d4d8116a4c5a22 | gitee |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ets | arkts | isFloat32Array | Check whether the entered value is of float32array array type.
@param { Object } value - A Float32Array value
@returns { boolean } Returns true if the value is a built-in Float32Array instance. | isFloat32Array(value: Object): boolean {
return value instanceof Float32Array;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isFloat32Array 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 Object AST#identifier#Right AST#)#Left )... | isFloat32Array(value: Object): boolean {
return value instanceof Float32Array;
} | https://gitcode.com/iop123123/arkts-static-skills | cef2e0ff58ca8a1b3ae0d5cb75ce91df6c92184a | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | setDrawLabels | Set this to true to enable drawing the labels of this axis (this will not
affect drawing the grid lines or axis lines).
@param enabled | public setDrawLabels(enabled: boolean): void {
this.mDrawLabels = enabled;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDrawLabels AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left... | public setDrawLabels(enabled: boolean): void {
this.mDrawLabels = enabled;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 1836c3d6ded8c5ffd3423d6a8715ab2a1865567f | gitee |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/AccountDAO.ets | arkts | getByUserId | 根据 userId 查询某个用户的所有账户
@throws | static async getByUserId(userId: number): Promise<Account[]> {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates('accounts');
predicates.equalTo('user_id', userId);
const resultSet = await store.query(predicates);
const list: Account[] = [];
try ... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left getByUserId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : AST... | static async getByUserId(userId: number): Promise<Account[]> {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates('accounts');
predicates.equalTo('user_id', userId);
const resultSet = await store.query(predicates);
const list: Account[] = [];
try ... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | cee850657281ac08027330a660816b8dcf21bd3f | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedArrays.ets | arkts | find | Finds the first element in the Float64Array that satisfies the condition
@param fn the condition to apply for each element
@returns the first element that satisfies fn
TODO: return double | undefined as in JS | public find(fn: (val: double, index: int, array: Float64Array) => boolean): double {
for (let i = 0; i < this.length; ++i) {
let val = this.at(i)
if (fn(val, i, this)) {
return val
}
}
throw new Error("Float64Array.find: not implemented if ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left find AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ... | public find(fn: (val: double, index: int, array: Float64Array) => boolean): double {
for (let i = 0; i < this.length; ++i) {
let val = this.at(i)
if (fn(val, i, this)) {
return val
}
}
throw new Error("Float64Array.find: not implemented if ... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 23588a8897cee8a0debaf74972bc8cc9c1962f7c | gitee |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets | arkts | currentTabSearchIsSearching | Gets the current tab search is in search mode. | get currentTabSearchIsSearching() {
return this.currentTab?.isSearching;
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentTabSearchIsSearching 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#{#L... | get currentTabSearchIsSearching() {
return this.currentTab?.isSearching;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | dd7669bb4aad3896db94d390b839c1a981ec62b9 | github |
XJTUWYD/ArkDiff | entry/src/main/ets/engine/DiffBlockLocator.ets | arkts | locateBlocks | 从 Unified 差异行中定位所有差异块
@param diffLines Unified 视图的差异行数组
@returns 差异块数组(按出现顺序排列) | static locateBlocks(diffLines: DiffLine[]): DiffBlock[] {
const blocks: DiffBlock[] = [];
let i = 0;
while (i < diffLines.length) {
if (DiffBlockLocator.isChangeLine(diffLines[i])) {
const startIndex = i;
let blockType = diffLines[i].type === DiffType.ADDED ? 1 :
diffLines... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left locateBlocks AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left diffLines AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expr... | static locateBlocks(diffLines: DiffLine[]): DiffBlock[] {
const blocks: DiffBlock[] = [];
let i = 0;
while (i < diffLines.length) {
if (DiffBlockLocator.isChangeLine(diffLines[i])) {
const startIndex = i;
let blockType = diffLines[i].type === DiffType.ADDED ? 1 :
diffLines... | https://github.com/XJTUWYD/ArkDiff | cf3cda99531bdf256ee2bfc2a34b5324525cf208 | github |
openharmony-sig/node_pool | nodepool/src/main/ets/lib/NodePool.ets | arkts | getNextId | 生成节点id
@returns 节点id | public static getNextId(): number {
return ++NodePool.idGen;
} | 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 getNextId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef... | public static getNextId(): number {
return ++NodePool.idGen;
} | https://gitee.com/openharmony-sig/node_pool.git | b15606e2bcee857dd1a23e98b05bdc6409ecce1b | gitee |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/data/LineDataSet.ets | arkts | setCircleRadius | Sets the radius of the drawn circles.
Default radius = 4f, Min = 1f
@param radius | public setCircleRadius(radius: number): void {
if (radius >= 1) {
// this.mCircleRadius = Utils.convertDpToPixel(radius);
this.mCircleRadius = radius;
} else {
LogUtil.log("LineDataSet", "Circle radius cannot be < 1")
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCircleRadius AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left radius AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | public setCircleRadius(radius: number): void {
if (radius >= 1) {
// this.mCircleRadius = Utils.convertDpToPixel(radius);
this.mCircleRadius = radius;
} else {
LogUtil.log("LineDataSet", "Circle radius cannot be < 1")
}
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | dd6a5054ebacba9e2c818b3112e23dc57b16a090 | gitee |
who7708/harmonyos-codelabs | HmosWorld/commons/common/src/main/ets/service/datasource/network/agc/FuncNetwork.ets | arkts | getUserData | @param userId
@returns UserData | public getUserData(): Promise<UserData> {
const params: UserIdParams = {
userId: (AppStorage.get<UserAccount>('user') as UserAccount)?.id
};
return new Promise(((resolve: (value: UserData | PromiseLike<UserData>) => void,
reject: (reason?: Object) => void) => {
Reques... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getUserData 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... | public getUserData(): Promise<UserData> {
const params: UserIdParams = {
userId: (AppStorage.get<UserAccount>('user') as UserAccount)?.id
};
return new Promise(((resolve: (value: UserData | PromiseLike<UserData>) => void,
reject: (reason?: Object) => void) => {
Reques... | https://github.com/who7708/harmonyos-codelabs | 02215330b8978b9d99b6986c98baadb119320367 | github |
openharmony/codelabs | Security/StringCipherArkTS/entry/src/main/ets/common/utils/AesUtil.ets | arkts | genKeyMaterialBlob | Data of the DataBlob type is generated based on the data group.
@param data Data to be encapsulated.
@returns DataBlob data | genKeyMaterialBlob(data: Array<number>): cryptoFramework.DataBlob {
let keyMaterial = new Uint8Array(data);
return { data: keyMaterial };
} | AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left genKeyMaterialBlob 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#instantiati... | genKeyMaterialBlob(data: Array<number>): cryptoFramework.DataBlob {
let keyMaterial = new Uint8Array(data);
return { data: keyMaterial };
} | https://gitee.com/openharmony/codelabs.git | 00e15aff2b0d31bfd02a04600f31e6f343ef70c2 | gitee |
JackJiang2011/harmonychat | entry/src/main/ets/IMClientManager.ets | arkts | getMessageProvider | 返回聊天消息的缓存数据提供者对象。
@returns | getMessageProvider() {
return this.messageProvider;
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getMessageProvider 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... | getMessageProvider() {
return this.messageProvider;
} | https://github.com/JackJiang2011/harmonychat | f433a2b5e2a8cfb4012117e7ff434b6ffd0ddeec | github |
NissonCX/CQU-HarmonyOS-APP-Dev-Final | entry/src/main/ets/pages/HomePage.ets | arkts | animateCards | 启动卡片入场动画 | animateCards() {
this.scaleValues.forEach((_, index) => {
setTimeout(() => {
this.scaleValues[index] = 1.05;
setTimeout(() => {
this.scaleValues[index] = 1;
}, 200);
}, index * 100);
});
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left animateCards 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 ... | animateCards() {
this.scaleValues.forEach((_, index) => {
setTimeout(() => {
this.scaleValues[index] = 1.05;
setTimeout(() => {
this.scaleValues[index] = 1;
}, 200);
}, index * 100);
});
} | https://github.com/NissonCX/CQU-HarmonyOS-APP-Dev-Final | 1eda3c3766b24d99da702ced15d1926b704b8a2f | github |
Mydstiny/RemoteDeskHarmonyOS | entry/src/main/ets/services/CloudStore.ets | arkts | syncRelaysToCloud | ==================== RustDesk Relay 云同步 (via cryptoparams) ====================
将全部 relay 序列化写入 cryptoparams → 随4张主表云同步 | syncRelaysToCloud(): void {
if (!this.store) { return; }
try {
const relays: RustDeskRelayConfig[] = this.loadAllRelaysLocal();
const json: string = JSON.stringify(relays.map((r: RustDeskRelayConfig) => this.relayToCloudJson(r)));
const vb: relationalStore.ValuesBucket = {};
vb['key'] ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left syncRelaysToCloud 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_... | syncRelaysToCloud(): void {
if (!this.store) { return; }
try {
const relays: RustDeskRelayConfig[] = this.loadAllRelaysLocal();
const json: string = JSON.stringify(relays.map((r: RustDeskRelayConfig) => this.relayToCloudJson(r)));
const vb: relationalStore.ValuesBucket = {};
vb['key'] ... | https://github.com/Mydstiny/RemoteDeskHarmonyOS | 42512bba1f3720b11067c7ab4940fd3c9ed08652 | github |
openharmony/codelabs | ETSUI/MemoTime/entry/src/main/ets/common/utils/Logger.ets | arkts | warn | Warn 日志 | static warn(tag: string, message: string): void {
if (Logger.currentLevel <= LogLevel.WARN) {
hilog.warn(DOMAIN, `${TAG}:${tag}`, message)
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left warn AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR... | static warn(tag: string, message: string): void {
if (Logger.currentLevel <= LogLevel.WARN) {
hilog.warn(DOMAIN, `${TAG}:${tag}`, message)
}
} | https://gitcode.com/openharmony/codelabs | d4bfbd284eb4f6038d4cc9bca66e797270ce5406 | gitcode |
Yebingiscn/SweetVideo | entry/src/main/ets/controller/MpvController/MpvController.ets | arkts | switchDecodingMode | 统一的模式切换方法 | private switchDecodingMode(
targetMode: 'buffer_hw' | 'buffer_sw',
errorMessage: string,
currentTime?: number,
wasPlaying?: boolean,
currentVideo?: VideoMetadata
) {
if (this.isInState(MpvPlayerState.RELEASING) || this.isInState(MpvPlayerState.IDLE)) {
salmonLogger.addLog(TAG, '[MpvCon... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left switchDecodingMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left targetMode AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#bina... | private switchDecodingMode(
targetMode: 'buffer_hw' | 'buffer_sw',
errorMessage: string,
currentTime?: number,
wasPlaying?: boolean,
currentVideo?: VideoMetadata
) {
if (this.isInState(MpvPlayerState.RELEASING) || this.isInState(MpvPlayerState.IDLE)) {
salmonLogger.addLog(TAG, '[MpvCon... | https://github.com/Yebingiscn/SweetVideo | 5b244e1b9c80f3bae7e1dbe7ef36157b41cdef02 | github |
SMAT-Lab/PhantomRendering | Harmoney_Next-Tiktok/entry/src/main/ets/pages/My/My.ets | arkts | openRightSideBar | 打开右侧边栏 | openRightSideBar() {
this.showDialog = true
this.dialogBgColor = Constants.COLOR_OpacityBlack
this.IndexX = '-65%'
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openRightSideBar 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... | openRightSideBar() {
this.showDialog = true
this.dialogBgColor = Constants.COLOR_OpacityBlack
this.IndexX = '-65%'
} | https://github.com/SMAT-Lab/PhantomRendering | 171b287e985cdfda9e4d12dc5ff6a3605aea117c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | cleanupOldBackups | 清理旧备份文件 | private async cleanupOldBackups(backupDir: string): Promise<void> {
try {
const files = await this.sandboxManager.listDirectory(backupDir);
const backupFiles = files.filter(file => file.startsWith('backup_') && file.endsWith('.db'));
if (backupFiles.length > this.config.maxBackupFiles) {
... | 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 cleanupOldBackups AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left backupDir AST#identifier#Right AST#ERROR#Left AST#... | private async cleanupOldBackups(backupDir: string): Promise<void> {
try {
const files = await this.sandboxManager.listDirectory(backupDir);
const backupFiles = files.filter(file => file.startsWith('backup_') && file.endsWith('.db'));
if (backupFiles.length > this.config.maxBackupFiles) {
... | https://github.com/DaLongZhuaZi/manxia | 1df32a5a080b29888bfe7217cac4d2fbbf43ffee | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | keys | Returns an list of keys in Float32Array
@returns { IterableIterator<int> } - iterator over keys
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public keys(): IterableIterator<int> {
return new Float32ArrayIteratorKeys(this)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left keys AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ... | public keys(): IterableIterator<int> {
return new Float32ArrayIteratorKeys(this)
} | https://gitcode.com/iop123123/arkts-static-skills | 30e1f4fc9a910b5e106f427e1c8ceb6e7c642498 | gitcode |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/YAxis.ets | arkts | getSpaceTop | Returns the top axis space in percent of the full range. Default 10f
@return | public getSpaceTop(): number {
return this.mSpacePercentTop;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getSpaceTop AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#num... | public getSpaceTop(): number {
return this.mSpacePercentTop;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | bc564445b6c4f8a600c97586928b42f4e32db2c7 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Utils/WelcomeGuideTestHelper.ets | arkts | getStepName | 获取步骤名称 | private static getStepName(step: GuideStep): string {
switch (step) {
case GuideStep.WELCOME:
return 'WELCOME (欢迎页)';
case GuideStep.THEME_SELECTION:
return 'THEME_SELECTION (主题选择)';
case GuideStep.DATA_IMPORT:
return 'DATA_IMPORT (Download同步)';
case GuideStep.IMAGE... | 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 getStepName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left step AST#identifier#Right AST#:#Left : A... | private static getStepName(step: GuideStep): string {
switch (step) {
case GuideStep.WELCOME:
return 'WELCOME (欢迎页)';
case GuideStep.THEME_SELECTION:
return 'THEME_SELECTION (主题选择)';
case GuideStep.DATA_IMPORT:
return 'DATA_IMPORT (Download同步)';
case GuideStep.IMAGE... | https://github.com/DaLongZhuaZi/manxia | a815287ed4e7dbf2440764149715e28c0fffebc9 | github |
aimilin6688/KeePassHO | entry/src/main/ets/services/store/SyncSettingsService.ets | arkts | extractEntryValue | 从 Entry 中提取实际的字符串值
KVStore 回调的 entry.value 是 Value 对象 {type: ValueType, value: string}
需要取出 .value 属性才是实际的同步数据 | private static extractEntryValue(entry: distributedKVStore.Entry): string | null {
try {
const raw = entry.value;
if (typeof raw === 'string') {
return raw;
}
// Value 对象:{type: ValueType, value: Uint8Array | string | number | boolean}
const kvValue = raw as distributedKVStor... | 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 extractEntryValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left entry AST#identifier#Right AST#:#L... | private static extractEntryValue(entry: distributedKVStore.Entry): string | null {
try {
const raw = entry.value;
if (typeof raw === 'string') {
return raw;
}
// Value 对象:{type: ValueType, value: Uint8Array | string | number | boolean}
const kvValue = raw as distributedKVStor... | https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/SyncSettingsService.ets#L313-L329 | 3bb22f54705e06ebd8cf3abdaab6188858199de0 | github |
erosTeam/NextE | shared/src/main/ets/sync/SyncService.ets | arkts | mergeRemoteRaw | Transport-neutral file sync core: merge a remote envelope with local RDB, apply the merged result
locally, and return the exact raw payload that the provider should write back. | static async mergeRemoteRaw(
context: common.UIAbilityContext,
remoteRaw: string,
deviceId: string = '',
selection: SyncDatasetSelection = new SyncDatasetSelection(),
): Promise<string> {
const remote: SyncEnvelopeV1 = SyncService.parseRaw(remoteRaw)
const selectedMerged: SyncEnvelopeV1 =
... | 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 mergeRemoteRaw AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left :... | static async mergeRemoteRaw(
context: common.UIAbilityContext,
remoteRaw: string,
deviceId: string = '',
selection: SyncDatasetSelection = new SyncDatasetSelection(),
): Promise<string> {
const remote: SyncEnvelopeV1 = SyncService.parseRaw(remoteRaw)
const selectedMerged: SyncEnvelopeV1 =
... | https://github.com/erosTeam/NextE | c9842cbbee7a035c7ae5fb9cd94cacfd7fed2713 | github |
Harrisonls2004/WaterFlow | entry/src/main/ets/common/utils/OrderManager.ets | arkts | loadUserOrders | Load orders for specific user | static async loadUserOrders(username: string): Promise<void> {
if (!orderPreferences || !username) {
cachedOrderList = [];
return;
}
currentOrderUsername = username;
const key = `orders_${username}`;
try {
// 优先从服务器获取
if (SERVER_ENABLED) {
try {
... | 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 loadUserOrders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left username AST#identifier#Right AST#ERROR#Left AST#:#Left ... | static async loadUserOrders(username: string): Promise<void> {
if (!orderPreferences || !username) {
cachedOrderList = [];
return;
}
currentOrderUsername = username;
const key = `orders_${username}`;
try {
// 优先从服务器获取
if (SERVER_ENABLED) {
try {
... | https://github.com/Harrisonls2004/WaterFlow | 5293e5f0e742f635ec3eacaa6a1923005f000874 | github |
qiaomu8559968/AnalogClock | analog_clock/src/main/ets/components/AnalogClockDark.ets | arkts | aboutToAppear | 组件即将出现时启动定时器 | aboutToAppear() {
// 初始化时间
this.updateTime()
// 启动定时器,每秒更新一次
// 解决“时钟无法自动更新时间”的问题
this.timerId = setInterval(() => {
this.updateTime()
}, 1000)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear() {
// 初始化时间
this.updateTime()
// 启动定时器,每秒更新一次
// 解决“时钟无法自动更新时间”的问题
this.timerId = setInterval(() => {
this.updateTime()
}, 1000)
} | https://gitcode.com/qiaomu8559968/AnalogClock | b00cb9b622cb9379770d2c6a2b324e14581ba9fc | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/MangaSourceEngine.ets | arkts | parseChineseNumber | 解析中文数字
@param chineseStr 中文数字字符串
@param numMap 中文数字映射表
@returns 解析后的数字,无法解析返回null | private parseChineseNumber(chineseStr: string, numMap: Record<string, number>): number | null {
if (!chineseStr) return null;
let result = 0;
let temp = 0;
let prevUnit = 1;
for (let i = 0; i < chineseStr.length; i++) {
const char = chineseStr[i];
const num = numMap[char];
if ... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseChineseNumber AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chineseStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A... | private parseChineseNumber(chineseStr: string, numMap: Record<string, number>): number | null {
if (!chineseStr) return null;
let result = 0;
let temp = 0;
let prevUnit = 1;
for (let i = 0; i < chineseStr.length; i++) {
const char = chineseStr[i];
const num = numMap[char];
if ... | https://github.com/DaLongZhuaZi/manxia | f76d3c40f1c03057959908c36aa5c4b1e28920e6 | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/MonotonicClock.ets | arkts | generateEventId | Short event/view id: 16 hex chars of random UUID followed by the
current monotonic timestamp. Sharing the clock with `nowMs()` means
an id minted right after a `nowMs()` call has a trailing timestamp
>= that value, preserving wire-order ties between an event's `id`
and its `timestamp` field. | public generateEventId(): string {
const uuid: string = util.generateRandomUUID(false).replace(/-/g, '');
return uuid.substring(0, 16) + this.nowMs().toString();
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left generateEventId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST... | public generateEventId(): string {
const uuid: string = util.generateRandomUUID(false).replace(/-/g, '');
return uuid.substring(0, 16) + this.nowMs().toString();
} | https://github.com/Countly/countly-sdk-hos | 32ab31473d109b0a25f5cff58e4c8f2b9c29e95c | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/DiskCacheManager.ets | arkts | clear | 清空所有缓存 | public async clear(): Promise<void> {
try {
logger.info(TAG, '清空所有缓存');
for (const entry of this.cacheIndex.values()) {
const fileExists = await fs.access(entry.filePath);
if (fileExists) {
await fs.unlink(entry.filePath);
}
}
this.cacheIndex.clear();
... | 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 clear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : A... | public async clear(): Promise<void> {
try {
logger.info(TAG, '清空所有缓存');
for (const entry of this.cacheIndex.values()) {
const fileExists = await fs.access(entry.filePath);
if (fileExists) {
await fs.unlink(entry.filePath);
}
}
this.cacheIndex.clear();
... | https://github.com/DaLongZhuaZi/manxia | 6b04b3997a51674001abd636e2560a8202f52cb4 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | set | Copies all elements of arr to the current Int8Array.
@param { FixedArray<number> } arr - array to copy data from
@throws { RangeError } - If the number of assigned elements exceeds the array range, throw an exception
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public set(arr: FixedArray<number>): void {
this.set(arr, 0)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#... | public set(arr: FixedArray<number>): void {
this.set(arr, 0)
} | https://gitcode.com/iop123123/arkts-static-skills | 835ae8f13b06d7313b669523ec2b2ec362fe4b33 | gitcode |
somnio-software/my-bot-pal | entry/src/main/ets/utils/PermissionUtils.ets | arkts | checkMultiplePermissions | Mock implementation for checking multiple permissions
@param permissions List of permissions to check
@param context Application context (not used in mock) | 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.isPermissionGranted(permission));
}
retu... | 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.isPermissionGranted(permission));
}
retu... | https://github.com/somnio-software/my-bot-pal | 408b08f44bf400b389d58da5b37a9ede65a468f4 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Console.ets | arkts | timeLog | Logs the current duration of a running timer without stopping it
Prints a warning if the specified timer doesn't exist
@param {string} [label='default'] - Label of the timer to check
@returns {void}
@see time | public timeLog(label?: string, ...arguments: Object[]): void {
const key = label ?? 'default'
Console.isNullCharacter(key);
const len = arguments.length;
let result = "";
const startTime = this.timers.get(key)
if (startTime === undefined) {
this.warn(`Time... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left timeLog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left label AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AS... | public timeLog(label?: string, ...arguments: Object[]): void {
const key = label ?? 'default'
Console.isNullCharacter(key);
const len = arguments.length;
let result = "";
const startTime = this.timers.get(key)
if (startTime === undefined) {
this.warn(`Time... | https://gitcode.com/iop123123/arkts-static-skills | 9f8efaa82de19e0488853aa98551a5ad77d2c560 | gitcode |
chendi126/harmonyOS-TCP | entry/src/main/ets/common/GlassStyles.ets | arkts | getButtonGradientEnd | 获取按钮渐变结束色 | static getButtonGradientEnd(type: 'primary' | 'secondary' | 'success' | 'warning' = 'primary'): string {
switch (type) {
case 'primary':
return GlassColors.BUTTON_PRIMARY_END;
case 'secondary':
return GlassColors.BUTTON_SECONDARY_END;
case 'success':
return GlassColors.BU... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getButtonGradientEnd AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_... | static getButtonGradientEnd(type: 'primary' | 'secondary' | 'success' | 'warning' = 'primary'): string {
switch (type) {
case 'primary':
return GlassColors.BUTTON_PRIMARY_END;
case 'secondary':
return GlassColors.BUTTON_SECONDARY_END;
case 'success':
return GlassColors.BU... | https://github.com/chendi126/harmonyOS-TCP | 3f67f1a72420c7131ee7ba3744579e852272f68e | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | getAxisLineDashPathEffect | returns the DashPathEffect that is set for axis line
@return | public getAxisLineDashPathEffect(): DashPathEffect | null {
return this.mAxisLineDashPathEffect;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAxisLineDashPathEffect 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_expre... | public getAxisLineDashPathEffect(): DashPathEffect | null {
return this.mAxisLineDashPathEffect;
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | fca13d597a6efb67fbf93644a8fff593b6755c50 | gitee |
LJ666-ui/harmony-health-care | entry/src/main/ets/aiagent/ConversationMemory.ets | arkts | getRecentTurns | 获取最近N轮对话
@param sessionId 会话ID
@param turns 轮数
@returns 对话消息列表 | async getRecentTurns(sessionId: string, turns: number): Promise<ConversationMessage[]> {
const context = await this.retrieve(sessionId);
if (!context) {
return [];
}
const messages = context.messages;
const recentMessages = messages.slice(-turns * 2);
return recentMessages;
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getRecentTurns AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sessionId AST#identifier#Right AST#type_annotation#Left AST#:#Le... | async getRecentTurns(sessionId: string, turns: number): Promise<ConversationMessage[]> {
const context = await this.retrieve(sessionId);
if (!context) {
return [];
}
const messages = context.messages;
const recentMessages = messages.slice(-turns * 2);
return recentMessages;
} | https://github.com/LJ666-ui/harmony-health-care | ad208e36ebaca4f3c494de22f6f4ec27d2583154 | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/InputProcessor.ets | arkts | setAxisDeadZone | 设置摇杆轴死区阈值
@param deadZone 死区阈值 (0.0 - 1.0) | setAxisDeadZone(deadZone: number): void {
this.axisDeadZone = deadZone
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setAxisDeadZone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deadZone AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST... | setAxisDeadZone(deadZone: number): void {
this.axisDeadZone = deadZone
} | https://github.com/richshaw2015/nds | 69aadbae7f7e8cdf7ec7801efa914ba52df29ff3 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/CancellablePromise.ets | arkts | resolve | 创建已解决的 CancellablePromise | static resolve<T>(value: T): CancellablePromise<T> {
return new CancellablePromise<T>((resolve) => {
resolve(value);
});
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#binary_expression#Left AST#identifier#Left resolve 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#(#Right... | static resolve<T>(value: T): CancellablePromise<T> {
return new CancellablePromise<T>((resolve) => {
resolve(value);
});
} | https://github.com/DaLongZhuaZi/manxia | 75de178707d16604a8490eb252247aba8abce8ef | github |
kumaleap/ArkLuban | entry/src/main/ets/utils/PhotoHelper.ets | arkts | takePhoto | 只拍照,不选择相册
@param supportEdit 是否支持编辑,默认 true
@returns 返回拍照的图片 URI,如果取消则返回 null | static async takePhoto(supportEdit: boolean = true): Promise<string | null> {
const options = new photoAccessHelper.PhotoSelectOptions();
options.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
options.maxSelectNumber = 1;
options.isPhotoTakingSupported = true;
options.isEditSupported ... | 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 takePhoto AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left supportEdit AST#identifier#Right AST#:#Left : ... | static async takePhoto(supportEdit: boolean = true): Promise<string | null> {
const options = new photoAccessHelper.PhotoSelectOptions();
options.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE;
options.maxSelectNumber = 1;
options.isPhotoTakingSupported = true;
options.isEditSupported ... | https://github.com/kumaleap/ArkLuban | 5e4fc2aedb5a9e00640ddad54a5ab3597f38c3f5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoWebViewComponent.ets | arkts | isComponentReady | 检查组件是否已挂载 | isComponentReady(): boolean {
return this.isComponentMounted;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isComponentReady 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#st... | isComponentReady(): boolean {
return this.isComponentMounted;
} | https://github.com/DaLongZhuaZi/manxia | 6e6ad1512cebec1f61a7e12a68c3b7d6bcff2b1d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | addPageInfo | 添加页面信息 | public async addPageInfo(pageInfoInput: PageInfoInput): Promise<string> {
try {
const pageId = this.generateId();
// 确保所有数值字段都是有效的整数
const record: PageInfoDatabaseRecord = {
id: pageId,
chapterId: pageInfoInput.chapterId,
index: Math.floor(pageInfoInput.index),
... | 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 addPageInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pageInfoInput AST#identifier#Right AST#:#Lef... | public async addPageInfo(pageInfoInput: PageInfoInput): Promise<string> {
try {
const pageId = this.generateId();
// 确保所有数值字段都是有效的整数
const record: PageInfoDatabaseRecord = {
id: pageId,
chapterId: pageInfoInput.chapterId,
index: Math.floor(pageInfoInput.index),
... | https://github.com/DaLongZhuaZi/manxia | 06fa0d74888481a9ba08ee1769f4262cb28e986a | github |
Tencent-RTC/TUIKit_Harmony | atomic_x/src/main/ets/messagelist/utils/TranslationTextParser.ets | arkts | replacedStringWithArray | Reconstruct translated text by replacing text fragments with translations | public static replacedStringWithArray(
array: string[],
indexArray: number[],
replaceDict?: Record<string, string>
): string | null {
if (!replaceDict) {
return null;
}
const mutableArray = [...array];
for (const value of indexArray) {
if (value < 0 || value >= mutableArray... | 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 replacedStringWithArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left array AST#identifier#Right AST#... | public static replacedStringWithArray(
array: string[],
indexArray: number[],
replaceDict?: Record<string, string>
): string | null {
if (!replaceDict) {
return null;
}
const mutableArray = [...array];
for (const value of indexArray) {
if (value < 0 || value >= mutableArray... | https://github.com/Tencent-RTC/TUIKit_Harmony | 025913a0814f6fb954fd5abf6f98215b87cf15fc | github |
webabcd/HarmonyDemo | entry/src/main/ets/entryability/EntryAbility.ets | arkts | handleCard | 当通过卡片的 router 或 call 方式拉起了此 ability 时 | handleCard(want: Want) {
// 有 method 参数,所以是 call 方式拉起的
// 当卡片通过 call 的方式调用此应用时:
// 1、此应用未启动时,则会拉起此应用,可以在 onCreate() 中通过 Want 获取到卡片传递过来的数据,但是此应用不会出现在最近任务列表中
// 2、此应用已启动时,则在 callee.on() 中通过 data.readString() 获取卡片传递过来的数据
// 3、此应用必须具有 ohos.permission.KEEP_BACKGROUND_RUNNING 权限
if (want.parameters... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleCard AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#... | handleCard(want: Want) {
// 有 method 参数,所以是 call 方式拉起的
// 当卡片通过 call 的方式调用此应用时:
// 1、此应用未启动时,则会拉起此应用,可以在 onCreate() 中通过 Want 获取到卡片传递过来的数据,但是此应用不会出现在最近任务列表中
// 2、此应用已启动时,则在 callee.on() 中通过 data.readString() 获取卡片传递过来的数据
// 3、此应用必须具有 ohos.permission.KEEP_BACKGROUND_RUNNING 权限
if (want.parameters... | https://github.com/webabcd/HarmonyDemo | d0790e9285fe2222023d30290ce15b97d159f1fe | github |
Delsin-Yu/JustPDF | entry/src/main/ets/entryability/EntryAbility.ets | arkts | scheduleContinuationLaunchFallback | 仅当未发生 onWindowStageRestore 时,在应用已前台的情况下温启动接续 | private scheduleContinuationLaunchFallback(): void {
this.clearContinuationLaunchFallback();
this.continuationLaunchFallbackTimer = setTimeout(() => {
this.continuationLaunchFallbackTimer = undefined;
if (this.pendingContinuationWant === undefined) {
return;
}
logContinuationLi... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left scheduleContinuationLaunchFallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#... | private scheduleContinuationLaunchFallback(): void {
this.clearContinuationLaunchFallback();
this.continuationLaunchFallbackTimer = setTimeout(() => {
this.continuationLaunchFallbackTimer = undefined;
if (this.pendingContinuationWant === undefined) {
return;
}
logContinuationLi... | https://github.com/Delsin-Yu/JustPDF/blob/07d9dd917e7592f584d67821fb06a7369bd3f15b/entry/src/main/ets/entryability/EntryAbility.ets#L209-L221 | f98375ef2dded47118678459baa2ddd7dab39901 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test3_original_index.ets | arkts | testGenericIdentity | === Generic Functions === | function testGenericIdentity<T>(value: T): T {
return value;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testGenericIdentity AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type_identifier#Right AST#type_parameter#Right AST#>#Left > A... | function testGenericIdentity<T>(value: T): T {
return value;
} | https://github.com/miaochiahao/ark-ghidra | 552683ece413ede784abbed6b34faa5c2b714236 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Tracking/trackers/BaseTracker.ets | arkts | logError | 记录错误日志 | protected logError(message: string, error?: string): void {
if (error) {
logger.error(TAG, `[${this.name}] ${message}`, error);
} else {
logger.error(TAG, `[${this.name}] ${message}`);
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left protected AST#identifier#Right AST#ERROR#Left AST#identifier#Left logError AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Righ... | protected logError(message: string, error?: string): void {
if (error) {
logger.error(TAG, `[${this.name}] ${message}`, error);
} else {
logger.error(TAG, `[${this.name}] ${message}`);
}
} | https://github.com/DaLongZhuaZi/manxia | 01a7b5202a0f4d8678f5bcc1d879565771d71fe7 | github |
openharmony-tpc/ohos_mpchart | library/src/main/ets/components/components/AxisBase.ets | arkts | setAxisMinimum | Set a custom minimum value for this axis. If set, this value will not be calculated
automatically depending on
the provided data. Use resetAxisMinValue() to undo this. Do not forget to call
setStartAtZero(false) if you use
this method. Otherwise, the axis-minimum value will still be forced to 0.
@param min | public setAxisMinimum(min: number): void {
this.mCustomAxisMin = true;
this.mAxisMinimum = min;
this.mAxisRange = Math.abs(this.mAxisMaximum - min);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setAxisMinimum AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left min AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu... | public setAxisMinimum(min: number): void {
this.mCustomAxisMin = true;
this.mAxisMinimum = min;
this.mAxisRange = Math.abs(this.mAxisMaximum - min);
} | https://gitee.com/openharmony-tpc/ohos_mpchart.git | 560ce905a2fcf496c03dc83d5ad6141bfb59bbcd | gitee |
openharmony/codelabs | ETSUI/LifeTrack/entry/src/main/ets/pages/DataManager.ets | arkts | updateEventInstanceCompletion | 更新事件实例完成状态 | async updateEventInstanceCompletion(instanceId: string, completed: boolean): Promise<boolean> {
try {
return await this.eventDao.updateEventInstanceCompletion(instanceId, completed);
} catch (error) {
console.error('更新事件实例完成状态失败:', error);
return false;
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateEventInstanceCompletion AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left instanceId AST#identifier#Right AST#type_annotati... | async updateEventInstanceCompletion(instanceId: string, completed: boolean): Promise<boolean> {
try {
return await this.eventDao.updateEventInstanceCompletion(instanceId, completed);
} catch (error) {
console.error('更新事件实例完成状态失败:', error);
return false;
}
} | https://gitcode.com/openharmony/codelabs | c810504e055d263d624d82b81e20778b1bd09e6b | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/ImageCacheManager.ets | arkts | putToDiskCache | 存入磁盘缓存 | private async putToDiskCache(
cacheKey: string,
pixelMap: image.PixelMap,
options?: LoadOptions
): Promise<void> {
try {
const coversDir = this.sandboxManager.getDirectory('covers');
const fileName = `${cacheKey}.jpg`;
const filePath = `${coversDir}/${fileName}`;
// 将P... | 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 putToDiskCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left cacheKey AST#identifier#Right AST#ERROR#Left AST#:#Le... | private async putToDiskCache(
cacheKey: string,
pixelMap: image.PixelMap,
options?: LoadOptions
): Promise<void> {
try {
const coversDir = this.sandboxManager.getDirectory('covers');
const fileName = `${cacheKey}.jpg`;
const filePath = `${coversDir}/${fileName}`;
// 将P... | https://github.com/DaLongZhuaZi/manxia | 8f837a5ed38983af9431d6c80294b0cf16ecc3a9 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Diagnostics/StartupRecovery.ets | arkts | executeSafeModeStrategy | 执行安全模式策略 | private async executeSafeModeStrategy(failureType: StartupFailureType): Promise<RecoveryResult> {
logger.info('StartupRecovery', '🛡️ 执行安全模式策略');
try {
// 发送安全模式事件
const safeModePayload: IEventPayload = { failureType };
eventBus.emit('ENTER_SAFE_MODE', safeModePayload);
con... | 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 executeSafeModeStrategy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left failureType AST#identifier#Ri... | private async executeSafeModeStrategy(failureType: StartupFailureType): Promise<RecoveryResult> {
logger.info('StartupRecovery', '🛡️ 执行安全模式策略');
try {
// 发送安全模式事件
const safeModePayload: IEventPayload = { failureType };
eventBus.emit('ENTER_SAFE_MODE', safeModePayload);
con... | https://github.com/DaLongZhuaZi/manxia | b8eea8a472e4b4dee22dafa0d027d755a1993dd3 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | getData | Returns the underlying Objects array
@returns the underlying Objects array | private getData(): T[] {
return this.data
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#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#identifier#Left T AST#ident... | private getData(): T[] {
return this.data
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 03bba9c9fa53f3dd294dcb8bd75357f4f85b7970 | gitee |
honjow/Next2V | shared/src/main/ets/components/MarkdownContent.ets | arkts | InlineTokenSpans | Renders inline markdown tokens (bold, italic, code, link, etc.) as Span children.
Used inside CustomList since the library's Inline component is not exported. | @Builder
function InlineTokenSpans(
tokens: Token[],
fontSize: number,
inlineImageSizeRecords: InlineImageSizeRecord[] = [],
reportImageComplete?: InlineImageCompleteReporter,
reportImageError?: InlineImageErrorReporter,
availableWidth: number = 0,
) {
ForEach(tokens, (t: Token) => {
if (t.type === "s... | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Builder AST#identifier#Right AST#decorator#Right AST#function#Left function AST#function#Right AST#identifier#Left InlineTokenSpans AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#... | @Builder
function InlineTokenSpans(
tokens: Token[],
fontSize: number,
inlineImageSizeRecords: InlineImageSizeRecord[] = [],
reportImageComplete?: InlineImageCompleteReporter,
reportImageError?: InlineImageErrorReporter,
availableWidth: number = 0,
) {
ForEach(tokens, (t: Token) => {
if (t.type === "s... | https://github.com/honjow/Next2V | c991ccc7670aff0a8aa1ebfd81a57147a2f42dda | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Storage/StorageAnalyzer.ets | arkts | analyzeImageCache | 分析图片缓存(仅内存缓存,磁盘缓存已合并到COVER_FILES) | private async analyzeImageCache(): Promise<StorageItem> {
try {
const cacheStats = await this.imageCacheManager.getCacheStats();
const memorySize = cacheStats.memoryCache.size;
return {
type: StorageType.IMAGE_CACHE,
name: '图片内存缓存',
description: `临时缓存在内存中的图片`,
... | 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 analyzeImageCache AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | private async analyzeImageCache(): Promise<StorageItem> {
try {
const cacheStats = await this.imageCacheManager.getCacheStats();
const memorySize = cacheStats.memoryCache.size;
return {
type: StorageType.IMAGE_CACHE,
name: '图片内存缓存',
description: `临时缓存在内存中的图片`,
... | https://github.com/DaLongZhuaZi/manxia | 8ca7e90bc4a6d191827862f0e29629f05828a9b5 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | updateSystemTheme | 更新系统主题(由系统配置变化调用) | public updateSystemTheme(colorMode: number): void {
const newActualTheme = colorMode === 0 ? ThemeType.DARK : ThemeType.LIGHT;
if (this.actualTheme !== newActualTheme) {
this.actualTheme = newActualTheme;
logger.info(TAG, `系统主题更新: colorMode=${colorMode}, actualTheme=${this.actualTheme}`);
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left updateSystemTheme AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left colorMode AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#nu... | public updateSystemTheme(colorMode: number): void {
const newActualTheme = colorMode === 0 ? ThemeType.DARK : ThemeType.LIGHT;
if (this.actualTheme !== newActualTheme) {
this.actualTheme = newActualTheme;
logger.info(TAG, `系统主题更新: colorMode=${colorMode}, actualTheme=${this.actualTheme}`);
... | https://github.com/DaLongZhuaZi/manxia | 1b975a085d5dbea37bcfbedd80dfe153871f5980 | github |
Joker-x-dev/CoolMallArkTS | feature/user/src/main/ets/viewmodel/ProfileViewModel.ets | arkts | onLogoutClick | 退出登录点击
@returns {void} 无返回值 | onLogoutClick(): void {
this.requestLogout();
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onLogoutClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc... | onLogoutClick(): void {
this.requestLogout();
} | https://github.com/Joker-x-dev/CoolMallArkTS | 20273cbceda89e956dbf2f5a640c5d8151d010a8 | github |
FinalScave/SweetLine | platform/OHOS/demo/src/main/ets/pages/HighlightTheme.ets | arkts | getColor | Get color value by styleId, returns default text color if not found | public getColor(styleId: number): number {
return this.colorMap.get(styleId) ?? this.textColor;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left styleId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right ... | public getColor(styleId: number): number {
return this.colorMap.get(styleId) ?? this.textColor;
} | https://github.com/FinalScave/SweetLine | 6f7eb5042f19bd13aa985f7e1220540022899374 | github |
AetheriumSimulator/qemu-hmos | entry/src/main/ets/common/VNCConnection.ets | arkts | setState | 设置连接状态并通知回调 | private setState(state: VNCConnectionState): void {
this.connectionState = state;
this.callbacks.onStateChanged?.(state);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left setState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left state AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left VNC... | private setState(state: VNCConnectionState): void {
this.connectionState = state;
this.callbacks.onStateChanged?.(state);
} | https://github.com/AetheriumSimulator/qemu-hmos | 1087457e1268daf8cae28ec06bbbff441f4fe5ab | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Array.ets | arkts | sliceArray | Creates a new `Object[]` primitive array from portion of an array
selected from `start` to `end` (`end` not included) where `start` and `end` represent the index
of items in that array.
@param start zero-based index at which to start extraction
@param end zero-based index at which to end extraction. `sliceArray()` extr... | private sliceArray(start: int, end: int): T[] {
let len: int = this.data.length;
let relativeStart = start;
let k: int;
let _final: int;
if (relativeStart == (Int.MIN_VALUE as int)) {
k = 0;
} else if (relativeStart < 0) {
k = max(len + (relat... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left sliceArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left start AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifie... | private sliceArray(start: int, end: int): T[] {
let len: int = this.data.length;
let relativeStart = start;
let k: int;
let _final: int;
if (relativeStart == (Int.MIN_VALUE as int)) {
k = 0;
} else if (relativeStart < 0) {
k = max(len + (relat... | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | bc6ea24ee97eeda145729f6d6ee4cae609223284 | gitee |
apap6628114/nga_oh | entry/src/main/ets/service/NgaClient.ets | arkts | encryptPassword | ============== 工具函数 ==============
编解码工具(stringToUint8Array/uint8ArrayToBase64/decodeGb18030/emojiToHtmlEntity/
gbkPercentEncode/buildEncodedBody/buildMultipart/emptyStringRecord)
已下沉至 common/utils/CodecUtils.ets。
URL 工具(extractHostname/buildUrl)已下沉至 common/utils/UrlUtils.ets。
============== RSA 加密 ============== | async function encryptPassword(password: string): Promise<string> {
// convertKey 需要 DER 编码的二进制数据,即 Base64 解码后的原始字节
const base64 = new util.Base64Helper();
const pubKeyData: cryptoFramework.DataBlob = {
data: base64.decodeSync(NGA_RSA_PUBLIC_KEY),
};
let keyGenerator: cryptoFramework.AsyKeyGenerator
tr... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left encryptPassword AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left password AST#identifier#Right AST... | async function encryptPassword(password: string): Promise<string> {
// convertKey 需要 DER 编码的二进制数据,即 Base64 解码后的原始字节
const base64 = new util.Base64Helper();
const pubKeyData: cryptoFramework.DataBlob = {
data: base64.decodeSync(NGA_RSA_PUBLIC_KEY),
};
let keyGenerator: cryptoFramework.AsyKeyGenerator
tr... | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/service/NgaClient.ets#L66-L106 | 1498b481d99307901fefc72887d1fb05398f838f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebDAV/WebDAVClient.ets | arkts | createDirectoryRecursive | 递归创建目录 | async createDirectoryRecursive(remotePath: string): Promise<void> {
const parts = remotePath.split('/').filter(p => p);
let currentPath = '';
for (const part of parts) {
currentPath = currentPath ? `${currentPath}/${part}` : part;
const exists = await this.exists(currentPath);
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left createDirectoryRecursive AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left remotePath AST#identifier#Right AST#type_annotation#Le... | async createDirectoryRecursive(remotePath: string): Promise<void> {
const parts = remotePath.split('/').filter(p => p);
let currentPath = '';
for (const part of parts) {
currentPath = currentPath ? `${currentPath}/${part}` : part;
const exists = await this.exists(currentPath);
... | https://github.com/DaLongZhuaZi/manxia | 877104ba8ae35ed1cc443664d9e4f5a077f036bf | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/ThemeManager.ets | arkts | getOutlineColor | 获取边框颜色 | public getOutlineColor(): string {
return AppColors.outline;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getOutlineColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST... | public getOutlineColor(): string {
return AppColors.outline;
} | https://github.com/DaLongZhuaZi/manxia | 9c5207252db9ec2190dfcb97c2caf239310526bb | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/UndefinableObjectArray.ets | arkts | size | Returns number of elements in the List
@returns { int } The number of elements in the array
@syscap SystemCapability.Utils.Lang | public size(): int {
return this.curSize
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left 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#call_expression#Right AST#:#Left : AST#:#Righ... | public size(): int {
return this.curSize
} | https://gitcode.com/iop123123/arkts-static-skills | aa13e6c25c3b19aefcb94c4b3f5048df80f5cd9e | gitcode |
YANGZX22/Voot | entry/src/main/ets/services/ModelDownloadService.ets | arkts | startDownload | 开始下载模型 | public async startDownload(context: common.UIAbilityContext): Promise<void> {
if (this.currentState === DownloadState.DOWNLOADING) {
console.warn('[ModelDownloadService] Download already in progress');
return;
}
this.currentState = DownloadState.DOWNLOADING;
this.notifyProgress({
st... | 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 startDownload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : ... | public async startDownload(context: common.UIAbilityContext): Promise<void> {
if (this.currentState === DownloadState.DOWNLOADING) {
console.warn('[ModelDownloadService] Download already in progress');
return;
}
this.currentState = DownloadState.DOWNLOADING;
this.notifyProgress({
st... | https://github.com/YANGZX22/Voot | 7d8ce993907f2ab8e762e957a28b1ef8711cc8ca | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Cache/OnlineImageLoader.ets | arkts | isRmcdnRequest | 执行HTTP请求(内部方法) | private isRmcdnRequest(url: string): boolean {
return url.includes('rmcdn');
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isRmcdnRequest 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#Left... | private isRmcdnRequest(url: string): boolean {
return url.includes('rmcdn');
} | https://github.com/DaLongZhuaZi/manxia | e78064071b7e5be82ef3a1453308a4f3bd351851 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets | arkts | keys | Returns the names of the fields of an object
@param o an object
@returns an array of strings representing the given object's own string-keyed field keys. | public static keys(o: Object): string[] {
// Char, Boolean and Numeric types doesn't have keys
if (o instanceof Char ||
o instanceof Boolean ||
o instanceof Byte ||
o instanceof Short ||
o instanceof Int ||
o instanceof Long ||
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#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 keys AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#... | public static keys(o: Object): string[] {
// Char, Boolean and Numeric types doesn't have keys
if (o instanceof Char ||
o instanceof Boolean ||
o instanceof Byte ||
o instanceof Short ||
o instanceof Int ||
o instanceof Long ||
... | https://gitcode.com/iop123123/arkts-static-skills | eab1a6caee347f1f0830c97fac21636a1fa4ffce | gitcode |
Joker-x-dev/CoolMallArkTS | core/util/src/main/ets/toast/ToastUtils.ets | arkts | showWarning | 显示警告提示
@param {string | ResourceStr} message - 提示内容
@returns {void} 无返回值 | static showWarning(message: string | ResourceStr): void {
IBestToast.show({
type: "warning",
message: message
});
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left showWarning AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression... | static showWarning(message: string | ResourceStr): void {
IBestToast.show({
type: "warning",
message: message
});
} | https://github.com/Joker-x-dev/CoolMallArkTS | d6ac6560103b3dfe8488fae5928d2e8d3ca5a1af | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.ArrayList.ets | arkts | add | Add new elements to the ArrayList.
@param element - the added element.
@returns true if added successfully. | public add(element: T): boolean {
if (this.length >= Int.MAX_VALUE) {
throw createBusinessError(CapacityErrorCodeId, `The current capacity has reached the maximum limit.`);
}
if (this.length == this.capacity) {
this.increaseCap((this.capacity * 1.5).toInt());
... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left add AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id... | public add(element: T): boolean {
if (this.length >= Int.MAX_VALUE) {
throw createBusinessError(CapacityErrorCodeId, `The current capacity has reached the maximum limit.`);
}
if (this.length == this.capacity) {
this.increaseCap((this.capacity * 1.5).toInt());
... | https://gitcode.com/iop123123/arkts-static-skills | a7114c5fcbcd2d0259ba7f768e049f1cb6a8abf5 | gitcode |
tdcare/tdwebrtc | src/main/ets/utils/PermissionUtil.ets | arkts | requestPermissions | 申请授权(支持权限组合)
@param permissions 需要授权的权限
@returns true表示授权成功继续业务操作,false表示用户拒绝授权 | static async requestPermissions(permissions: Permissions | Array<Permissions>): Promise<boolean> {
const atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
const context: Context = getContext() as common.UIAbilityContext;
//requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
let r... | 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 requestPermissions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left permissions AST#identifier#Right AST#... | static async requestPermissions(permissions: Permissions | Array<Permissions>): Promise<boolean> {
const atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager();
const context: Context = getContext() as common.UIAbilityContext;
//requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
let r... | https://github.com/tdcare/tdwebrtc | 31e1dfb5475dcc176a85ead7df7294a59e6257ac | github |
TDCQCX/ShiHuaMusic-Harmony | entry/src/main/ets/utils/StyleUtil.ets | arkts | getCaptionTextStyle | 获取小文本样式 | static getCaptionTextStyle() {
const theme = ThemeUtil.getCurrentThemeConfig();
const fontSize = theme.fontSize;
return {
fontSize: `${fontSize.sm}px`,
color: theme.colors.textSecondary
};
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCaptionTextStyle 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 getCaptionTextStyle() {
const theme = ThemeUtil.getCurrentThemeConfig();
const fontSize = theme.fontSize;
return {
fontSize: `${fontSize.sm}px`,
color: theme.colors.textSecondary
};
} | https://github.com/TDCQCX/ShiHuaMusic-Harmony | 1431a7f1288ced08290dc6d4b2a75baa1231e581 | github |
Joker-x-dev/CoolMallArkTS | feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets | arkts | loadCancelReasons | 加载取消原因字典数据
@returns {void} 无返回值 | loadCancelReasons(): void {
if (this.cancelReasonsUiState === BaseNetWorkUiState.SUCCESS && this.cancelReasonList.length > 0) {
return;
}
const params: DictDataRequest = new DictDataRequest();
params.types = ["orderCancelReason"];
RequestHelper.repository<DictDataResponse>(this.commonReposit... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left loadCancelReasons 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#{#Left { AST#{#Right AST#m... | loadCancelReasons(): void {
if (this.cancelReasonsUiState === BaseNetWorkUiState.SUCCESS && this.cancelReasonList.length > 0) {
return;
}
const params: DictDataRequest = new DictDataRequest();
params.types = ["orderCancelReason"];
RequestHelper.repository<DictDataResponse>(this.commonReposit... | https://github.com/Joker-x-dev/CoolMallArkTS | 05dad25757bba1f4d2f55fab86461db976f672d2 | github |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/input/GyroAssistService.ets | arkts | updateGamepadState | 更新最近一次手柄完整状态(每次手柄事件时由 StreamPage 调用)
陀螺仪即时发送时使用此状态来构造完整的数据包 | updateGamepadState(
deviceId: number,
buttons: number,
leftStickX: number,
leftStickY: number,
physRightStickX: number,
physRightStickY: number,
leftTrigger: number,
rightTrigger: number,
controllerType: number
): void {
this.lastDeviceId = deviceId;
this.lastButtons = bu... | AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left updateGamepadState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left deviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri... | updateGamepadState(
deviceId: number,
buttons: number,
leftStickX: number,
leftStickY: number,
physRightStickX: number,
physRightStickY: number,
leftTrigger: number,
rightTrigger: number,
controllerType: number
): void {
this.lastDeviceId = deviceId;
this.lastButtons = bu... | https://github.com/AlkaidLab/moonlight-harmony | cac73897f2f4a1d81424e6c2c27b62ceffbc0fb9 | github |
HarmonyOS_Samples/BestPracticeSnippets | ImageEditTaskPool/entry/src/main/ets/view/AdjustContentView.ets | arkts | imageProcessing | [End execImageProcessing]
[End postProcess_start] | @Concurrent
async function imageProcessing(args: ImageProcessing) {
const buf = execColorInfo(args.buffer, CommonConstants.SLIDER_MAX, args.value, args.type) as ArrayBuffer;
return buf;
} | AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left imageProcessing AST#identifier#Right AST#formal_parame... | @Concurrent
async function imageProcessing(args: ImageProcessing) {
const buf = execColorInfo(args.buffer, CommonConstants.SLIDER_MAX, args.value, args.type) as ArrayBuffer;
return buf;
} | https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets | 0711f7f1ca2904beee8bfcd311a99d8d0c800c92 | gitcode |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/DataManager.ets | arkts | destroy | 销毁数据管理器 | public destroy(): void {
this.stopTimers();
this.sandboxManager.destroy();
DataManager.instance = null;
logger.info(TAG, '数据管理器已销毁');
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left destroy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_sta... | public destroy(): void {
this.stopTimers();
this.sandboxManager.destroy();
DataManager.instance = null;
logger.info(TAG, '数据管理器已销毁');
} | https://github.com/DaLongZhuaZi/manxia | fe5006e12d618af2d821e038a87c2d83d5ed96f8 | github |
LJ666-ui/harmony-health-care | entry/src/main/ets/aiagent/RAGRetriever.ets | arkts | constructor | 构造函数
@param vectorDBClient 向量数据库客户端
@param knowledgeBaseClient 知识库客户端
@param config RAG配置 | constructor(
vectorDBClient: VectorDBClient,
knowledgeBaseClient: KnowledgeBaseClient,
config?: Partial<RAGConfig>
) {
this.vectorDBClient = vectorDBClient;
this.knowledgeBaseClient = knowledgeBaseClient;
this.config = {
topK: 5,
similarityThreshold: 0.7,
maxContentLength: ... | 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 vectorDBClient AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left VectorDBClient AST#... | constructor(
vectorDBClient: VectorDBClient,
knowledgeBaseClient: KnowledgeBaseClient,
config?: Partial<RAGConfig>
) {
this.vectorDBClient = vectorDBClient;
this.knowledgeBaseClient = knowledgeBaseClient;
this.config = {
topK: 5,
similarityThreshold: 0.7,
maxContentLength: ... | https://github.com/LJ666-ui/harmony-health-care | cf8c7bdf2381783b369bf607c51520ec557b4890 | github |
honjow/Next2V | shared/src/main/ets/utils/AppPrompt.ets | arkts | modalSystemMaterial | Semi-modal sheets and dialog boxes (半模态 / 弹出框) cover a large area with rich content; the guidance
recommends the thickest ULTRA_THICK tier so the blurred backdrop never lets the page behind bleed
through and hurt readability. | static modalSystemMaterial(): uiMaterial.Material | undefined {
if (!deviceInfo.apiAvailable('26.0.0')) {
return undefined
}
return ImmersiveMaterialSettings.systemMaterial(
connectImmersiveMaterialSettings().level,
uiMaterial.ImmersiveStyle.ULTRA_THICK,
false,
)
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left modalSystemMaterial 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#... | static modalSystemMaterial(): uiMaterial.Material | undefined {
if (!deviceInfo.apiAvailable('26.0.0')) {
return undefined
}
return ImmersiveMaterialSettings.systemMaterial(
connectImmersiveMaterialSettings().level,
uiMaterial.ImmersiveStyle.ULTRA_THICK,
false,
)
} | https://github.com/honjow/Next2V | 426bf59e9880c74daa59603c20dd5776cc5c0159 | github |
ZestBox-18/kitebook-frontend | commons/data_core/src/main/ets/services/BudgetManager.ets | arkts | updateBudget | 更新预算金额。 | private static async updateBudget(id: number, amount: number): Promise<number> {
const predicates = new relationalStore.RdbPredicates(TABLE_NAME);
predicates.equalTo('id', id);
const data: relationalStore.ValuesBucket = {
amount: amount,
updated_at: Date.now()
};
return new Promise<nu... | 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 updateBudget AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id... | private static async updateBudget(id: number, amount: number): Promise<number> {
const predicates = new relationalStore.RdbPredicates(TABLE_NAME);
predicates.equalTo('id', id);
const data: relationalStore.ValuesBucket = {
amount: amount,
updated_at: Date.now()
};
return new Promise<nu... | https://github.com/ZestBox-18/kitebook-frontend | 5b0bb26697d8b3136eecedb2246c5c5694d63a62 | github |
harmonyos/codelabs | HarmonyOS_NEXT/DistributedContacts/entry/src/main/ets/viewmodel/DetailPageViewModel.ets | arkts | redirectListPage | Redirect list page. | redirectListPage(): void {
router.pushUrl({
url: CommonConstants.LIST_PAGE_URL
}).catch((err: BusinessError) => {
Logger.error(`pushUrl failed, error message is ${JSON.stringify(err)}`);
});
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left redirectListPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b... | redirectListPage(): void {
router.pushUrl({
url: CommonConstants.LIST_PAGE_URL
}).catch((err: BusinessError) => {
Logger.error(`pushUrl failed, error message is ${JSON.stringify(err)}`);
});
} | https://gitee.com/harmonyos/codelabs.git | 5b0df1d947dca959222b873e604935dd96f63f32 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | copyWithin | Makes a copy of internal elements to targetPos from startPos to endPos.
See rules of parameters normalization on
{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin | MDN}
@param { int } target - insert index to place copied elements
@param { int } start - start inde... | public copyWithin(target: int, start: int, end?: int): Int8Array {
let arrayLength: int = this.lengthInt;
target = normalizeIndex(target, arrayLength);
start = normalizeIndex(start, arrayLength);
end = normalizeIndex(asIntOrDefault(end, arrayLength), arrayLength);
let count: ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left copyWithin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#... | public copyWithin(target: int, start: int, end?: int): Int8Array {
let arrayLength: int = this.lengthInt;
target = normalizeIndex(target, arrayLength);
start = normalizeIndex(start, arrayLength);
end = normalizeIndex(asIntOrDefault(end, arrayLength), arrayLength);
let count: ... | https://gitcode.com/iop123123/arkts-static-skills | b8c1ecc352ce3f2c2eb781770b0836113da5b28a | gitcode |
LJ666-ui/harmony-health-care | entry/src/main/ets/ar/PathPlanner.ets | arkts | getDistance | 计算两点间距离(3D欧几里得距离)
@param from 起点
@param to 终点 | public getDistance(from: Position3D, to: Position3D): number {
const dx = to.x - from.x;
const dy = to.y - from.y;
const dz = to.z - from.z;
return Math.sqrt(dx * dx + dy * dy + dz * dz);
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDistance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Posi... | public getDistance(from: Position3D, to: Position3D): number {
const dx = to.x - from.x;
const dy = to.y - from.y;
const dz = to.z - from.z;
return Math.sqrt(dx * dx + dy * dy + dz * dz);
} | https://github.com/LJ666-ui/harmony-health-care | d2df0664fcc8cecfbb47c853313dcec3bd86b191 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/concurrency/AsyncMutex.ets | arkts | lock | Acquires the mutex. Blocks if already locked by another coroutine.
@returns { Promise<void> } A promise that resolves when the mutex is acquired
@syscap SystemCapability.Utils.Lang | public async lock(): Promise<void> {
if (this.waiters_.fetchAdd(1) == 0) {
return;
}
await this.waitersList_.suspend();
return;
} | 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 lock AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS... | public async lock(): Promise<void> {
if (this.waiters_.fetchAdd(1) == 0) {
return;
}
await this.waitersList_.suspend();
return;
} | https://gitcode.com/iop123123/arkts-static-skills | 229e7c80ade63b97a0dbaa52860e5ec6f3467077 | gitcode |
openharmony/applications_app_samples | code/BasicFeature/DeviceManagement/ScreenDetector/entry/src/ohosTest/ets/test/Ability.test.ets | arkts | checkButtonAndClickWithID | 通过id验证有没有这个组件 有的话点击一下 | async function checkButtonAndClickWithID(text: string) {
let atom = text
await driver.assertComponentExist(ON.id(atom))
let button = await driver.findComponent(ON.id(atom))
await button.click()
await driver.delayMs(DELAY_TIME)
Logger.info(TAG, BUNDLE + atom)
} | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left checkButtonAndClickWithID AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left text AST#identifier#Rig... | async function checkButtonAndClickWithID(text: string) {
let atom = text
await driver.assertComponentExist(ON.id(atom))
let button = await driver.findComponent(ON.id(atom))
await button.click()
await driver.delayMs(DELAY_TIME)
Logger.info(TAG, BUNDLE + atom)
} | https://github.com/openharmony/applications_app_samples | afc245c6217aadddda815df494c90585116840ae | github |
XXYoLoong/SchoolSmart | entry/src/main/ets/components/indexpages/CampusEnvMonitor.ets | arkts | aboutToAppear | 生命周期方法,当组件即将出现在页面上时调用 | aboutToAppear(){
// 启动自动刷新功能,定期更新环境监测数据
this.startAutoRefresh();
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left... | aboutToAppear(){
// 启动自动刷新功能,定期更新环境监测数据
this.startAutoRefresh();
} | https://github.com/XXYoLoong/SchoolSmart | 3ce7eb8a415a86b8d316e50bb3b61d3616141488 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test35_original_index.ets | arkts | testForEach | --- Array.forEach with side effects --- | function testForEach(): string {
let arr: string[] = ['a', 'b', 'c', 'd'];
let result: string = '';
arr.forEach((val: string): void => {
result = result + val.toUpperCase();
});
return result;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testForEach AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type... | function testForEach(): string {
let arr: string[] = ['a', 'b', 'c', 'd'];
let result: string = '';
arr.forEach((val: string): void => {
result = result + val.toUpperCase();
});
return result;
} | https://github.com/miaochiahao/ark-ghidra | 991ca7cb96cf8771ba4f5f3912b9713b1c38e269 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/NovelLoginManager.ets | arkts | getLoginHeader | 获取登录头信息(对应Legado的getLoginHeader) | getLoginHeader(sourceId: string): string {
return this.loginHeaderStore.get(sourceId) || '';
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLoginHeader 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 ) AST#... | getLoginHeader(sourceId: string): string {
return this.loginHeaderStore.get(sourceId) || '';
} | https://github.com/DaLongZhuaZi/manxia | 878bd6a78fe0724dd103eaebce9309ebcf45b1da | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.