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
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/calculator/AdvancedSunshineCalculator.ets
arkts
isBlockedByBuildings
检查光线是否被建筑物遮挡
private isBlockedByBuildings( buildings: BuildingModel[], targetBuilding: BuildingModel, unitPoint: Point3D, pointZ: number, sunPosition: SunPosition ): boolean { const altitudeRad = sunPosition.altitude * Math.PI / 180; const azimuthRad = sunPosition.azimuth * Math.PI / 180; //...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left isBlockedByBuildings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left buildings AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#sub...
private isBlockedByBuildings( buildings: BuildingModel[], targetBuilding: BuildingModel, unitPoint: Point3D, pointZ: number, sunPosition: SunPosition ): boolean { const altitudeRad = sunPosition.altitude * Math.PI / 180; const azimuthRad = sunPosition.azimuth * Math.PI / 180; //...
https://github.com/qiuhaotc/Sunshine_HarmonyOS
997441fe1c5a2d0144865f623f4105a7ded10a50
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
every
Checks that all elements of Int8Array satisfy the passed function @param fn check function @returns true if all elements satisfy fn
public every(fn: (element: byte, index: int, array: Int8Array) => boolean): boolean { for (let i = 0; i < this.length; ++i) { if (!fn(this.at(i), i, this)) { return false } } return true }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left every 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#Rig...
public every(fn: (element: byte, index: int, array: Int8Array) => boolean): boolean { for (let i = 0; i < this.length; ++i) { if (!fn(this.at(i), i, this)) { return false } } return true }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
d0f0fa5d47f40652e3abaf302f2e1ef77f9824c7
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Console.ets
arkts
groupCollapsed
Alias for group() method Creates a collapsed group in environments that support it @param {string} [objs] - Data to be printed without additional indent @returns {void} @see group
public groupCollapsed(...objs: Any[]): void { this.group(...objs); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left groupCollapsed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left objs AST#identifier#Right AST#:#L...
public groupCollapsed(...objs: Any[]): void { this.group(...objs); }
https://gitcode.com/iop123123/arkts-static-skills
2092965baa0f3822a3e05dc7a7a77f1c54870669
gitcode
YANGZX22/Voot
entry/src/main/ets/storage/OnboardingStorage.ets
arkts
setVerifiedPhone
设置已验证的手机号码 @param ctx UI Ability Context @param phone 手机号码(完整11位)
static async setVerifiedPhone(ctx: common.UIAbilityContext, phone: string): Promise<void> { const prefs = await OnboardingStorage.getPrefs(ctx); await prefs.put(OnboardingStorage.KEY_VERIFIED_PHONE, phone); await prefs.flush(); }
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 setVerifiedPhone AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ctx AST#identifier#Right AST#:#Left : A...
static async setVerifiedPhone(ctx: common.UIAbilityContext, phone: string): Promise<void> { const prefs = await OnboardingStorage.getPrefs(ctx); await prefs.put(OnboardingStorage.KEY_VERIFIED_PHONE, phone); await prefs.flush(); }
https://github.com/YANGZX22/Voot
6cf5c91896e64023eb3dbce02739ac30718afbe8
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
moveViewToX
Moves the left side of the current viewport to the specified x-position. This also refreshes the chart by calling invalidate(). @param xValue
public moveViewToX(xValue: number): void { if (this.mViewPortHandler) { let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT) if (transformer) { let job: MoveViewJob = MoveViewJob.getInstance(this.mViewPortHandler, xValue, 0, transformer, this); this.addViewpo...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left moveViewToX AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left xValue AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left nu...
public moveViewToX(xValue: number): void { if (this.mViewPortHandler) { let transformer: Transformer | null = this.getTransformer(AxisDependency.LEFT) if (transformer) { let job: MoveViewJob = MoveViewJob.getInstance(this.mViewPortHandler, xValue, 0, transformer, this); this.addViewpo...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
3cfe0c512fd46d3a86cca4ccb722a028c8c5618c
gitee
751496032/ZRouter
RouterApi/src/main/ets/api/Router.ets
arkts
addService
添加服务路由,开发者不需要手动调用,在编译阶段会自动生成模版代码 @param name @param service
public static addService(name: string, service: IProvider) { ZRouter.serviceMgr().addService(name, service) }
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 addService AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:...
public static addService(name: string, service: IProvider) { ZRouter.serviceMgr().addService(name, service) }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L200-L202
37c37e2ecf5f63566c4eda19c462cc5351a7f310
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/AppInitializationManager.ets
arkts
isFailed
检查是否失败
isFailed(): boolean { return this.state.isFailed; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left isFailed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_...
isFailed(): boolean { return this.state.isFailed; }
https://github.com/DaLongZhuaZi/manxia
3aac7cb01a9e58b5c7abfa8ecb89ba51b7a7ed9c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Boolean.ets
arkts
constructor
Constructs a new Boolean with provided char value @param { char } value value to construct class instance with @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(value: char) { this.value = value != c'\u0000'; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left char AST#identifier...
public constructor(value: char) { this.value = value != c'\u0000'; }
https://gitcode.com/iop123123/arkts-static-skills
09f28d298b0dfb6a51568e8bd5aba04e6a1f606c
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/services/TotpService.ets
arkts
base32Encode
编码字节数组为Base32字符串 @param bytes 字节数组 @returns Base32编码的字符串
public base32Encode(bytes: Uint8Array): string { // 标准Base32字符集 const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; let result = ''; let buffer = 0; let bitsLeft = 0; for (let i = 0; i < bytes.length; i++) { // 将8位添加到缓冲区 buffer = (buffer << 8) | bytes[i]; bitsLeft += 8; ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left base32Encode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bytes AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Ui...
public base32Encode(bytes: Uint8Array): string { // 标准Base32字符集 const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; let result = ''; let buffer = 0; let bitsLeft = 0; for (let i = 0; i < bytes.length; i++) { // 将8位添加到缓冲区 buffer = (buffer << 8) | bytes[i]; bitsLeft += 8; ...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/TotpService.ets#L332-L358
19f2c5371b854b11a9d9ca6cb540634bd33e6736
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoJsEngine.ets
arkts
httpRequest
使用ArkTS发起HTTP请求(绕过WebView的CORS限制) @param url 请求URL @param method 请求方法 @param body 请求体 @param headers 请求头 @returns 响应结果
async httpRequest(url: string, method: string = 'GET', body?: string, headers?: Record<string, string>): Promise<HttpResponse> { let httpRequest: http.HttpRequest | null = null; try { httpRequest = http.createHttp(); const normalizedMethod = method.trim().toUpperCase(); // 构建请求头 ...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left httpRequest AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async httpRequest(url: string, method: string = 'GET', body?: string, headers?: Record<string, string>): Promise<HttpResponse> { let httpRequest: http.HttpRequest | null = null; try { httpRequest = http.createHttp(); const normalizedMethod = method.trim().toUpperCase(); // 构建请求头 ...
https://github.com/DaLongZhuaZi/manxia
52fc64c7bec4fd4fd065d3522be268db3675419f
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
some
Checks that at least one element of Uint16Array 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: Uint16Array) => boolean = (element: number, index: int, array: Uint16Array): 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: Uint16Array) => boolean = (element: number, index: int, array: Uint16Array): boolean => { return fn(element, index) } return this.some(newF) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
00ac15bd5796979163cefaf787a6191547c656e3
gitee
HarmonyOS_Samples/multi-tab-navigation
entry/src/main/ets/pages/BackgroundLightTab.ets
arkts
build
[End BackgroundLightTab_color]
build() { Column() { Row() { // [Start BackgroundLightTab_list] List({ scroller: this.listScroller }) { ForEach(this.tabArray.slice(0, 6), (item: TabItem, index: number) => { this.tabBuilder(item.name, index); }, (item: TabItem, index: number) ...
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() { Row() { // [Start BackgroundLightTab_list] List({ scroller: this.listScroller }) { ForEach(this.tabArray.slice(0, 6), (item: TabItem, index: number) => { this.tabBuilder(item.name, index); }, (item: TabItem, index: number) ...
https://gitcode.com/HarmonyOS_Samples/multi-tab-navigation
acee714564bb62465f1d58af2d17a179315b0070
gitcode
Kira-Yagami-Light/Kira-Projects
TodoTask/entry/src/main/ets/data/repository/CategoryRepository.ets
arkts
insertCategory
插入分类 @param category 分类模型 @returns Promise<boolean> 是否成功,成功后 category.id 会被设置为新 ID
async insertCategory(category: TaskCategoryData): Promise<boolean> { try { const valueBucket = this.toValueBucket(category); const rowId = await this.dao.insert(valueBucket); if (rowId > 0) { category.id = rowId; Logger.info(this.LOG_TAG, `Category inserted with ID: ${rowId}`); ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left insertCategory AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left category AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async insertCategory(category: TaskCategoryData): Promise<boolean> { try { const valueBucket = this.toValueBucket(category); const rowId = await this.dao.insert(valueBucket); if (rowId > 0) { category.id = rowId; Logger.info(this.LOG_TAG, `Category inserted with ID: ${rowId}`); ...
https://github.com/Kira-Yagami-Light/Kira-Projects
53f76f43dd3cd7b01499146301a4db6dbd24f6ec
github
arkui-x/samples
CodeLab/Cases/feature/addressrecognize/src/main/ets/view/ImageEdit.ets
arkts
isMove
判断操作类型 @param area @param touch
isMove(area: Area, touch: TouchObject) { if (touch.x < 60 && touch.y < 60) { // 左上角 this.actionType = ActionType.topLeft; } else if (touch.x < 60 && touch.y > (Number(area.height) - 60)) { // 左下 this.actionType = ActionType.bottomLeft; } else if (touch.x > Number(area.width) - 60 &...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left isMove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left area AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Area AST#identifier#Right AST#,#Le...
isMove(area: Area, touch: TouchObject) { if (touch.x < 60 && touch.y < 60) { // 左上角 this.actionType = ActionType.topLeft; } else if (touch.x < 60 && touch.y > (Number(area.height) - 60)) { // 左下 this.actionType = ActionType.bottomLeft; } else if (touch.x > Number(area.width) - 60 &...
https://gitcode.com/arkui-x/samples
0ded7acaf20acbae4fe5d4c62a1c9b06ab4181d0
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
every
Checks that all elements of Float32Array satisfy the passed function @param fn check function @returns true if all elements satisfy fn
public every(fn: (element: float, index: int, array: Float32Array) => boolean): boolean { for (let i = 0; i < this.length; ++i) { if (!fn(this.at(i), i, this)) { return false } } return true }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left every 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#Rig...
public every(fn: (element: float, index: int, array: Float32Array) => boolean): boolean { for (let i = 0; i < this.length; ++i) { if (!fn(this.at(i), i, this)) { return false } } return true }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
2e4b44458a07e5233ed9f94c77d7954d443d1d81
gitee
wanrenhuifu/JLU
harmonyos-鸿蒙实训/tkbrush-app/tkbrush-app/entry/src/main/ets/pages/Home/TKExaminationResult.ets
arkts
getOptionColor
获取选项背景色 answerStatus 用户答案状态:0 错误,1 正确,2 未答题
getOptionColor(answerStatus: number):ResourceColor{ switch (answerStatus) { case 0: return $r('app.color.resultOption_errorColor') break; case 1: return $r('app.color.resultOption_selectColor') break; default: return $r('app.color.option_normalColor') ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getOptionColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left answerStatus AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) ...
getOptionColor(answerStatus: number):ResourceColor{ switch (answerStatus) { case 0: return $r('app.color.resultOption_errorColor') break; case 1: return $r('app.color.resultOption_selectColor') break; default: return $r('app.color.option_normalColor') ...
https://github.com/wanrenhuifu/JLU
8f4e9ac31e744c0adc86d1deba60b631b30174eb
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/06.conversions_and_contexts/06.numeric_contexts/01.unary_numeric_promotion/bitwise_complement_n.ets
arkts
foo
--- desc: >- Unary numeric promotion is performed on expressions in the following situation: The operand of a bitwise complement operator. params: {{c.type}} cannot be promoted tags: [compile-only, negative] ---
function foo(a: Object): int { return 0; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left foo AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left a AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_...
function foo(a: Object): int { return 0; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
43b64df2642ac8e4ed7596ae8f15d61bc209da5f
gitee
Joker-x-dev/CoolMallArkTS
core/ibestui/src/main/ets/IBestUIInitializer.ets
arkts
initIBestUI
初始化 IBest UI 组件库 @param {window.WindowStage} windowStage - 窗口阶段 @param {common.UIAbilityContext} context - UIAbility 上下文 @returns {void} 无返回值
static initIBestUI(windowStage: window.WindowStage, context: common.UIAbilityContext): void { IBestInit(windowStage, context); IBestUIInitializer.setIBestUIBaseStyle(); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left initIBestUI AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left windowStage AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id...
static initIBestUI(windowStage: window.WindowStage, context: common.UIAbilityContext): void { IBestInit(windowStage, context); IBestUIInitializer.setIBestUIBaseStyle(); }
https://github.com/Joker-x-dev/CoolMallArkTS
5576a22460de8e93485010831ce3089a3945f568
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/TouchInputHandler.ets
arkts
setEnableDoubleClickDrag
配置是否启用双击拖动(从设置读取后调用)
setEnableDoubleClickDrag(enable: boolean): void { this.trackpad.updateConfig(undefined, undefined, enable); this.enableDoubleClickDrag = enable; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setEnableDoubleClickDrag AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enable AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolean AST#identifier#Right ...
setEnableDoubleClickDrag(enable: boolean): void { this.trackpad.updateConfig(undefined, undefined, enable); this.enableDoubleClickDrag = enable; }
https://github.com/AlkaidLab/moonlight-harmony
d801a156be2e519a01ea6dac01cac2051701058c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
constructor
Creates a copy of Float64Array. @param { Float64Array } other - data initializer @syscap SystemCapability.Utils.Lang @FaAndStageModel
public constructor(other: Float64Array) { this.buffer = other.buffer.slice(other.byteOffset, other.byteOffset + other.byteLength) as ArrayBuffer this.byteLength = other.byteLength this.lengthInt = other.length this.byteOffset = 0 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Flo...
public constructor(other: Float64Array) { this.buffer = other.buffer.slice(other.byteOffset, other.byteOffset + other.byteLength) as ArrayBuffer this.byteLength = other.byteLength this.lengthInt = other.length this.byteOffset = 0 }
https://gitcode.com/iop123123/arkts-static-skills
cb1569dc55ca54a94ebb81059a91748b1ad8ba29
gitcode
openharmony-sig/applications_clock
common/src/main/ets/manager/AlarmManager.ets
arkts
removeAlarmById
通过id删除闹钟 @param alarmID 闹钟id
async removeAlarmById(alarmID: string): Promise<string> { const rdbStore = await this.getRdbStore(); try { rdbStore.beginTransaction(); const predicates = new rdb.RdbPredicates(DATA_TABLE); predicates.equalTo('ID', alarmID as string); let deleteResult = await rdbStore.delete(predicates...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left removeAlarmById AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left alarmID AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
async removeAlarmById(alarmID: string): Promise<string> { const rdbStore = await this.getRdbStore(); try { rdbStore.beginTransaction(); const predicates = new rdb.RdbPredicates(DATA_TABLE); predicates.equalTo('ID', alarmID as string); let deleteResult = await rdbStore.delete(predicates...
https://gitee.com/openharmony-sig/applications_clock.git
03469b21827c383e4500c5687554c75b233656f3
gitee
erosTeam/NextE
shared/src/main/ets/settings/GalleryReadProgressSettings.ets
arkts
setIndex
Record the current page for a gallery: memory now, disk on a debounce.
static setIndex(context: common.UIAbilityContext, gid: string, index: number): void { if (gid.length === 0 || index < 0) { return } connectGalleryReadProgress().setIndex(gid, index, Date.now()) if (GalleryReadProgressSettings.flushTimer >= 0) { clearTimeout(GalleryReadProgressSettings.flus...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left setIndex 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#member_expression#Le...
static setIndex(context: common.UIAbilityContext, gid: string, index: number): void { if (gid.length === 0 || index < 0) { return } connectGalleryReadProgress().setIndex(gid, index, Date.now()) if (GalleryReadProgressSettings.flushTimer >= 0) { clearTimeout(GalleryReadProgressSettings.flus...
https://github.com/erosTeam/NextE
d9769fe711cb159a9d485b5979a0cd99235b60e0
github
richshaw2015/nds
ohos/entry/src/test/NativeSync.test.ets
arkts
getSettingsConfig
获取单个配置值 Requirements: 13.2
getSettingsConfig(key: string): SettingsConfigValue | undefined { return this.configStore.get(key); }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getSettingsConfig 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#Le...
getSettingsConfig(key: string): SettingsConfigValue | undefined { return this.configStore.get(key); }
https://github.com/richshaw2015/nds
412bd0bc68f9e23f83833f55185c2171d8bea8de
github
webabcd/HarmonyDemo
entry/src/main/ets/pages/arkts/concurrent/TaskPoolDemo.ets
arkts
fun2
@Concurrent 支持异步函数,且异步执行的过程不受任务的 3 分钟执行上限的时间限制
@Concurrent async function fun2(a: number, b: number): Promise<number> { // 睡 1 秒 await new Promise<void>((r) => { setTimeout(r, 1000) }) return a + b }
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left fun2 AST#identifier#Right AST#formal_parameters#Left A...
@Concurrent async function fun2(a: number, b: number): Promise<number> { // 睡 1 秒 await new Promise<void>((r) => { setTimeout(r, 1000) }) return a + b }
https://github.com/webabcd/HarmonyDemo
020da41b79d209cb71cda37ecb97f03b15316bed
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/DynamicUrlResolver.ets
arkts
resolveUrl
解析URL模板 支持变量替换:{{baseUrl}}, {{apiDomain}}, {{mangaId}}等
resolveUrl(template: string, config: UrlResolverConfig): string { if (!template) { return ''; } let url = template; // 1. 解析域名选择 const actualBaseUrl = this.resolveBaseUrl(config); url = url.replace(/\{\{baseUrl\}\}/g, actualBaseUrl); // 2. 替换其他变量 if (config.variables) { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left resolveUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left template AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#,#Ri...
resolveUrl(template: string, config: UrlResolverConfig): string { if (!template) { return ''; } let url = template; // 1. 解析域名选择 const actualBaseUrl = this.resolveBaseUrl(config); url = url.replace(/\{\{baseUrl\}\}/g, actualBaseUrl); // 2. 替换其他变量 if (config.variables) { ...
https://github.com/DaLongZhuaZi/manxia
82179df4091c0bc05b583bde08d7737e8e5a38f6
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
clearWebViewSourceCookies
清空指定图源的 Cookie
async clearWebViewSourceCookies(sourceId: number): Promise<void> { try { const now: number = Date.now(); const sql: string = `UPDATE webview_source_config SET cookies = '', updateTime = ? WHERE sourceId = ?`; await this.databaseManager.executeSql(sql, [String(now), String(sourceId)]); logg...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left clearWebViewSourceCookies AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left sourceId AST#identifier#Right AST#type_annotation#Lef...
async clearWebViewSourceCookies(sourceId: number): Promise<void> { try { const now: number = Date.now(); const sql: string = `UPDATE webview_source_config SET cookies = '', updateTime = ? WHERE sourceId = ?`; await this.databaseManager.executeSql(sql, [String(now), String(sourceId)]); logg...
https://github.com/DaLongZhuaZi/manxia
babed75ab4600161e8d443d5b4c2801ff35b8fd9
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/Transformer.ets
arkts
generateTransformedValuesLine
Transforms an List of Entry into a float array containing the x and y values transformed with all matrices for the LINECHART. @param data @return
public generateTransformedValuesLine(data: ILineDataSet, phaseX: number, phaseY: number, min: number, max: number): number[] { const count: number = Math.floor((((max - min) * phaseX) + 1) * 2); if (this.valuePointsForGenerateTran...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left generateTransformedValuesLine 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#id...
public generateTransformedValuesLine(data: ILineDataSet, phaseX: number, phaseY: number, min: number, max: number): number[] { const count: number = Math.floor((((max - min) * phaseX) + 1) * 2); if (this.valuePointsForGenerateTran...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
53ad704309b68c54319d3ff1330ac397210dc82c
gitee
Countly/countly-sdk-hos
library/src/main/ets/internal/modules/ModuleConfiguration.ets
arkts
triggerPostUcmRefresh
Called by `CountlyInstance.resolveUnknownConsent` on UCM exit (both grant and revoke paths) to kick off the SBS fetch + periodic timer that `onInit` deferred while UCM was active. Fire-and-forget per the Dart parity protocol.
public triggerPostUcmRefresh(): void { if (this.config.sdkBehaviorSettingsRequestsDisabled) return; if (this.core.deviceIdModule.isTemporary()) return; this.fetchFromServer().catch((err: Object) => { this.config.logger.e(`[ModuleConfiguration] post-UCM SBS fetch rejected: ${err}`); }); this....
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left triggerPostUcmRefresh 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 A...
public triggerPostUcmRefresh(): void { if (this.config.sdkBehaviorSettingsRequestsDisabled) return; if (this.core.deviceIdModule.isTemporary()) return; this.fetchFromServer().catch((err: Object) => { this.config.logger.e(`[ModuleConfiguration] post-UCM SBS fetch rejected: ${err}`); }); this....
https://github.com/Countly/countly-sdk-hos
0fe3e4de9effb31e5212c28ef0e0e5e1df0d955c
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/WebDavClient.ets
arkts
uploadByFilePath
使用系统上传方上传 @param context 上下文环境 @param name 文件名称 @param remoteUri 远端Uri地址 @param filePath 文件路径 @param progressCallback 上传进度回调 @returns
public uploadByFilePath(context: Context, name: string, remoteUri: string, filePath: string, progressCallback: (transferredSize: number) => void): Promise<ResultInfo> { return new Promise(async (resolve) => { filePath = filePath.replace(context.cacheDir, 'internal://cache') // 上传任务配置项 let fi...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left uploadByFilePath AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Context AST#identifier#Right AST#,#Left ...
public uploadByFilePath(context: Context, name: string, remoteUri: string, filePath: string, progressCallback: (transferredSize: number) => void): Promise<ResultInfo> { return new Promise(async (resolve) => { filePath = filePath.replace(context.cacheDir, 'internal://cache') // 上传任务配置项 let fi...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/WebDavClient.ets#L397-L459
3c835c8b73b479af3bafbf6d23ac11baa5a52b3e
github
aimilin6688/KeePassHO
entry/src/main/ets/services/kdbx/KdbxExportService.ets
arkts
handlerExport
处理导出 @param locationInfo
private static async handlerExport(locationInfo: LocationInfo, exportType: ExportType) { try { let existsError: Error | undefined; // 弹出导出进度提示信息 LoadingDialog.showLoading($r("app.string.export_saving")); const existsFile = locationInfo.storageType !== StorageType.LOCAL && await KdbxFileMan...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left handlerExport AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left l...
private static async handlerExport(locationInfo: LocationInfo, exportType: ExportType) { try { let existsError: Error | undefined; // 弹出导出进度提示信息 LoadingDialog.showLoading($r("app.string.export_saving")); const existsFile = locationInfo.storageType !== StorageType.LOCAL && await KdbxFileMan...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/kdbx/KdbxExportService.ets#L43-L75
c678b654661ff19056ccad5d1ed7eae5cd3bdaad
github
LJ666-ui/harmony-health-care
entry/src/main/ets/xiaoyi/XiaoyiSkillManager.ets
arkts
handleMCPRequest
处理MCP请求
private async handleMCPRequest(message: MCPMessage): Promise<MCPMessage> { const { method, params } = message; switch (method) { case 'tools/list': return { id: message.id, type: 'response', method, result: this.getMCPCapabilities().tools, times...
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 handleMCPRequest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left message AST#identifier#Right AST#:#L...
private async handleMCPRequest(message: MCPMessage): Promise<MCPMessage> { const { method, params } = message; switch (method) { case 'tools/list': return { id: message.id, type: 'response', method, result: this.getMCPCapabilities().tools, times...
https://github.com/LJ666-ui/harmony-health-care
bfa5a7efa9cb23b420a53a1d5aacaec18d63b80e
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets
arkts
length
Length of this string @returns { int } length of this string @syscap SystemCapability.Utils.Lang @FaAndStageModel
public get length(): int { return this.getLength() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left length AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS...
public get length(): int { return this.getLength() }
https://gitcode.com/iop123123/arkts-static-skills
e7301b56fb18a2d6a819894734b71cd7060f0254
gitcode
openharmony/applications_dlp_manager
entry/src/main/ets/OpenDlpFile/manager/OpeningDialogManager.ets
arkts
hideOpeningDialog
openDLPFile结束后调用
public async hideOpeningDialog(requestId: string): Promise<void> { this.printAllDecryptingMap(); HiLog.info(TAG, `OpeningDialogManager hideOpeningDialog requestId ${requestId}`); const decryptingState: DecryptingState | undefined = this._decryptingMap.get(requestId); if (!decryptingState) { HiLo...
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 hideOpeningDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left requestId AST#identifier#Right AST#ERROR#Left AST#:#L...
public async hideOpeningDialog(requestId: string): Promise<void> { this.printAllDecryptingMap(); HiLog.info(TAG, `OpeningDialogManager hideOpeningDialog requestId ${requestId}`); const decryptingState: DecryptingState | undefined = this._decryptingMap.get(requestId); if (!decryptingState) { HiLo...
https://gitee.com/openharmony/applications_dlp_manager.git
12f205cc35cde6d4d2da3d9da1e2df90897774d7
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelLoginManager.ets
arkts
executeJsLogin
执行JS登录
private async executeJsLogin(source: LegadoBookSource, formData: Record<string, string>): Promise<LoginResult> { const jsEngine = getLegadoRhinoEngine(); // 提取JS代码 let jsCode = source.loginUrl!; if (jsCode.startsWith('@js:')) { jsCode = jsCode.substring(4); } else if (jsCode.startsWith(...
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 executeJsLogin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left source AST#identifier#Right AST#:#Left...
private async executeJsLogin(source: LegadoBookSource, formData: Record<string, string>): Promise<LoginResult> { const jsEngine = getLegadoRhinoEngine(); // 提取JS代码 let jsCode = source.loginUrl!; if (jsCode.startsWith('@js:')) { jsCode = jsCode.substring(4); } else if (jsCode.startsWith(...
https://github.com/DaLongZhuaZi/manxia
423fd4131a9b733d8090676a8bb41aaa263d3496
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoCookieStore.ets
arkts
setCookie
设置Cookie
async setCookie(url: string, cookieStr: string): Promise<void> { const domain = this.extractDomain(url); if (!domain) return; const cookies = this.parseCookieString(cookieStr, domain); if (!this.cookies.has(domain)) { this.cookies.set(domain, new Map()); } const domainCook...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setCookie AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left url AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#...
async setCookie(url: string, cookieStr: string): Promise<void> { const domain = this.extractDomain(url); if (!domain) return; const cookies = this.parseCookieString(cookieStr, domain); if (!this.cookies.has(domain)) { this.cookies.set(domain, new Map()); } const domainCook...
https://github.com/DaLongZhuaZi/manxia
48272d0346ade767cd53d6833936115c24c3b845
github
Countly/countly-sdk-hos
library/src/main/ets/internal/Utils.ets
arkts
sha256Hex
SHA-256 hex digest. Uses HarmonyOS cryptoFramework. Async because the framework exposes only an async API; callers queue requests while waiting.
public static async sha256Hex(input: string): Promise<string> { const md: cryptoFramework.Md = cryptoFramework.createMd('SHA256'); const textEncoder: util.TextEncoder = new util.TextEncoder(); const bytes: Uint8Array = textEncoder.encodeInto(input); await md.update({ data: bytes }); const digest: ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left sha256Hex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AS...
public static async sha256Hex(input: string): Promise<string> { const md: cryptoFramework.Md = cryptoFramework.createMd('SHA256'); const textEncoder: util.TextEncoder = new util.TextEncoder(); const bytes: Uint8Array = textEncoder.encodeInto(input); await md.update({ data: bytes }); const digest: ...
https://github.com/Countly/countly-sdk-hos
dbe5f7344292527513140bfaf92a779ed6615f9b
github
LongLiveY96/chatcube
entry/src/main/ets/viewmodels/ChatViewModel.ets
arkts
cancelActiveRequestsForScope
取消活跃请求 + pending 工具交互的统一入口。scopedToSession=false 时清掉全部, 为 true 时 只清匹配 sessionId 的, 这样 stopGeneration / cancelGenerationForMessageRewrite 全局/局部 两条路径可以共用同一份 destroy + cancel 逻辑。
private cancelActiveRequestsForScope(scopedToSession: boolean, sessionId?: string): void { if (!scopedToSession) { this.activeRequests.forEach((info: ActiveRequestInfo) => { info.cancelCallback() try { info.httpRequest.destroy() } catch (e) { // ignore destroy err...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left cancelActiveRequestsForScope AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left scopedToSession AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#boole...
private cancelActiveRequestsForScope(scopedToSession: boolean, sessionId?: string): void { if (!scopedToSession) { this.activeRequests.forEach((info: ActiveRequestInfo) => { info.cancelCallback() try { info.httpRequest.destroy() } catch (e) { // ignore destroy err...
https://github.com/LongLiveY96/chatcube
bc7da843e6a06a0589e5aa2bdf94bf86cde5d912
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/managers/VNCNativeClient.ets
arkts
callVncMethod1
辅助函数:安全调用 VNC 方法(1个参数)
function callVncMethod1<T>(methodName: string, arg1: number): T | null { try { const api = qemu as QemuAPI if (methodName === 'vncDisconnect' && api.vncDisconnect !== undefined) { api.vncDisconnect(arg1) return null as T } if (methodName === 'vncGetFrame' && api.vncGetFrame !== undefined) ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left callVncMethod1 AST#identifier#Right AST#type_parameters#Left AST#<#Left < AST#<#Right AST#type_parameter#Left AST#type_identifier#Left T AST#type_identifier#Right AST#type_parameter#Right AST#>#Left > AST#>#...
function callVncMethod1<T>(methodName: string, arg1: number): T | null { try { const api = qemu as QemuAPI if (methodName === 'vncDisconnect' && api.vncDisconnect !== undefined) { api.vncDisconnect(arg1) return null as T } if (methodName === 'vncGetFrame' && api.vncGetFrame !== undefined) ...
https://github.com/AetheriumSimulator/qemu-hmos
144d0e75d0d44ec914090f0e762055d3c16ebce2
github
Vsolon0401/MallShopping
common/src/main/ets/service/ShoppingCartService.ets
arkts
fetchCartItemSpecification
获取购物车指定商品的规格,用于重选规格 @param productId 商品id @returns
async fetchCartItemSpecification(productId: number) { return Request.get(`/cart/getProduct/${productId}`) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left fetchCartItemSpecification AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left productId AST#identifier#Right AST#type_annotation#L...
async fetchCartItemSpecification(productId: number) { return Request.get(`/cart/getProduct/${productId}`) }
https://github.com/Vsolon0401/MallShopping
8b92697069443216d50aea6122a34b3b2aa68b03
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Animation/GlobalAnimationSystem.ets
arkts
createAnimationState
创建动画状态
public createAnimationState(animationId: string): AnimationState { const state: AnimationState = { isPlaying: false, isCompleted: false, currentIteration: 0, progress: 0 }; this.activeAnimations.set(animationId, state); return state; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left createAnimationState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left animationId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A...
public createAnimationState(animationId: string): AnimationState { const state: AnimationState = { isPlaying: false, isCompleted: false, currentIteration: 0, progress: 0 }; this.activeAnimations.set(animationId, state); return state; }
https://github.com/DaLongZhuaZi/manxia
ef56470d78c29216967f4cdc088cbd2462e6e5b6
github
offlinecat-dev/OCNetORM
src/main/ets/query/QueryBuilder.ets
arkts
getRelationNames
获取需要加载的关联关系名称列表 @returns 关联关系名称数组
getRelationNames(): Array<string> { return this.relationNames.slice() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getRelationNames AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#R...
getRelationNames(): Array<string> { return this.relationNames.slice() }
https://github.com/offlinecat-dev/OCNetORM
0430fb47bdc6ab0b52f52f9163190b78b814a699
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
sin
Return a new Decimal whose value is the sine of the value in radians of this Decimal. @returns { Decimal } the Decimal type
public sin(): Decimal { let x: Decimal = this; if (!x.isFinite()) { return new Decimal(NaN); } if (x.isZero()) { return new Decimal(x); } let pr = Decimal.precision; let rm = Decimal.rounding; Decimal.precision = pr + Math.max(...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left sin 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 sin(): Decimal { let x: Decimal = this; if (!x.isFinite()) { return new Decimal(NaN); } if (x.isZero()) { return new Decimal(x); } let pr = Decimal.precision; let rm = Decimal.rounding; Decimal.precision = pr + Math.max(...
https://gitcode.com/iop123123/arkts-static-skills
273c11693a71899c6ba6f0e86de80c975a0d4cb5
gitcode
codelably/HCompass
core/module/src/main/ets/ModuleRegistry.ets
arkts
topologicalSort
拓扑排序 按依赖关系排序模块 @returns 排序后的模块 ID 列表
private topologicalSort(): string[] { const result: string[] = []; const visited = new Set<string>(); const visiting = new Set<string>(); const visit = (moduleId: string) => { if (visited.has(moduleId)) { return; } if (visiting.has(moduleId)) { throw new Error(`Circ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left topologicalSort AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left str...
private topologicalSort(): string[] { const result: string[] = []; const visited = new Set<string>(); const visiting = new Set<string>(); const visit = (moduleId: string) => { if (visited.has(moduleId)) { return; } if (visiting.has(moduleId)) { throw new Error(`Circ...
https://github.com/codelably/HCompass
928a8e2423e79a10dba9680694704174332e6a7c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSettingsManager.ets
arkts
clearBrowseHistory
清空历史浏览记录
async clearBrowseHistory(): Promise<void> { this.browseHistory = []; await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.BROWSE_HISTORY, []); // 通知监听器 this.notifyBrowseHistoryListeners(); }
AST#program#Left AST#expression_statement#Left AST#assignment_expression#Left AST#member_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left clearBrowseHistory AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_param...
async clearBrowseHistory(): Promise<void> { this.browseHistory = []; await this.settingsManager.setJSON(NOVEL_SETTING_KEYS.BROWSE_HISTORY, []); // 通知监听器 this.notifyBrowseHistoryListeners(); }
https://github.com/DaLongZhuaZi/manxia
087ad6ff8758d4dbc3f5d70f5d80ee7dde55d7cd
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets
arkts
sideAreaShrunkSummarized
Whether the side area is shrunk. Takes the blocker into consideration.
get sideAreaShrunkSummarized() { return this.sideAreaShrinkExpect && !this.sideAreaShrinkBlock_menu && !this.sideAreaShrinkBlock_drag; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left sideAreaShrunkSummarized 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...
get sideAreaShrunkSummarized() { return this.sideAreaShrinkExpect && !this.sideAreaShrinkBlock_menu && !this.sideAreaShrinkBlock_drag; }
https://github.com/awaLiny2333/LinysBrowser_NEXT
8826ff50102f1f42307cc9f0476a591af661bc06
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/DeepLinkRouter.ets
arkts
parse
解析 manxia:// 或 https://manxia.top/ URI 为结构化结果(同步,不做源查找)
parse(uri: string): DeepLinkResult | null { try { // 将 https://manxia.top/ 链接转换为内部路径格式 let pathPart: string = ''; let queryPart: string = ''; if (uri.startsWith(SCHEME + '://')) { const afterScheme: string = uri.substring(SCHEME.length + 3); const queryStart: number = afte...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left parse 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 AS...
parse(uri: string): DeepLinkResult | null { try { // 将 https://manxia.top/ 链接转换为内部路径格式 let pathPart: string = ''; let queryPart: string = ''; if (uri.startsWith(SCHEME + '://')) { const afterScheme: string = uri.substring(SCHEME.length + 3); const queryStart: number = afte...
https://github.com/DaLongZhuaZi/manxia
928b184187407ee4997d42a87abb463c8578bb5c
github
openharmony/applications_dlp_manager
entry/src/main/ets/OpenDlpFile/handler/StartSandboxHandler.ets
arkts
startSandbox
拉起沙箱:弹框超过250ms,拉起沙箱;弹框小于250ms,等待弹框250ms之后,拉起沙箱
public async startSandbox(decryptContent?: DecryptContent): Promise<Result<DecryptContent>> { HiLog.info(TAG, 'start startSandbox'); if (decryptContent) { this._decryptContent = decryptContent; } if (!this._decryptContent) { HiLog.error(TAG, 'decryptContent null'); return ResultMsg.g...
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 startSandbox AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left decryptContent AST#identifier#Right AST#?#L...
public async startSandbox(decryptContent?: DecryptContent): Promise<Result<DecryptContent>> { HiLog.info(TAG, 'start startSandbox'); if (decryptContent) { this._decryptContent = decryptContent; } if (!this._decryptContent) { HiLog.error(TAG, 'decryptContent null'); return ResultMsg.g...
https://gitee.com/openharmony/applications_dlp_manager.git
0602738ca55a87b70e63453cca99d9bf1fe699e4
gitee
ZHCOOL520/HarmonyOS-AUTOcall
entry/src/main/ets/utils/FileImportManager.ets
arkts
importFromText
从文本导入(剪贴板等)
static importFromText(text: string): PhoneEntry[] { const phoneList: PhoneEntry[] = [] const lines = text.split('\n').filter(line => line.trim()) for (const line of lines) { const phoneNumbers = FileImportUtils.extractPhoneNumbers(line) for (const phone of phoneNumbers) { if (File...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left importFromText 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 s...
static importFromText(text: string): PhoneEntry[] { const phoneList: PhoneEntry[] = [] const lines = text.split('\n').filter(line => line.trim()) for (const line of lines) { const phoneNumbers = FileImportUtils.extractPhoneNumbers(line) for (const phone of phoneNumbers) { if (File...
https://github.com/ZHCOOL520/HarmonyOS-AUTOcall
317d15d66215704291a3f79be7ce3b4b423b96b6
github
pangpang20/antennaPodHM
entry/src/main/ets/service/PlayerService.ets
arkts
clearSleepTimer
清除睡眠定时器
clearSleepTimer(): void { if (this.sleepTimerId !== -1) { clearTimeout(this.sleepTimerId); this.sleepTimerId = -1; } this.sleepTimerMinutes = 0; this.sleepTimerStartTime = 0; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left clearSleepTimer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bl...
clearSleepTimer(): void { if (this.sleepTimerId !== -1) { clearTimeout(this.sleepTimerId); this.sleepTimerId = -1; } this.sleepTimerMinutes = 0; this.sleepTimerStartTime = 0; }
https://github.com/pangpang20/antennaPodHM
9201f984f39119f4111925aaf6c81bf61b148cd4
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
findIndex
Returns the index of the first element in the array where predicate is true, and -1 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, findIndex immediately returns that elem...
public findIndex(predicate: (value: number, index: int, obj: Int8Array) => boolean): int { for (let i = 0; i < this.lengthInt; ++i) { if (predicate((this.getUnsafe(i)).toDouble(), i, this)) { return i } } return -1 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left findIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left predicate AST#identifier#Right AST#ERROR#Left AST#:#Left...
public findIndex(predicate: (value: number, index: int, obj: Int8Array) => boolean): int { for (let i = 0; i < this.lengthInt; ++i) { if (predicate((this.getUnsafe(i)).toDouble(), i, this)) { return i } } return -1 }
https://gitcode.com/iop123123/arkts-static-skills
ee592673faee135e8a13f1a85bdf36802458a3f5
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/medicalimaging/ImagePreprocessor.ets
arkts
validateImageFormat
验证图像格式 @param imageUri 图像URI @returns 是否为支持的格式
validateImageFormat(imageUri: string): boolean { const supportedFormats = ['.jpg', '.jpeg', '.png', '.bmp']; const lowerUri = imageUri.toLowerCase(); return supportedFormats.some(format => lowerUri.endsWith(format)); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left validateImageFormat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left imageUri AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#)#Left )...
validateImageFormat(imageUri: string): boolean { const supportedFormats = ['.jpg', '.jpeg', '.png', '.bmp']; const lowerUri = imageUri.toLowerCase(); return supportedFormats.some(format => lowerUri.endsWith(format)); }
https://github.com/LJ666-ui/harmony-health-care
d2a8466d5f7af5041dd1d0848e07fac0670e5d73
github
LiMingKuan-UESTC/HarmonyOs-Clock-Demo
entry/src/main/ets/pages/ReminderSettings.ets
arkts
build
build
build() { Column() { Text('提醒设置') .fontSize(24) .fontWeight(FontWeight.Bold) .padding(16) // 改动1:传入 getter 和 setter,而不是 boolean 值 this.buildReminderCard('早晨提醒', 'morning', () => this.morningOn, val => this.morningOn = val) this.buildReminderCard('中午提醒', 'noon', () ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST...
build() { Column() { Text('提醒设置') .fontSize(24) .fontWeight(FontWeight.Bold) .padding(16) // 改动1:传入 getter 和 setter,而不是 boolean 值 this.buildReminderCard('早晨提醒', 'morning', () => this.morningOn, val => this.morningOn = val) this.buildReminderCard('中午提醒', 'noon', () ...
https://github.com/LiMingKuan-UESTC/HarmonyOs-Clock-Demo
858cd4fbd19fe969640f01c415de5e1b63a4683f
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceSearchService.ets
arkts
executeSearch
执行搜索(内部方法)
private async executeSearch( taskId: number, config: SearchTaskConfig, callback?: SearchProgressCallback, checkCancelled?: () => boolean ): Promise<void> { const keyword = config.keyword.trim(); if (!keyword) { callback?.onComplete?.([], []); return; } const allResults: ...
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 executeSearch AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifier#Right AST#:#Left ...
private async executeSearch( taskId: number, config: SearchTaskConfig, callback?: SearchProgressCallback, checkCancelled?: () => boolean ): Promise<void> { const keyword = config.keyword.trim(); if (!keyword) { callback?.onComplete?.([], []); return; } const allResults: ...
https://github.com/DaLongZhuaZi/manxia
523c60aa4d09851ef46adfe937aa9923089e3b94
github
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/videorecorder/components/VideoRecorder.ets
arkts
takeVideo
Launch camera for video recording (supports both video and photo based on config)
async takeVideo( config: TakeVideoConfig = {}, listener: RecordListener, context?: common.UIAbilityContext ): Promise<void> { try { const actualContext = context || getContext() as common.UIAbilityContext; // Determine camera position based on config const cameraPosition = c...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left takeVideo AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left config AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
async takeVideo( config: TakeVideoConfig = {}, listener: RecordListener, context?: common.UIAbilityContext ): Promise<void> { try { const actualContext = context || getContext() as common.UIAbilityContext; // Determine camera position based on config const cameraPosition = c...
https://github.com/Tencent-RTC/TUIKit_Harmony
c4a923af5b53667904d7b43fcbda8b27de8df5fc
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Distributed/DistributedFileManager.ets
arkts
writeTextToDistributed
将文本内容直接写入分布式沙箱(例如小说章节文本)
public writeTextToDistributed(fileName: string, content: string): boolean { if (!this.distributedRoot) return false; const path = `${this.getDistributedCachePath()}/${fileName}`; try { const file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE | fileIo.OpenMode.TRUNC...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left writeTextToDistributed AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left fileName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AS...
public writeTextToDistributed(fileName: string, content: string): boolean { if (!this.distributedRoot) return false; const path = `${this.getDistributedCachePath()}/${fileName}`; try { const file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | fileIo.OpenMode.CREATE | fileIo.OpenMode.TRUNC...
https://github.com/DaLongZhuaZi/manxia
66c6397d38c3fc11a90cff27d6b25acc40bc44f8
github
LJ666-ui/harmony-health-care
entry/src/main/ets/store/AppStore.ets
arkts
addHealthRecord
Action: 添加健康记录
public addHealthRecord(record: Omit<HealthRecord, 'id' | 'createdAt' | 'updatedAt'>): void { const newRecord: HealthRecord = { type: record.type, value: record.value, unit: record.unit, date: record.date, time: record.time, color: record.color, notes: record.notes, ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left addHealthRecord AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left record AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right ...
public addHealthRecord(record: Omit<HealthRecord, 'id' | 'createdAt' | 'updatedAt'>): void { const newRecord: HealthRecord = { type: record.type, value: record.value, unit: record.unit, date: record.date, time: record.time, color: record.color, notes: record.notes, ...
https://github.com/LJ666-ui/harmony-health-care
4ff3df567a07d4415d60e0d7f2b87de43a5fee4b
github
LJ666-ui/harmony-health-care
entry/src/main/ets/services/FamilyService.ets
arkts
getAuthorizationLevelDescription
获取授权等级说明
getAuthorizationLevelDescription(level: number): string { if (level === 1) { return '基础查看:可查看患者基本健康状态和用药情况'; } else if (level === 2) { return '详细查看:可查看患者完整病历、检查报告和诊断记录'; } else if (level === 3) { return '完全访问:可查看所有信息并提交健康信息'; } else { return '未知授权等级'; } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAuthorizationLevelDescription AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left level AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#...
getAuthorizationLevelDescription(level: number): string { if (level === 1) { return '基础查看:可查看患者基本健康状态和用药情况'; } else if (level === 2) { return '详细查看:可查看患者完整病历、检查报告和诊断记录'; } else if (level === 3) { return '完全访问:可查看所有信息并提交健康信息'; } else { return '未知授权等级'; } }
https://github.com/LJ666-ui/harmony-health-care
7b67f8ecce106c66bb5dcf0fdb40e85ab65f0231
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/NotificationManager.ets
arkts
sendTransferUploadFailedNotification
发送局域网传书上传失败通知
public async sendTransferUploadFailedNotification( taskId: string, fileName: string, reason: string ): Promise<boolean> { const config: NotificationConfig = { id: this.getNotificationId(taskId), title: '传书失败', text: fileName.length > 0 ? fileName : '未命名文件', additionalText: re...
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 sendTransferUploadFailedNotification AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left taskId AST#identifi...
public async sendTransferUploadFailedNotification( taskId: string, fileName: string, reason: string ): Promise<boolean> { const config: NotificationConfig = { id: this.getNotificationId(taskId), title: '传书失败', text: fileName.length > 0 ? fileName : '未命名文件', additionalText: re...
https://github.com/DaLongZhuaZi/manxia
afa4422066aa0c6999608ddc03c32e7845bf6378
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
getCenter
Returns a recyclable MPPointF instance. Returns the center point of the chart (the whole View) in pixels. @return
public getCenter(): MPPointF { return MPPointF.getInstance(this.width / 2, this.height / 2); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getCenter AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left MPPointF AST...
public getCenter(): MPPointF { return MPPointF.getInstance(this.width / 2, this.height / 2); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
aaee2787d98b4198eb6daef237037b2ee99834f3
gitee
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/app/tabs/classes/meowTabsBunch.ets
arkts
currentTabSearchIsDone
Gets the current tab search is done.
get currentTabSearchIsDone() { return this.currentTab?.searchIsDone; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left currentTabSearchIsDone 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 {...
get currentTabSearchIsDone() { return this.currentTab?.searchIsDone; }
https://github.com/awaLiny2333/LinysBrowser_NEXT
842b6c0ede44ce61a70285abc2b3219ddfdab62e
github
openharmony-sig/arkui_composite_component
source/TreeView/TreeView.ets
arkts
removeNode
Delete a node. Register an ON_ITEM_DELETE callback through the EventBus mechanism to obtain the IDs of all deleted nodes. @since 10
public removeNode(): void { let clickNodeId = this.listNodeDataSource.getClickNodeId(); let parentNodeId = this.listNodeUtils.findParentNodeId(clickNodeId); let removeNodeIdList: number[] = this.listNodeUtils.removeNode(clickNodeId, parentNodeId, this.listNodeUtils.traverseNodeBF); t...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left removeNode 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#Rig...
public removeNode(): void { let clickNodeId = this.listNodeDataSource.getClickNodeId(); let parentNodeId = this.listNodeUtils.findParentNodeId(clickNodeId); let removeNodeIdList: number[] = this.listNodeUtils.removeNode(clickNodeId, parentNodeId, this.listNodeUtils.traverseNodeBF); t...
https://gitee.com/openharmony-sig/arkui_composite_component.git
d6652bca0e7b80f116ae3350b9e9ee7e826cd5f8
gitee
openharmony/codelabs
CommonEventAndNotification/AlarmClock/entry/src/main/ets/model/ReminderService.ets
arkts
addReminder
Adding and modifying alarm reminders @param alarmItem ReminderItem @param callback callback
public addReminder(alarmItem: ReminderItem, callback?: (reminderId: number) => void) { let reminder = this.initReminder(alarmItem); reminderAgent.publishReminder(reminder, (err, reminderId) => { if (callback != null) { callback(reminderId); } }); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left addReminder AST#identifier#Right AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left alarmItem AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ReminderItem AST#identifier#Right AST#,#Lef...
public addReminder(alarmItem: ReminderItem, callback?: (reminderId: number) => void) { let reminder = this.initReminder(alarmItem); reminderAgent.publishReminder(reminder, (err, reminderId) => { if (callback != null) { callback(reminderId); } }); }
https://gitee.com/openharmony/codelabs.git
9e66726100288ac66358c57003503991c66c74c5
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Tuple.ets
arkts
unsafeGet
Get the element at the specified index. @param { int } index The index of the element to get. @returns { Any } The element at the specified index. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public unsafeGet(index: int): Any { throw new IndexOutOfBoundsError(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left unsafeGet AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Ri...
public unsafeGet(index: int): Any { throw new IndexOutOfBoundsError(); }
https://gitcode.com/iop123123/arkts-static-skills
6bfbd41a62827cac74035edbddb850672e8dde28
gitcode
2763981847/Accounting-app
entry/src/main/ets/pages/EntryPage.ets
arkts
aboutToAppear
页面即将显示时执行的生命周期函数
aboutToAppear() { this.onAccountsChange() }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left...
aboutToAppear() { this.onAccountsChange() }
https://github.com/2763981847/Accounting-app
30c041ee87b8abf55507cd0334e9fc316fc0e0e9
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/ARNavigationService.ets
arkts
updateARRendering
更新AR渲染
private updateARRendering(): void { if (!this.navigationState.currentPath) return; // 计算箭头方向 const currentWaypoint = this.getCurrentWaypoint(); if (currentWaypoint) { const direction = this.calculateArrowDirection( this.navigationState.currentPosition, currentWaypoint.position ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateARRendering 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 AS...
private updateARRendering(): void { if (!this.navigationState.currentPath) return; // 计算箭头方向 const currentWaypoint = this.getCurrentWaypoint(); if (currentWaypoint) { const direction = this.calculateArrowDirection( this.navigationState.currentPosition, currentWaypoint.position ...
https://github.com/LJ666-ui/harmony-health-care
75275e5fdb95177cda62423007ed7897f793bc11
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/WeakSet.ets
arkts
delete
The delete() method removes the specified element from a WeakSet object.
delete(v: K): boolean { throw new Error("Not implemented"); return false; }
AST#program#Left AST#ERROR#Left AST#delete#Left delete AST#delete#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left v AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#type_identifier#Left K AST#type_identifier#Right AST#type_annotation#Ri...
delete(v: K): boolean { throw new Error("Not implemented"); return false; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
62024fc901b0ee714b33825971db095df276683f
gitee
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/components/VirtualKeyboard.ets
arkts
toggle
Toggle visibility
toggle(type: string = 'special'): void { if (this.isVisible && this.keyboardType === type) { this.hide(); } else { this.show(type); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toggle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#identifier#Left string AST#identif...
toggle(type: string = 'special'): void { if (this.isVisible && this.keyboardType === type) { this.hide(); } else { this.show(type); } }
https://github.com/tangwengang-del/freerdp-harmonyos
39ec6b2dc7921f33367e4ac3394586fbabfa5678
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarLineChartBaseModel.ets
arkts
constructor
/** the approximator object used for data filtering private Approximator mApproximator;
constructor() { super(); this.init(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expression_statement#Right AST#statement_block#Left A...
constructor() { super(); this.init(); }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
ec9c691ee3a9783027af0e6318520d34745a05f3
gitee
AlkaidLab/moonlight-harmony
entry/src/main/ets/viewmodel/AppViewModel.ets
arkts
updateRunningApp
更新正在运行的应用
private updateRunningApp(): void { this.runningApp = this.apps.find(app => app.isRunning) || null; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left updateRunningApp 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#ex...
private updateRunningApp(): void { this.runningApp = this.apps.find(app => app.isRunning) || null; }
https://github.com/AlkaidLab/moonlight-harmony
19d34518e5095d107d85dc5538589f063ddda699
github
bhengubv/aether-protocol
arkts/src/main/ets/market/PoVTokenExchangeService.ets
arkts
getScore
Returns the local PoV trust score for `uhid`, derived from recorded tokens.
getScore(uhid: string): PoVScore { const tokens: PoVToken[] = this.tokensBySubject.get(uhid) ?? []; const witnesses: Set<string> = new Set<string>(); for (let i = 0; i < tokens.length; i++) { witnesses.add(tokens[i].witnessUhid); } const unique: number = witnesses.size; const weighted:...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getScore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uhid AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) AST#)#...
getScore(uhid: string): PoVScore { const tokens: PoVToken[] = this.tokensBySubject.get(uhid) ?? []; const witnesses: Set<string> = new Set<string>(); for (let i = 0; i < tokens.length; i++) { witnesses.add(tokens[i].witnessUhid); } const unique: number = witnesses.size; const weighted:...
https://github.com/bhengubv/aether-protocol
494a549e169704ebe66543d6e61aad2fc56acd56
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/EntityData.ets
arkts
setRelatedArray
设置关联数据(数组类型,用于 ONE_TO_MANY) 自动触发 UI 刷新 @param propertyName 关联属性名 @param data 关联实体数组
setRelatedArray(propertyName: string, data: Array<EntityData>): void { this.relatedData.set(propertyName, RelatedDataValue.fromArray(data)) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setRelatedArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left propertyName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left ,...
setRelatedArray(propertyName: string, data: Array<EntityData>): void { this.relatedData.set(propertyName, RelatedDataValue.fromArray(data)) }
https://github.com/offlinecat-dev/OCNetORM
2228cbf6541ebfed8ef933e067860e1c4feb2ad9
github
harmonyos/codelabs
HarmonyOS_NEXT/SimpleCalculator/entry/src/main/ets/common/util/CalculateUtil.ets
arkts
comparePriority
Determine the priority of addition, subtraction, multiplication, and division. @param arg1 Parameter 1. @param arg2 Parameter 2. @return Compare Priority Results.
comparePriority(arg1: string, arg2: string): boolean { if (CheckEmptyUtil.isEmpty(arg1) || CheckEmptyUtil.isEmpty(arg2)) { return false; } return (this.getPriority(arg1) <= this.getPriority(arg2)); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left comparePriority 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 ,...
comparePriority(arg1: string, arg2: string): boolean { if (CheckEmptyUtil.isEmpty(arg1) || CheckEmptyUtil.isEmpty(arg2)) { return false; } return (this.getPriority(arg1) <= this.getPriority(arg2)); }
https://gitee.com/harmonyos/codelabs.git
98f4195863695275ff5f3a541d0bd83ea80954d6
gitee
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/data/api/ApiClient.ets
arkts
getTodayCheckInStatus
获取今日打卡状态
async getTodayCheckInStatus(): Promise<ApiResponse<any>> { return this.get<any>('/api/attendance/today') }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getTodayCheckInStatus 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 getTodayCheckInStatus(): Promise<ApiResponse<any>> { return this.get<any>('/api/attendance/today') }
https://github.com/David8Idira/AI-OA
2151f8939fe7e5f58bb6d4133e231f43bf88c425
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/UserDAO.ets
arkts
getAll
查询全部(未删除)
static async getAll(): Promise<User[]> { const store = DatabaseManager.getDatabase(); const sql = `SELECT * FROM users WHERE is_deleted = 0 ORDER BY user_id ASC`; let rs: relationalStore.ResultSet | null = null; const users: User[] = []; try { rs = await store.querySql(sql); while (rs....
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 getAll 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 getAll(): Promise<User[]> { const store = DatabaseManager.getDatabase(); const sql = `SELECT * FROM users WHERE is_deleted = 0 ORDER BY user_id ASC`; let rs: relationalStore.ResultSet | null = null; const users: User[] = []; try { rs = await store.querySql(sql); while (rs....
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
34cf0e41ee85c83fd572b9e87eda4fab4a07a82c
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/EAWorker.ets
arkts
join
Stop EAWorker This method closes run queue and detaches worker Note: it's required to call join for EAWorker @returns { Promise<void> } Promise that resolves when the worker has joined
public join(): Promise<void> { if (!this.loopStarted.get()) { throw new Error('EAWorker:: Cannot stop worker before start'); } let finalTask = () => { EAWorker.getWorkers().delete(this.worker.getWorkerId()); this.releaseUserWorkerSlot(); }; ...
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left join AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right ...
public join(): Promise<void> { if (!this.loopStarted.get()) { throw new Error('EAWorker:: Cannot stop worker before start'); } let finalTask = () => { EAWorker.getWorkers().delete(this.worker.getWorkerId()); this.releaseUserWorkerSlot(); }; ...
https://gitcode.com/iop123123/arkts-static-skills
3ae70a53d31db322c0628b8dff90e66f6c48a29c
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.uri.ets
arkts
encodedFragment
Sets the encoded fragment component from this URI. @param { string } input
set encodedFragment(input: string) { this.uriEntry.setFragment(input); }
AST#program#Left AST#ERROR#Left AST#set#Left set AST#set#Right AST#call_expression#Left AST#identifier#Left encodedFragment AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A...
set encodedFragment(input: string) { this.uriEntry.setFragment(input); }
https://gitcode.com/iop123123/arkts-static-skills
51c1d9b8406ba5f465254ed1ea15356ea52fb75d
gitcode
dcloudio/uni-app
src/uni_modules/uni-loading/utssdk/app-harmony/builder.ets
arkts
getLineCoefficient
计算粗细的倍数 (最小边 / 16 * coefficient)
function getLineCoefficient(borderWidth: string | undefined) { if (borderWidth == null) { return 1 } // TODO 不支持具体 px 值 /* if (borderWidth.endsWith('px')) { const num = parseFloat(borderWidth.replace('px', '')) return isNaN(num) ? 1 : num } */ switch (borderWidth) { case 'medium': case '...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left getLineCoefficient AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left borderWidth AST#identifier#Right AST#type_annotation#Left AST#:#Lef...
function getLineCoefficient(borderWidth: string | undefined) { if (borderWidth == null) { return 1 } // TODO 不支持具体 px 值 /* if (borderWidth.endsWith('px')) { const num = parseFloat(borderWidth.replace('px', '')) return isNaN(num) ? 1 : num } */ switch (borderWidth) { case 'medium': case '...
https://github.com/dcloudio/uni-app
b7d7b209d46ccbb64e1c448b2c930fda19527b92
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/ViewModelMapper.ets
arkts
getReverseMapper
获取反向属性映射器 @returns 反向属性映射器或 null
getReverseMapper(): ReversePropertyMapper<T> | null { return this.reverseMapper }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getReverseMapper AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#binary_expression#Left AST#instantiation_expression#Left AST#...
getReverseMapper(): ReversePropertyMapper<T> | null { return this.reverseMapper }
https://github.com/offlinecat-dev/OCNetORM
61ff002d88a0e0f45ca9477f0d0482dff8bb07a9
github
PollenWang6/HiXD
entry/src/main/ets/services/SchoolnetService.ets
arkts
completeZfwLogin
完成最终登录 对齐 Flutter: POST / → 302 → _getNetworkUsage() NETSTACK POST 302 不跟随,需手动 GET /home
async completeZfwLogin( username: string, encryptedPwd: string, verifyCode: string, csrf: string ): Promise<boolean> { const data: Record<string, string> = {}; data['_csrf-8800'] = csrf; data['LoginForm[username]'] = username; data['LoginForm[password]'] = encryptedPwd; data['Log...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left completeZfwLogin AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left username AST#identifier#Right AST#type_annotation#Left AST#:#L...
async completeZfwLogin( username: string, encryptedPwd: string, verifyCode: string, csrf: string ): Promise<boolean> { const data: Record<string, string> = {}; data['_csrf-8800'] = csrf; data['LoginForm[username]'] = username; data['LoginForm[password]'] = encryptedPwd; data['Log...
https://github.com/PollenWang6/HiXD
845ae6ac3e7a189d8379d2a8c7cb9c45e0c25373
github
HarmonyOS_Samples/BestPracticeSnippets
VideoProcessBaseWeb/entry/src/main/ets/utils/WebDownloadManager.ets
arkts
resume
[Start resume] Provides an external interface for resuming downloads.
public resume() { const state = this.currentTask.getState(); if (state === webview.WebDownloadState.CANCELED) { webview.WebDownloadManager.setDownloadDelegate(this.delegate); try { webview.WebDownloadManager.resumeDownload(webview.WebDownloadItem.deserialize(this.failedData)); } catc...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resume AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{#...
public resume() { const state = this.currentTask.getState(); if (state === webview.WebDownloadState.CANCELED) { webview.WebDownloadManager.setDownloadDelegate(this.delegate); try { webview.WebDownloadManager.resumeDownload(webview.WebDownloadItem.deserialize(this.failedData)); } catc...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
72a82a031f3b8202f8afabd9c63e7357a4f24d3a
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/PrivacyModeManager.ets
arkts
exitPrivacyMode
退出隐私模式
public async exitPrivacyMode(): Promise<void> { // 恢复之前的主题 await this.themeManager.setTheme(this.previousTheme); this.isPrivacyMode = false; this.notifyListeners(false); logger.info(TAG, '已退出隐私模式,主题已恢复'); }
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 exitPrivacyMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
public async exitPrivacyMode(): Promise<void> { // 恢复之前的主题 await this.themeManager.setTheme(this.previousTheme); this.isPrivacyMode = false; this.notifyListeners(false); logger.info(TAG, '已退出隐私模式,主题已恢复'); }
https://github.com/DaLongZhuaZi/manxia
ec2c3e9f39aab2f269806703c7966dc215685981
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
slice
Creates a slice of current BigUint64Array using range [begin, this.lengthInt]. @param { int } begin - start index to be taken into slice. @returns { BigUint64Array } - a new BigUint64Array with elements of current BigUint64Array[begin, this.lengthInt]. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public slice(begin: int): BigUint64Array { return this.sliceFromTo(begin, this.lengthInt) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left slice AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left begin AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#id...
public slice(begin: int): BigUint64Array { return this.sliceFromTo(begin, this.lengthInt) }
https://gitcode.com/iop123123/arkts-static-skills
de0562622b88d5e6b61af00dacb13fd33c113c19
gitcode
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
readUint16Array
Reads the next array of unsigned shorts. @param byteLength The byte length. @returns The value.
readUint16Array(byteLength?: number): Uint16Array { const value = this.getUint16Array(this.mByteOffset, byteLength) this.mByteOffset += value.byteLength return value }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left readUint16Array AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteLength AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#E...
readUint16Array(byteLength?: number): Uint16Array { const value = this.getUint16Array(this.mByteOffset, byteLength) this.mByteOffset += value.byteLength return value }
https://gitee.com/openharmony-sig/flutter_engine.git
2eea2cf3b54fdd48fcf8da8560183f4dde58935a
gitee
1055235342/Wpixelgram-for-HarmonyOS
entry/src/main/ets/common/service/TdlibService.ets
arkts
setTdlibParameters
============ 常用 API 封装 ============
public setTdlibParameters(params: TdlibParameters): void { const request: SetTdlibParametersRequest = { '@type': 'setTdlibParameters', use_test_dc: params.use_test_dc, database_directory: params.database_directory, files_directory: params.files_directory, database_encryption_key: par...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTdlibParameters AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left params AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
public setTdlibParameters(params: TdlibParameters): void { const request: SetTdlibParametersRequest = { '@type': 'setTdlibParameters', use_test_dc: params.use_test_dc, database_directory: params.database_directory, files_directory: params.files_directory, database_encryption_key: par...
https://github.com/1055235342/Wpixelgram-for-HarmonyOS
25ca0d35d17803941f3381cd767480f22715e7f8
github
LJ666-ui/harmony-health-care
entry/src/main/ets/utils/SettingsUtil.ets
arkts
saveFamilyToken
========== 家属相关方法 ========== 保存家属Token
async saveFamilyToken(token: string): Promise<void> { if (this.dataPreferences === null) { return; } try { await this.dataPreferences.put('family_token', token); await this.dataPreferences.flush(); } catch (e) { console.error('SettingsUtil - save family token failed:', e); ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left saveFamilyToken AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left token AST#identifier#Right AS...
async saveFamilyToken(token: string): Promise<void> { if (this.dataPreferences === null) { return; } try { await this.dataPreferences.put('family_token', token); await this.dataPreferences.flush(); } catch (e) { console.error('SettingsUtil - save family token failed:', e); ...
https://github.com/LJ666-ui/harmony-health-care
434bcb20a4fd996a294c6a5d0094a4c57b75e33e
github
Joker-x-dev/CoolMallArkTS
core/ui/src/main/ets/component/modal/DictSelectModal.ets
arkts
build
构建字典选择弹窗 @returns {void} 无返回值
build(): void { BottomModal({ visible: this.visible, title: this.title, onDismiss: this.onDismiss, containerColor: $r("app.color.bg_grey"), content: (): void => this.ModalContentNetWorkLayout() }); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_statement#Left AST#unary_expression#Left AST#...
build(): void { BottomModal({ visible: this.visible, title: this.title, onDismiss: this.onDismiss, containerColor: $r("app.color.bg_grey"), content: (): void => this.ModalContentNetWorkLayout() }); }
https://github.com/Joker-x-dev/CoolMallArkTS
1ef4f49761b1844c78f165b06ba1b8387cf02b8d
github
CLMC2025/Vignette
entry/src/main/ets/manager/PromptTemplateManager.ets
arkts
validateOutput
验证模板输出
validateOutput(templateId: string, output: string): ValidationResult { const template: PromptTemplate | null = this.getActiveTemplate(this.getTemplateType(templateId)); if (template === null) { const result: ValidationResult = { valid: false, errors: ['Template not found'] }; return result; } ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left validateOutput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left templateId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AS...
validateOutput(templateId: string, output: string): ValidationResult { const template: PromptTemplate | null = this.getActiveTemplate(this.getTemplateType(templateId)); if (template === null) { const result: ValidationResult = { valid: false, errors: ['Template not found'] }; return result; } ...
https://github.com/CLMC2025/Vignette
e64bef2593e6069b5f4847aa713f3420a687f945
github
cpdd5201314/harmonyOS-music-app
products/phone/src/main/ets/pages/MusicSearchService.ets
arkts
formatKugouMusic
格式化酷狗音乐数据
private formatKugouMusic(song: KugouSong): MusicInfo { const songNameWithoutTags: string = song.SingerName.replace(/<\/?em>/g, ''); const musicInfo: MusicInfo = { id: `${song.FileHash}`, name: song.SongName || '', singer: songNameWithoutTags || '', albumName: song.AlbumName || '', ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left formatKugouMusic AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left song AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
private formatKugouMusic(song: KugouSong): MusicInfo { const songNameWithoutTags: string = song.SingerName.replace(/<\/?em>/g, ''); const musicInfo: MusicInfo = { id: `${song.FileHash}`, name: song.SongName || '', singer: songNameWithoutTags || '', albumName: song.AlbumName || '', ...
https://github.com/cpdd5201314/harmonyOS-music-app
a6f4b7356f77eb016d62ee28ee155419d0c921a5
github
Joker-x-dev/CoolMallArkTS
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
shouldShowBottomButton
是否显示底部保存按钮 @returns {boolean} 是否显示
shouldShowBottomButton(): boolean { return this.uiState === BaseNetWorkUiState.SUCCESS; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left shouldShowBottomButton AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right ...
shouldShowBottomButton(): boolean { return this.uiState === BaseNetWorkUiState.SUCCESS; }
https://github.com/Joker-x-dev/CoolMallArkTS
9252580f84b78d8ec6a045e702b0fceb4a5c8aa7
github
pangpang20/antennaPodHM
entry/src/main/ets/pages/MainPage.ets
arkts
startDownloadUpdateTimer
开始下载更新定时器
startDownloadUpdateTimer() { if (this.downloadUpdateTimer === -1) { this.downloadUpdateTimer = setInterval(() => { this.loadDownloads(); }, 1000); } }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startDownloadUpdateTimer 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...
startDownloadUpdateTimer() { if (this.downloadUpdateTimer === -1) { this.downloadUpdateTimer = setInterval(() => { this.loadDownloads(); }, 1000); } }
https://github.com/pangpang20/antennaPodHM
645ed46702a03c76f49d953187528aff15cd91e4
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test24_original_index.ets
arkts
testArrayIsNarrow
--- Array.isArray with type narrowing ---
function testArrayIsNarrow(): string { let val: number[] = [1, 2, 3]; let check: boolean = Array.isArray(val); let len: number = 0; if (check) { len = val.length; } return String(check) + ',' + String(len); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testArrayIsNarrow AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefine...
function testArrayIsNarrow(): string { let val: number[] = [1, 2, 3]; let check: boolean = Array.isArray(val); let len: number = 0; if (check) { len = val.length; } return String(check) + ',' + String(len); }
https://github.com/miaochiahao/ark-ghidra
9fc3388dd3793f8624cfd1c639ec6700159d0caf
github
openharmony/arkui_ace_engine
examples/Image/entry/src/main/ets/pages/SVG/svgExample017.ets
arkts
CreateGlowEffect
Advanced filter combinations
CreateGlowEffect(intensity: number, color: Color): string { const radius = 10 + intensity * 20 return `drop-shadow(0 0 ${radius}px ${color})` }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left CreateGlowEffect AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left intensity AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#,#Left , A...
CreateGlowEffect(intensity: number, color: Color): string { const radius = 10 + intensity * 20 return `drop-shadow(0 0 ${radius}px ${color})` }
https://gitcode.com/openharmony/arkui_ace_engine
793adb8c448c68f1fc8283de0cdff8d92b7d9bd5
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/UUIDGenerator.ets
arkts
resetCounter
重置计数器(用于测试)
public resetCounter(): void { this.counter = 0; logger.debug(TAG, '计数器已重置'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left resetCounter 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#expressio...
public resetCounter(): void { this.counter = 0; logger.debug(TAG, '计数器已重置'); }
https://github.com/DaLongZhuaZi/manxia
6130d41c1258034d5c9939f8a8c05b567115a6b2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Loading/LoadingStateManager.ets
arkts
getStateSnapshot
获取当前状态快照
public getStateSnapshot(): LoadingStateSnapshot { const overallProgress = this.calculateOverallProgress(); return { timestamp: Date.now(), currentPhase: this.currentPhase, overallProgress: overallProgress, phases: new Map(this.phases), globalErrors: [...this.globalErrors], ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStateSnapshot AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left Loadi...
public getStateSnapshot(): LoadingStateSnapshot { const overallProgress = this.calculateOverallProgress(); return { timestamp: Date.now(), currentPhase: this.currentPhase, overallProgress: overallProgress, phases: new Map(this.phases), globalErrors: [...this.globalErrors], ...
https://github.com/DaLongZhuaZi/manxia
d4c42766f9b1d4953550ddd1e2180b8e62f39c4c
github
AetheriumSimulator/qemu-hmos
entry/src/main/ets/components/RDPDisplay.ets
arkts
constructor
添加 errorMessage 属性
constructor(callbacks: RDPConnectionCallbacks) { this.callbacks = callbacks }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callbacks AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left RDPConnectionCallbacks A...
constructor(callbacks: RDPConnectionCallbacks) { this.callbacks = callbacks }
https://github.com/AetheriumSimulator/qemu-hmos
ba2c7cf2bdc98a01a472e70ec6d8a5897edde480
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BarDataSet.ets
arkts
setGradientColor
Sets the start and end color for gradient color, ONLY color that should be used for this DataSet. @param startColor @param endColor
public setGradientColor(startColor: number, endColor: number): void { if (this.mFills) { this.mFills.clear(); this.mFills.insert(new Fill(startColor, endColor)); } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setGradientColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left startColor AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#nu...
public setGradientColor(startColor: number, endColor: number): void { if (this.mFills) { this.mFills.clear(); this.mFills.insert(new Fill(startColor, endColor)); } }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
450d4f81acad3b9f088fb738605514b07911fe14
gitee
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/ColorTemplate.ets
arkts
blue
from Color blue() @param color
public static blue(color: number): number { return color & 0xFF; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#identifier#Left blue AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#i...
public static blue(color: number): number { return color & 0xFF; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
f12497e3f8518af60934fe3fecc80cd43cebc3ec
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Byte.ets
arkts
toByte
Returns the primitive as byte value @param { byte } value value to cast @returns { byte } @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static toByte(value: byte): byte { return value; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left toByte AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Ri...
public static toByte(value: byte): byte { return value; }
https://gitcode.com/iop123123/arkts-static-skills
4e6c565bb2a0e80a8c562c32ad360622dd163479
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
includes
Checks if specified argument is in Int32Array @param e search element @returns true if e is in Int32Array, false otherwise
public includes(e: number): boolean { return this.includes(e as double as int as int, 0) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left e AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST...
public includes(e: number): boolean { return this.includes(e as double as int as int, 0) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
8d0edf7d41b59a47ead207473a333e30a19a6a9d
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeMap.ets
arkts
getHigherKey
Return the higher key of the given key's element in the TreeMap @param key: the key of the element which will be get the higher key @returns the higher key of the given key's element
getHigherKey(key: K): K | undefined { this.checkEmptyContainer(); let resultEntry: TreeMapEntry<K, V> | undefined = undefined; let entry = this.rootEntry; while(entry !== undefined) { if (this.comparator!(entry!.key, key) >= 0) { entry = entry!.right; ...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getHigherKey AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left K AST#identifier#R...
getHigherKey(key: K): K | undefined { this.checkEmptyContainer(); let resultEntry: TreeMapEntry<K, V> | undefined = undefined; let entry = this.rootEntry; while(entry !== undefined) { if (this.comparator!(entry!.key, key) >= 0) { entry = entry!.right; ...
https://gitcode.com/iop123123/arkts-static-skills
30f9280af4ce6577f281073a7b4a206cadf7afde
gitcode