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
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Storage/StorageAnalyzer.ets
arkts
analyzeDatabase
分析数据库
private async analyzeDatabase(): Promise<StorageItem> { try { // 【修复】使用实际的数据库目录路径 const context = uiContextManager.getAbilityContext(); if (!context) { logger.warn(TAG, 'Context未初始化,无法分析数据库'); return this.createEmptyItem(StorageType.DATABASE, '数据库'); } // 数据库文件...
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 analyzeDatabase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right A...
private async analyzeDatabase(): Promise<StorageItem> { try { // 【修复】使用实际的数据库目录路径 const context = uiContextManager.getAbilityContext(); if (!context) { logger.warn(TAG, 'Context未初始化,无法分析数据库'); return this.createEmptyItem(StorageType.DATABASE, '数据库'); } // 数据库文件...
https://github.com/DaLongZhuaZi/manxia
efe0d9dcc253c8c8d7e7128fc9a1a8f2508f02ff
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/LocalImageCacheManager.ets
arkts
doLoadImage
执行实际加载
private async doLoadImage(pageId: string, filePath: string, config?: LocalLoadConfig): Promise<image.PixelMap | null> { this.loadingTasks.add(pageId); let file: fs.File | null = null; let imageSource: image.ImageSource | null = null; try { // 处理文件路径 let actualPath = filePath; if...
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 doLoadImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pageId AST#identifier#Right AST#:#Left : ...
private async doLoadImage(pageId: string, filePath: string, config?: LocalLoadConfig): Promise<image.PixelMap | null> { this.loadingTasks.add(pageId); let file: fs.File | null = null; let imageSource: image.ImageSource | null = null; try { // 处理文件路径 let actualPath = filePath; if...
https://github.com/DaLongZhuaZi/manxia
af3ae044c0d4d3ac9b9bd910afc2d7103bb48f32
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/NativeModuleManager.ets
arkts
isModuleAvailable
检查模块是否可用 @param moduleName 模块名称 @returns 模块是否可用
public isModuleAvailable(moduleName: string): boolean { const module = this.getNativeModule(moduleName); return module !== undefined; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isModuleAvailable AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s...
public isModuleAvailable(moduleName: string): boolean { const module = this.getNativeModule(moduleName); return module !== undefined; }
https://github.com/DaLongZhuaZi/manxia
40727e26812c2733f5897bd8edb73a170dba9de0
github
arkui-x/samples
CodeLab/Cases/feature/imageviewer/src/main/ets/view/ImageItemView.ets
arkts
initCurrentImageInfo
设置当前图片的相关信息:uri、whRatio、pixelMap、fitWH、defaultSize、maxScaleValue TODO:知识点:提前获取图片的信息,以进行Image组件的尺寸设置及后续的相关计算
initCurrentImageInfo(): void { this.matrix = matrix4.identity().copy(); const imageSource: image.ImageSource = image.createImageSource(this.imageUri); imageSource.getImageInfo(0).then((data: image.ImageInfo) => { this.imageWHRatio = data.size.width / data.size.height; this.imageDefaultSize = t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left initCurrentImageInfo 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#stateme...
initCurrentImageInfo(): void { this.matrix = matrix4.identity().copy(); const imageSource: image.ImageSource = image.createImageSource(this.imageUri); imageSource.getImageInfo(0).then((data: image.ImageInfo) => { this.imageWHRatio = data.size.width / data.size.height; this.imageDefaultSize = t...
https://gitcode.com/arkui-x/samples
f594e56fe0df7119f02dc203fb1e0f65afb0550c
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
sort
Sorts in-place @param { function } [compareFn] - comparator _ used to determine the order of the elements. compareFn returns a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. @returns { this } - sorted Int8Array @syscap SystemCapability.Utils.Lang @F...
public sort(compareFn?: (a: number, b: number) => int): this { if (compareFn == undefined) { this.sort() return this } let cmp = (l: byte, r: byte): int => { const result = compareFn!((l).toDouble(), (r).toDouble()) return result.toInt() ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sort AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left compareFn AST#identifi...
public sort(compareFn?: (a: number, b: number) => int): this { if (compareFn == undefined) { this.sort() return this } let cmp = (l: byte, r: byte): int => { const result = compareFn!((l).toDouble(), (r).toDouble()) return result.toInt() ...
https://gitcode.com/iop123123/arkts-static-skills
fb3d1e62d8d0f1bb32455a6807aa09adaa229d93
gitcode
fbinba3955/Flymby
common/src/main/ets/utils/BrightnessUtil.ets
arkts
getCurrentWindowBright
获取当前窗口的亮度值 @returns
public static getCurrentWindowBright() { if (BrightnessUtil.currentWindow) { LogUtil.info(`BrightnessUtil 获取当前窗口亮度: ${BrightnessUtil.currentWindow.getWindowProperties().brightness}`); return BrightnessUtil.currentWindow.getWindowProperties().brightness } else { LogUtil.error('BrightnessUtil ...
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 getCurrentWindowBright AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri...
public static getCurrentWindowBright() { if (BrightnessUtil.currentWindow) { LogUtil.info(`BrightnessUtil 获取当前窗口亮度: ${BrightnessUtil.currentWindow.getWindowProperties().brightness}`); return BrightnessUtil.currentWindow.getWindowProperties().brightness } else { LogUtil.error('BrightnessUtil ...
https://github.com/fbinba3955/Flymby
f8d7a38c6c3d5d203c096f3247a297a7eb51c156
github
offlinecat-dev/OCNetORM
src/main/ets/core/MetadataStorage.ets
arkts
registerEntity
注册实体元数据 @param entityName 实体类名 @param tableName 数据库表名(可选,默认使用实体类名) @throws DuplicateEntityError 如果实体已注册
registerEntity(entityName: string, tableName?: string): void { if (this.entities.has(entityName)) { throw new DuplicateEntityError(entityName) } const actualTableName = tableName ? tableName : entityName const metadata = new EntityMetadata(entityName, actualTableName) this.entities.set(entit...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerEntity AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AS...
registerEntity(entityName: string, tableName?: string): void { if (this.entities.has(entityName)) { throw new DuplicateEntityError(entityName) } const actualTableName = tableName ? tableName : entityName const metadata = new EntityMetadata(entityName, actualTableName) this.entities.set(entit...
https://github.com/offlinecat-dev/OCNetORM
004e31a49205cd48ebf42909dd160739f5153e97
github
harmonyos/codelabs
AlarmClock/entry/src/main/ets/model/database/PreferencesHandler.ets
arkts
addPreferencesListener
Add preferences listener in PreferencesHandler. @param listener PreferencesListener
public addPreferencesListener(listener: PreferencesListener) { this.listeners.push(listener); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addPreferencesListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#ident...
public addPreferencesListener(listener: PreferencesListener) { this.listeners.push(listener); }
https://gitee.com/harmonyos/codelabs.git
e4c4e71bb29551c748d4d9633e1459ec10c745f4
gitee
HarmonyOS_Samples/sample_in_harmonyos
common/src/main/ets/util/ResourceUtil.ets
arkts
getResourceStringArray
Obtains the string array result with a specified resource. @param resource resource.
public static getResourceStringArray(context: Context, resource: Resource): string[] { if (!context) { Logger.error(TAG, 'getResourceStringArray context is null'); return []; } if (ResourceUtil.isEmptyObj(resource)) { Logger.error(TAG, '[getResourceStringArray] resource is empty.'); ...
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 getResourceStringArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST...
public static getResourceStringArray(context: Context, resource: Resource): string[] { if (!context) { Logger.error(TAG, 'getResourceStringArray context is null'); return []; } if (ResourceUtil.isEmptyObj(resource)) { Logger.error(TAG, '[getResourceStringArray] resource is empty.'); ...
https://gitcode.com/HarmonyOS_Samples/sample_in_harmonyos
b55f9cd79e0269590eb6fab6b925043e30b53563
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/common/accessibility/AccessibilityConfig.ets
arkts
needsConfirmation
检查是否需要操作确认 @param isImportant 是否为重要操作
public needsConfirmation(isImportant: boolean): boolean { switch (this.settings.confirmationLevel) { case 'none': return false; case 'important': return isImportant; case 'all': return true; default: return isImportant; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left needsConfirmation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isImportant AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boolean#Left boolean AS...
public needsConfirmation(isImportant: boolean): boolean { switch (this.settings.confirmationLevel) { case 'none': return false; case 'important': return isImportant; case 'all': return true; default: return isImportant; } }
https://github.com/LJ666-ui/harmony-health-care
1dbd174227e47a2c55512c606ca0d2b8d9998949
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/MoreViewModel.ets
arkts
email
获取邮箱显示
get email(): string { return this.currentUser?.mail_address || ''; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left email 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#E...
get email(): string { return this.currentUser?.mail_address || ''; }
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/MoreViewModel.ets#L36-L38
bec23b635f3ee59ce497a08e0d538a104db2cfdd
github
CPF-ApplicationTPC/openharmony_tpc_samples
bc_ohos/library/src/main/ets/ISO9797Alg3Mac.ets
arkts
init
初始化 MAC @param params 密钥参数或带 IV 的参数
init(params: KeyParameter | ParametersWithIV): void { // 先设置 IV,再调用 reset() let kp: KeyParameter; const paramsWithIV = params as ParametersWithIV; if (paramsWithIV.parameters !== undefined && paramsWithIV.iv !== undefined) { // ParametersWithIV kp = paramsWithIV.parameters; this.iv =...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left init AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left params AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expression#Left AST#identifier#Left KeyParameter AST#ident...
init(params: KeyParameter | ParametersWithIV): void { // 先设置 IV,再调用 reset() let kp: KeyParameter; const paramsWithIV = params as ParametersWithIV; if (paramsWithIV.parameters !== undefined && paramsWithIV.iv !== undefined) { // ParametersWithIV kp = paramsWithIV.parameters; this.iv =...
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
e4152c6c0e9c876044c6e812d2bae8f3b9b5c870
gitcode
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/MyDemoOld/pages/heima/security/CountDownPage.ets
arkts
stopCountDown
关闭倒计时
stopCountDown() { clearInterval(this.intervalId) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left stopCountDown 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...
stopCountDown() { clearInterval(this.intervalId) }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
d771f204561025443e854bcfccc4f72f3750016e
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
find
Returns the value of the first element in the array where predicate is true, and undefined otherwise @param { function } predicate - find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that el...
public find(predicate: (value: BigInt, index: int, array: BigUint64Array) => boolean): BigInt | undefined { for (let i = 0; i < this.lengthInt; i++) { let val = new BigInt(this.getUnsafe(i)) if (predicate(val, i, this)) { return val } } ret...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left find AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left ...
public find(predicate: (value: BigInt, index: int, array: BigUint64Array) => boolean): BigInt | undefined { for (let i = 0; i < this.lengthInt; i++) { let val = new BigInt(this.getUnsafe(i)) if (predicate(val, i, this)) { return val } } ret...
https://gitcode.com/iop123123/arkts-static-skills
f4886ca099a6b7bd728928bffc470f443bdc2ce6
gitcode
ibestservices/ibest-ui
library/src/main/ets/components/tree/index.ets
arkts
changeExpand
展开/折叠
changeExpand(){ const isExpand = this.isExpand if(isExpand){ // 收起 this.switchExpand(false) }else if(!this.data.children?.length && !(this.data.isLeaf === true) && this.lazyLoad){ // 展开 this.isLoading = true this.lazyLoad(getNodeData(this.data), this.l...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left changeExpand 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 ...
changeExpand(){ const isExpand = this.isExpand if(isExpand){ // 收起 this.switchExpand(false) }else if(!this.data.children?.length && !(this.data.isLeaf === true) && this.lazyLoad){ // 展开 this.isLoading = true this.lazyLoad(getNodeData(this.data), this.l...
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/tree/index.ets#L335-L355
e9f81d48d74c4bf7d0a4eb1d4cbb3dc413cb7439
github
codelably/tuniao-ui
core/tuniaoui/src/main/ets/index.ets
arkts
getBundleType
是否是元服务
private static getBundleType() { TnUIInitializer.isApp = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).appInfo.bundleType == bundleManager.BundleType.APP; }
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 getBundleType AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
private static getBundleType() { TnUIInitializer.isApp = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).appInfo.bundleType == bundleManager.BundleType.APP; }
https://github.com/codelably/tuniao-ui
38a7b22525648efb249d01f85be028590e81e0cf
github
openharmony-sig/qr-code-generator
library/src/main/ets/components/MainPage/qrcodegen.ets
arkts
drawFunctionPatterns
-- Private helper methods for constructor: Drawing function modules -- Reads this object's version field, and draws and marks all function modules.
private drawFunctionPatterns(): void { // Draw horizontal and vertical timing patterns for (let i = 0; i < this.size; i++) { this.setFunctionModule(6, i, i % 2 == 0); this.setFunctionModule(i, 6, i % 2 == 0); } // Draw 3 finder patterns (all corners except bottom right; over...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left drawFunctionPatterns AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void...
private drawFunctionPatterns(): void { // Draw horizontal and vertical timing patterns for (let i = 0; i < this.size; i++) { this.setFunctionModule(6, i, i % 2 == 0); this.setFunctionModule(i, 6, i % 2 == 0); } // Draw 3 finder patterns (all corners except bottom right; over...
https://gitee.com/openharmony-sig/qr-code-generator.git
2f3ae36b31afb03955dfbd7d51d9fc088445a4b4
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/service/EventSourcingService.ets
arkts
publishEvents
批量发布事件
static async publishEvents(events: EventData[]): Promise<EventPublishResult[]> { const results: EventPublishResult[] = []; for (let i = 0; i < events.length; i++) { const e = events[i]; const result = await EventSourcingService.publishEvent( e.eventType, e.aggregateType, e...
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 publishEvents AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left events AST#identifier#Right AST#:#Left : A...
static async publishEvents(events: EventData[]): Promise<EventPublishResult[]> { const results: EventPublishResult[] = []; for (let i = 0; i < events.length; i++) { const e = events[i]; const result = await EventSourcingService.publishEvent( e.eventType, e.aggregateType, e...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
0405da528014dcb87a472a909ff36a00071d12a8
github
apap6628114/nga_oh
entry/src/main/ets/common/managers/ReplyManager.ets
arkts
uploadImage
上传图片:pick → compress → upload → 插入 [img] → 记录附件参数
async uploadImage(imageData: ArrayBuffer, fileName: string): Promise<string> { logger.verbose('[IMGUP] getOrFetchAuth start') const authResult: PostAuthResult = await this.getOrFetchAuth() logger.verbose('[IMGUP] getOrFetchAuth ok: %{public}s', String(authResult.ok)) if (!authResult.ok) { throw ...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left uploadImage AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left imageData AST#identifier#Right AST#type_annotation#Left AS...
async uploadImage(imageData: ArrayBuffer, fileName: string): Promise<string> { logger.verbose('[IMGUP] getOrFetchAuth start') const authResult: PostAuthResult = await this.getOrFetchAuth() logger.verbose('[IMGUP] getOrFetchAuth ok: %{public}s', String(authResult.ok)) if (!authResult.ok) { throw ...
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/common/managers/ReplyManager.ets#L268-L294
113159631f2b0aa96e058d6228f198578d1dfea6
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test35_original_index.ets
arkts
reverseString
--- String reverse (manual) ---
function reverseString(s: string): string { let result: string = ''; for (let i: number = s.length - 1; i >= 0; i--) { result = result + s.charAt(i); } return result; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left reverseString AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left s AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right...
function reverseString(s: string): string { let result: string = ''; for (let i: number = s.length - 1; i >= 0; i--) { result = result + s.charAt(i); } return result; }
https://github.com/miaochiahao/ark-ghidra
cf801c4d92664f4eaaaeaf2da5c79373d56ec167
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/RdpBackgroundService.ets
arkts
resetRestartCount
Reset restart counter
static resetRestartCount(): void { restartCount = 0; lastRestartTime = 0; console.info(`${TAG}: Restart count reset`); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left resetRestartCount 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#v...
static resetRestartCount(): void { restartCount = 0; lastRestartTime = 0; console.info(`${TAG}: Restart count reset`); }
https://github.com/tangwengang-del/freerdp-harmonyos
3b570d0e5d162ce3e4738419abc32730c3c5bad5
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Date.ets
arkts
setUTCDate
Changes the day of the month of a given Date instance, based on UTC time. @param value new day.
public setUTCDate(value: byte): void { let day = this.getUTCDate(); this.ms -= day * msPerDay; this.ms += value * msPerDay; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setUTCDate 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 byte AST#identifier#...
public setUTCDate(value: byte): void { let day = this.getUTCDate(); this.ms -= day * msPerDay; this.ms += value * msPerDay; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
91ada622fd6b1d68a59fbed76e95fdf540349e90
gitee
LambdaYH/ScrcpyForHarmonyOS
app/src/main/ets/helper/Logger.ets
arkts
info
Info 级别日志
info(msg: string, ...args: (string | number | boolean | object | undefined | null)[]): void { const formattedMsg = this.formatMessage(msg, args); hilog.info(DOMAIN, this.tag, '%{public}s', formattedMsg); this.writeToFile(LogLevel.INFO, 'INFO', formattedMsg); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left info AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left msg AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Right...
info(msg: string, ...args: (string | number | boolean | object | undefined | null)[]): void { const formattedMsg = this.formatMessage(msg, args); hilog.info(DOMAIN, this.tag, '%{public}s', formattedMsg); this.writeToFile(LogLevel.INFO, 'INFO', formattedMsg); }
https://github.com/LambdaYH/ScrcpyForHarmonyOS
53cb0dce182461fd890a617cbac88786623437d8
github
openharmony/codelabs
ETSUI/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets
arkts
add
Addition and subtraction operation. @param arg1 Number 1. @param arg2 Number 2. @param symbol Operators. @return Addition and subtraction results.
add(arg1: string, arg2: string, symbol: string): number { let addFlag = (symbol === CommonConstants.ADD); if (this.containScientificNotation(arg1) || this.containScientificNotation(arg2)) { if (addFlag) { return Number(arg1) + Number(arg2); } return Number(arg1) - Number(arg2); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left add AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arg1 AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST#,#Right...
add(arg1: string, arg2: string, symbol: string): number { let addFlag = (symbol === CommonConstants.ADD); if (this.containScientificNotation(arg1) || this.containScientificNotation(arg2)) { if (addFlag) { return Number(arg1) + Number(arg2); } return Number(arg1) - Number(arg2); ...
https://gitee.com/openharmony/codelabs.git
2ed32a69333ef0bcb3421db060f9dd714ce7bbd9
gitee
2763981847/Clock-Alarm
entry/src/main/ets/viewmodel/AlarmClockViewModel.ets
arkts
openAlarm
启用/禁用闹钟。 @param id number 闹钟项的 ID @return isOpen boolean 闹钟是否启用
public openAlarm(id: number, isOpen: boolean) { for (let i = 0; i < this.alarms.length; i++) { if (this.alarms[i].id === id) { this.alarms[i].isOpen = isOpen; if (isOpen) { this.reminderService.addReminder(this.alarms[i]); } else { this.reminderService.deleteRemin...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left openAlarm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number A...
public openAlarm(id: number, isOpen: boolean) { for (let i = 0; i < this.alarms.length; i++) { if (this.alarms[i].id === id) { this.alarms[i].isOpen = isOpen; if (isOpen) { this.reminderService.addReminder(this.alarms[i]); } else { this.reminderService.deleteRemin...
https://github.com/2763981847/Clock-Alarm
05329861d26867a38cc7065c8f615c5d26bcafab
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets
arkts
openNewTab
Open a NEW TAB with the given URL. @param url The URL.
openNewTab(url: string) { const myTabs = AppStorageV2.connect(meowTabsBunch, `meowTabsBunch_${this.windowId}`)!; myTabs.newTabWrapped(url); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openNewTab AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST...
openNewTab(url: string) { const myTabs = AppStorageV2.connect(meowTabsBunch, `meowTabsBunch_${this.windowId}`)!; myTabs.newTabWrapped(url); }
https://github.com/awaLiny2333/LinysBrowser_NEXT
68b3289e2c7c2c0f4bd1b9b4f4d3777cfb6407f9
github
hiyuey3/Hixy_MyMemories
entry/src/main/ets/store/MemoryStore.ets
arkts
init
初始化 MemoryStore @param context 可选上下文对象 @returns Promise<void>
async function init(context?: Context): Promise<void> { // 初始化逻辑... }
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left init AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#optional_parameter#Left AST#identifier#Left context AST#identifier#Right AST#?#Left ? AS...
async function init(context?: Context): Promise<void> { // 初始化逻辑... }
https://github.com/hiyuey3/Hixy_MyMemories/blob/9769d82c97a877be3d464456e79f66c5c84a9590/entry/src/main/ets/store/MemoryStore.ets#L13-L15
921098610bbd0414ee2fb0a90092be7172426410
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/VideoOperateUtil.ets
arkts
playErrorExecute
播放器播放失败处理
static playErrorExecute(pathStack: NavPathStack, videoMetaData: VideoMetadata[], date: string, playerName: string, currentTime?: number) { ToolsUtil.showToast(ToolsUtil.getStringResource($r('app.string.video_error').id)) const nowPlayItem = videoMetaData.find(item => item.date === date) // 更新当前播放时间,确保...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left playErrorExecute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left pathStack AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
static playErrorExecute(pathStack: NavPathStack, videoMetaData: VideoMetadata[], date: string, playerName: string, currentTime?: number) { ToolsUtil.showToast(ToolsUtil.getStringResource($r('app.string.video_error').id)) const nowPlayItem = videoMetaData.find(item => item.date === date) // 更新当前播放时间,确保...
https://github.com/Yebingiscn/SweetVideo
ebf0bc55fac8734c05ad4ba18de5a85b8afb5b93
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/renderer/BarLineScatterCandleBubbleRenderer.ets
arkts
set
Calculates the minimum and maximum x values as well as the range between them. @param chart @param dataSet
public set(chart: BarLineScatterCandleBubbleDataProvider, dataSet: IBarLineScatterCandleBubbleDataSet<EntryOhos>) { let phaseX: number = Math.max(0, Math.min(1, (this.mAnimator ? this.mAnimator.getPhaseX() : 1))); let low: number = chart.getLowestVisibleX(); let high: number = chart.getHighestVisibleX();...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chart AST#identifier#Right AST#:#Left : AST#:...
public set(chart: BarLineScatterCandleBubbleDataProvider, dataSet: IBarLineScatterCandleBubbleDataSet<EntryOhos>) { let phaseX: number = Math.max(0, Math.min(1, (this.mAnimator ? this.mAnimator.getPhaseX() : 1))); let low: number = chart.getLowestVisibleX(); let high: number = chart.getHighestVisibleX();...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
67788379471dd81f107acec80134045a8bef8e3a
gitee
YANGZX22/Voot
entry/src/main/ets/pages/Index.ets
arkts
onShortcutPageChange
快捷方式页面跳转处理
onShortcutPageChange(): void { if (!this.shortcutTargetPage || this.shortcutTargetPage === '') { return; } console.info('[Index] Shortcut page change detected: ' + this.shortcutTargetPage); // 延迟执行跳转,确保页面已完成初始化 setTimeout(() => { const targetPage = this.shortcutTargetPage; /...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onShortcutPageChange AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expre...
onShortcutPageChange(): void { if (!this.shortcutTargetPage || this.shortcutTargetPage === '') { return; } console.info('[Index] Shortcut page change detected: ' + this.shortcutTargetPage); // 延迟执行跳转,确保页面已完成初始化 setTimeout(() => { const targetPage = this.shortcutTargetPage; /...
https://github.com/YANGZX22/Voot
3c2fd95ca0e8aa3f323c5e5ab0baded0e955ec14
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/ContentPanel.ets
arkts
getDefaultIconForType
根据面板类型获取默认图标
function getDefaultIconForType(type: ContentPanelType): Resource { switch (type) { case ContentPanelType.HELP: return $r('sys.symbol.questionmark_circle_fill'); case ContentPanelType.CHANGELOG: return $r('sys.symbol.doc_text_fill'); case ContentPanelType.EFFECTS: return $r('sys.symbol.st...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getDefaultIconForType AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left type AST#identifier#Right AST#type_annotation#Left AST#:#Left : ...
function getDefaultIconForType(type: ContentPanelType): Resource { switch (type) { case ContentPanelType.HELP: return $r('sys.symbol.questionmark_circle_fill'); case ContentPanelType.CHANGELOG: return $r('sys.symbol.doc_text_fill'); case ContentPanelType.EFFECTS: return $r('sys.symbol.st...
https://github.com/DaLongZhuaZi/manxia
8fba40c8b4827a5eb3d044d7e32a984317158eb5
github
openharmony-tpc/VCard
library/src/main/ets/components/VCardEntry.ets
arkts
consolidateFields
Consolidate several fielsds (like mName) using name candidates,
public consolidateFields(): void { this.mNameData.fullName = this.constructDisplayName(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left consolidateFields 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 consolidateFields(): void { this.mNameData.fullName = this.constructDisplayName(); }
https://gitee.com/openharmony-tpc/VCard.git
b29e7addae2e7e4778a62af283efb5f991b54a7d
gitee
CPF-ApplicationTPC/openharmony_tpc_samples
SwipeMenuListView/library/src/main/ets/utils/AnimationInterpolator.ets
arkts
spring
弹簧插值器 模拟弹簧物理效果
static spring(stiffness: number = 1, damping: number = 0.8): curves.ICurve { return curves.springMotion(stiffness, damping); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left spring AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left stiffness AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expressio...
static spring(stiffness: number = 1, damping: number = 0.8): curves.ICurve { return curves.springMotion(stiffness, damping); }
https://gitcode.com/CPF-ApplicationTPC/openharmony_tpc_samples
71d4b618ce99c7182c55b3087c504a7a3afa9ea4
gitcode
zmuxuny/ai-guardian-star
entry/src/main/ets/database/DatabaseHelper.ets
arkts
restore
从备份文件恢复数据库
public async restore(): Promise<void> { try { await (this.getStore() as relationalStore.RdbStore).restore("GuardianStar_backup.db"); hilog.info(DOMAIN, TAG, "数据库恢复成功"); } catch (e) { const err = e as BusinessError; hilog.error(DOMAIN, TAG, `restore 失败 ${err.code} ${err.message}`); ...
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 restore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left :...
public async restore(): Promise<void> { try { await (this.getStore() as relationalStore.RdbStore).restore("GuardianStar_backup.db"); hilog.info(DOMAIN, TAG, "数据库恢复成功"); } catch (e) { const err = e as BusinessError; hilog.error(DOMAIN, TAG, `restore 失败 ${err.code} ${err.message}`); ...
https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/database/DatabaseHelper.ets#L801-L810
be4c1ca1ef80b2d125404d9047a4614e9728b430
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/deviceAwareness/facades/DeviceAdaptationFacade.ets
arkts
calculateBreakpoint
计算断点(基于宽度vp)
private calculateBreakpoint(widthVp: number): NGFBreakpoint { if (widthVp < 600) { return NGFBreakpoint.XS; } else if (widthVp < 840) { return NGFBreakpoint.SM; } else if (widthVp < 1024) { return NGFBreakpoint.MD; } else { return NGFBreakpoint.LG; } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left calculateBreakpoint AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left widthVp AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST...
private calculateBreakpoint(widthVp: number): NGFBreakpoint { if (widthVp < 600) { return NGFBreakpoint.XS; } else if (widthVp < 840) { return NGFBreakpoint.SM; } else if (widthVp < 1024) { return NGFBreakpoint.MD; } else { return NGFBreakpoint.LG; } }
https://github.com/DaLongZhuaZi/NGF
852b07737ee4b109357a937c127a2c1a10a09da4
github
tdcare/tdwebrtc
src/main/ets/MediaStream.ets
arkts
setAudioRoute
设置音频路由(听筒/免提)
public async setAudioRoute(isSpeakerOn: boolean): Promise<void> { if (this.audioPlayback !== null) { await this.audioPlayback.setAudioRoute(isSpeakerOn); } }
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 setAudioRoute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left isSpeakerOn AST#identifier#Right AST#ERROR#Left AST#:#Lef...
public async setAudioRoute(isSpeakerOn: boolean): Promise<void> { if (this.audioPlayback !== null) { await this.audioPlayback.setAudioRoute(isSpeakerOn); } }
https://github.com/tdcare/tdwebrtc
3d97b500238ac47e7e6465cc10bb9ac623a8ac82
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
getSourcesWithoutGroup
获取无分组的书源
getSourcesWithoutGroup(): NovelSourceInfo[] { return this.getAllSources().filter(s => !s.group || s.group.trim().length === 0); }
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 getSourcesWithoutGroup AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#argumen...
getSourcesWithoutGroup(): NovelSourceInfo[] { return this.getAllSources().filter(s => !s.group || s.group.trim().length === 0); }
https://github.com/DaLongZhuaZi/manxia
31801c7154363d9b6a86552d4830541b35e39d1b
github
openharmony/applications_app_samples
code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets
arkts
getBuilder
通过名称获取builder
public static getBuilder(builderName: string): WrappedBuilder<[object]>{ let builder = RouterModule.builderMap.get(builderName); return builder as WrappedBuilder<[object]>; }
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 getBuilder AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left builderName AST#identifier#Right AST#ERROR#Left AST#:#Left ...
public static getBuilder(builderName: string): WrappedBuilder<[object]>{ let builder = RouterModule.builderMap.get(builderName); return builder as WrappedBuilder<[object]>; }
https://github.com/openharmony/applications_app_samples
38c18847ddc6913c3b5e1c4aeb4d91a8006222f3
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Cache/LocalImageCacheManager.ets
arkts
get
从缓存获取PixelMap
public get(pageId: string): image.PixelMap | null { const item = this.cache.get(pageId); if (item) { // 更新访问时间(LRU) item.lastAccess = Date.now(); return item.pixelMap; } return null; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left get AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identif...
public get(pageId: string): image.PixelMap | null { const item = this.cache.get(pageId); if (item) { // 更新访问时间(LRU) item.lastAccess = Date.now(); return item.pixelMap; } return null; }
https://github.com/DaLongZhuaZi/manxia
0c629ed52881da8c95db15ce41cd8863279e792a
github
openharmony/applications_app_samples
code/BasicFeature/DFX/AppRecovery/entry/src/main/ets/ability/EntryAbility.ets
arkts
restoreLocalStorage
Read previous saved status from want if we are launched by appRecovery
restoreLocalStorage(want: Want): void { Logger.info(TAG, "RestoreLocalStorage String:${want.parameters['Page1Str']} Counter:${want.parameters['Page2Counter']}"); if (want.parameters !== undefined) { this.storage.setOrCreate<string>('FaultTriggerPageString', want.parameters['FaultTriggerPageString'] as ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left restoreLocalStorage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#)#Left...
restoreLocalStorage(want: Want): void { Logger.info(TAG, "RestoreLocalStorage String:${want.parameters['Page1Str']} Counter:${want.parameters['Page2Counter']}"); if (want.parameters !== undefined) { this.storage.setOrCreate<string>('FaultTriggerPageString', want.parameters['FaultTriggerPageString'] as ...
https://github.com/openharmony/applications_app_samples
f590b1de947ed19a68ef793a666f85a7cf164ad3
github
Cool_foolisher1/ArkTSRepository
ArkTSDemo/products/entry/src/main/ets/MyDemoOld/manager/WindowManager.ets
arkts
setStatusBarLight
设置状态栏文字颜色为白色
static async setStatusBarLight() { // 获取应用上下文 const context = new UIContext().getHostContext() as Context try { await (await window.getLastWindow(context)).setWindowSystemBarProperties({ statusBarContentColor: '#FFFFFFFF' }) } catch (error) { } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left setStatusBarLight AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AS...
static async setStatusBarLight() { // 获取应用上下文 const context = new UIContext().getHostContext() as Context try { await (await window.getLastWindow(context)).setWindowSystemBarProperties({ statusBarContentColor: '#FFFFFFFF' }) } catch (error) { } }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
974a8267bc06abb8026b72eeaaadb49adc44310f
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
getScaleY
returns the current y-scale factor
public getScaleY(): number { if (this.mViewPortHandler == null) return 1; else return this.mViewPortHandler.getScaleY(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getScaleY 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#numbe...
public getScaleY(): number { if (this.mViewPortHandler == null) return 1; else return this.mViewPortHandler.getScaleY(); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
8130d1ae253d297f9b07d9c7a74f5a886a4539c4
gitee
openharmony-sig/ohos_byte_global_viewpool
byte_global_viewpool/src/main/ets/schedule/ScheduleService.ets
arkts
postFrameOnIdleCallback
@description 下一帧的OnIdle时机调用,主要用于预创建组件 @param {UIContext} uiContext @param {()=>void>} callback @param {number} timeout 如果OnIdle剩余时间小于timeout,不执行callback
public static postFrameOnIdleCallback(uiContext: UIContext, callback: () => void, timeout: number) { try { MissionFrameOnIdleEngine.getInstance().addOnIdleTask(uiContext, callback, timeout) } catch (error) { } }
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 postFrameOnIdleCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right ...
public static postFrameOnIdleCallback(uiContext: UIContext, callback: () => void, timeout: number) { try { MissionFrameOnIdleEngine.getInstance().addOnIdleTask(uiContext, callback, timeout) } catch (error) { } }
https://gitee.com/openharmony-sig/ohos_byte_global_viewpool.git
5aa39a8712404879b4292f5d77ea7875e8131630
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/AxisBase.ets
arkts
isAxisLineDashedLineEnabled
Returns true if the axis dashed-line effect is enabled, false if not. @return
public isAxisLineDashedLineEnabled(): boolean { return this.mAxisLineDashPathEffect == null ? false : true; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isAxisLineDashedLineEnabled 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#Le...
public isAxisLineDashedLineEnabled(): boolean { return this.mAxisLineDashPathEffect == null ? false : true; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
cefcc6e594f3ae186706779207762f64f0f306c4
gitee
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/util/StringUtil.ets
arkts
copyText
复制文本 @param text 文本
public async copyText(text: string) { // 创建一条纯文本类型的剪贴板内容对象 let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, text) // 将数据写入系统剪贴板 let systemPasteboard = pasteboard.getSystemPasteboard() await systemPasteboard.setData(pasteData) //从系统剪贴板中读取数据 systemPasteboard.getData().th...
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 copyText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left text AST#identifier#Right AST#:#Left : AST#:#Ri...
public async copyText(text: string) { // 创建一条纯文本类型的剪贴板内容对象 let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, text) // 将数据写入系统剪贴板 let systemPasteboard = pasteboard.getSystemPasteboard() await systemPasteboard.setData(pasteData) //从系统剪贴板中读取数据 systemPasteboard.getData().th...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
ab6326ec6c282eac4d372acf1c9d40bde995fab3
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/renderer/XAxisRenderer.ets
arkts
renderCustomGridLines
render custom grid lines. @param c
public renderCustomGridLines(c: CanvasRenderingContext2D) { let gridLines = this.mXAxis?.getGridLines(); gridLines && this.renderLinesInner(c, gridLines); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left renderCustomGridLines AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public renderCustomGridLines(c: CanvasRenderingContext2D) { let gridLines = this.mXAxis?.getGridLines(); gridLines && this.renderLinesInner(c, gridLines); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
a5b5b3f2cfd08ad687a18f178cde726d264c88e8
gitee
HarmonyOS_Samples/pdfkit_-sample-code_-arkts
entry/src/main/ets/pages/Index.ets
arkts
copyURIAndJump
将URI对应的PDF文件复制到沙盒中并进入到下一个页面
copyURIAndJump(uri: string): void { try { let context = this.getUIContext().getHostContext(); if (!context) { hilog.error(0x0000, TAG, 'Get context failed'); return; } let dir = context.filesDir; let file = dir + '/temp.pdf'; hilog.info(0x0000, TAG, `Copy file t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left copyURIAndJump AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uri AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) A...
copyURIAndJump(uri: string): void { try { let context = this.getUIContext().getHostContext(); if (!context) { hilog.error(0x0000, TAG, 'Get context failed'); return; } let dir = context.filesDir; let file = dir + '/temp.pdf'; hilog.info(0x0000, TAG, `Copy file t...
https://gitcode.com/HarmonyOS_Samples/pdfkit_-sample-code_-arkts
86e09ade77ae8a742063e7d30131d32ac6d9dbb2
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
some
Checks that at least one element of Uint32Array satisfies the passed function @param fn check function @returns true if some element satisfies fn
public some(fn: (element: number, index: int) => boolean): boolean { let newF: (element: number, index: int, array: Uint32Array) => boolean = (element: number, index: int, array: Uint32Array): boolean => { return fn(element, index) } return this.some(newF) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left some AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Righ...
public some(fn: (element: number, index: int) => boolean): boolean { let newF: (element: number, index: int, array: Uint32Array) => boolean = (element: number, index: int, array: Uint32Array): boolean => { return fn(element, index) } return this.some(newF) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
01730af1c7d8a4871df0669476b3193e0d7a71d0
gitee
xiaofenger_705/protobuf-arkts-generator
runtime/arkpb/JsonEncodingVisitor.ets
arkts
visitMapInt64Int64
访问 map<int64, int64> 字段 JSON: object with string keys and values
visitMapInt64Int64(value: Map<bigint, bigint>, fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) const obj: Record<string, Object> = {} value.forEach((v, k) => { obj[k.toString()] = v.toString() as Object }) this.json[fieldName] = obj as Object }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitMapInt64Int64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Map AST#identifier...
visitMapInt64Int64(value: Map<bigint, bigint>, fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) const obj: Record<string, Object> = {} value.forEach((v, k) => { obj[k.toString()] = v.toString() as Object }) this.json[fieldName] = obj as Object }
https://gitcode.com/xiaofenger_705/protobuf-arkts-generator
67cdccec4552df925154e12f8ab4eb2b69cd08de
gitcode
LongLiveY96/chatcube
entry/src/main/ets/utils/IconGeneratorUtils.ets
arkts
isEnglishLetter
判断字符是否为英文字母
function isEnglishLetter(char: string): boolean { const code = char.charCodeAt(0) return (code >= 65 && code <= 90) || (code >= 97 && code <= 122) }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isEnglishLetter AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left char AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#...
function isEnglishLetter(char: string): boolean { const code = char.charCodeAt(0) return (code >= 65 && code <= 90) || (code >= 97 && code <= 122) }
https://github.com/LongLiveY96/chatcube
ec9f4b5fc5eb8490c5d16f98d13ce629f6ff404b
github
Harrisonls2004/WaterFlow
entry/src/main/ets/common/network/ApiService.ets
arkts
clearCart
清空购物车
static async clearCart(): Promise<ApiResponse> { const response = await httpClient.delete('/cart'); const result = parseJsonSafe(response.data); if (result) { const data = result as Record<string, Object>; const apiResponse = new ApiResponse(); apiResponse.code = getResponseCode(dat...
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 clearCart AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left...
static async clearCart(): Promise<ApiResponse> { const response = await httpClient.delete('/cart'); const result = parseJsonSafe(response.data); if (result) { const data = result as Record<string, Object>; const apiResponse = new ApiResponse(); apiResponse.code = getResponseCode(dat...
https://github.com/Harrisonls2004/WaterFlow
0a195b449ae9627c57b29ad8ecbe05cb82a48710
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoSourceParser.ets
arkts
isNovelSource
检查书源是否为小说类型
static isNovelSource(source: LegadoBookSource): boolean { return source.bookSourceType === LegadoBookSourceType.TEXT; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isNovelSource AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
static isNovelSource(source: LegadoBookSource): boolean { return source.bookSourceType === LegadoBookSourceType.TEXT; }
https://github.com/DaLongZhuaZi/manxia
bc03a65d6b454c85201da86e017e71371d238a60
github
Nekofox-POT/LinMusic
entry/src/main/ets/package/audio_player/class_audio_player.ets
arkts
set_player_mode
设置播放器模式(重加载) //
async set_player_mode(mode: boolean) { // 更改模式 // this.global_config!.player_mode = mode this.global_config?.save_data() // 重加载 // this.reset_data() }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left set_player_mode AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left mode AST#identifier#Right AST#type_annotation#Left AST#:#Left :...
async set_player_mode(mode: boolean) { // 更改模式 // this.global_config!.player_mode = mode this.global_config?.save_data() // 重加载 // this.reset_data() }
https://github.com/Nekofox-POT/LinMusic
274a3ce138ae5396ea59bda95a7c97222ba46f3a
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/CategoryDAO.ets
arkts
insert
插入新分类(自动清除缓存) 缓存失效策略: - 插入后清除该用户的所有分类缓存 - 确保数据一致性
static async insert(category: Category): Promise<void> { if (!category.validate()) { throw new Error('[CategoryDAO] 无效分类数据'); } const store = DatabaseManager.getDatabase(); // 1. 检查是否存在同名同类型分类(包括已删除的) const checkSql = `SELECT * FROM categories WHERE user_id = ? AND name = ? AND type = ?...
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 insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left category AST#identifier#Right AST#:#Left : AST#:#...
static async insert(category: Category): Promise<void> { if (!category.validate()) { throw new Error('[CategoryDAO] 无效分类数据'); } const store = DatabaseManager.getDatabase(); // 1. 检查是否存在同名同类型分类(包括已删除的) const checkSql = `SELECT * FROM categories WHERE user_id = ? AND name = ? AND type = ?...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
e4cb9216e2668b7cd243908d018cac9f4db0560b
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/HtmlEntities.ets
arkts
containsEntities
检查字符串是否包含 HTML 实体
static containsEntities(text: string): boolean { return /&[#a-zA-Z0-9]+;/.test(text); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left containsEntities 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...
static containsEntities(text: string): boolean { return /&[#a-zA-Z0-9]+;/.test(text); }
https://github.com/DaLongZhuaZi/manxia
60783cd72678bdda2e6571c0bb8468264b42c924
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
of
Returns a new array from a set of elements. @param { FixedArray<long> } items - a set of elements to include in the new array object. @returns { BigUint64Array } - a new BigUint64Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(...items: FixedArray<long>): BigUint64Array { let res = new BigUint64Array(items.length.toInt()) res.ofLong(stub.toValueArray(items)) return res }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR...
public static of(...items: FixedArray<long>): BigUint64Array { let res = new BigUint64Array(items.length.toInt()) res.ofLong(stub.toValueArray(items)) return res }
https://gitcode.com/iop123123/arkts-static-skills
1ded12e9fdc99aa8e1b2f5e535abe75779637ff7
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Storage/SandboxManager.ets
arkts
getDirectory
获取目录路径
public getDirectory(type: keyof DirectoryPaths): string { // 检查Context是否已初始化 if (!this.context) { const errorMsg = `SandboxManager未初始化,无法获取目录路径: ${type}`; logger.error(TAG, errorMsg); throw new Error(errorMsg); } // 使用显式属性访问替代索引访问 let path: string = ''; switch (type...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getDirectory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#keyof#Left keyof AST#keyof#Right AS...
public getDirectory(type: keyof DirectoryPaths): string { // 检查Context是否已初始化 if (!this.context) { const errorMsg = `SandboxManager未初始化,无法获取目录路径: ${type}`; logger.error(TAG, errorMsg); throw new Error(errorMsg); } // 使用显式属性访问替代索引访问 let path: string = ''; switch (type...
https://github.com/DaLongZhuaZi/manxia
edaad0d7ffa44c63dc3c34c641ae9f96c8281d4c
github
SakuraNeko/Deepseek-Harmony
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onConfigurationUpdate
监听系统深色/浅色模式切换,同步更新 AppStorage 与状态栏样式
onConfigurationUpdate(newConfig: Configuration): void { const newColorMode: ConfigurationConstant.ColorMode | undefined = newConfig.colorMode; if (newColorMode === undefined) { return; } const currentColorMode: ConfigurationConstant.ColorMode | undefined = AppStorage.get('currentColorMode'); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onConfigurationUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newConfig AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Configuration AST#identifier#...
onConfigurationUpdate(newConfig: Configuration): void { const newColorMode: ConfigurationConstant.ColorMode | undefined = newConfig.colorMode; if (newColorMode === undefined) { return; } const currentColorMode: ConfigurationConstant.ColorMode | undefined = AppStorage.get('currentColorMode'); ...
https://github.com/SakuraNeko/Deepseek-Harmony
6d3ee2b434a4c233d477956598e0af47710c5464
github
openharmony-sig/fluttertpc_mobile_scanner
ohos/src/main/ets/MobileScannerPlugin.ets
arkts
changeToXComponent
frameCallback横向码图位置信息转换为预览流xComponent对应码图位置信息
changeToXComponent(frameResult: customScan.ScanFrame) { if (frameResult && frameResult.scanCodeRects) { let frameHeight = frameResult.height; let ratio = this.scanWidth / frameHeight; frameResult.scanCodeRects.forEach((item) => { this.scanCodeRect.push({ left: this.toFixedNumbe...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left changeToXComponent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left frameResult AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#iden...
changeToXComponent(frameResult: customScan.ScanFrame) { if (frameResult && frameResult.scanCodeRects) { let frameHeight = frameResult.height; let ratio = this.scanWidth / frameHeight; frameResult.scanCodeRects.forEach((item) => { this.scanCodeRect.push({ left: this.toFixedNumbe...
https://gitee.com/openharmony-sig/fluttertpc_mobile_scanner.git
d5f0db8f29e2e3efd2c547d868533064266c8a67
gitee
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test26_original_index.ets
arkts
testFloat64Array
--- Float64Array with computation ---
function testFloat64Array(): string { let f64: Float64Array = new Float64Array(3); f64[0] = 1.5; f64[1] = 2.5; f64[2] = 3.5; let avg: number = (f64[0] + f64[1] + f64[2]) / 3; return avg.toFixed(2); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testFloat64Array 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...
function testFloat64Array(): string { let f64: Float64Array = new Float64Array(3); f64[0] = 1.5; f64[1] = 2.5; f64[2] = 3.5; let avg: number = (f64[0] + f64[1] + f64[2]) / 3; return avg.toFixed(2); }
https://github.com/miaochiahao/ark-ghidra
716d76873af1c2dcee5d890426064fa1850e07e1
github
FinalScave/SweetLine
platform/OHOS/sweetline/src/main/ets/Index.ets
arkts
getName
Get the name of the syntax rule
public getName(): string { return lib.SyntaxRule_GetName(this.nativeHandle); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getName 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#...
public getName(): string { return lib.SyntaxRule_GetName(this.nativeHandle); }
https://github.com/FinalScave/SweetLine
86132dcc95fdef47f846251ec10ba2e134c0c32e
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/Matcher.ets
arkts
matchAttribute
检查属性是否匹配
static matchAttribute(attrValue: string | undefined, selector: AttributeSelector): boolean { if (!selector.operator) { return attrValue !== undefined; } if (attrValue === undefined) return false; switch (selector.operator) { case '=': return attrValue === selector.value; ca...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left matchAttribute AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#identifier#Left attrValue AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#s...
static matchAttribute(attrValue: string | undefined, selector: AttributeSelector): boolean { if (!selector.operator) { return attrValue !== undefined; } if (attrValue === undefined) return false; switch (selector.operator) { case '=': return attrValue === selector.value; ca...
https://github.com/DaLongZhuaZi/manxia
e2f90a67aa5195f6898e5cb9de16710387dee0ff
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/component/navigation/NavigationDemo3.ets
arkts
animate
启动指定页面的转场动画
animate(id: string, operation: NavigationOperation) { let animateCallback = customTransitionMap.get(id)?.animateCallback; if (!animateCallback) { return; } animateCallback(operation); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left animate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#L...
animate(id: string, operation: NavigationOperation) { let animateCallback = customTransitionMap.get(id)?.animateCallback; if (!animateCallback) { return; } animateCallback(operation); }
https://github.com/webabcd/HarmonyDemo
afe209147c40f3c16b67004a8950381cdb2602ff
github
AGenUI/AGenUI
platforms/harmony/agenui/src/main/ets/agenui/function/FunctionManager.ets
arkts
unregisterFunction
Unregisters a function @param name Function name
public unregisterFunction(name: string): void { if (this.functions.has(name)) { napiUnregisterFunction(name); this.functions.delete(name); hilog.info(0x0000, 'FunctionManager', 'unregisterFunction success: %{public}s', name); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unregisterFunction 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#Le...
public unregisterFunction(name: string): void { if (this.functions.has(name)) { napiUnregisterFunction(name); this.functions.delete(name); hilog.info(0x0000, 'FunctionManager', 'unregisterFunction success: %{public}s', name); } }
https://github.com/AGenUI/AGenUI
3267ff56861adf66e623238057bbcfe5568d700c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Jsonx.ets
arkts
tryGetBigInt
Attempts to get an bigint value from an object by key. Returns the fallback value if the key is not found or if the value is not an bigint. @param {string} key - The key to look up @param {bigint} [fallback=0n] - The fallback value to return if the key is not found @returns {bigint} The bigint value if found, fallback ...
tryGetBigInt(key: string, fallback: bigint = 0n): bigint { return this.tryGetElement(key)?.tryAsBigInt() ?? fallback }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left tryGetBigInt AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#,#Left , AST...
tryGetBigInt(key: string, fallback: bigint = 0n): bigint { return this.tryGetElement(key)?.tryAsBigInt() ?? fallback }
https://gitcode.com/iop123123/arkts-static-skills
57de58d55d80b74bed396de64f68ddf643f26dff
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/pages/DiscoverPage.ets
arkts
formatDate
日期格式化
formatDate(publishTime: string): string { const date = new Date(publishTime); const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); return `${year}-${month}-${day}`; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left formatDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left publishTime AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#)...
formatDate(publishTime: string): string { const date = new Date(publishTime); const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); return `${year}-${month}-${day}`; }
https://github.com/LJ666-ui/harmony-health-care
3b16ef819d8881acb0b624e6e2886ca4bd38a8d0
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/AnomalyDetectionDAO.ets
arkts
acknowledge
确认异常记录
static async acknowledge(anomalyId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); const values: relationalStore.ValuesBucket = { is_acknowledged: 1, acknowledged_at: now, updated_at: now }; ...
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 acknowledge AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left anomalyId AST#identifier#Right AST#ERROR#Left AST#:#Left : ...
static async acknowledge(anomalyId: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); const values: relationalStore.ValuesBucket = { is_acknowledged: 1, acknowledged_at: now, updated_at: now }; ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f247142d70dfce6914a5a742e784ff9f2df40cd3
github
openharmony-sig/amountinputtext
libamountinput/src/main/ets/widget/AmountInputText.ets
arkts
onTextChanged
文字内容变动处理
onTextChanged(data: AmountInputData, instance: any) { let curValue: string = instance.model.amountStr; console.info('onclick amountStr: ' + curValue) //点击标题栏中的"完成"或者"收起",收起键盘 if (data == AmountInputData.TITLEDONE) { instance.dialogController.close(); return; } //点击键盘的"完成", 收起键盘,并...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onTextChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AmountInputData AST#identif...
onTextChanged(data: AmountInputData, instance: any) { let curValue: string = instance.model.amountStr; console.info('onclick amountStr: ' + curValue) //点击标题栏中的"完成"或者"收起",收起键盘 if (data == AmountInputData.TITLEDONE) { instance.dialogController.close(); return; } //点击键盘的"完成", 收起键盘,并...
https://gitee.com/openharmony-sig/amountinputtext.git
3bf790766d3e83d1c5eeed6c3f6ed6c963559495
gitee
aimilin6688/KeePassHO
entry/src/main/ets/components/loading/LoadingDialogUtils.ets
arkts
showWarn
显示 warn hud @param value
async showWarn(value: ResourceStr | LoadingSettings = ''): Promise<void> { await this.showDialog(new LoadingActionOptions(LoadingState.WARN, value)) this.hideDialogDelay(LoadingState.WARN, value) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left showWarn AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left value AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:...
async showWarn(value: ResourceStr | LoadingSettings = ''): Promise<void> { await this.showDialog(new LoadingActionOptions(LoadingState.WARN, value)) this.hideDialogDelay(LoadingState.WARN, value) }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/components/loading/LoadingDialogUtils.ets#L83-L86
4a83827bb875d815850ace909adb72865d50241d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/GoogleBooksScraper.ets
arkts
setApiKey
设置API Key
public setApiKey(apiKey: string): void { this.config.apiKey = apiKey; logger.info(TAG, 'Google Books API Key已设置'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setApiKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left apiKey AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left stri...
public setApiKey(apiKey: string): void { this.config.apiKey = apiKey; logger.info(TAG, 'Google Books API Key已设置'); }
https://github.com/DaLongZhuaZi/manxia
6f63940862a6a7632af89b83507af2ffc48bdc6a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInstanceMethod.ets
arkts
invoke
Invokes this instance method. @param { Object } thisObj The this object used when invoking the method. @param { FixedArray<Any> } [ args ] args The argument array passed when invoking the method. @returns { Any } The execution result of the method. @throws { TypeError } Throws when `thisObj` is incompatible with the me...
public invoke(thisObj: Object, args?: FixedArray<Any>): Any { return super.invoke(thisObj, args) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left invoke AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left thisObj AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Object AST#identifier#...
public invoke(thisObj: Object, args?: FixedArray<Any>): Any { return super.invoke(thisObj, args) }
https://gitcode.com/iop123123/arkts-static-skills
c4a2a7097d97c3502c3fe4c71c242eba9c176862
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.List.ets
arkts
getIndexOf
Gets the index of the first occurrence of an element. @param element The element to search for. @returns The index of the first occurrence of the element, or -1 if not found.
public getIndexOf(element: T): int { return this.buffer.getIndexOf(element); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getIndexOf AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#R...
public getIndexOf(element: T): int { return this.buffer.getIndexOf(element); }
https://gitcode.com/iop123123/arkts-static-skills
17214db4cbf72e778506131d75198987fd9a4a53
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LargeFileJSONParser.ets
arkts
sleep
休眠指定毫秒
private sleep(ms: number): Promise<void> { return new Promise(resolve => setTimeout(resolve, ms)); }
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left private AST#identifier#Right AST#ERROR#Left AST#identifier#Left sleep AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ms AST#i...
private sleep(ms: number): Promise<void> { return new Promise(resolve => setTimeout(resolve, ms)); }
https://github.com/DaLongZhuaZi/manxia
20a51fa7a2e1dd9a1f7d74b238aa03ea333e8245
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/TypeCreator.ets
arkts
from
@returns created {@link TypeOrCreator_Type}
static from(typ: Type): TypeOrCreator { return new TypeOrCreator_Type(typ) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left typ AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR...
static from(typ: Type): TypeOrCreator { return new TypeOrCreator_Type(typ) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
9f38aaa9e1114ac862c078cf90572aac5bcd610f
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeSet.ets
arkts
has
Check whether the given value is in the TreeSet @param value: the value to find in the TreeSet @returns true if the value is in the TreeSet
override has(value: T): boolean { return this.treeMap.hasKey(value); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left has AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id...
override has(value: T): boolean { return this.treeMap.hasKey(value); }
https://gitcode.com/iop123123/arkts-static-skills
465b843dc1746c56e1da19633f52e9e9b39d969d
gitcode
HarmonyOS_Samples/MusicHome
features/player/src/main/ets/view/PlaybackPage.ets
arkts
aboutToAppear
Seeds cover Resource from the current queue item.
aboutToAppear(): void { const song = this.state.getCurrentSongItem(); this.releaseBackgroundCoverIfPixelMap(); this.imageLabel = song !== undefined ? song.label : $r('app.string.page_show'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { const song = this.state.getCurrentSongItem(); this.releaseBackgroundCoverIfPixelMap(); this.imageLabel = song !== undefined ? song.label : $r('app.string.page_show'); }
https://gitcode.com/HarmonyOS_Samples/MusicHome
54bbded3c46b62756460643306a1b9cff72221ea
gitcode
openharmony/applications_settings
product/phone/src/main/ets/pages/searchPage.ets
arkts
doSearch
search
doSearch() { if (this.searchModel) { this.searchModel.search(this.searchKeyword) .then((result: SearchData[]) => { LogUtil.debug(ConfigData.TAG + 'searchPage doSearch : search : searchKeyword = ' + this.searchKeyword + '; => then data = ' + JSON.stringify(result)); this...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left doSearch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#if_statement#Left AST#if#Lef...
doSearch() { if (this.searchModel) { this.searchModel.search(this.searchKeyword) .then((result: SearchData[]) => { LogUtil.debug(ConfigData.TAG + 'searchPage doSearch : search : searchKeyword = ' + this.searchKeyword + '; => then data = ' + JSON.stringify(result)); this...
https://gitee.com/openharmony/applications_settings.git
0e7a31373ae8a142cdc3df4ef526007753d20518
gitee
openharmony-tpc/ImageKnife
library/src/main/ets/cache/FileCache.ets
arkts
saveFileCacheOnlyFile
子线程里只写入缓存文件 @param context @param key @param value
static saveFileCacheOnlyFile(context: Context, key: string, value: ArrayBuffer, folder: string = FileCache.CACHE_FOLDER): boolean { // 写文件 FileUtils.getInstance() .writeFileSync(context.cacheDir + FileUtils.SEPARATOR + folder + FileUtils.SEPARATOR + key, value) return true }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left saveFileCacheOnlyFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identif...
static saveFileCacheOnlyFile(context: Context, key: string, value: ArrayBuffer, folder: string = FileCache.CACHE_FOLDER): boolean { // 写文件 FileUtils.getInstance() .writeFileSync(context.cacheDir + FileUtils.SEPARATOR + folder + FileUtils.SEPARATOR + key, value) return true }
https://gitee.com/openharmony-tpc/ImageKnife.git
ef171cfd124f24475ce4221aeee9162c837ed12c
gitee
openharmony/arkui_advanced_ui_component
customappbar/source/custom_app_bar.ets
arkts
setCustomCallback
atomicservice侧的事件变化回调 @param eventName 事件名称 @param param 事件参数
setCustomCallback(eventName: string, param: string): void { if (param === null || param === '' || param === undefined) { hilog.error(0x3900, LOG_TAG, 'invalid params'); return; } if (eventName === ARKUI_APP_BAR_COLOR_CONFIGURATION) { hilog.error(0x3900, LOG_TAG, `setCustomCallback notify...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setCustomCallback AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left eventName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , ...
setCustomCallback(eventName: string, param: string): void { if (param === null || param === '' || param === undefined) { hilog.error(0x3900, LOG_TAG, 'invalid params'); return; } if (eventName === ARKUI_APP_BAR_COLOR_CONFIGURATION) { hilog.error(0x3900, LOG_TAG, `setCustomCallback notify...
https://gitee.com/openharmony/arkui_advanced_ui_component.git
0e5b0a18ffd09283e6c0723e7672acc42767409b
gitee
Mydstiny/RemoteDeskHarmonyOS
entry/src/main/ets/services/DataCrypto.ets
arkts
resetSetup
清除所有加密状态 (用户主动关闭加密时调用) — 清除盐值+验证器, 数据恢复明文存储
resetSetup(): void { this.lock(); this.attemptCount = 0; this.lockUntil = 0; try { const store = this.getStore(); if (store) { store.executeSql("DELETE FROM cryptoparams WHERE key IN ('crypto_salt', 'crypto_verifier')"); } hilog.info(DOMAIN, TAG, '加密参数已清除 (resetSetup)')...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resetSetup 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#L...
resetSetup(): void { this.lock(); this.attemptCount = 0; this.lockUntil = 0; try { const store = this.getStore(); if (store) { store.executeSql("DELETE FROM cryptoparams WHERE key IN ('crypto_salt', 'crypto_verifier')"); } hilog.info(DOMAIN, TAG, '加密参数已清除 (resetSetup)')...
https://github.com/Mydstiny/RemoteDeskHarmonyOS
6b3e7ec7162fba5c18868d98ee83e145002bf1b4
github
midori52000/ArkPilot
Agent/entry/src/main/ets/skills/SkillsBackendService.ets
arkts
installFromGithub
安装 Skill(完整流程,通过 Rust host 完成 SSOT 复制 + 注册)
async installFromGithub(skill: DiscoverableSkill): Promise<InstalledSkill> { // Step 1: 校验 const sourceRel = this.isRootSkillDirectory(skill.directory) ? '' : this.sanitizeSourcePath(skill.directory); if (sourceRel === null) { throw new SkillError( SkillErrorCode.INVALID_SKILL_DI...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left installFromGithub AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left skill AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async installFromGithub(skill: DiscoverableSkill): Promise<InstalledSkill> { // Step 1: 校验 const sourceRel = this.isRootSkillDirectory(skill.directory) ? '' : this.sanitizeSourcePath(skill.directory); if (sourceRel === null) { throw new SkillError( SkillErrorCode.INVALID_SKILL_DI...
https://github.com/midori52000/ArkPilot
582bca819e8b14d5f6b5a65942ee9df5e52b3203
github
Joker-x-dev/CoolMallArkTS
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onBackground
应用进入后台时调用 暂停应用状态、注销路由 @returns {void} 无返回值
onBackground(): void { }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onBackground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Le...
onBackground(): void { }
https://github.com/Joker-x-dev/CoolMallArkTS
e65b531dbe93198b7dbeb2eeabb90057d6f3258a
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets
arkts
asIntN
Clamps a BigInt to a signed integer with the specified number of bits. @param { long } bits The number of bits for the signed integer representation. @param { BigInt } num The BigInt value to clamp. @returns { BigInt } A BigInt value clamped to the specified number of bits as a signed integer. @throws { RangeError } Th...
public static asIntN(bits: long, num: BigInt): BigInt { if (bits == 0 || num.isZero()) { return 0n } if (bits < 0 || bits > Double.MAX_SAFE_INTEGER) { throw new RangeError('bits < 0 or bits > Double.MAX_SAFE_INTEGER') } if (bits > num.length() * BigInt...
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 asIntN AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bits AST#identifier#Right AST#:#Left : AST#:#Rig...
public static asIntN(bits: long, num: BigInt): BigInt { if (bits == 0 || num.isZero()) { return 0n } if (bits < 0 || bits > Double.MAX_SAFE_INTEGER) { throw new RangeError('bits < 0 or bits > Double.MAX_SAFE_INTEGER') } if (bits > num.length() * BigInt...
https://gitcode.com/iop123123/arkts-static-skills
9ef4b05d52ed89bbb049dd1490c285f5e9560aaa
gitcode
qiuhaotc/HarmonyOSPlayground
entry/src/main/ets/pages/BillListPage.ets
arkts
parseDateString
解析日期字符串为Date对象
parseDateString(dateStr: string): Date { if (!dateStr) { return new Date(); } const parts = dateStr.split('-'); if (parts.length === 3) { return new Date(parseInt(parts[0]), parseInt(parts[1]) - 1, parseInt(parts[2])); } return new Date(); ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left parseDateString AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left dateStr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left ) AST#...
parseDateString(dateStr: string): Date { if (!dateStr) { return new Date(); } const parts = dateStr.split('-'); if (parts.length === 3) { return new Date(parseInt(parts[0]), parseInt(parts[1]) - 1, parseInt(parts[2])); } return new Date(); ...
https://github.com/qiuhaotc/HarmonyOSPlayground
f4a5a4ebe42be7f77afa62a6b8f61613f2e193b4
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/dialogs/parts/WoofCatsDev/parts/settings/SimpleSettingsExamples.ets
arkts
build
adblock_exceptions
build() { UniContentCard({ roundedRadius: defaultInnerRadius }) { Flex(meowFlexOptions) { // DEV_MODE as an example of meowSettingsEntryType.BOOLEAN Row({ space: 8 }) { Text('DEV_MODE'); Toggle({ isOn: this.mySettings.settingsData[74].value as boolean, type: ToggleType.Sw...
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#object#Left AST#{#Left { AST#{#Right AST#method_def...
build() { UniContentCard({ roundedRadius: defaultInnerRadius }) { Flex(meowFlexOptions) { // DEV_MODE as an example of meowSettingsEntryType.BOOLEAN Row({ space: 8 }) { Text('DEV_MODE'); Toggle({ isOn: this.mySettings.settingsData[74].value as boolean, type: ToggleType.Sw...
https://github.com/awaLiny2333/LinysBrowser_NEXT
faaa4f39841e6c1d3a8edf1238fa398a23de5f5b
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/arkts/class/Class.ets
arkts
run
重写父类的方法
public run():string { return `runrunrun: ${this.name}`; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left run AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right...
public run():string { return `runrunrun: ${this.name}`; }
https://github.com/webabcd/HarmonyDemo
a166376a8ac396455e1dd91633a28524ccb7331b
github
honjow/Next2V
shared/src/main/ets/utils/FoldScreenUtil.ets
arkts
registerCallback
Register state change callback @param callback Callback when state changes
registerCallback(callback: (value: boolean) => void): void { this.callbacks.push(callback) }
AST#program#Left AST#ERROR#Left AST#identifier#Left registerCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#...
registerCallback(callback: (value: boolean) => void): void { this.callbacks.push(callback) }
https://github.com/honjow/Next2V
495cab9232b70086cf8a7ed9402f4806bbccb4b9
github
openharmony-sig/knowledge_demo_entainment
FA/GuoChat/entry/src/main/ets/MainAbility/common/messageBottom.ets
arkts
build
切换表情按钮的图标
build() { Column(){ /** * 输入框布局 * 包括文字输入和语音输入 */ Flex({direction: FlexDirection.Row , alignItems:ItemAlign.Center}){ //语音按钮 Image($r('app.media.ic_sound')) .height(25) .width(25) .margin({ left: 10 }) .onClick(() =>{ ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Column(){ /** * 输入框布局 * 包括文字输入和语音输入 */ Flex({direction: FlexDirection.Row , alignItems:ItemAlign.Center}){ //语音按钮 Image($r('app.media.ic_sound')) .height(25) .width(25) .margin({ left: 10 }) .onClick(() =>{ ...
https://gitee.com/openharmony-sig/knowledge_demo_entainment.git
55b4c2b31d24dad3074dca785badd1ff378e6e11
gitee
youyeyejie/ZhiXing_ActHub
entry/src/main/ets/app/MainShell.ets
arkts
buildCurrentTabPage
根据当前主路由渲染对应标签页内容。
private buildCurrentTabPage() { if (this.app.nav.mainRouteName === AppRoute.PLAN) { PlanPage(); } else if (this.app.nav.mainRouteName === AppRoute.TODO) { TodoPage(); } else if (this.app.nav.mainRouteName === AppRoute.IDEA) { IdeaPage(); } else { UserPage(); } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildCurrentTabPage 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...
private buildCurrentTabPage() { if (this.app.nav.mainRouteName === AppRoute.PLAN) { PlanPage(); } else if (this.app.nav.mainRouteName === AppRoute.TODO) { TodoPage(); } else if (this.app.nav.mainRouteName === AppRoute.IDEA) { IdeaPage(); } else { UserPage(); } }
https://github.com/youyeyejie/ZhiXing_ActHub/blob/869a378eba0782e97a38aecf259bce457d267b44/entry/src/main/ets/app/MainShell.ets#L32-L42
6ea1161c7a598b3f54d10162b259f75add3f21e9
github
silence17/harmonydemo
entry/src/main/ets/pages/MinePage.ets
arkts
aboutToAppear
组件的声明周期 @Component 仅首次创建的时候执行
aboutToAppear() { setTimeout(() => { this.onLoginChange() }, 1500); this.viewModel.initData() }
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() { setTimeout(() => { this.onLoginChange() }, 1500); this.viewModel.initData() }
https://github.com/silence17/harmonydemo
886cb9d58856654c4e4a912f2e5aa0e7a3dec8d5
github
LJ666-ui/harmony-health-care
entry/src/main/ets/parking/ParkingService.ets
arkts
calculateFee
计算停车费用
calculateFee(parkDurationMinutes: number): FeeDetailBreakdown { const config: FeeRateConfig = this.getFeeRates(); let totalFee: number = 0; const breakdown: FeeItem[] = []; if (parkDurationMinutes <= config.freeMinutes) { const item: FeeItem = { period: '0-30分钟(免费)', fee: 0 }; breakdown.p...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateFee AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left parkDurationMinutes AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Le...
calculateFee(parkDurationMinutes: number): FeeDetailBreakdown { const config: FeeRateConfig = this.getFeeRates(); let totalFee: number = 0; const breakdown: FeeItem[] = []; if (parkDurationMinutes <= config.freeMinutes) { const item: FeeItem = { period: '0-30分钟(免费)', fee: 0 }; breakdown.p...
https://github.com/LJ666-ui/harmony-health-care
7c43dc9babf2057345948a23ba80c0bdfba8fb93
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/utils/RDPPerformanceManager.ets
arkts
measureNetworkQuality
测量网络质量 - 使用真正的 TCP 连接测试 RTT
async measureNetworkQuality(): Promise<NetworkQuality> { const startTime = Date.now() try { // 执行真正的网络测试 const latency = await this.performNetworkTest() this.latencyHistory.push(latency) if (this.latencyHistory.length > 10) { this.latencyHistory.shift() } ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left measureNetworkQuality 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 AS...
async measureNetworkQuality(): Promise<NetworkQuality> { const startTime = Date.now() try { // 执行真正的网络测试 const latency = await this.performNetworkTest() this.latencyHistory.push(latency) if (this.latencyHistory.length > 10) { this.latencyHistory.shift() } ...
https://github.com/AetheriumSimulator/qemu-hmos
0c4310f28748925f1ec185c5ef04f726a9963e45
github
Dabing-0x19d/berverage_HarmonyOS6.0
entry/src/main/ets/model/linechart.ets
arkts
calculateData
计算所有数据
calculateData(): void { const now = new Date() const currentHour = now.getHours() + now.getMinutes() / 60 // 筛选今日记录 const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0).getTime() const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateData 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...
calculateData(): void { const now = new Date() const currentHour = now.getHours() + now.getMinutes() / 60 // 筛选今日记录 const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0).getTime() const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, ...
https://github.com/Dabing-0x19d/berverage_HarmonyOS6.0
c7a138bfe08c044023ef876b7455458b8dd21cc1
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnFormViewModel.ets
arkts
setSubjectScore
设置学科分数 @param index 索引 @param value 分数
setSubjectScore(index: number, value: string): void { this.dynamicForm.subjects[index].score = value; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setSubjectScore 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 ...
setSubjectScore(index: number, value: string): void { this.dynamicForm.subjects[index].score = value; }
https://github.com/codelably/tuniao-ui
54359d5a7a61d2f2b60837a9bda00c4451c2b30b
github
codelably/HCompass
core/network/src/main/ets/RequestHelper.ets
arkts
onLoading
设置 loading 回调 @param show 显示回调 @param hide 隐藏回调 @returns 当前实例
onLoading(show: () => void, hide: () => void): RequestHelper<T> { this.showLoadingCallback = show; this.hideLoadingCallback = hide; return this; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onLoading AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left sh...
onLoading(show: () => void, hide: () => void): RequestHelper<T> { this.showLoadingCallback = show; this.hideLoadingCallback = hide; return this; }
https://github.com/codelably/HCompass
482d4637a04afcba635212392cf27cd03be8c0a3
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ArrayBlockingQueue.ets
arkts
isEmpty
Checks if the BlockingQueue is empty. @returns { boolean } True if a BlockingQueue has no elements, otherwise false.
override isEmpty(): boolean { return this.size == 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left override AST#identifier#Right AST#ERROR#Left AST#identifier#Left isEmpty 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#:...
override isEmpty(): boolean { return this.size == 0; }
https://gitcode.com/iop123123/arkts-static-skills
a7c92f2acfb7242352445c5552a5f183ab8a5629
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.HashSet.ets
arkts
$_iterator
Returns an iterator for the HashSet @returns An iterator for the HashSet
$_iterator(): IterableIterator<T> { return this.values(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left $_iterator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left ...
$_iterator(): IterableIterator<T> { return this.values(); }
https://gitcode.com/iop123123/arkts-static-skills
7c442e1f1c33bded4767b72311d54f5a98200a01
gitcode
luojiang001/Pulse
Pulse/entry/src/main/ets/pages/component/ShouYe/DoctorListComponent.ets
arkts
applyFilters
统一过滤逻辑
applyFilters() { let temp = this.allDoctors; // 1. 科室过滤 if (this.filterDepartment && this.filterDepartment !== '全部') { temp = temp.filter(d => d.department === this.filterDepartment); } // 2. 关键词过滤 if (this.searchKeyword) { const keyword = this.searchKeyword.trim(); temp = ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left applyFilters 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 ...
applyFilters() { let temp = this.allDoctors; // 1. 科室过滤 if (this.filterDepartment && this.filterDepartment !== '全部') { temp = temp.filter(d => d.department === this.filterDepartment); } // 2. 关键词过滤 if (this.searchKeyword) { const keyword = this.searchKeyword.trim(); temp = ...
https://github.com/luojiang001/Pulse
490358caa94f692c4c35cf2a3cb07a3a71183ad9
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
with
Creates a copy with replaced value on index @param { int } index - index to change @param { number } value - value to set @returns { Uint8ClampedArray } - an Uint8ClampedArray with replaced value on index @throws { RangeError } - If the index exceeds the array range, throw an exception @syscap SystemCapability.Utils.La...
public with(index: int, value: number): Uint8ClampedArray { let res = new Uint8ClampedArray(this) res.setUnsafeClamp(index, value.toInt()) return res }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#ERROR#Right AST#with_statement#Left AST#with#Left with AST#with#Right AST#parenthesized_expression#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
public with(index: int, value: number): Uint8ClampedArray { let res = new Uint8ClampedArray(this) res.setUnsafeClamp(index, value.toInt()) return res }
https://gitcode.com/iop123123/arkts-static-skills
d6ea6dd059e41dc127dcd7173f3a97fb3ee70cd5
gitcode
openharmony/arkui_ace_engine
examples/Info/entry/src/main/ets/pages/qrcode/qrcodegen.ets
arkts
assert
Throws an exception if the given condition is false.
function assert(cond: boolean): void { if (!cond) throw new Error("Assertion error"); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left assert AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left cond AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST...
function assert(cond: boolean): void { if (!cond) throw new Error("Assertion error"); }
https://gitee.com/openharmony/arkui_ace_engine.git
009ee88868b55f67a41c734ba5adce986768928b
gitee