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 |
|---|---|---|---|---|---|---|---|---|---|---|
bluedeer000/HarmonyCalendar | entry/src/main/ets/services/CalDavSourceAdapter.ets | arkts | queryFreeBusy | -------- 高级功能 -------- | async queryFreeBusy(
source: CalendarSource,
startAt: number,
endAt: number
): Promise<CalendarFreeBusySlot[]> {
const account: CalendarAccount = mergeAccount(source, this.account);
const client = buildDavClient(account, source.collectionUrl);
const queryUrl: string = source.scheduleOutboxUr... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left queryFreeBusy AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left source AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | async queryFreeBusy(
source: CalendarSource,
startAt: number,
endAt: number
): Promise<CalendarFreeBusySlot[]> {
const account: CalendarAccount = mergeAccount(source, this.account);
const client = buildDavClient(account, source.collectionUrl);
const queryUrl: string = source.scheduleOutboxUr... | https://github.com/bluedeer000/HarmonyCalendar | 53ca59f349a47b960da3b789ccc7c802154ea207 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/DataValidator.ets | arkts | validateTimestamp | 验证时间戳
@param value - 要验证的时间戳
@param fieldName - 字段名称
@returns 验证结果 | static validateTimestamp(value: number | undefined | null, fieldName: string = 'timestamp'): ValidationResult {
const errors: string[] = [];
if (value === null || value === undefined) {
errors.push(`${fieldName} 不能为空`);
} else if (typeof value !== 'number' || isNaN(value)) {
errors.push(`... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left validateTimestamp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expres... | static validateTimestamp(value: number | undefined | null, fieldName: string = 'timestamp'): ValidationResult {
const errors: string[] = [];
if (value === null || value === undefined) {
errors.push(`${fieldName} 不能为空`);
} else if (typeof value !== 'number' || isNaN(value)) {
errors.push(`... | https://github.com/DaLongZhuaZi/manxia | 1473ec9d6b7e91998078bcb23ad6a905e04c0cd8 | github |
harmonyos/codelabs | HarmonyOS_NEXT/MusicHome/common/mediaCommon/src/main/ets/utils/BackgroundUtil.ets | arkts | stopContinuousTask | Stop background task.
@param context | public static stopContinuousTask(context: common.UIAbilityContext): void {
try {
backgroundTaskManager.stopBackgroundRunning(context).then(() => {
Logger.info('this avPlayer: ', 'stopBackgroundRunning succeeded');
}).catch((error: BusinessError) => {
Logger.error('this avPlayer: ', `st... | 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 stopContinuousTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#L... | public static stopContinuousTask(context: common.UIAbilityContext): void {
try {
backgroundTaskManager.stopBackgroundRunning(context).then(() => {
Logger.info('this avPlayer: ', 'stopBackgroundRunning succeeded');
}).catch((error: BusinessError) => {
Logger.error('this avPlayer: ', `st... | https://gitee.com/harmonyos/codelabs.git | b32be1604664a9d8d834d57d3b763a41071244c4 | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/TypedUArrays.ets | arkts | map | Creates a new Uint16Array using fn(arr[i]) over all elements of current Uint16Array
@param fn a function to apply for each element of current Uint16Array
@returns a new Uint16Array where for each element from current Uint16Array fn was applied | public map(fn: (val: number) => number): Uint16Array
{
let newF: (val: number, index: int) => number =
(val: number, index: int): number => { return fn(val as number) as number }
return this.map(newF)
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right... | public map(fn: (val: number) => number): Uint16Array
{
let newF: (val: number, index: int) => number =
(val: number, index: int): number => { return fn(val as number) as number }
return this.map(newF)
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 09c17a6bdd930fa55f490d7a72210d7a4cfc566f | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/NovelReaderPage.ets | arkts | closeEncyclopediaDialog | 关闭百科搜索对话框 | closeEncyclopediaDialog(): void {
this.showEncyclopediaDialog = false;
this.encyclopediaKeyword = '';
this.encyclopediaUrl = '';
this.handleReaderOverlayClosed('encyclopedia_close');
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left closeEncyclopediaDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#stat... | closeEncyclopediaDialog(): void {
this.showEncyclopediaDialog = false;
this.encyclopediaKeyword = '';
this.encyclopediaUrl = '';
this.handleReaderOverlayClosed('encyclopedia_close');
} | https://github.com/DaLongZhuaZi/manxia | 05f0f2d1aaf3cbfd6cec6227b47e1da9da3db80d | github |
xblLab/HarmonyProjectTemplate | commons/lib_account/src/main/ets/utils/HuaweiAuthUtils.ets | arkts | loginHuaweiID | 登录华为账号
@returns | static loginHuaweiID(): Promise<void> {
const loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
// 默认值为true,若账号未登录则强制拉起账号登录页
loginRequest.forceLogin = true;
loginRequest.state = util.generateRandomUUID();
const controller = new authentication.AuthenticationCont... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left loginHuaweiID 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#instantiation_expression... | static loginHuaweiID(): Promise<void> {
const loginRequest = new authentication.HuaweiIDProvider().createLoginWithHuaweiIDRequest();
// 默认值为true,若账号未登录则强制拉起账号登录页
loginRequest.forceLogin = true;
loginRequest.state = util.generateRandomUUID();
const controller = new authentication.AuthenticationCont... | https://github.com/xblLab/HarmonyProjectTemplate | 24595fcc7826d00a219ad2c512627b779348feb5 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets | arkts | titleTopEmpty | Whether there is nothing in the major title top area. | get titleTopEmpty() {
if (windowTitleOnAddressBar() || !showWindowTitle(this.myLayout)) {
return true;
} else {
return false;
}
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left titleTopEmpty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Ri... | get titleTopEmpty() {
if (windowTitleOnAddressBar() || !showWindowTitle(this.myLayout)) {
return true;
} else {
return false;
}
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | ba775288c94558b9cd82355fc120605b72e5e4f3 | github |
iop123123/arkts-static-skills | cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.xml.ets | arkts | setCDATA | Sets the CDATA section for the XML content.
@param {string} data - The string data to be wrapped in a Cdata section. | public setCDATA(text: string): void {
let stringBuilder = this.prepareBufferForNewItem(text);
text = text.replaceAll(']]>', ']]]]><![CDATA[>');
stringBuilder.append(`<![CDATA[${text}]]>`);
this.type = XmlType.OTHERS;
this.writeToBuffer(stringBuilder, ... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setCDATA AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ... | public setCDATA(text: string): void {
let stringBuilder = this.prepareBufferForNewItem(text);
text = text.replaceAll(']]>', ']]]]><![CDATA[>');
stringBuilder.append(`<![CDATA[${text}]]>`);
this.type = XmlType.OTHERS;
this.writeToBuffer(stringBuilder, ... | https://gitcode.com/iop123123/arkts-static-skills | 1df5f28d5e1db1f70cf9b36d002b8893e78e8926 | gitcode |
2763981847/Accounting-app | entry/src/main/ets/pages/MainPage.ets | arkts | getGroupedAccounts | 将账单按日期分组 | function getGroupedAccounts(accounts: Array<Account>): Array<Array<Account>> {
let groupedAccounts = [];
for (let i = 0; i < accounts.length; i++) {
const account = accounts[i];
if (i === 0 || !isSameDay(accounts[i - 1].date, account.date)) {
groupedAccounts.push([]);
}
groupedAccounts[grouped... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getGroupedAccounts AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left accounts AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | function getGroupedAccounts(accounts: Array<Account>): Array<Array<Account>> {
let groupedAccounts = [];
for (let i = 0; i < accounts.length; i++) {
const account = accounts[i];
if (i === 0 || !isSameDay(accounts[i - 1].date, account.date)) {
groupedAccounts.push([]);
}
groupedAccounts[grouped... | https://github.com/2763981847/Accounting-app | 04a1ddc971d3a8ba3ae725a3ee90358fe31c0bd1 | github |
XXYoLoong/SchoolSmart | entry/src/main/ets/components/indexpages/CampusEnvMonitor.ets | arkts | startAutoRefresh | 自动刷新方法,使用定时器每隔3000毫秒(3秒)刷新数据 | startAutoRefresh() {
setInterval(() => {
// 调用 fetchSensorData 方法来获取新的传感器数据
this.fetchSensorData();
}, 3000);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startAutoRefresh 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... | startAutoRefresh() {
setInterval(() => {
// 调用 fetchSensorData 方法来获取新的传感器数据
this.fetchSensorData();
}, 3000);
} | https://github.com/XXYoLoong/SchoolSmart | feb427a22ed9ad5ed38416049fe4963760765ff8 | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test10_original_index.ets | arkts | testConditionalAssign | --- Conditional expression in variable assignment --- | function testConditionalAssign(score: number): string {
let grade: string = '';
if (score >= 90) {
grade = 'A';
} else if (score >= 80) {
grade = 'B';
} else if (score >= 70) {
grade = 'C';
} else {
grade = 'F';
}
return grade;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testConditionalAssign AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left score AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | function testConditionalAssign(score: number): string {
let grade: string = '';
if (score >= 90) {
grade = 'A';
} else if (score >= 80) {
grade = 'B';
} else if (score >= 70) {
grade = 'C';
} else {
grade = 'F';
}
return grade;
} | https://github.com/miaochiahao/ark-ghidra | 92b164e768da1e0bd16e6a26719d932703810edc | github |
CPF-ApplicationTPC/imageknifepro | library/src/main/ets/ImageKnife.ets | arkts | setHeicOptimizeDecoding | 设置默认解码是否使用优化heic图片解码
没有调用时,默认不启用
设置为true后,图片会优化Heic解码,以减小解码后的图片内存占用
如果Heic图片设置了图形变换,则不会应用该解码优化,仍然使用默认的解码方式
启用后,GetCacheImage接口可能获取到非RGBA像素的格式的pixelmap
@param enable 是否开启heic解码优化 | setHeicOptimizeDecoding(enable: boolean) {
nativeNode.setHeicOptimizeDecoding(enable);
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setHeicOptimizeDecoding AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#ide... | setHeicOptimizeDecoding(enable: boolean) {
nativeNode.setHeicOptimizeDecoding(enable);
} | https://gitcode.com/CPF-ApplicationTPC/imageknifepro/blob/5b2c39b2925d2e6c4a267ce62edc340b3150dcb9/library/src/main/ets/ImageKnife.ets#L406-L408 | cba8a003c5c073efdff1dd17d2fcde3e0a73c2e1 | gitcode |
openharmony-tpc/XmlGraphicsBatik | library/src/main/ets/batik/SVGManager.ets | arkts | createFolder | 创建文件夹
@param 文件夹绝对路径 | public createFolder(path: string): void {
//创建文件夹
if (!this._isFolderExisted(path)) {
fileio.mkdirSync(path);
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left createFolder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left path AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left str... | public createFolder(path: string): void {
//创建文件夹
if (!this._isFolderExisted(path)) {
fileio.mkdirSync(path);
}
} | https://gitee.com/openharmony-tpc/XmlGraphicsBatik.git | 8ab2e38f0bfd9d63ef2d389d71c67311e15eb138 | gitee |
openharmony-sig/commons-cli | library/src/main/ets/components/cli/HelpFormatter.ets | arkts | setArgName | Sets the 'argName'.
@param name the new value of 'argName' | public setArgName(name:string):void {
this.defaultArgName = name;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setArgName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left strin... | public setArgName(name:string):void {
this.defaultArgName = name;
} | https://gitee.com/openharmony-sig/commons-cli.git | 6d2d33d64321ddf93f73ccb3b680f75ccdd37b5c | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Workflow/WorkflowExecutor.ets | arkts | createApiWorkflow | 创建简单的API工作流 | static createApiWorkflow(
name: string,
url: string,
method: string = 'GET',
headers?: Record<string, string>,
body?: Object
): WorkflowDefinition {
const step: WorkflowStep = {
type: 'api',
url: url,
method: method,
headers: headers,
body: body
};
cons... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createApiWorkflow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef... | static createApiWorkflow(
name: string,
url: string,
method: string = 'GET',
headers?: Record<string, string>,
body?: Object
): WorkflowDefinition {
const step: WorkflowStep = {
type: 'api',
url: url,
method: method,
headers: headers,
body: body
};
cons... | https://github.com/DaLongZhuaZi/manxia | f7e98c1430f3bf4ad4ae00deff1df92a58bc2d04 | github |
openharmony/applications_permission_manager | permissionmanager/src/main/ets/pages/application-tertiary.ets | arkts | updateReason | Update reason | updateReason() {
bundleManager.getApplicationInfo(
this.applicationInfo.bundleName, bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT
).then(appInfo => {
let bundleContext = this.context.createBundleContext(this.bundleName)
bundleContext.resourceManager.getStringValue(appInfo.labelI... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateReason 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 ... | updateReason() {
bundleManager.getApplicationInfo(
this.applicationInfo.bundleName, bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT
).then(appInfo => {
let bundleContext = this.context.createBundleContext(this.bundleName)
bundleContext.resourceManager.getStringValue(appInfo.labelI... | https://gitee.com/openharmony/applications_permission_manager.git | 52d1f5e5438202f369428b90a9db39eea24d884d | gitee |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/app/AppNav.ets | arkts | selectTab | 按标签切换主页面。 | selectTab(tab: AppTab): void {
this.navigateByName(this.resolveMainRouteByTab(tab));
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left selectTab AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tab AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AppTab AST#identifier#Right AST#)#Left ) AST#)#... | selectTab(tab: AppTab): void {
this.navigateByName(this.resolveMainRouteByTab(tab));
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/app/AppNav.ets#L32-L34 | 7512ba4913ba24b550bcbf3895cc5b850189c699 | github |
webabcd/HarmonyDemo | entry/src/main/ets/pages/security/PermissionDemo.ets | arkts | checkPermission | 判断当前应用是否具有指定的授权 | function checkPermission(permissionName: Permissions): boolean {
try {
// 获取当前应用的 tokenId
const bundleInfo = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION);
const tokenId = bundleInfo.appInfo.accessTokenId;
// 创建权限管理器
const atManager = abilityAcc... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left checkPermission AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left permissionName AST#identifier#Right AST#type_annotation#Left AST#:#Lef... | function checkPermission(permissionName: Permissions): boolean {
try {
// 获取当前应用的 tokenId
const bundleInfo = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION);
const tokenId = bundleInfo.appInfo.accessTokenId;
// 创建权限管理器
const atManager = abilityAcc... | https://github.com/webabcd/HarmonyDemo | fc7d196b11f182f41469d2b4352f0293e51a9ae0 | github |
openharmony/codelabs | ETSUI/Foodbook/entry/src/main/ets/pages/login.ets | arkts | aboutToAppear | 生成的验证码 | aboutToAppear() {
if (!AppStorage.has(USER_LIST_KEY)) {
const userList: user_account[] = [];
userList.push(initialUser);
AppStorage.setOrCreate(USER_LIST_KEY, userList);
}
} | 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() {
if (!AppStorage.has(USER_LIST_KEY)) {
const userList: user_account[] = [];
userList.push(initialUser);
AppStorage.setOrCreate(USER_LIST_KEY, userList);
}
} | https://gitcode.com/openharmony/codelabs | bcaa3a3c8e82ca7d9080dd1617117c2970041b30 | gitcode |
openharmony-sig/applications_clock | feature/timer/src/main/ets/controller/TimerController.ets | arkts | reload | Read the previous state from the preferences | public async reload() {
LogUtil.info(`${TAG} Read the previous data `);
this.preferences = await data_preferences.getPreferences(globalThis.abilityContext, STORE_NAME);
this.state = <TimerState> await this.preferences.get(this.stateStr, TimerState.IDLE);
this.lastTimeMs = <number> await this.preferenc... | 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 reload AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Rig... | public async reload() {
LogUtil.info(`${TAG} Read the previous data `);
this.preferences = await data_preferences.getPreferences(globalThis.abilityContext, STORE_NAME);
this.state = <TimerState> await this.preferences.get(this.stateStr, TimerState.IDLE);
this.lastTimeMs = <number> await this.preferenc... | https://gitee.com/openharmony-sig/applications_clock.git | 99bfd060c3650420e808262bab0ac8805f2c6a4a | gitee |
openharmony/arkui_ace_engine | examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets | arkts | getData | -- Methods --
Returns a new copy of the data bits of this segment. | public getData(): Array<bit> {
return this.bitData.slice(); // Make defensive copy
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_sta... | public getData(): Array<bit> {
return this.bitData.slice(); // Make defensive copy
} | https://gitee.com/openharmony/arkui_ace_engine.git | 1da8ddaf0d7dd764be2f5ebf6552d3565a2e769f | gitee |
Explore-In-HMOS-Wearable/how-to-use-uiability-lifecycle | entry/src/main/ets/pages/Index.ets | arkts | build | Builds the user interface for displaying lifecycle logs and a refresh button.
@returns The UI layout. | build() {
Column() {
Text($r('app.string.title_text'))
.fontSize($r('app.float.large_font_size'))
.fontWeight(FontWeight.Bold)
.fontColor(Color.Blue)
.margin({ top: ($r('app.float.margin_top')) })
.textAlign(TextAlign.Center)
.width('50%')
Button($r('ap... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST... | build() {
Column() {
Text($r('app.string.title_text'))
.fontSize($r('app.float.large_font_size'))
.fontWeight(FontWeight.Bold)
.fontColor(Color.Blue)
.margin({ top: ($r('app.float.margin_top')) })
.textAlign(TextAlign.Center)
.width('50%')
Button($r('ap... | https://github.com/Explore-In-HMOS-Wearable/how-to-use-uiability-lifecycle | 5d798ce3e222481943dd84acd0e8db30b5a88580 | github |
the-wwyang/kids-learning-app | src/main/ets/services/WrongQuestionService.ets | arkts | getAnalysisReport | 获取错题分析报告
@param records 错题记录列表
@returns 分析报告文本 | static getAnalysisReport(records: WrongQuestionRecord[]): string[] {
const stats = WrongQuestionService.calculateStats(records);
const report: string[] = [];
if (stats.totalCount === 0) {
report.push('🎉 太棒了!目前没有错题记录');
return report;
}
// 总体情况
report.push(`📊 共有 ${stats.totalCou... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getAnalysisReport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_e... | static getAnalysisReport(records: WrongQuestionRecord[]): string[] {
const stats = WrongQuestionService.calculateStats(records);
const report: string[] = [];
if (stats.totalCount === 0) {
report.push('🎉 太棒了!目前没有错题记录');
return report;
}
// 总体情况
report.push(`📊 共有 ${stats.totalCou... | https://github.com/the-wwyang/kids-learning-app | fde80d6673c87897963d3f7eb807be1fbf21532a | github |
Countly/countly-sdk-hos | library/src/main/ets/internal/OverlayStore.ets | arkts | resizeContent | Update just the placement (content triggered a `resize_me` message). Does
not bump ACTIVE, the overlay is already showing. | public static resizeContent(px: number, py: number, pw: number, ph: number, lx: number, ly: number, lw: number, lh: number): void {
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P_X, px);
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P_Y, py);
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P... | 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 resizeContent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left px AST#identifier#Right AST#:#Left : AST#... | public static resizeContent(px: number, py: number, pw: number, ph: number, lx: number, ly: number, lw: number, lh: number): void {
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P_X, px);
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P_Y, py);
AppStorage.SetOrCreate<number>(OverlayKeys.CONTENT_P... | https://github.com/Countly/countly-sdk-hos | d3f549bf8f61a7c67ad7a408687014e4bc5cd9fa | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/PageLifecycleManager.ets | arkts | clearInterval | 清除 setInterval
@param timerId 定时器 ID | clearInterval(timerId: number): void {
const timerInfo = this.timers.get(timerId);
if (timerInfo) {
clearInterval(timerInfo.id);
this.timers.delete(timerId);
if (this.config.enableDebug) {
logger.debug(TAG, `[${this.pageId}] clearInterval: id=${timerId}`);
}
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearInterval AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left timerId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#... | clearInterval(timerId: number): void {
const timerInfo = this.timers.get(timerId);
if (timerInfo) {
clearInterval(timerInfo.id);
this.timers.delete(timerId);
if (this.config.enableDebug) {
logger.debug(TAG, `[${this.pageId}] clearInterval: id=${timerId}`);
}
}
} | https://github.com/DaLongZhuaZi/manxia | d026598742b59968fa6bc40e2d5149d92aca9432 | github |
erosTeam/NextE | shared/src/main/ets/settings/SearchFilterSettings.ets | arkts | parse | Defensive parse: bad JSON / shape → null; bad fields → safe defaults (0 / false). | private static parse(raw: string): SearchFilterSnapshot | null {
try {
const parsed: Object = JSON.parse(raw) as Object
// Reject a non-object blob (null / primitive / array) outright rather than silently coercing it
// to an all-defaults snapshot that would overwrite live state.
if (parse... | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left parse AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AS... | private static parse(raw: string): SearchFilterSnapshot | null {
try {
const parsed: Object = JSON.parse(raw) as Object
// Reject a non-object blob (null / primitive / array) outright rather than silently coercing it
// to an all-defaults snapshot that would overwrite live state.
if (parse... | https://github.com/erosTeam/NextE | 3d36d95f4499d83dd1dd20dd36eb060ff95320e7 | github |
HarmonyOS_Samples/MultiPictureBeautification | features/multipicturebrowsing/src/main/ets/viewmodel/AlbumListViewModel.ets | arkts | updateSidebarVisibility | Update sidebar visibility based on screen width and aspect ratio
Business logic moved from View to ViewModel | updateSidebarVisibility(curWidthVp: number, ratio: number): void {
if (curWidthVp >= CommonConstants.BREAKPOINT_WIDTH_MEDIUM && ratio <= CommonConstants.SCREEN_RATIO_THRESHOLD) {
this.showSidebarIcon = true;
} else {
this.showSidebarIcon = false;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateSidebarVisibility AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left curWidthVp AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#... | updateSidebarVisibility(curWidthVp: number, ratio: number): void {
if (curWidthVp >= CommonConstants.BREAKPOINT_WIDTH_MEDIUM && ratio <= CommonConstants.SCREEN_RATIO_THRESHOLD) {
this.showSidebarIcon = true;
} else {
this.showSidebarIcon = false;
}
} | https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification | 896f657bf2ee9358d69f457e69b86400bd1b7de6 | gitcode |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ScaleMode.ets | arkts | onClick | view 调用 点击事件 此事件分发单击、双击事件
@param event | public onClick(event: ClickEvent) {
let currnetTime = new Date().getTime();
let spaceTime = currnetTime - this.firstClickTime;
this.firstClickTime = currnetTime;
if (spaceTime < 300) {
/**
* 双击放大事件
*/
this.centerX = event.x;
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left onClick AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left event AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ClickEv... | public onClick(event: ClickEvent) {
let currnetTime = new Date().getTime();
let spaceTime = currnetTime - this.firstClickTime;
this.firstClickTime = currnetTime;
if (spaceTime < 300) {
/**
* 双击放大事件
*/
this.centerX = event.x;
... | https://gitee.com/openharmony/developtools_profiler.git | ddaa8045556f109275274a8c8ec32b20e1f9a147 | gitee |
DaLongZhuaZi/manxia | entry/src/main/ets/pages/MainMenuPage.ets | arkts | normalizeCoverPath | 标准化封面路径(处理本地文件、网络URL、媒体资源等) | private normalizeCoverPath(coverPath: string): string {
const normalized = typeof coverPath === 'string' ? coverPath.trim() : '';
if (!normalized) {
return '';
}
// 已带协议前缀的路径直接返回(http/file/datashare/resource 等)
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(normalized)) {
return normalized;
... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left normalizeCoverPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left coverPath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS... | private normalizeCoverPath(coverPath: string): string {
const normalized = typeof coverPath === 'string' ? coverPath.trim() : '';
if (!normalized) {
return '';
}
// 已带协议前缀的路径直接返回(http/file/datashare/resource 等)
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(normalized)) {
return normalized;
... | https://github.com/DaLongZhuaZi/manxia | ebfb1750138c17348e7f1e8c69028a1cc61ecaa6 | github |
huangyuanlove/HelloArkUI | entry/src/main/ets/pages/basic_knowledge/LifeCirclePage.ets | arkts | onPageShow | 只有被@Entry装饰的组件才可以调用页面的生命周期 | onPageShow() {
console.info('Index onPageShow');
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onPageShow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left AS... | onPageShow() {
console.info('Index onPageShow');
} | https://github.com/huangyuanlove/HelloArkUI | 41c26ffb9c6250e885c7fcd5ce91d3576324118e | github |
richshaw2015/nds | ohos/entry/src/main/ets/utils/ThemeManager.ets | arkts | isValidThemeId | 验证主题 ID 是否有效
@param themeId 主题 ID
@returns 是否有效 | private isValidThemeId(themeId: string): boolean {
return VALID_THEME_IDS.has(themeId);
} | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isValidThemeId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left themeId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#stri... | private isValidThemeId(themeId: string): boolean {
return VALID_THEME_IDS.has(themeId);
} | https://github.com/richshaw2015/nds | 0443a33b6d75626b723c537764c2a78b8da1b17f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/components/DualPageCurlEffect.ets | arkts | aboutToAppear | halfWidth getter 已移除 —— ArkTS getter 在某些场景下返回 NaN
改为在 renderCurlEffect 中直接计算
========== 生命周期 ========== | aboutToAppear(): void {
logger.info(TAG, `初始化: ${this.componentWidth}x${this.componentHeight}, ` +
`curLPM=${this.currentLeftPixelMap !== null}, curRPM=${this.currentRightPixelMap !== null}, ` +
`nxtLPM=${this.nextLeftPixelMap !== null}, nxtRPM=${this.nextRightPixelMap !== null}, ` +
`extProgres... | 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 {
logger.info(TAG, `初始化: ${this.componentWidth}x${this.componentHeight}, ` +
`curLPM=${this.currentLeftPixelMap !== null}, curRPM=${this.currentRightPixelMap !== null}, ` +
`nxtLPM=${this.nextLeftPixelMap !== null}, nxtRPM=${this.nextRightPixelMap !== null}, ` +
`extProgres... | https://github.com/DaLongZhuaZi/manxia | 7e1c5eb8b191a347d4f2e56844a23b4c6844a1ba | github |
CLMC2025/Vignette | entry/src/main/ets/model/AnimationModel.ets | arkts | springStiff | 创建僵硬的弹簧动画 | static springStiff(direction: AnimationDirection = AnimationDirection.CENTER): AnimationConfig {
return AnimationConfig.spring(direction, 500, 20, 1);
} | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left springStiff AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left direction AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expr... | static springStiff(direction: AnimationDirection = AnimationDirection.CENTER): AnimationConfig {
return AnimationConfig.spring(direction, 500, 20, 1);
} | https://github.com/CLMC2025/Vignette | ce2e268a613cc8ea472c5f9f6f719778716965ef | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Lifecycle/PageLifecycleManager.ets | arkts | dumpInfo | 导出详细信息(用于调试) | dumpInfo(): string {
const stats = this.getStats();
const lines: string[] = [
`=== PageLifecycleManager [${this.pageId}] ===`,
`状态: ${this.isDestroyed ? '已销毁' : '活跃'}`,
`运行时间: ${stats.uptime}ms`,
`定时器: ${stats.timerCount}`,
`Promise: ${stats.promiseCount}`,
`资源: ${stats.res... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left dumpInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statement_blo... | dumpInfo(): string {
const stats = this.getStats();
const lines: string[] = [
`=== PageLifecycleManager [${this.pageId}] ===`,
`状态: ${this.isDestroyed ? '已销毁' : '活跃'}`,
`运行时间: ${stats.uptime}ms`,
`定时器: ${stats.timerCount}`,
`Promise: ${stats.promiseCount}`,
`资源: ${stats.res... | https://github.com/DaLongZhuaZi/manxia | 57be6bac8ebbb967feedc1d5d7802c25f727cce0 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Debug/HidebugPerformanceCollector.ets | arkts | collectCpuInfoSync | 同步收集CPU信息 | private collectCpuInfoSync(): HidebugCpuInfo {
const cpuInfo: HidebugCpuInfo = {
cpuUsage: 0,
systemCpuUsage: 0,
appThreadCpuUsage: null
};
try {
// 获取进程CPU使用率
cpuInfo.cpuUsage = hidebug.getCpuUsage();
// 获取系统CPU使用情况
cpuInfo.systemCpuUsage = hidebug.getSys... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left collectCpuInfoSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left ... | private collectCpuInfoSync(): HidebugCpuInfo {
const cpuInfo: HidebugCpuInfo = {
cpuUsage: 0,
systemCpuUsage: 0,
appThreadCpuUsage: null
};
try {
// 获取进程CPU使用率
cpuInfo.cpuUsage = hidebug.getCpuUsage();
// 获取系统CPU使用情况
cpuInfo.systemCpuUsage = hidebug.getSys... | https://github.com/DaLongZhuaZi/manxia | 1042624fe1876d7d1e17010d536687d5bd9088d2 | github |
offlinecat-dev/OCNetORM | src/main/ets/repository/Repository.ets | arkts | forceRemoveById | 根据主键强制物理删除(忽略软删除设置)
@param id 主键值
@returns Promise<DeleteResult> | async forceRemoveById(id: ValueType): Promise<DeleteResult> {
this.ensureWritePathAllowed('FORCE_REMOVE_BY_ID')
return await this.withSessionStore(async (repo) => {
const result = await repo.deleteOperations.forceRemoveById(id)
return repo.ensureDeleteResultSuccess(result, 'FORCE_REMOVE_BY_ID')
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left forceRemoveById AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left id... | async forceRemoveById(id: ValueType): Promise<DeleteResult> {
this.ensureWritePathAllowed('FORCE_REMOVE_BY_ID')
return await this.withSessionStore(async (repo) => {
const result = await repo.deleteOperations.forceRemoveById(id)
return repo.ensureDeleteResultSuccess(result, 'FORCE_REMOVE_BY_ID')
... | https://github.com/offlinecat-dev/OCNetORM | de213fedf70333135c6fe9b4e5ad8a7c2fb6bc79 | github |
CLMC2025/Vignette | entry/src/main/ets/utils/SecureStorage.ets | arkts | ensureInitialized | Ensure the storage is initialized | private async ensureInitialized(): Promise<boolean> {
if (!this.isInitialized) {
return await this.initialize();
}
return true;
} | 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 ensureInitialized AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right... | private async ensureInitialized(): Promise<boolean> {
if (!this.isInitialized) {
return await this.initialize();
}
return true;
} | https://github.com/CLMC2025/Vignette | a7b3953135bcf51f43c60e99e5bb46d6abf8c5f9 | github |
openharmony/codelabs | Data/PersonalAssistantPro/entry/src/main/ets/viewmodel/CalendarViewModel.ets | arkts | processEventsToTaskDays | 此时这里的 Event 类型就能被正确识别了 | public processEventsToTaskDays(events: Event[]): Set<string> {
const taskSet = new Set<string>();
events.forEach(event => {
// 1. 获取日程的开始和结束时间 (清除时分秒,只保留日期)
const startDate = new Date(event.startTime);
startDate.setHours(0, 0, 0, 0);
const endDate = new Date(event.endTime);
end... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left processEventsToTaskDays AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left events AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscr... | public processEventsToTaskDays(events: Event[]): Set<string> {
const taskSet = new Set<string>();
events.forEach(event => {
// 1. 获取日程的开始和结束时间 (清除时分秒,只保留日期)
const startDate = new Date(event.startTime);
startDate.setHours(0, 0, 0, 0);
const endDate = new Date(event.endTime);
end... | https://gitcode.com/openharmony/codelabs | da2273a74d423aede9b5f58ac5d7e9f4be60e289 | gitcode |
XHXYT/Pixark | entry/src/main/ets/viewmodel/UserDetailViewModel.ets | arkts | currentIllustList | --- 辅助获取 --- | get currentIllustList(): PixivIllust[] {
if (this.tabIndex === 0) {
return this.userIllusts;
} else if (this.tabIndex === 1) {
return this.userBookmarks;
}
return [];
} | AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentIllustList 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 PixivIllust A... | get currentIllustList(): PixivIllust[] {
if (this.tabIndex === 0) {
return this.userIllusts;
} else if (this.tabIndex === 1) {
return this.userBookmarks;
}
return [];
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/UserDetailViewModel.ets#L228-L235 | 283bdd26054ebdab063e5cef85db40c6e8803719 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets | arkts | filter | Creates a new Int16Array from current Int16Array based on a condition fn.
@param { function } fn - the condition to apply for each element
@returns { Int16Array } - a new Int16Array
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public filter(fn: (val: number, index: int, array: Int16Array) => boolean): Int16Array {
let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt)
let resLen = 0
for (let i = 0; i < this.lengthInt; ++i) {
markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this)
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left filter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#R... | public filter(fn: (val: number, index: int, array: Int16Array) => boolean): Int16Array {
let markers : ValueArray<boolean> = new ValueArray<boolean>(this.lengthInt)
let resLen = 0
for (let i = 0; i < this.lengthInt; ++i) {
markers[i] = fn((this.getUnsafe(i)).toDouble(), i, this)
... | https://gitcode.com/iop123123/arkts-static-skills | 66ab2bd8c09d138fdb4d2eaed91436f077be38af | gitcode |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/SettingsService.ets | arkts | getAudioSettings | 获取音频设置 | async getAudioSettings(): Promise<AudioSettings> {
return {
audioConfig: await this.getString(SettingsKeys.AUDIO_CONFIG, '立体声'),
enableLocalAudio: await this.getBoolean(SettingsKeys.ENABLE_LOCAL_AUDIO, false),
enableSpatializer: await this.getBoolean(SettingsKeys.ENABLE_SPATIALIZER, false),
... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getAudioSettings AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#gen... | async getAudioSettings(): Promise<AudioSettings> {
return {
audioConfig: await this.getString(SettingsKeys.AUDIO_CONFIG, '立体声'),
enableLocalAudio: await this.getBoolean(SettingsKeys.ENABLE_LOCAL_AUDIO, false),
enableSpatializer: await this.getBoolean(SettingsKeys.ENABLE_SPATIALIZER, false),
... | https://github.com/AlkaidLab/moonlight-harmony | 1454aa109225a07403cc335413278ffc17c8b290 | github |
darcycui/DarcyHarmonyNext | entry/src/main/ets/pages/entry/render_control/ForEachPage.ets | arkts | <arrow> | 生成key | (item: string, index: number) => {
// return item // TODO:使用item作为key 第二个two不显示 因为key相同
return index.toString() // TODO 使用index作为key 无法修改item内容 因为key已经存在且未发生变化
}) | AST#program#Left AST#ERROR#Left AST#arrow_function#Left AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left item AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#Left AST#string#Left string AST#string#Right AST#predefined_type#Rig... | (item: string, index: number) => {
// return item // TODO:使用item作为key 第二个two不显示 因为key相同
return index.toString() // TODO 使用index作为key 无法修改item内容 因为key已经存在且未发生变化
}) | https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/pages/entry/render_control/ForEachPage.ets#L18-L21 | a36f640742f6d749e9007bdf4c10d656e63a4044 | github |
YANGZX22/Voot | entry/src/main/ets/workers/NonStreamingAsrWithVadWorker.ets | arkts | onMessage | -------- message handling -------- | function onMessage(event: MessageEvents): void {
const data = event.data as MessageFromMain;
switch (data.type) {
case 'init':
handleInit(data);
break;
case 'pcm':
handlePcm(data);
break;
case 'flush':
handleFlush();
break;
default:
console.warn('ASR worker:... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left onMessage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left event AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right... | function onMessage(event: MessageEvents): void {
const data = event.data as MessageFromMain;
switch (data.type) {
case 'init':
handleInit(data);
break;
case 'pcm':
handlePcm(data);
break;
case 'flush':
handleFlush();
break;
default:
console.warn('ASR worker:... | https://github.com/YANGZX22/Voot | c284d376b03692ee85fddf9c9c282eb04692b377 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/WelcomeGuideManager.ets | arkts | resetGuide | 重置引导状态(用于测试) | public async resetGuide(): Promise<void> {
try {
if (!this.isInitialized) {
await this.initialize();
}
this.isFirstLaunch = true;
this.guideCompleted = false;
this.guideSkipped = false;
this.currentStep = GuideStep.WELCOME;
this.sourceFeatureGuideShown = false;
... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left resetGuide AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef... | public async resetGuide(): Promise<void> {
try {
if (!this.isInitialized) {
await this.initialize();
}
this.isFirstLaunch = true;
this.guideCompleted = false;
this.guideSkipped = false;
this.currentStep = GuideStep.WELCOME;
this.sourceFeatureGuideShown = false;
... | https://github.com/DaLongZhuaZi/manxia | 890c07f40bd9ef6576fe4f716c71a80bc5b400d8 | github |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/BannerRepository.ets | arkts | getBannerList | 查询轮播图列表
@param params 查询条件
@returns 轮播图列表响应 | async getBannerList(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> {
return this.networkDataSource.getBannerList(params);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getBannerList AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left :... | async getBannerList(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> {
return this.networkDataSource.getBannerList(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 6f73e341e2406286e0289f8f2a60598d6dc7e4a7 | github |
openharmony/developtools_profiler | host/smartperf/client/client_ui/entry/src/main/ets/common/FloatWindowComponent.ets | arkts | MoveWindow | 悬浮框移动触摸点 X | MoveWindow(offsetX: number, offsetY: number) {
moveFloatWindow(this.title, offsetX, offsetY)
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left MoveWindow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left offsetX AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#L... | MoveWindow(offsetX: number, offsetY: number) {
moveFloatWindow(this.title, offsetX, offsetY)
} | https://gitee.com/openharmony/developtools_profiler.git | 763253a4b37c0eecf64e910ba56092a3ec15d70d | gitee |
openharmony/applications_contacts | feature/call/src/main/ets/missedcall/MissedCallNotifier.ets | arkts | updateMissedCallNotifications | update Missed Call Notification
@param missedData missedCallData - missed call data for notification | public async updateMissedCallNotifications(missedData: Map<string, MissedCallNotifyData>) {
let notifyData = await this.getMissedCallNotifyDatas();
HiLog.i(TAG, `updateMissedCallNotifications notifyData:${notifyData.length} missedData: ${missedData.size}`)
let badgeNumber: number = 0;
if (notifyData.l... | 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 updateMissedCallNotifications AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left missedD... | public async updateMissedCallNotifications(missedData: Map<string, MissedCallNotifyData>) {
let notifyData = await this.getMissedCallNotifyDatas();
HiLog.i(TAG, `updateMissedCallNotifications notifyData:${notifyData.length} missedData: ${missedData.size}`)
let badgeNumber: number = 0;
if (notifyData.l... | https://gitee.com/openharmony/applications_contacts.git | 4070e1b4dbdd22f18445a0c8a4d9b70a7d150703 | gitee |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ArrayBuffer.ets | arkts | from | Creates a new ArrayBuffer from an array of bytes.
@param { FixedArray<byte> } arr Source byte array.
@returns { ArrayBuffer } The new ArrayBuffer.
@static
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public static from(arr: FixedArray<byte>): ArrayBuffer {
const bf = new ArrayBuffer(arr.length)
copyTo(arkruntime.stub.toValueArray(arr), bf.data!, 0, 0, arr.length)
return bf
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ... | public static from(arr: FixedArray<byte>): ArrayBuffer {
const bf = new ArrayBuffer(arr.length)
copyTo(arkruntime.stub.toValueArray(arr), bf.data!, 0, 0, arr.length)
return bf
} | https://gitcode.com/iop123123/arkts-static-skills | 8a6a60855f880ed925dba8037c053d492c15ffeb | gitcode |
CsCesium/KantaiHomo | entry/src/main/ets/features/alerts/executor.ets | arkts | handleExpeditionReturn | ========== Alert 处理函数 ========== | async function handleExpeditionReturn(alert: ExpeditionReturnAlert): Promise<void> {
const config = getAlertBus().getConfig();
const deckId = alert.deckId;
const missionName = getMissionName(alert.missionId);
const timeStr = new Date(alert.timestamp).toLocaleTimeString();
const body = `第 ${deckId} 舰队「${missio... | AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left handleExpeditionReturn AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alert AST#identifier#Right... | async function handleExpeditionReturn(alert: ExpeditionReturnAlert): Promise<void> {
const config = getAlertBus().getConfig();
const deckId = alert.deckId;
const missionName = getMissionName(alert.missionId);
const timeStr = new Date(alert.timestamp).toLocaleTimeString();
const body = `第 ${deckId} 舰队「${missio... | https://github.com/CsCesium/KantaiHomo | 62fafeb40f2bb58fa9bc6badb8528efbd079aab0 | github |
HarmonyOS_Samples/MusicHome | products/default/src/main/ets/entryability/EntryAbility.ets | arkts | onForeground | App brought to foreground. | onForeground() {
// Ability has brought to foreground
Logger.info('EntryAbility: Ability onForeground');
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onForeground 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 ... | onForeground() {
// Ability has brought to foreground
Logger.info('EntryAbility: Ability onForeground');
} | https://gitcode.com/HarmonyOS_Samples/MusicHome | a931da5c52fd08d022fa6e550cbed54b73201243 | gitcode |
huaweicloud/huaweicloud-iot-device-sdk-arkts | huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets | arkts | disableAutoReport | 关闭自动周期上报,您可以通过firePropertiesChanged触发上报 | public disableAutoReport(): void {
if (this.timer != null) {
clearInterval(this.timer);
this.timer = null;
}
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left disableAutoReport 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#expr... | public disableAutoReport(): void {
if (this.timer != null) {
clearInterval(this.timer);
this.timer = null;
}
} | https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts | 95717506bba02f3153dc6657bfdca52c8dee8ea9 | github |
tangwengang-del/freerdp-harmonyos | entry/src/main/ets/model/SessionState.ets | arkts | setInstance | Set the FreeRDP instance handle | setInstance(instance: number): void {
this.instance = instance;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left instance AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST#)#R... | setInstance(instance: number): void {
this.instance = instance;
} | https://github.com/tangwengang-del/freerdp-harmonyos | 52804982652008c43b932d47b095b9fb8ff7f193 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/common/utils/DAOHelper.ets | arkts | convertToAggregateSnapshot | 转换为AggregateSnapshot | static convertToAggregateSnapshot(resultSet: relationalStore.ResultSet): AggregateSnapshot {
const snapshot = new AggregateSnapshot();
snapshot.snapshotId = DAOHelper.getNumberValue(resultSet, 'snapshot_id');
snapshot.aggregateType = DAOHelper.getStringValue(resultSet, 'aggregate_type');
snapshot.aggr... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left convertToAggregateSnapshot AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left resultSet AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#... | static convertToAggregateSnapshot(resultSet: relationalStore.ResultSet): AggregateSnapshot {
const snapshot = new AggregateSnapshot();
snapshot.snapshotId = DAOHelper.getNumberValue(resultSet, 'snapshot_id');
snapshot.aggregateType = DAOHelper.getStringValue(resultSet, 'aggregate_type');
snapshot.aggr... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 3f8468d65dcfa990faf9d918e083519119710622 | github |
webabcd/HarmonyDemo | entry/src/main/ets/pages/component/list/ListDemo6.ets | arkts | notifyDataDelete | 通知 LazyForEach 组件,需要删除位置 index 处的 item | notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDatasetChange([{type: DataOperationType.DELETE, index: index}]);
// 上面的相当于下面的,但是在一个 IDataSource 内,onDatasetChange 和 onDataXXX 不能混用,否则可能会报错 Error: onDatasetChange cannot be used with other interface
// listene... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left notifyDataDelete AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left... | notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDatasetChange([{type: DataOperationType.DELETE, index: index}]);
// 上面的相当于下面的,但是在一个 IDataSource 内,onDatasetChange 和 onDataXXX 不能混用,否则可能会报错 Error: onDatasetChange cannot be used with other interface
// listene... | https://github.com/webabcd/HarmonyDemo | ba84e2d5f34a08834d2856d415db73d8a8d8221a | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/tests/ets-templates/06.conversions_and_contexts/02.assignment_contexts/widening_refs_unbox.ets | arkts | foo | ---
desc: Assignment contexts allow the use a widening reference conversion followed by an unboxing conversion.
params: Assignment of '{{case.type}}' to '{{case.ptype}}'
tags: {{case.tags}}
--- | function foo<T extends {{case.type}}>(p: T): {{case.ptype}} { | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left foo 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#constraint#Left AST#extends#Left extends AST#extend... | function foo<T extends {{case.type}}>(p: T): {{case.ptype}} { | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | fdf33857112ff4216f9249ab7ac0db150aeb653d | gitee |
Joker-x-dev/CoolMallArkTS | core/data/src/main/ets/repository/AddressRepository.ets | arkts | addAddress | 新增地址
@param params 地址信息
@returns 新增地址ID | async addAddress(params: Address): Promise<NetworkResponse<Id>> {
return this.networkDataSource.addAddress(params);
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left addAddress AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left params AST#identifier#Right AST#type_annotation#Left AST#:#Left : AS... | async addAddress(params: Address): Promise<NetworkResponse<Id>> {
return this.networkDataSource.addAddress(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS | 605b72cb97f31532d55b27fa3bfbf2174be75364 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/Date.ets | arkts | setTime | Sets the number of milliseconds since the epoch,
which is defined as the midnight at the beginning of January 1, 1970, UTC.
@param value new ms
@see ECMA-262, 21.4.4.10
@returns A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and the given date. | public setTime(value: long): void {
this.ms = value;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left long AST#identifier#Rig... | public setTime(value: long): void {
this.ms = value;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | 056b3cd81d4b6fb76987c4064fbc985361fdc0c4 | gitee |
offlinecat-dev/OCNetORM | src/main/ets/mapping/TypedEntityData.ets | arkts | getPropertyCount | 获取属性数量
@returns 属性数量 | getPropertyCount(): number {
return this.data.size
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getPropertyCount 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#state... | getPropertyCount(): number {
return this.data.size
} | https://github.com/offlinecat-dev/OCNetORM | bdfc4507a0822a9875789cc695c8c7bc6fe1e562 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/model/SmartBudgetPlan.ets | arkts | createBudgetAdvice | 创建预算建议对象 | static createBudgetAdvice(
adviceId: string,
categoryId: number,
categoryName: string,
adviceType: string,
currentBudget: number,
suggestedBudget: number,
reason: string,
priority: number,
potentialSavings: number,
historicalTrend: string
): BudgetAdvice {
const changePer... | AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left createBudgetAdvice AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left adviceId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st... | static createBudgetAdvice(
adviceId: string,
categoryId: number,
categoryName: string,
adviceType: string,
currentBudget: number,
suggestedBudget: number,
reason: string,
priority: number,
potentialSavings: number,
historicalTrend: string
): BudgetAdvice {
const changePer... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | e6e3f163e55b6d63554bd3a7968d300c8f34ac91 | github |
LZZLHY/hlib | entry/src/main/ets/api/ZLibraryClient.ets | arkts | setDomain | 切换镜像域;登录态会被保留(cookie 之外的 set-cookie 会清掉以避免跨域)。 | setDomain(domain: string): void {
this.http.setDomain(domain);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setDomain AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left domain AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST... | setDomain(domain: string): void {
this.http.setDomain(domain);
} | https://github.com/LZZLHY/hlib | 7eb804e6d85d6ddc0c8dd1394b463bd6ba0cffef | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test2_original_index.ets | arkts | testMapOperations | === Map / Set Collections === | function testMapOperations(): number {
let m: Map<string, number> = new Map();
m.set('a', 1);
m.set('b', 2);
m.set('c', 3);
let total: number = 0;
m.forEach((value: number, key: string): void => {
total += value;
});
return total;
} | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testMapOperations 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#predefine... | function testMapOperations(): number {
let m: Map<string, number> = new Map();
m.set('a', 1);
m.set('b', 2);
m.set('c', 3);
let total: number = 0;
m.forEach((value: number, key: string): void => {
total += value;
});
return total;
} | https://github.com/miaochiahao/ark-ghidra | ae3a3c885ab0c79129c7ba813ac11bf661812e44 | github |
openharmony-sig/earth | hpauditor/tests/issues/issue450.ets | arkts | initAll | init properties of scenePanelView | public initAll() {
this.flexWidth = "100%";
this.flexHeight = "100%";
this.flexPadding = 0;
this.flexOffsetX = 0;
this.flexOffsetY = 0;
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left initAll AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{... | public initAll() {
this.flexWidth = "100%";
this.flexHeight = "100%";
this.flexPadding = 0;
this.flexOffsetX = 0;
this.flexOffsetY = 0;
} | https://gitee.com/openharmony-sig/earth.git | 57ee521a946c11081d6fec4829af127db3b7fbbc | gitee |
ibestservices/ibest-ui | library/src/main/ets/components/picker/index.ets | arkts | getTextByIndex | 根据索引获取值 文字 | getTextByIndex(): string[]{
return this.getColumns().map((item, index) => getResourceStr(item[this.indexArr[index]]?.text || ""))
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left getTextByIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right... | getTextByIndex(): string[]{
return this.getColumns().map((item, index) => getResourceStr(item[this.indexArr[index]]?.text || ""))
} | https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/picker/index.ets#L555-L557 | c961ceae6a132e839741761a2a3b382f190f6d2f | github |
encorexin/WordPressCMS | harmonyos/entry/src/main/ets/services/http/WordPressApi.ets | arkts | getCategories | 获取分类列表 | static async getCategories(site: WordPressSite): Promise<WPCategoryResult> {
const result = new WPCategoryResult()
try {
const url = `${WordPressApi.getApiUrl(site.siteUrl)}/categories?per_page=100`
const response = await HttpClient.get(url, WordPressApi.getAuthHeaders(site))
if (response.s... | 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 getCategories AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left site AST#identifier#Right AST#:#Left : AST... | static async getCategories(site: WordPressSite): Promise<WPCategoryResult> {
const result = new WPCategoryResult()
try {
const url = `${WordPressApi.getApiUrl(site.siteUrl)}/categories?per_page=100`
const response = await HttpClient.get(url, WordPressApi.getAuthHeaders(site))
if (response.s... | https://github.com/encorexin/WordPressCMS | b533dee0dfa9789cf675dc5b810be4be91d175e3 | github |
iop123123/arkts-static-skills | docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets | arkts | map | Creates a new Uint8ClampedArray using fn(arr[i]) over all elements of current Uint8ClampedArray.
@param { function } fn - a function to apply for each element of current Uint8ClampedArray
@returns { Uint8ClampedArray } - a new Uint8ClampedArray,
where for each element from current Uint8ClampedArray fn was applied
@sysc... | public map(fn: (val: number, index: int, array: Uint8ClampedArray) => number): Uint8ClampedArray {
let resBuf = new ArrayBuffer(this.lengthInt * Uint8ClampedArray.BYTES_PER_ELEMENT)
let res = new Uint8ClampedArray(resBuf)
for (let i = 0; i < this.lengthInt; i++) {
res.set(i, fn(t... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left map AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right... | public map(fn: (val: number, index: int, array: Uint8ClampedArray) => number): Uint8ClampedArray {
let resBuf = new ArrayBuffer(this.lengthInt * Uint8ClampedArray.BYTES_PER_ELEMENT)
let res = new Uint8ClampedArray(resBuf)
for (let i = 0; i < this.lengthInt; i++) {
res.set(i, fn(t... | https://gitcode.com/iop123123/arkts-static-skills | b89a7d4812143e590b0a639f29b3c410fbc5c214 | gitcode |
XHXYT/Pixark | entry/src/main/ets/viewmodel/UserDetailViewModel.ets | arkts | loadUserDetail | --- 核心数据加载 --- | async loadUserDetail(userId: number) {
this.isDetailLoading = true;
logger.debug(`[loadUserDetail] Requesting userId=${userId}`);
try {
const data = await pixiv.getUserDetail(userId);
this.userData = data;
// 更新关注状态
this.isFollow = data.user?.is_followed ?? false;
const user... | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left loadUserDetail AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left userId AST#identifier#Right AST#type_annotation#Left AST#:#Left ... | async loadUserDetail(userId: number) {
this.isDetailLoading = true;
logger.debug(`[loadUserDetail] Requesting userId=${userId}`);
try {
const data = await pixiv.getUserDetail(userId);
this.userData = data;
// 更新关注状态
this.isFollow = data.user?.is_followed ?? false;
const user... | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/UserDetailViewModel.ets#L98-L124 | d1604ff01f9a33cacb284811881a0ca7291b983b | github |
apap6628114/nga_oh | entry/src/main/ets/store/settings/domain/MediaSettings.ets | arkts | load | 从持久化对象加载媒体字段 | load(saved: SettingsState): void {
if (saved.imageLoadStrategy !== undefined) {
this.ctx.state.imageLoadStrategy = saved.imageLoadStrategy
}
if (saved.enableImageSizePrefetch !== undefined) {
this.ctx.state.enableImageSizePrefetch = saved.enableImageSizePrefetch
}
if (saved.videoMuted ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left load AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left saved AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left SettingsState AST#identifier#Right AST#)#Left ) AS... | load(saved: SettingsState): void {
if (saved.imageLoadStrategy !== undefined) {
this.ctx.state.imageLoadStrategy = saved.imageLoadStrategy
}
if (saved.enableImageSizePrefetch !== undefined) {
this.ctx.state.enableImageSizePrefetch = saved.enableImageSizePrefetch
}
if (saved.videoMuted ... | https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/store/settings/domain/MediaSettings.ets#L64-L76 | 7bb91c6095f8d1736017cdce80122d0515742b15 | github |
ActiveInsighter/HMOS-CodeLab | common/src/main/ets/util/ColorPickerUtil.ets | arkts | getRgb | Calculate the color number of red, blue, green area.
@param rgb, rgba(0, 255, 1, 1.00)
@returns the number of three area. | public static getRgb(rgb: string): number[] {
rgb = rgb.substring(ColorPickerUtil.RGB_PREFIX_LENGTH, rgb.length - 1);
const rgbArray = rgb.split(',');
const redArea: number = parseFloat(rgbArray[0]);
const greenArea: number = parseFloat(rgbArray[1]);
const blueArea: number = parseFloat(rgbArray[2]... | 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 getRgb AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rgb AST#identifier#Right AST#:#Left : AST#:#Righ... | public static getRgb(rgb: string): number[] {
rgb = rgb.substring(ColorPickerUtil.RGB_PREFIX_LENGTH, rgb.length - 1);
const rgbArray = rgb.split(',');
const redArea: number = parseFloat(rgbArray[0]);
const greenArea: number = parseFloat(rgbArray[1]);
const blueArea: number = parseFloat(rgbArray[2]... | https://github.com/ActiveInsighter/HMOS-CodeLab | 7d609526e45cb157e99bafd649e3c22a14d6773d | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets | arkts | getElementsAsync | 异步获取元素列表(支持JS规则执行) | async getElementsAsync(ruleStr: string, jsContext?: JsContext): Promise<string[]> {
if (!ruleStr || ruleStr.trim() === '') {
return [];
}
try {
const processedRule = await this.preprocessRuleTextAsync(ruleStr);
// 先处理 || 操作符(或操作,第一个有结果就返回)
if (processedRule.includes('||')) {
... | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left getElementsAsync AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left ruleStr AST#identifier#Right... | async getElementsAsync(ruleStr: string, jsContext?: JsContext): Promise<string[]> {
if (!ruleStr || ruleStr.trim() === '') {
return [];
}
try {
const processedRule = await this.preprocessRuleTextAsync(ruleStr);
// 先处理 || 操作符(或操作,第一个有结果就返回)
if (processedRule.includes('||')) {
... | https://github.com/DaLongZhuaZi/manxia | d99ae2356cd972392e383a2d349087eebe4bcce1 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/WebView/WebViewMangaLoader.ets | arkts | getLoadingProgress | 获取加载进度 | getLoadingProgress(chapterId: string): LoadingProgress | null {
return this.loadingChapters.get(chapterId) || null;
} | AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getLoadingProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left chapterId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST... | getLoadingProgress(chapterId: string): LoadingProgress | null {
return this.loadingChapters.get(chapterId) || null;
} | https://github.com/DaLongZhuaZi/manxia | 878b75b259d2503fabf5c894eaa401772d53316b | github |
Amaz1ny/HarmonyDO-public | entry/src/main/ets/services/network/CookieStore.ets | arkts | ingestSetCookieHeader | 从 Set-Cookie 合并(支持多个 cookie 合并到一个 header 字符串) | ingestSetCookieHeader(setCookieValue: string, requestUrl: string = AppConstants.BASE_URL): void {
const raw: string = setCookieValue.trim();
if (raw.length === 0) return;
const chunks: string[] = CookieStore.splitSetCookieHeader(raw);
for (let i = 0; i < chunks.length; i++) {
const chunk: strin... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left ingestSetCookieHeader AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left setCookieValue AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#... | ingestSetCookieHeader(setCookieValue: string, requestUrl: string = AppConstants.BASE_URL): void {
const raw: string = setCookieValue.trim();
if (raw.length === 0) return;
const chunks: string[] = CookieStore.splitSetCookieHeader(raw);
for (let i = 0; i < chunks.length; i++) {
const chunk: strin... | https://github.com/Amaz1ny/HarmonyDO-public | 34e361c12738af722edacde8e74fdfdfbeed2cfe | github |
CPF-ApplicationTPC/openharmony_tpc_samples | SignalR/entry/src/ohosTest/ets/test/LongPollingTransport.test.ets | arkts | signal | Called by the code under test to signal it has reached the sync point | signal(): void {
if (!this._signaled) {
this._signaled = true;
this._waitForSyncPoint.resolve();
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left signal 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 ... | signal(): void {
if (!this._signaled) {
this._signaled = true;
this._waitForSyncPoint.resolve();
}
} | https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples | 7838c6433ed5df6545cf1754a7093c8e4c4bb1d8 | gitcode |
midori52000/ArkPilot | Agent/entry/src/main/ets/apim/ApiManagementService.ets | arkts | exportProviders | ========== 导入导出 ========== | exportProviders(): string {
const providers = this.getProviders();
const exportDoc: ProviderExportDoc = new ProviderExportDoc();
exportDoc.version = 1;
exportDoc.exportedAt = new Date().toISOString();
exportDoc.providers = providers;
return JSON.stringify(exportDoc, null, 2);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left exportProviders AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#statem... | exportProviders(): string {
const providers = this.getProviders();
const exportDoc: ProviderExportDoc = new ProviderExportDoc();
exportDoc.version = 1;
exportDoc.exportedAt = new Date().toISOString();
exportDoc.providers = providers;
return JSON.stringify(exportDoc, null, 2);
} | https://github.com/midori52000/ArkPilot | b126007729c2b83fde8c48721999d12a90dde261 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Storage/StorageAnalyzer.ets | arkts | clearStorageItem | 清理单个存储项 | private async clearStorageItem(type: StorageType, options: ClearOptions): Promise<ClearResult> {
const result: ClearResult = {
success: true,
clearedSize: 0,
clearedCount: 0,
errors: []
};
switch (type) {
case StorageType.IMAGE_CACHE:
// 只清理内存缓存,磁盘文件由COVER_FILES管理
... | 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 clearStorageItem AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left... | private async clearStorageItem(type: StorageType, options: ClearOptions): Promise<ClearResult> {
const result: ClearResult = {
success: true,
clearedSize: 0,
clearedCount: 0,
errors: []
};
switch (type) {
case StorageType.IMAGE_CACHE:
// 只清理内存缓存,磁盘文件由COVER_FILES管理
... | https://github.com/DaLongZhuaZi/manxia | 29918528aa9a0e159debaffdfc879836c7c8ecc8 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Data/TypeShelfManager.ets | arkts | copyShelfWithTimestamp | 复制书架对象(避免使用spread语法) | private copyShelfWithTimestamp(shelf: TypeShelf): TypeShelf {
const result: TypeShelf = {
id: shelf.id,
name: shelf.name,
shelfType: shelf.shelfType,
contentTypes: shelf.contentTypes.slice(),
icon: shelf.icon,
color: shelf.color,
order: shelf.order,
isSystem: shelf.... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left copyShelfWithTimestamp AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left shelf AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident... | private copyShelfWithTimestamp(shelf: TypeShelf): TypeShelf {
const result: TypeShelf = {
id: shelf.id,
name: shelf.name,
shelfType: shelf.shelfType,
contentTypes: shelf.contentTypes.slice(),
icon: shelf.icon,
color: shelf.color,
order: shelf.order,
isSystem: shelf.... | https://github.com/DaLongZhuaZi/manxia | 4be2e41a2f8c7ad1454f1a3bde7bf2a45fce8dea | github |
offlinecat-dev/OCNetORM | src/main/ets/query/QueryBuilder.ets | arkts | hasRelations | 检查是否有需要加载的关联关系
@returns 是否有关联关系需要加载 | hasRelations(): boolean {
return this.relationNames.length > 0
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasRelations AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statem... | hasRelations(): boolean {
return this.relationNames.length > 0
} | https://github.com/offlinecat-dev/OCNetORM | 20f0e61ab7ef8aa894e86e42683e32d57b0706ce | github |
openharmony-sig/applications_clock | common/src/main/ets/manager/BreakpointManager.ets | arkts | register | Register breakpoint listening. | public register(): void {
for (const item of this.listenerList) {
if (item.listener.matches && this.currentBreakpoint !== item.breakPoint) {
this.updateCurrentBreakpoint(item.breakPoint);
break;
}
item.listener.on('change', data => {
data.matches && this.updateCurrentBrea... | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left register 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_st... | public register(): void {
for (const item of this.listenerList) {
if (item.listener.matches && this.currentBreakpoint !== item.breakPoint) {
this.updateCurrentBreakpoint(item.breakPoint);
break;
}
item.listener.on('change', data => {
data.matches && this.updateCurrentBrea... | https://gitee.com/openharmony-sig/applications_clock.git | 372fec7841e94b57dafe0e09d7a3400c83d52639 | gitee |
AlkaidLab/moonlight-harmony | entry/src/main/ets/service/streaming/StreamInputHandler.ets | arkts | startKeyInterceptor | ==================== 按键拦截器 ====================
启动按键事件拦截器
拦截被系统劫持的手柄按键和特殊键盘按键,转发给 GamepadManager / StreamingSession 处理 | startKeyInterceptor(): void {
const result = InputInterceptorService.getInstance().start((event) => {
if (!this.viewModel?.isConnected) {
return;
}
const keyCode = event.keyCode;
// action: 1=KEY_DOWN, 2=KEY_UP
const isPressed = event.action === 1;
// 1. 手柄按键范围 (2300-2... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left startKeyInterceptor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statemen... | startKeyInterceptor(): void {
const result = InputInterceptorService.getInstance().start((event) => {
if (!this.viewModel?.isConnected) {
return;
}
const keyCode = event.keyCode;
// action: 1=KEY_DOWN, 2=KEY_UP
const isPressed = event.action === 1;
// 1. 手柄按键范围 (2300-2... | https://github.com/AlkaidLab/moonlight-harmony | 374e3ea223023b2f516383bc75e7cfd3597f234c | github |
pangpang20/antennaPodHM | entry/src/main/ets/model/Episode.ets | arkts | getFormattedDuration | 添加到队列的时间
格式化时长显示 | getFormattedDuration(): string {
const hours = Math.floor(this.duration / 3600);
const minutes = Math.floor((this.duration % 3600) / 60);
const seconds = this.duration % 60;
if (hours > 0) {
return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
} e... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getFormattedDuration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#s... | getFormattedDuration(): string {
const hours = Math.floor(this.duration / 3600);
const minutes = Math.floor((this.duration % 3600) / 60);
const seconds = this.duration % 60;
if (hours > 0) {
return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
} e... | https://github.com/pangpang20/antennaPodHM | 815e99eae16e48684145b1a3ef9ead11707f333f | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Utils/ChineseConverter.ets | arkts | initialize | 初始化转换映射表 | private static initialize(): void {
if (this.initialized) {
return;
}
// 常用简繁对照表(部分示例,实际应用中需要完整的映射表)
const commonPairs: [string, string][] = [
// 常用字
['万', '萬'], ['与', '與'], ['专', '專'], ['业', '業'], ['丛', '叢'],
['东', '東'], ['丝', '絲'], ['丢', '丟'], ['两', '兩'], ['严', '嚴'],
[... | 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 initialize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:... | private static initialize(): void {
if (this.initialized) {
return;
}
// 常用简繁对照表(部分示例,实际应用中需要完整的映射表)
const commonPairs: [string, string][] = [
// 常用字
['万', '萬'], ['与', '與'], ['专', '專'], ['业', '業'], ['丛', '叢'],
['东', '東'], ['丝', '絲'], ['丢', '丟'], ['两', '兩'], ['严', '嚴'],
[... | https://github.com/DaLongZhuaZi/manxia | 421f07557edaf89515da6638bc0ba48f391bb7ec | github |
miaochiahao/ark-ghidra | data/test_hap/arkts-decompile-test46_original_index.ets | arkts | testBooleanOps | --- Boolean constructor --- | function testBooleanOps(): string {
let b1: boolean = Boolean(1);
let b2: boolean = Boolean(0);
let b3: boolean = Boolean('');
let b4: boolean = Boolean('hello');
let b5: boolean = Boolean(null);
let b6: boolean = Boolean(undefined);
return String(b1) + ',' + String(b2) + ',' + String(b3) + ',' + String(b... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testBooleanOps 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_t... | function testBooleanOps(): string {
let b1: boolean = Boolean(1);
let b2: boolean = Boolean(0);
let b3: boolean = Boolean('');
let b4: boolean = Boolean('hello');
let b5: boolean = Boolean(null);
let b6: boolean = Boolean(undefined);
return String(b1) + ',' + String(b2) + ',' + String(b3) + ',' + String(b... | https://github.com/miaochiahao/ark-ghidra | 5db216bd990d76604787c1d4d5571e24142006c5 | github |
openharmony/applications_photos | common/src/main/ets/default/model/common/WorkerThreadPool.ets | arkts | terminateWorker | 终止worker运行
@param worker | public static terminateWorker(worker: worker.ThreadWorker) {
Log.info(TAG, 'terminate worker')
if (!worker) {
Log.error(TAG, 'worker is null');
}
try {
worker.terminate();
} catch (err) {
Log.error(TAG, 'worker terminate error: ' + JSON.stringify(err));
}
} | 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 terminateWorker AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left worker AST#identifier#Right AST#:#Left ... | public static terminateWorker(worker: worker.ThreadWorker) {
Log.info(TAG, 'terminate worker')
if (!worker) {
Log.error(TAG, 'worker is null');
}
try {
worker.terminate();
} catch (err) {
Log.error(TAG, 'worker terminate error: ' + JSON.stringify(err));
}
} | https://gitee.com/openharmony/applications_photos.git | 4cc6cc9c67a36f181c39c5d7f3c16edb3392f094 | gitee |
codelably/HCompass | packages/demo/src/main/ets/services/DemoNavSvcImpl.ets | arkts | toNetworkRequest | 跳转到通用网络请求示例页
@returns {void} 无返回值 | toNetworkRequest(): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(DemoRoutes.NetworkRequest);
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toNetworkRequest 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... | toNetworkRequest(): void {
const navigation = getContainer().tryResolve<NavigationService>(CoreServiceKeys.NavigationService);
navigation?.navigateTo(DemoRoutes.NetworkRequest);
} | https://github.com/codelably/HCompass | a5b5c42669cdae8a103310de573ce6a617574e56 | github |
openharmony/codelabs | Media/AudioPlayer/entry/src/main/ets/common/utils/BackgroundTaskUtil.ets | arkts | startContinuousTask | Start a long-time task in the background.
@param context Context. | public static startContinuousTask(context: Context) {
if (context === undefined) {
Logger.info(TAG, 'startContinuousTask fail,context is empty.');
return;
}
let wantAgentInfo = {
// Action to be performed after a notification is clicked.
wants: [
{
bundleName: Com... | 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 startContinuousTask AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#... | public static startContinuousTask(context: Context) {
if (context === undefined) {
Logger.info(TAG, 'startContinuousTask fail,context is empty.');
return;
}
let wantAgentInfo = {
// Action to be performed after a notification is clicked.
wants: [
{
bundleName: Com... | https://gitee.com/openharmony/codelabs.git | 291b7aff45c2258c7addff80fc87756857beeb0e | gitee |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/std/core/Char.ets | arkts | isHighSurrogate | isHighSurrogate(char) checks if the char is a high surrogate.
@param value the char to be checked.
@returns true if the char is a high surrogate, false otherwise. | public static isHighSurrogate(value: char): boolean {
return Char.HIGH_SURROGATE_MIN <= value
&& Char.HIGH_SURROGATE_MAX >= value;
} | 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 isHighSurrogate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left :... | public static isHighSurrogate(value: char): boolean {
return Char.HIGH_SURROGATE_MIN <= value
&& Char.HIGH_SURROGATE_MAX >= value;
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | a97aa7881f6138bbd4fa8710105fc9e01cdc48de | gitee |
HarmonyCandies/image_cropper | image_cropper/src/main/ets/model/Geometry.ets | arkts | subtract | Operator overloading for addition and subtraction | subtract(other: OffsetBase): OffsetBase {
if (other instanceof Size) {
return new Offset(this.width - other.width, this.height - other.height);
} else if (other instanceof Offset) {
return new Size(this.width - other.dx, this.height - other.dy);
}
throw new Error("Invalid typ... | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left subtract AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left OffsetBase AST#identifier#Right AST#)#Left ) A... | subtract(other: OffsetBase): OffsetBase {
if (other instanceof Size) {
return new Offset(this.width - other.width, this.height - other.height);
} else if (other instanceof Offset) {
return new Size(this.width - other.dx, this.height - other.dy);
}
throw new Error("Invalid typ... | https://github.com/HarmonyCandies/image_cropper/blob/dd3664946b413166307b736a5763f998084364e1/image_cropper/src/main/ets/model/Geometry.ets#L229-L236 | 62b916d2b0997ad1e3d8d93392d3081d0c62b525 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Novel/LegadoSourceParser.ets | arkts | parseExploreRule | 解析发现规则 | private parseExploreRule(obj: ESObject): LegadoExploreRule | undefined {
if (!obj) {
return undefined;
}
return {
bookList: obj.bookList ? String(obj.bookList) : undefined,
name: obj.name ? String(obj.name) : undefined,
author: obj.author ? String(obj.author) : undefined,
in... | AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseExploreRule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le... | private parseExploreRule(obj: ESObject): LegadoExploreRule | undefined {
if (!obj) {
return undefined;
}
return {
bookList: obj.bookList ? String(obj.bookList) : undefined,
name: obj.name ? String(obj.name) : undefined,
author: obj.author ? String(obj.author) : undefined,
in... | https://github.com/DaLongZhuaZi/manxia | 2cf61b1cbf29d444e0f9888d694614367eb2f438 | github |
Vincent-Leon/zotero-harmony | entry/src/main/ets/data/AttachmentCache.ets | arkts | pickExtractedFile | Looks at every entry in `dir` and picks the first one that's plausibly the
real attachment file: skips dot-files, the archive itself, and Zotero's
.prop metadata sidecar. | function pickExtractedFile(dir: string): string | undefined {
let entries: string[];
try {
entries = fs.listFileSync(dir);
} catch (err) {
hilog.error(LOG_DOMAIN, LOG_TAG, 'listFile(%{public}s) failed: %{public}s',
dir, JSON.stringify(err));
return undefined;
}
for (const name of entries) {
... | AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left pickExtractedFile AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left dir AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:... | function pickExtractedFile(dir: string): string | undefined {
let entries: string[];
try {
entries = fs.listFileSync(dir);
} catch (err) {
hilog.error(LOG_DOMAIN, LOG_TAG, 'listFile(%{public}s) failed: %{public}s',
dir, JSON.stringify(err));
return undefined;
}
for (const name of entries) {
... | https://github.com/Vincent-Leon/zotero-harmony | 8ebf20f2ee169df12650946cf4d41d72a3ca7e0b | github |
XHXYT/Pixark | entry/src/main/ets/viewmodel/DownloadsViewModel.ets | arkts | isFileInSandbox | 检查沙箱文件是否真实存在 | isFileInSandbox(filePath: string | undefined): boolean {
if (!filePath) return false;
try {
// accessSync 是微秒级的本地校验,在这里使用不会卡 UI
return fs.accessSync(filePath);
} catch (e) {
return false;
}
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isFileInSandbox AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#E... | isFileInSandbox(filePath: string | undefined): boolean {
if (!filePath) return false;
try {
// accessSync 是微秒级的本地校验,在这里使用不会卡 UI
return fs.accessSync(filePath);
} catch (e) {
return false;
}
} | https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/DownloadsViewModel.ets#L209-L217 | ea134bdcf2dcb8aa3e44e5dacba8832947841128 | github |
arkui-x/samples | CodeLab/Cases/feature/customscan/src/main/ets/components/CommonCodeLayout.ets | arkts | avplayerPlay | 播放二维码扫描成功提示音 | avplayerPlay() {
if (this.avPlayer) {
this.avPlayer.playDrip();
}
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left avplayerPlay 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 ... | avplayerPlay() {
if (this.avPlayer) {
this.avPlayer.playDrip();
}
} | https://gitcode.com/arkui-x/samples | 46978d3f19e8f247c6c45d2c932db853f3808f8d | gitcode |
openharmony/applications_filepicker | audiopicker/src/main/ets/pages/viewmodel/AudioPickerViewModel.ets | arkts | getData | 获取当前页面的音频列表
@returns | protected getData(): ObservedArray<LocalAudioFile> {
return this.audioPickerViewData.getDataList()
} | AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left protected AST#identifier#Right AST#ERROR#Left AST#identifier#Left getData AST#identifier#Right AST#ERROR#Right AST#argumen... | protected getData(): ObservedArray<LocalAudioFile> {
return this.audioPickerViewData.getDataList()
} | https://gitee.com/openharmony/applications_filepicker.git | ec519530c916a50ee5f7aebf7c6265d2a5a80807 | gitee |
youyeyejie/ZhiXing_ActHub | entry/src/main/ets/core/services/FocusTimerEngine.ets | arkts | getLeftSeconds | 获取本轮专注还剩多少秒(如果是休息阶段则含义不同) | getLeftSeconds(): number {
return this.totalSeconds - this.elapsedSeconds;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLeftSeconds 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#stateme... | getLeftSeconds(): number {
return this.totalSeconds - this.elapsedSeconds;
} | https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/core/services/FocusTimerEngine.ets#L280-L282 | 4525c5e7af5489cfd0b859560e604d45de78f073 | github |
wblxr408/SEU-SE-HarmonyExpense-App- | entry/src/main/ets/dao/EventSourcingDAO.ets | arkts | getByAggregateId | 按聚合ID获取读模型 | static async getByAggregateId(aggregateType: string, aggregateId: number): Promise<ReadModel | null> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ReadModel.tableName);
predica... | 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 getByAggregateId AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left aggregateType AST#identifier#Right AST#ERROR#Left AST#... | static async getByAggregateId(aggregateType: string, aggregateId: number): Promise<ReadModel | null> {
let resultSet: relationalStore.ResultSet | null = null;
try {
const store = DatabaseManager.getDatabase();
const predicates = new relationalStore.RdbPredicates(ReadModel.tableName);
predica... | https://github.com/wblxr408/SEU-SE-HarmonyExpense-App- | 0f4c622407940eb6b1afc953a58f3c794f0c1fb3 | 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 Int32Array
@returns { IterableIterator<int> } - iterator over keys
@syscap SystemCapability.Utils.Lang
@FaAndStageModel | public keys(): IterableIterator<int> {
return new Int32ArrayIteratorKeys(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 Int32ArrayIteratorKeys(this)
} | https://gitcode.com/iop123123/arkts-static-skills | f8485080bb578baa2f6ccbd3282ed40d23600907 | gitcode |
the-wwyang/kids-learning-app | src/main/ets/storage/AchievementStorageService.ets | arkts | loadAchievements | 加载成就数据
@returns 成就列表,如果没有保存数据则返回初始化数据 | static async loadAchievements(): Promise<Achievement[]> {
try {
// 先检查是否有保存的数据
const hasData = await dataStorage.has(
AchievementStorageService.STORE_NAME,
AchievementStorageService.KEY_ACHIEVEMENTS
);
if (!hasData) {
console.log('[AchievementStorage] No saved data... | 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 loadAchievements AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST... | static async loadAchievements(): Promise<Achievement[]> {
try {
// 先检查是否有保存的数据
const hasData = await dataStorage.has(
AchievementStorageService.STORE_NAME,
AchievementStorageService.KEY_ACHIEVEMENTS
);
if (!hasData) {
console.log('[AchievementStorage] No saved data... | https://github.com/the-wwyang/kids-learning-app | f4a6032403a66a3b4f2f9f895fc566eca8f1bff8 | github |
awaLiny2333/LinysBrowser_NEXT | home/src/main/ets/hosts/app/tabs/classes/WebNode.ets | arkts | detachWeb | 卸载Webview | detachWeb(): void {
this.rootNode = null;
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left detachWeb 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#Le... | detachWeb(): void {
this.rootNode = null;
} | https://github.com/awaLiny2333/LinysBrowser_NEXT | 576989946f1db3eb1f72392e2c3c49f6f3005913 | github |
HarmonyOS_Samples/hmosworld | HMOSWorld/Application/commons/audioplayer/src/main/ets/service/SpeechPlayerService.ets | arkts | stopTextToSpeechEngine | Stop TextToSpeechEngine | async stopTextToSpeechEngine() {
try {
this.ttsEngine?.stop();
Logger.info(TAG, 'Succeeded to stop textToSpeechEngine.');
} catch (error) {
Logger.error(TAG, `Failed to stop textToSpeechEngine.Cause: ${(error as BusinessError).message}`);
}
} | AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left stopTextToSpeechEngine AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left... | async stopTextToSpeechEngine() {
try {
this.ttsEngine?.stop();
Logger.info(TAG, 'Succeeded to stop textToSpeechEngine.');
} catch (error) {
Logger.error(TAG, `Failed to stop textToSpeechEngine.Cause: ${(error as BusinessError).message}`);
}
} | https://gitcode.com/HarmonyOS_Samples/hmosworld | 046546b91aa287dfe51a752c8b98ba14aac80d59 | gitcode |
offlinecat-dev/OCNetORM | src/main/ets/mapping/EntityData.ets | arkts | setRelatedSingle | 设置关联数据(单个实体类型,用于 MANY_TO_ONE 或 ONE_TO_ONE)
自动触发 UI 刷新
@param propertyName 关联属性名
@param data 单个关联实体或 null | setRelatedSingle(propertyName: string, data: EntityData | null): void {
this.relatedData.set(propertyName, RelatedDataValue.fromSingle(data))
} | AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setRelatedSingle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left ... | setRelatedSingle(propertyName: string, data: EntityData | null): void {
this.relatedData.set(propertyName, RelatedDataValue.fromSingle(data))
} | https://github.com/offlinecat-dev/OCNetORM | 8d4c20976e58db394ff15fa9ec5f35f7f3461bd6 | github |
DaLongZhuaZi/manxia | entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets | arkts | restoreCloudConfig | 恢复云存储配置(包含WebDAV、Suwayomi、FTP) | private async restoreCloudConfig(cloudConfig: CloudConfigBackupSection): Promise<void> {
const context = getGlobalContext();
const failures: string[] = [];
// 1. 恢复WebDAV配置
if (cloudConfig.webdav) {
try {
const webdavPrefs = await preferences.getPreferences(context, 'webdav_settings');
... | 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 restoreCloudConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left cloudConfig AST#identifier#Right A... | private async restoreCloudConfig(cloudConfig: CloudConfigBackupSection): Promise<void> {
const context = getGlobalContext();
const failures: string[] = [];
// 1. 恢复WebDAV配置
if (cloudConfig.webdav) {
try {
const webdavPrefs = await preferences.getPreferences(context, 'webdav_settings');
... | https://github.com/DaLongZhuaZi/manxia | 9a0ea1cd475f54dbd5ed28c275c3cc995218db86 | github |
openharmony-sig/arkcompiler_runtime_core | plugins/ets/stdlib/escompat/ArrayBuffer.ets | arkts | resize | Resizes the ArrayBuffer
@param newLen new length
TODO: return undefined | public resize(newLen : int): void {
let newData = new byte[newLen]
let size = min(newLen, this.data.length)
for (let i = 0; i < size; ++i) {
newData[i] = this.data[i]
}
this.data = newData
} | AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left newLen AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Righ... | public resize(newLen : int): void {
let newData = new byte[newLen]
let size = min(newLen, this.data.length)
for (let i = 0; i < size; ++i) {
newData[i] = this.data[i]
}
this.data = newData
} | https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git | fd92c7282afaeda5e54f5491081ea89c64f330c2 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.