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
popsiclelmlm/Hey
entry/src/main/ets/features/nodes/NodeDetailFields.ets
arkts
buildBasics
---- 基本信息:地址/端口/认证/加密,按协议分支 ----
function buildBasics(proto: string, settings: Record<string, Object> | null): Array<NodeDetailField> { const fields: Array<NodeDetailField> = []; pushField(fields, 'node.field.protocol', proto.toUpperCase(), false); if (settings === null) { return fields; } if (proto === 'vless' || proto === 'vmess') { ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left buildBasics AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left proto AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Rig...
function buildBasics(proto: string, settings: Record<string, Object> | null): Array<NodeDetailField> { const fields: Array<NodeDetailField> = []; pushField(fields, 'node.field.protocol', proto.toUpperCase(), false); if (settings === null) { return fields; } if (proto === 'vless' || proto === 'vmess') { ...
https://github.com/popsiclelmlm/Hey
ff82c80d65419ad938ecc0d2bc9e23ef70b10b0f
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/renderer/XAxisRendererRadarChart.ets
arkts
renderLimitLines
XAxis LimitLines on RadarChart not yet supported. @param c
public renderLimitLines(c: CanvasRenderingContext2D) { // this space intentionally left blank }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left renderLimitLines AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Ca...
public renderLimitLines(c: CanvasRenderingContext2D) { // this space intentionally left blank }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
212d52c48a8e5a44f5f4c55ad0ff8a87efec15d4
gitee
Joker-x-dev/CoolMallArkTS
feature/user/src/main/ets/viewmodel/ProfileViewModel.ets
arkts
getAvatarUrl
获取头像地址 @returns {ResourceStr} 头像地址
getAvatarUrl(): ResourceStr { return this.getUserInfo().avatarUrl; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAvatarUrl 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 ResourceStr AST#identifier#Right AST#ERROR#Right ...
getAvatarUrl(): ResourceStr { return this.getUserInfo().avatarUrl; }
https://github.com/Joker-x-dev/CoolMallArkTS
8eadb9de43ebfc42d9a00dd70cd697da1794ae94
github
HarmonyOS_Samples/BestPracticeSnippets
AppDataSecurity/entry/src/main/ets/pages/Index.ets
arkts
GetAesGenerateProperties
[Start get_aes_generate_properties]
function GetAesGenerateProperties(): Array<huks.HuksParam> { let properties: Array<huks.HuksParam> = [{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES }, { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 }, { tag: huks.HuksTag.HUKS_...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left GetAesGenerateProperties 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#ge...
function GetAesGenerateProperties(): Array<huks.HuksParam> { let properties: Array<huks.HuksParam> = [{ tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_AES }, { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_128 }, { tag: huks.HuksTag.HUKS_...
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
8d0b7e74433c1329ae3576cfeb25ea5f0fc9fbee
gitcode
openharmony-sig/ostest_integration_test
function/bms/bundlemanager/sceneProject/bmsqueryresourceinfo062/entry/src/main/ets/accessibilityextability/AccessibilityExtAbility.ets
arkts
onDisconnect
Called when your accessibility service is successfully disconnected to the OS.
onDisconnect() { console.log("[AccessibilityExtAbility] onDisconnect"); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left onDisconnect 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 ...
onDisconnect() { console.log("[AccessibilityExtAbility] onDisconnect"); }
https://gitee.com/openharmony-sig/ostest_integration_test.git
a09aa79fb6d67d9eeebe206b185aa35b17577533
gitee
HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
products/phone/src/main/ets/pages/customScan/model/ScanLayout.ets
arkts
setTopLayout
Page layout above the scanning line. @param titleHeight
public setTopLayout(titleHeight: number = this.titleHeight): void { Logger.info(TAG, 'Start to set top layout.'); this.titleHeight = titleHeight; this.topAvoidHeight = WindowService.getInstance().topAvoidHeight; const topButtonHeight = TOP_BUTTON_HEIGHT; // If the height is less than 480, the mai...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setTopLayout AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left titleHeight AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_e...
public setTopLayout(titleHeight: number = this.titleHeight): void { Logger.info(TAG, 'Start to set top layout.'); this.titleHeight = titleHeight; this.topAvoidHeight = WindowService.getInstance().topAvoidHeight; const topButtonHeight = TOP_BUTTON_HEIGHT; // If the height is less than 480, the mai...
https://gitcode.com/HarmonyOS_Samples/scankit-samplecode-clientdemo-arkts
c65d2259369e6373b7ddd4e252559e54e28fd1fd
gitcode
xblLab/HarmonyProjectTemplate
features/mine/src/main/ets/utils/NumberUtil.ets
arkts
getHourAndMinuteFormat
获取时分格式化。 格式为xx小时xx分钟 @param seconds 秒 @returns
public static getHourAndMinuteFormat(seconds: number | undefined): string { if (seconds) { let hours: number = Math.floor(seconds / 3600); // 每小时3600秒 let minutes: number = Math.floor((seconds % 3600) / 60); // 剩余秒数转换为分钟 let format: string = `${minutes}分钟`; if (hours > 0) { format ...
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 getHourAndMinuteFormat AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left seconds AST#identifier#Right AST...
public static getHourAndMinuteFormat(seconds: number | undefined): string { if (seconds) { let hours: number = Math.floor(seconds / 3600); // 每小时3600秒 let minutes: number = Math.floor((seconds % 3600) / 60); // 剩余秒数转换为分钟 let format: string = `${minutes}分钟`; if (hours > 0) { format ...
https://github.com/xblLab/HarmonyProjectTemplate
e06ef0fb7c6d8165e5c1b98f2cb6cbde859b9bab
github
LongLiveY96/chatcube
entry/src/main/ets/models/ChatModels.ets
arkts
hasReasoningContent
检查是否有推理内容
hasReasoningContent(): boolean { return this.reasoningContent.length > 0 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasReasoningContent 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...
hasReasoningContent(): boolean { return this.reasoningContent.length > 0 }
https://github.com/LongLiveY96/chatcube
ee80fc9ee4e39135d85383896d93bcec40cf470d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/String.ets
arkts
small
The small() method creates a string that embeds a string in a <small> element (<small>str</small>), which causes a string to be displayed in a big font. @returns { String } @syscap SystemCapability.Utils.Lang @FaAndStageModel
public small(): String{ return this.CreateHTMLString('small', '') }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left small 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#:#Rig...
public small(): String{ return this.CreateHTMLString('small', '') }
https://gitcode.com/iop123123/arkts-static-skills
b8ff03725003fcb03e2786961f10ad9c3b3b28b2
gitcode
HarmonyOS_Samples/MultiPictureBeautification
features/multipicturebrowsing/src/main/ets/datasource/PictureListDataSource.ets
arkts
notifyDataAdd
Notify listeners when data is added at end
notifyDataAdd(): void { this.listeners.forEach(listener => { listener.onDataAdd(this.pictureList.length - 1); }); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left notifyDataAdd AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
notifyDataAdd(): void { this.listeners.forEach(listener => { listener.onDataAdd(this.pictureList.length - 1); }); }
https://gitcode.com/HarmonyOS_Samples/MultiPictureBeautification
e61c6674e48c2091e372cb82fcb7ef414315e344
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Double.ets
arkts
isInteger
Checks if the underlying double is similar to an integer value @returns { boolean } true if the underlying double is similar to an integer value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public isInteger(): boolean { return Double.isInteger(this.value); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isInteger 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#boo...
public isInteger(): boolean { return Double.isInteger(this.value); }
https://gitcode.com/iop123123/arkts-static-skills
0f140ffd441be504d2d2ee21d00b7b8dda9699c7
gitcode
terryma2024/happyword
harmonyos/entry/src/main/ets/services/LearningRecorder.ets
arkts
attachStore
Used by unit tests to install a pre-configured store.
attachStore(store: WrongAnswerStore, snapshot: LearningSnapshot): void { this.store = store; this.snapshot = snapshot; this.sessionStartLearnedIds = this.computeLearnedIdSet(); this.ready = true; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left attachStore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left store AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left WrongAnswerStore AST#identifier#Right AST#,...
attachStore(store: WrongAnswerStore, snapshot: LearningSnapshot): void { this.store = store; this.snapshot = snapshot; this.sessionStartLearnedIds = this.computeLearnedIdSet(); this.ready = true; }
https://github.com/terryma2024/happyword
bd6fe626de4f0f250d4439a3474bf70c76e10d9b
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Object.ets
arkts
constructor
Constructs a new blank Object
constructor () {};
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 () {};
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
d26ad37b9ce6c9f54d1492c92e9ba9b1e77e07a0
gitee
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test35_original_index.ets
arkts
testReduce
=== Round 35: Array.reduce, Array.findIndex, nested ternary, Number constants (isInteger/isSafeInteger), Array.forEach, String split+join, chained range comparisons === --- Array.reduce (sum and max) ---
function testReduce(): string { let arr: number[] = [1, 2, 3, 4, 5]; let sum: number = arr.reduce((acc: number, val: number): number => { return acc + val; }, 0); let max: number = arr.reduce((acc: number, val: number): number => { if (val > acc) { return val; } return acc; }, arr[0]); ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testReduce AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#predefined_type#...
function testReduce(): string { let arr: number[] = [1, 2, 3, 4, 5]; let sum: number = arr.reduce((acc: number, val: number): number => { return acc + val; }, 0); let max: number = arr.reduce((acc: number, val: number): number => { if (val > acc) { return val; } return acc; }, arr[0]); ...
https://github.com/miaochiahao/ark-ghidra
c490e5f965a7a6be66799fe021d27e4d61e3512e
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets
arkts
closed
Writable completes destroyfile and returns true, otherwise returns false.
get closed(): boolean { return this.closedInner; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left closed 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 A...
get closed(): boolean { return this.closedInner; }
https://gitcode.com/iop123123/arkts-static-skills
11a0a1efe50a9767f40103fedd9ce09f84d90576
gitcode
YDYm233/EasyRandom_HarmonyNextApp
product/wearable/src/main/ets/utils/WearScreenUtil.ets
arkts
contentWidthRatio
内容区宽度占比 — 圆形屏更窄(内接正方形)
static get contentWidthRatio(): string { const screenSize = WearScreenUtil.screenSize; if (WearScreenUtil.isRoundScreen()) { if (screenSize === 'small') return '65%'; if (screenSize === 'large') return '75%'; // 暂无此设备,预留 return '70%'; // standard } if (screenSize === 'small') retu...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left contentWidthRatio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
static get contentWidthRatio(): string { const screenSize = WearScreenUtil.screenSize; if (WearScreenUtil.isRoundScreen()) { if (screenSize === 'small') return '65%'; if (screenSize === 'large') return '75%'; // 暂无此设备,预留 return '70%'; // standard } if (screenSize === 'small') retu...
https://github.com/YDYm233/EasyRandom_HarmonyNextApp
f32449dfdf9c2ffed176cb9bc5755d9ad5856638
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Set.ets
arkts
$_iterator
Returns the iterator itself. @returns { IterableIterator<T> } - The iterator itself. @syscap SystemCapability.Utils.Lang @FaAndStageModel
override $_iterator(): IterableIterator<T> { return this.it }
AST#program#Left AST#ERROR#Left AST#override#Left override AST#override#Right AST#call_expression#Left AST#identifier#Left $_iterator AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expre...
override $_iterator(): IterableIterator<T> { return this.it }
https://gitcode.com/iop123123/arkts-static-skills
e07c9eafb3078e6ee9df2b34db9862329bafc41f
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Object.ets
arkts
hasOwnProperty
Determines whether an object has a field with the specified name @param key the string name of the field to test @returns true if the object has the specified field; false otherwise
public hasOwnProperty(key: string): boolean { const keys = Object.getOwnPropertyNames(this) const len = keys.length for(let i = 0; i < len; i++) { if (keys[i] == key) { return true } } return false }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hasOwnProperty AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st...
public hasOwnProperty(key: string): boolean { const keys = Object.getOwnPropertyNames(this) const len = keys.length for(let i = 0; i < len; i++) { if (keys[i] == key) { return true } } return false }
https://gitcode.com/iop123123/arkts-static-skills
0e6a7f1fdeaeb667df981eee169baedfce3d6727
gitcode
JackJiang2011/harmonychat
entry/src/main/ets/IMClientManager.ets
arkts
getLog
返回日志对象。 @returns Logger对象
getLog() :Logger { return ClientCoreSDK.Log; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLog 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 Logger AST#identifier#Right AST#ERROR#Right AST#stateme...
getLog() :Logger { return ClientCoreSDK.Log; }
https://github.com/JackJiang2011/harmonychat
799124a4e03be9c0c3f7a6afd43b0dd23ab64317
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Parsers/ReaderKitParser.ets
arkts
readFileBuffer
读取文件二进制数据
private async readFileBuffer(filePath: string): Promise<ArrayBuffer> { try { let openTarget: string = filePath; if (!filePath.startsWith('file://') && !filePath.startsWith('/')) { openTarget = `/${filePath}`; } let file = SafeFileUtils.openSync(openTarget, fileIo.OpenMode.READ_ONL...
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 readFileBuffer AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left filePath AST#identifier#Right AST#ERROR#Left AST#:#Le...
private async readFileBuffer(filePath: string): Promise<ArrayBuffer> { try { let openTarget: string = filePath; if (!filePath.startsWith('file://') && !filePath.startsWith('/')) { openTarget = `/${filePath}`; } let file = SafeFileUtils.openSync(openTarget, fileIo.OpenMode.READ_ONL...
https://github.com/DaLongZhuaZi/manxia
f4738c1174775997c8e9aee79364af3c93fbdfe0
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/ThemeManager.ets
arkts
getThemeMode
获取当前主题模式
public getThemeMode(): ThemeMode { return this.currentThemeMode; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getThemeMode 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 ThemeMode...
public getThemeMode(): ThemeMode { return this.currentThemeMode; }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/ThemeManager.ets#L72-L74
5227207a529f3d632a2a8ba16be6e1f13de325ac
github
Joker-x-dev/CoolMallArkTS
core/data/src/main/ets/repository/SearchHistoryRepository.ets
arkts
getAllSearchHistory
获取所有搜索历史记录,按搜索时间倒序 @returns {Promise<SearchHistory[]>} 搜索历史列表
getAllSearchHistory(): Promise<SearchHistory[]> { return this.dataSource.getAllSearchHistory(); }
AST#program#Left AST#expression_statement#Left AST#instantiation_expression#Left AST#call_expression#Left AST#identifier#Left getAllSearchHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Righ...
getAllSearchHistory(): Promise<SearchHistory[]> { return this.dataSource.getAllSearchHistory(); }
https://github.com/Joker-x-dev/CoolMallArkTS
306113dcc74b578c484ea23f0728fb9c1bb9fa44
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BarDataSet.ets
arkts
setBarShadowColor
Sets the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value. Don't for get to use getResources().getColor(...) to set this. Or Color.rgb(...). @param color
public setBarShadowColor(color: number): void { this.mBarShadowColor = color; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setBarShadowColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left color AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
public setBarShadowColor(color: number): void { this.mBarShadowColor = color; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
1b247948d7b5f3d97efe97ab75ce7e06fa15c69d
gitee
arkui-x/samples
CodeLab/Cases/feature/imageviewer/src/main/ets/model/RotateModel.ets
arkts
stash
保存最后的数据
stash(): void { // 一个完整的圆的角度是360度 let angle = 360; this.lastRotate = this.currentRotate % angle; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stash AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block#Left A...
stash(): void { // 一个完整的圆的角度是360度 let angle = 360; this.lastRotate = this.currentRotate % angle; }
https://gitcode.com/arkui-x/samples
0cb0a426937df2392f479bda2e17e65f0564f65e
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/CryptoService.ets
arkts
decryptV1
v1 解密(HUKS 设备绑定密钥)— 仅用于兼容旧格式
private static async decryptV1(data: Uint8Array): Promise<string> { const headerSize = MAGIC_SIZE + GCM_NONCE_SIZE; // 17 if (data.length < headerSize + GCM_TAG_SIZE) { throw new Error('v1 加密数据太短'); } await CryptoService.ensureHuksKey(); const nonce = data.slice(MAGIC_SIZE, MAGIC_SIZE + GC...
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 decryptV1 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left data ...
private static async decryptV1(data: Uint8Array): Promise<string> { const headerSize = MAGIC_SIZE + GCM_NONCE_SIZE; // 17 if (data.length < headerSize + GCM_TAG_SIZE) { throw new Error('v1 加密数据太短'); } await CryptoService.ensureHuksKey(); const nonce = data.slice(MAGIC_SIZE, MAGIC_SIZE + GC...
https://github.com/AlkaidLab/moonlight-harmony
23e5d429accc6935522ebf639def0a35282c2bba
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Date.ets
arkts
UTC
Returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. @param year to be converted to milliseconds. @param month to be converted to milliseconds. @param day to be converted to milliseconds. @param hours to be converted to milliseconds. @ret...
public static UTC(year: long, month: long, day: long, hours: long): long { return ecmaMakeDate(ecmaMakeDay(year, month, day), ecmaMakeTime(hours, 0 as long, 0 as long, 0 as long)) }
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 UTC AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left year AST#ide...
public static UTC(year: long, month: long, day: long, hours: long): long { return ecmaMakeDate(ecmaMakeDay(year, month, day), ecmaMakeTime(hours, 0 as long, 0 as long, 0 as long)) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
f7c771445330edf2fd01029688f5e9920ca87410
gitee
erosTeam/NextE
shared/src/main/ets/constants/EhConstants.ets
arkts
exactTagSearchQuery
Fielded tag query matching eros_fe's exact EH tag semantics; uploader is a name search, not a tag.
static exactTagSearchQuery(namespace: string, tag: string): string { const ns: string = EhConstants.compactNamespace(namespace) const text: string = EhConstants.canonicalTagText(tag) if (ns.length === 0 || text.length === 0) { return '' } if (ns === 'uploader') { return `${ns}:"${text}...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left exactTagSearchQuery AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left namespace AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#...
static exactTagSearchQuery(namespace: string, tag: string): string { const ns: string = EhConstants.compactNamespace(namespace) const text: string = EhConstants.canonicalTagText(tag) if (ns.length === 0 || text.length === 0) { return '' } if (ns === 'uploader') { return `${ns}:"${text}...
https://github.com/erosTeam/NextE
039eb3f0455ae7a4759273ac867ab915418e04e8
github
openharmony-tpc/VCard
library/src/main/ets/components/VCardParserImpl_V21.ets
arkts
getPropertyNameUpperCase
Extracts the property name portion of a given vCard line. <p> Properties must contain a colon. <p> E.g. TEL;TYPE=WORK:+5555555 // returns "TEL" END:VCARD // returns "END" TEL; // returns null @param line The vCard line. @return The property name portion. {@literal null} if no property name found.
private getPropertyNameUpperCase(line: string): string | null { const colonIndex: number = line.indexOf(":"); if (colonIndex > -1) { const semiColonIndex: number = line.indexOf(";"); // Find the minimum index that is greater than -1. let minIndex: number; ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getPropertyNameUpperCase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left line AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#iden...
private getPropertyNameUpperCase(line: string): string | null { const colonIndex: number = line.indexOf(":"); if (colonIndex > -1) { const semiColonIndex: number = line.indexOf(";"); // Find the minimum index that is greater than -1. let minIndex: number; ...
https://gitee.com/openharmony-tpc/VCard.git
455be9af0e220aa06bd3d536ecb74f9bcdb45d24
gitee
arkui-x/samples
CodeLab/Cases/common/utils/src/main/ets/utils/NWebUtils.ets
arkts
makeNode
必须要重写的方法,用于构建节点数、返回节点挂载在对应NodeContainer中 在对应NodeContainer创建的时候调用、或者通过rebuild方法调用刷新
makeNode(uiContext: UIContext): FrameNode | null { if (this.rootNode) { return this.rootNode.getFrameNode(); } // 返回null控制动态组件脱离绑定节点 return null; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left makeNode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uiContext AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ...
makeNode(uiContext: UIContext): FrameNode | null { if (this.rootNode) { return this.rootNode.getFrameNode(); } // 返回null控制动态组件脱离绑定节点 return null; }
https://gitcode.com/arkui-x/samples
c53c0a85d89c33e22e43546d8a02fb8a813551c8
gitcode
daugf2527/harmonyos-libretro-emulator
entry/src/main/ets/common/PerformanceTracker.ets
arkts
reset
重置计时器(重新开始计时) @param label 计时器标签
static reset(label: string): void { if (this.timers.has(label)) { this.timers.set(label, Date.now()); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left reset AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left label AST#identifier#Right AST#:#Left : AST#:#Right AST#ER...
static reset(label: string): void { if (this.timers.has(label)) { this.timers.set(label, Date.now()); } }
https://github.com/daugf2527/harmonyos-libretro-emulator
1af7c7e393635fd686f0357b2bfd8b3a892d5b8e
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/AsyncLinkedConcurrentQueue.ets
arkts
initializeQueueState
Initializes the queue sentinel state used by all constructors. @returns { void } No return value. @syscap SystemCapability.Utils.Lang @FaAndStageModel
private initializeQueueState(): void { const sentinel = new ListNode<T>(); this.head = sentinel; this.tail = sentinel; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initializeQueueState AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void...
private initializeQueueState(): void { const sentinel = new ListNode<T>(); this.head = sentinel; this.tail = sentinel; }
https://gitcode.com/iop123123/arkts-static-skills
02a2641c1c509aa83e81bda4693e776b69ba66fa
gitcode
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/pages/CategoryManagement.ets
arkts
openCreateDialog
打开新建分类弹窗
openCreateDialog(parentId: number = 0) { const newCategory = new Category() newCategory.type = this.currentType newCategory.parentCategoryId = parentId this.currentEditingCategory = newCategory // 创建弹窗 this.dialogController = new CustomDialogController({ builder: CategoryEditDialog(...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openCreateDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left parentId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#assignment_expression#Left AST#ident...
openCreateDialog(parentId: number = 0) { const newCategory = new Category() newCategory.type = this.currentType newCategory.parentCategoryId = parentId this.currentEditingCategory = newCategory // 创建弹窗 this.dialogController = new CustomDialogController({ builder: CategoryEditDialog(...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
ac1b576c497927f5bd9dd95dff1a064b924f79cb
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/CloudSyncRecordDAO.ets
arkts
insertMany
批量插入同步记录
static async insertMany(records: CloudSyncRecord[]): Promise<void> { await DAOHelper.transaction(async () => { for (const record of records) { await CloudSyncRecordDAO.insert(record); } }, '[CloudSyncRecordDAO] 批量插入'); }
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 insertMany AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left records AST#identifier#Right AST#:#Left : AST...
static async insertMany(records: CloudSyncRecord[]): Promise<void> { await DAOHelper.transaction(async () => { for (const record of records) { await CloudSyncRecordDAO.insert(record); } }, '[CloudSyncRecordDAO] 批量插入'); }
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
f5c80f6d8d3dec5f6a7bdad12eb66c66d540e41c
github
openharmony/codelabs
ETSUI/ContactManager/entry/src/main/ets/pages/ContactEditPage.ets
arkts
fillData
将对象数据填充到状态变量
fillData(c: Contact) { this.contactId = c.id || ''; this.contactKey = c.key || ''; // 关键:保存系统的 key this.name = c.name || ''; this.phone = c.phone || ''; this.email = c.email || ''; this.remark = c.remark || ''; console.info('[ContactEditPage] 填充数据:', { id: this.contactId, key...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fillData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left c AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Contact AST#identifier#Right AST#)#...
fillData(c: Contact) { this.contactId = c.id || ''; this.contactKey = c.key || ''; // 关键:保存系统的 key this.name = c.name || ''; this.phone = c.phone || ''; this.email = c.email || ''; this.remark = c.remark || ''; console.info('[ContactEditPage] 填充数据:', { id: this.contactId, key...
https://gitcode.com/openharmony/codelabs
b8044a60285b75abd60ab7cfad35341d7fc22f4b
gitcode
LongLiveY96/chatcube
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onConfigurationUpdate
监听配置变化(包括主题切换)
onConfigurationUpdate(newConfig: Configuration): void { hilog.info(DOMAIN, 'testTag', 'Configuration updated: %{public}s', JSON.stringify(newConfig)); // 使用 newConfig.colorMode 获取最新系统深浅色,this.context.config 在回调时可能尚未更新 const latestColorMode = newConfig.colorMode ?? this.context.config.colorMode; void t...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onConfigurationUpdate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newConfig AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Configuration AST#identifier#...
onConfigurationUpdate(newConfig: Configuration): void { hilog.info(DOMAIN, 'testTag', 'Configuration updated: %{public}s', JSON.stringify(newConfig)); // 使用 newConfig.colorMode 获取最新系统深浅色,this.context.config 在回调时可能尚未更新 const latestColorMode = newConfig.colorMode ?? this.context.config.colorMode; void t...
https://github.com/LongLiveY96/chatcube
551742be45cc3227c9c3e6606da27d6703a04cae
github
OHPG/FinSdk
jellyfin/src/main/ets/api/SystemApi.ets
arkts
getWakeOnLanInfo
getWakeOnLanInfo @summary Gets wake on lan information. @deprecated @throws {RequiredError} @memberof SystemApi
public async getWakeOnLanInfo(): Promise<Array<WakeOnLanInfo>> { return this.apiClient.get({ path: "/System/WakeOnLanInfo" }) }
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 getWakeOnLanInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
public async getWakeOnLanInfo(): Promise<Array<WakeOnLanInfo>> { return this.apiClient.get({ path: "/System/WakeOnLanInfo" }) }
https://github.com/OHPG/FinSdk
a936cdf6ddc6843f740b7837cdae32007d6a3048
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Array.ets
arkts
of
Creates a new Array instance from a variable number of arguments, regardless of number or type of the arguments. @param { T[] } values Elements of which to create the array. @returns { Array<T> } A new Array instance. @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of<T>(...values: T[]): Array<T> { const ret = new Array<T>() const length: int = values.length ret.ensureUnusedCapacity(length) for (let i = 0; i < length; i++) { ret.push(values[i]) } return ret }
AST#program#Left AST#ERROR#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left...
public static of<T>(...values: T[]): Array<T> { const ret = new Array<T>() const length: int = values.length ret.ensureUnusedCapacity(length) for (let i = 0; i < length; i++) { ret.push(values[i]) } return ret }
https://gitcode.com/iop123123/arkts-static-skills
c23fa76eff7c8336d2bdbb93bef1396682eef059
gitcode
webabcd/HarmonyCachedImage
harmony_cachedimage/src/main/ets/CachedImage.ets
arkts
aci
异步缓存图片 @param config 图片的 url @returns 如果缓存成功或缓存命中成功则返 file:// 开头的缓存地址,否则返回原 url
public async aci(url: string): Promise<string> { let ok = await this.addDownloading(url) if (!ok) { log.i(`缓存任务已存在 ${url}`) return url } // 如果目录不存在则创建 fs.mkdir(this.config.cacheDirectory, true) let urlMd5 = CryptoHelper.md5(url) let filePath = PathHelper.join(this.config.cac...
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 aci AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AS...
public async aci(url: string): Promise<string> { let ok = await this.addDownloading(url) if (!ok) { log.i(`缓存任务已存在 ${url}`) return url } // 如果目录不存在则创建 fs.mkdir(this.config.cacheDirectory, true) let urlMd5 = CryptoHelper.md5(url) let filePath = PathHelper.join(this.config.cac...
https://github.com/webabcd/HarmonyCachedImage
6e212e4621f6266bdd1760a03e44aba2a5aad063
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/TagDAO.ets
arkts
incrementUsageCount
增加标签使用次数 @param tagId 标签ID
private static async incrementUsageCount(tagId: number): Promise<void> { const store = DatabaseManager.getDatabase(); const sql = `UPDATE tags SET usage_count = usage_count + 1 WHERE tag_id = ?`; try { await store.executeSql(sql, [tagId]); } catch (error) { console.error('[TagDAO] 增加使用次数失败...
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 incrementUsageCount AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#...
private static async incrementUsageCount(tagId: number): Promise<void> { const store = DatabaseManager.getDatabase(); const sql = `UPDATE tags SET usage_count = usage_count + 1 WHERE tag_id = ?`; try { await store.executeSql(sql, [tagId]); } catch (error) { console.error('[TagDAO] 增加使用次数失败...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
504ce25a973e4dd3d2f9d87aaeca923fe888f29d
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/TaskExecutor.ets
arkts
evaluateExpression
评估表达式
private evaluateExpression(expr: string, context: TaskContext): Object | undefined { // 支持简单的变量引用: ${variableName} 或 ${stepResults.stepId.field} if (expr.startsWith('${') && expr.endsWith('}')) { const path = expr.slice(2, -1); return this.getValueByPath(context, path); } return expr; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left evaluateExpression AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left expr AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
private evaluateExpression(expr: string, context: TaskContext): Object | undefined { // 支持简单的变量引用: ${variableName} 或 ${stepResults.stepId.field} if (expr.startsWith('${') && expr.endsWith('}')) { const path = expr.slice(2, -1); return this.getValueByPath(context, path); } return expr; }
https://github.com/DaLongZhuaZi/manxia
7af4f2a8c01128836a9b1367d8d23abf5527757a
github
Coke0807/NewsAPP-HarmonyOS
NewsApp/entry/src/main/ets/utils/SettingsUtil.ets
arkts
getFontSize
获取字体大小
static getFontSize(): number { return AppStorage.get<number>(STORAGE_KEYS.FONT_SIZE) || DEFAULT_FONT_SIZE; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getFontSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#num...
static getFontSize(): number { return AppStorage.get<number>(STORAGE_KEYS.FONT_SIZE) || DEFAULT_FONT_SIZE; }
https://github.com/Coke0807/NewsAPP-HarmonyOS
a687c11a25aa89d65fd99e6e59ba3a0902c105df
github
openharmony/codelabs
Ability/StageAbility/entry/src/main/ets/model/ButtonClickMethod.ets
arkts
toSecondAbilitySecond
Navigate to the Second Page of SecondAbility. @param context Context of EntryAbility. @param callback Execute the result callback function.
toSecondAbilitySecond(context: common.UIAbilityContext, callback: (abilityResult: common.AbilityResult) => void) { let want: Want = { 'deviceId': '', 'bundleName': CommonConstants.BUNDLE_NAME, 'abilityName': CommonConstants.SECOND_ABILITY_NAME, 'moduleName': CommonConstants.DEVICE_MODULE_N...
AST#program#Left AST#ERROR#Left AST#identifier#Left toSecondAbilitySecond AST#identifier#Right AST#(#Left ( AST#(#Right AST#member_expression#Left AST#identifier#Left context AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left common AST#identifier#Right AST#ERROR#Right AST#.#Left . AST#.#R...
toSecondAbilitySecond(context: common.UIAbilityContext, callback: (abilityResult: common.AbilityResult) => void) { let want: Want = { 'deviceId': '', 'bundleName': CommonConstants.BUNDLE_NAME, 'abilityName': CommonConstants.SECOND_ABILITY_NAME, 'moduleName': CommonConstants.DEVICE_MODULE_N...
https://gitee.com/openharmony/codelabs.git
106306619958a22dd67448cf2a7a077d640547ae
gitee
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/utils/PerformanceMonitor.ets
arkts
getMemorySnapshots
获取内存快照历史
getMemorySnapshots(): Array<NGFMemorySnapshot> { const copied: Array<NGFMemorySnapshot> = []; for (let index = 0; index < this.memorySnapshots.length; index++) { copied.push(this.memorySnapshots[index]); } return copied; }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getMemorySnapshots AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#...
getMemorySnapshots(): Array<NGFMemorySnapshot> { const copied: Array<NGFMemorySnapshot> = []; for (let index = 0; index < this.memorySnapshots.length; index++) { copied.push(this.memorySnapshots[index]); } return copied; }
https://github.com/DaLongZhuaZi/NGF
7e7f713bf7fe272019579060c1b74d45e101087e
github
richshaw2015/nds
ohos/entry/src/main/ets/utils/WebUploadServer.ets
arkts
getLocalIpAddress
获取本地 IP 地址
private async getLocalIpAddress(): Promise<string> { try { const ipInfo = wifiManager.getIpInfo(); if (ipInfo && ipInfo.ipAddress) { const ip = this.intToIp(ipInfo.ipAddress); hilog.info(DOMAIN, TAG, `Local IP: ${ip}`); return ip; } } catch (err) { hilog.error(D...
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 getLocalIpAddress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right...
private async getLocalIpAddress(): Promise<string> { try { const ipInfo = wifiManager.getIpInfo(); if (ipInfo && ipInfo.ipAddress) { const ip = this.intToIp(ipInfo.ipAddress); hilog.info(DOMAIN, TAG, `Local IP: ${ip}`); return ip; } } catch (err) { hilog.error(D...
https://github.com/richshaw2015/nds
d711d4999eae5b34563397e36be855bb5e0d29a3
github
Cool_foolisher1/ArkTSRepository
GuardianAssistant/entry/src/main/ets/pages/Guard/Indoor/IndoorCheckMovePage.ets
arkts
checkStatic
检测手机是否静止
checkStatic(value: sensor.AccelerometerResponse, oldValue: sensor.AccelerometerResponse) { // Math.abs 计算绝对值,用于判断误差范围,只要误差范围小于等于 1 都认为设备静止 return ( Math.abs(value.x - oldValue.x) <= 1 && Math.abs(value.y - oldValue.y) <= 1 && Math.abs(value.z - oldValue.z) <= 1 ) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left checkStatic AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#member_expression#Left AST#identifier#Left s...
checkStatic(value: sensor.AccelerometerResponse, oldValue: sensor.AccelerometerResponse) { // Math.abs 计算绝对值,用于判断误差范围,只要误差范围小于等于 1 都认为设备静止 return ( Math.abs(value.x - oldValue.x) <= 1 && Math.abs(value.y - oldValue.y) <= 1 && Math.abs(value.z - oldValue.z) <= 1 ) }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
97c41f87dd532c6d242930d67d43029ebdfbd938
gitcode
openharmony/codelabs
Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets
arkts
removeDataChangeListener
Remove the data change listener.
removeDataChangeListener(): void { if (this.kvStore === undefined) { return; } try { this.kvStore.off('dataChange'); } catch (error) { Logger.error('KvStoreModel', `removeDataChangeListener off('dataChange') failed, err=${JSON.stringify(error)}`); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left removeDataChangeListener 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#sta...
removeDataChangeListener(): void { if (this.kvStore === undefined) { return; } try { this.kvStore.off('dataChange'); } catch (error) { Logger.error('KvStoreModel', `removeDataChangeListener off('dataChange') failed, err=${JSON.stringify(error)}`); } }
https://gitee.com/openharmony/codelabs.git
d8ed6075e4f3c16ed33b792feec622f61a61c2a3
gitee
HarmonyOS_Samples/guide-snippets
ArkTS/ArkTSModule/ArkModuleSideEffects/entry/src/main/ets/pages/PageFourteen.ets
arkts
testHar
[End import_modulePartFourteen]
function testHar() { serviceManager.print(); }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testHar AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#expression_statemen...
function testHar() { serviceManager.print(); }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
64518f1811e743da696b813cc833c1b035a7b6fc
gitcode
killetom/ktretrofit
ktretrofit/src/main/ets/retrofit/Retrofit.ets
arkts
addInterceptor
Add an interceptor to the HTTP client. @param interceptor The interceptor to add. @returns This builder instance for method chaining.
addInterceptor(interceptor: Interceptor): RetrofitBuilder { // Create a new HttpClientBuilder with the existing client's configuration const newClientBuilder = new HttpClientBuilder(); // Add all existing interceptors from the current client if (typeof (this.client as any).interceptors === ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addInterceptor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left interceptor AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Interceptor AST#identifier#Right A...
addInterceptor(interceptor: Interceptor): RetrofitBuilder { // Create a new HttpClientBuilder with the existing client's configuration const newClientBuilder = new HttpClientBuilder(); // Add all existing interceptors from the current client if (typeof (this.client as any).interceptors === ...
https://github.com/killetom/ktretrofit
6dfd0c9795ca7a36cf7deb0e1dd1eb266c2eec39
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Intl.ets
arkts
assignOptionsDefault
Assign new options or default decimal style and values @param options options @returns boolean true means notation is 'compact'. Otherwise, false
private static assignOptionsDefault(options?: NumberFormatOptions): ResolvedNumberFormatOptionsImpl { let newOptions = new ResolvedNumberFormatOptionsImpl // Set new options or default decimal style and values newOptions._currencySign = options?.currencySign ?? undefined ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left static AST#identifier#Right AST#call_expression#Left AST#identifier#Left assignOptionsDefault AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left options AST#identifier#Right AS...
private static assignOptionsDefault(options?: NumberFormatOptions): ResolvedNumberFormatOptionsImpl { let newOptions = new ResolvedNumberFormatOptionsImpl // Set new options or default decimal style and values newOptions._currencySign = options?.currencySign ?? undefined ...
https://gitcode.com/iop123123/arkts-static-skills
4686644e7550677242ebbe1027fa775c17117c95
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
from
Creates an array from an array-like object. @param { ArrayLike<number> } arr - An array-like object to convert to an array. @returns { Uint8Array } - A new Uint8Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arr: ArrayLike<number>): Uint8Array { return Uint8Array.from<number>( arr, (x: number, _k: number): number => x ); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left arr AST#identifier#Righ...
public static from(arr: ArrayLike<number>): Uint8Array { return Uint8Array.from<number>( arr, (x: number, _k: number): number => x ); }
https://gitcode.com/iop123123/arkts-static-skills
88dfbbe16a7377c9998a165db000e9f157ad5d6e
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Initialization/DataInitializer.ets
arkts
performDataMigration
执行数据迁移
private async performDataMigration(): Promise<void> { try { // 检查是否需要数据迁移 // 这里可以实现版本检查和数据迁移逻辑 // [修复] 修复所有图源缺失的 pkg 字段 // 这是一个一次性修复,用于解决旧版本数据没有保存 pkg 的问题 try { const dataManager = DataManager.getInstance(); const fixedCount = await dataManager.fixAllSourcePkgF...
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 performDataMigration AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri...
private async performDataMigration(): Promise<void> { try { // 检查是否需要数据迁移 // 这里可以实现版本检查和数据迁移逻辑 // [修复] 修复所有图源缺失的 pkg 字段 // 这是一个一次性修复,用于解决旧版本数据没有保存 pkg 的问题 try { const dataManager = DataManager.getInstance(); const fixedCount = await dataManager.fixAllSourcePkgF...
https://github.com/DaLongZhuaZi/manxia
a684ae5355701e0b385e047f9ea38b17c72e56cb
github
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/model/SongDataSource.ets
arkts
constructor
Copies the given array into this data source. @param element Initial song list.
public constructor(element: SongItem[]) { for (let index = 0; index < element.length; index++) { this.dataArray.push(element[index]); } }
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 element AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_express...
public constructor(element: SongItem[]) { for (let index = 0; index < element.length; index++) { this.dataArray.push(element[index]); } }
https://gitcode.com/HarmonyOS_Samples/MusicHome
04784893c37aa4a78911f2606547f62913099168
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoCookieStore.ets
arkts
loadCookies
从持久化存储加载Cookie
private async loadCookies(): Promise<void> { if (!this.dataPreferences) return; try { const cookieData = await this.dataPreferences.get('cookies', '{}'); const parsed = SafeUtils.parseObj(cookieData as string) as Record<string, Record<string, CookieItem>>; for (const domain of Ob...
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 loadCookies AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:...
private async loadCookies(): Promise<void> { if (!this.dataPreferences) return; try { const cookieData = await this.dataPreferences.get('cookies', '{}'); const parsed = SafeUtils.parseObj(cookieData as string) as Record<string, Record<string, CookieItem>>; for (const domain of Ob...
https://github.com/DaLongZhuaZi/manxia
52a7fa983ada5fa25f21ce16632a89a9179182ff
github
CLMC2025/Vignette
entry/src/main/ets/context/OfflineContext.ets
arkts
validateContext
验证生成的语境
validateContext(context: string, targetWord: string): boolean { if (context.length === 0) { return false; } // 检查目标词汇是否在语境中 const lowerContext = context.toLowerCase(); const lowerTargetWord = targetWord.toLowerCase(); if (!lowerContext.includes(lowerTargetWord)) { return false; ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left validateContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left context AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left , AST#...
validateContext(context: string, targetWord: string): boolean { if (context.length === 0) { return false; } // 检查目标词汇是否在语境中 const lowerContext = context.toLowerCase(); const lowerTargetWord = targetWord.toLowerCase(); if (!lowerContext.includes(lowerTargetWord)) { return false; ...
https://github.com/CLMC2025/Vignette
dad41fe9187aeb13adc39c4b515c482e8982a8ca
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/FontAware.ets
arkts
syncFromFontManager
从FontManager同步设置
public syncFromFontManager(): void { const fontManager = getFontManager(); const settings = fontManager.getSettings(); this.appFontFamily = fontManager.getFontFamily(FontScene.APP_UI); this.appFontSize = settings.appFontSize; this.novelFontFamily = fontManager.getFontFamily(FontScene.NOVEL); ...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left syncFromFontManager 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...
public syncFromFontManager(): void { const fontManager = getFontManager(); const settings = fontManager.getSettings(); this.appFontFamily = fontManager.getFontFamily(FontScene.APP_UI); this.appFontSize = settings.appFontSize; this.novelFontFamily = fontManager.getFontFamily(FontScene.NOVEL); ...
https://github.com/DaLongZhuaZi/manxia
76b6c6ae5fd0cf29dd6e59fc4c47619677294c63
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/LibFreeRDP.ets
arkts
sendUnicodeKeyEvent
Send a Unicode key event
static sendUnicodeKeyEvent(inst: number, keycode: number, down: boolean): boolean { if (!LibFreeRDP.ensureNativeReady()) { return false; } return freerdpNative!.freerdpSendUnicodeKeyEvent(inst, keycode, down); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left sendUnicodeKeyEvent AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left inst AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#L...
static sendUnicodeKeyEvent(inst: number, keycode: number, down: boolean): boolean { if (!LibFreeRDP.ensureNativeReady()) { return false; } return freerdpNative!.freerdpSendUnicodeKeyEvent(inst, keycode, down); }
https://github.com/tangwengang-del/freerdp-harmonyos
586b6106656d6dbdfc205d8cce2b29aa627ffc96
github
zhubowen-bot/Bowen_ArkWeb_framework
entry/src/main/ets/delegate/IWebDownloadFile.ets
arkts
generateDefaultPath
生成默认下载路径
private generateDefaultPath(): string { const defaultDir = `${getContext(this).cacheDir}/web_download` const fileName = this.webDownloadItem?.getSuggestedFileName() || `download_${Date.now()}.bin` return `${defaultDir}${fileName}` }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left generateDefaultPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left str...
private generateDefaultPath(): string { const defaultDir = `${getContext(this).cacheDir}/web_download` const fileName = this.webDownloadItem?.getSuggestedFileName() || `download_${Date.now()}.bin` return `${defaultDir}${fileName}` }
https://github.com/zhubowen-bot/Bowen_ArkWeb_framework
2d5586918cc8d24054a606a059935064c4fd0a68
github
wuba/omni-ui
omni_component/src/main/ets/components/popup/Builder.ets
arkts
setTextFontColor
内容颜色,列表时,列表项文字颜色 @param textFontColor @returns
setTextFontColor(textFontColor?: ResourceColor): Builder { this.popupOptions.textFontColor = textFontColor return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setTextFontColor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left textFontColor AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Resou...
setTextFontColor(textFontColor?: ResourceColor): Builder { this.popupOptions.textFontColor = textFontColor return this }
https://github.com/wuba/omni-ui
268d19c7eb70e1a0217f459ee1e8bba7c06dce77
github
openharmony/codelabs
ETSUI/AccountApp/entry/src/main/ets/pages/LoginPage.ets
arkts
handleLogin
处理登录逻辑
handleLogin() { if (this.usernameStr === '' || this.passwordStr === '') { this.showToast('请输入用户名和密码'); return; } if (!this.rdbHelper) { this.showToast('系统初始化中...'); return; } // 查询数据库 this.rdbHelper.queryUser(this.usernameStr).then((user: User | null) => { if (u...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left handleLogin 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...
handleLogin() { if (this.usernameStr === '' || this.passwordStr === '') { this.showToast('请输入用户名和密码'); return; } if (!this.rdbHelper) { this.showToast('系统初始化中...'); return; } // 查询数据库 this.rdbHelper.queryUser(this.usernameStr).then((user: User | null) => { if (u...
https://gitcode.com/openharmony/codelabs
a1722fb5461384d1caed23be2355433514845561
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
toSorted
Creates a sorted copy @returns { Float32Array } - a sorted copy @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toSorted(): Float32Array { return new Float32Array(this).sort() }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left toSorted 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 Float32Array ...
public toSorted(): Float32Array { return new Float32Array(this).sort() }
https://gitcode.com/iop123123/arkts-static-skills
dd9ad040101259169943465bde958e883e0b36a5
gitcode
richshaw2015/nds
ohos/entry/src/main/ets/utils/ThemeManager.ets
arkts
getAllThemes
获取所有可用主题 @returns 所有 NDSTheme 数组
public getAllThemes(): NDSTheme[] { return [...NDS_THEMES]; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getAllThemes 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 NDSTheme ...
public getAllThemes(): NDSTheme[] { return [...NDS_THEMES]; }
https://github.com/richshaw2015/nds
cc5c2217af47c884c49b71193527ea03af40ead2
github
arkui-x/samples
CodeLab/Cases/feature/bottomdrawerslidecase/src/main/ets/utils/ArrayUtil.ets
arkts
contains
判断数组是否包含某个对象 param 数组对象Array<Object> 含有的对象Object @returns boolean
static contains(array: Array<Object>, value: Object): boolean { try { for (let index = 0; index < array.length; index++) { const element = array[index]; if (element === value) { return true; } } } catch (err) { logger.error('Failed ' + JSON.stringify(err)) ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left contains AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left array AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expressi...
static contains(array: Array<Object>, value: Object): boolean { try { for (let index = 0; index < array.length; index++) { const element = array[index]; if (element === value) { return true; } } } catch (err) { logger.error('Failed ' + JSON.stringify(err)) ...
https://gitcode.com/arkui-x/samples
71a113c7f3e159ad0d44910ca8776d1077e56d17
gitcode
arkui-x/samples
CodeLab/Cases/feature/customscan/src/main/ets/model/PermissionModel.ets
arkts
requestPermission
向用户申请授权 @param {Permissions} permissionName 申请授权的权限名 @returns {boolean} 申请授权结果
async requestPermission(permissionName: Permissions) { // 向用户申请授权 let context = getContext() as common.UIAbilityContext; let atManager = abilityAccessCtrl.createAtManager(); let grantStatusArr = await atManager.requestPermissionsFromUser(context, [ permissionName ]); const grantStatus = grantStatu...
AST#program#Left AST#expression_statement#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left requestPermission AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left permissionName AST#identifier#Right AST#type_annotat...
async requestPermission(permissionName: Permissions) { // 向用户申请授权 let context = getContext() as common.UIAbilityContext; let atManager = abilityAccessCtrl.createAtManager(); let grantStatusArr = await atManager.requestPermissionsFromUser(context, [ permissionName ]); const grantStatus = grantStatu...
https://gitcode.com/arkui-x/samples
f7249860db46f4e833269dc268d8ba8df4a1da3e
gitcode
lidaixian999/Smart_Car
entry/src/main/ets/view/carInformation.ets
arkts
updateMileage
电池电量与里程数转换
updateMileage() { this.mileage = Math.floor(this.batteryLevel * 5); // 假设1%电量=5km }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left updateMileage 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...
updateMileage() { this.mileage = Math.floor(this.batteryLevel * 5); // 假设1%电量=5km }
https://github.com/lidaixian999/Smart_Car
4d659d8750f5bff13b43099023ffb3b2272e05cf
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/RadarChartModel.ets
arkts
setDrawWeb
If set to true, drawing the web is enabled, if set to false, drawing the whole web is disabled. Default: true @param enabled
public setDrawWeb(enabled: boolean) { this.mDrawWeb = enabled; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setDrawWeb AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left enabled AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left bo...
public setDrawWeb(enabled: boolean) { this.mDrawWeb = enabled; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
fe9815af6b79436598c1e8e2edfa7a9ecd64891d
gitee
terryma2024/happyword
harmonyos/entry/src/main/ets/services/CloudWishlistService.ets
arkts
pollDecisions
Poll for decisions newer than the persisted cursor. Updates cursor to the server-reported `server_now_ms` on success. Returns the list of decisions to be applied by the caller (so the caller can run the UI flow itself: gift box, toast, etc.).
async pollDecisions(): Promise<RedemptionDecision[]> { const snap: CloudCredentialsSnapshot = await this.credentials.load(); if (!snap.isBound() || snap.deviceToken.length === 0) { return []; } const sinceMs: number = await this.readSince(); const basePoll: string = CloudWishlistService.trim...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left pollDecisions AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generi...
async pollDecisions(): Promise<RedemptionDecision[]> { const snap: CloudCredentialsSnapshot = await this.credentials.load(); if (!snap.isBound() || snap.deviceToken.length === 0) { return []; } const sinceMs: number = await this.readSince(); const basePoll: string = CloudWishlistService.trim...
https://github.com/terryma2024/happyword
b2131a9d9747f2caf42433adc99a2ac2971dbc80
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/EnhancedBackupManager.ets
arkts
exportNovelReaderSettings
导出小说阅读器设置
private async exportNovelReaderSettings(): Promise<NovelReaderSettingsBackup[]> { try { const sql = 'SELECT * FROM novel_reader_settings ORDER BY updateTime DESC'; const results = await this.dbManager.querySql(sql); const items: NovelReaderSettingsBackup[] = []; for (const record of resul...
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 exportNovelReaderSettings AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expressi...
private async exportNovelReaderSettings(): Promise<NovelReaderSettingsBackup[]> { try { const sql = 'SELECT * FROM novel_reader_settings ORDER BY updateTime DESC'; const results = await this.dbManager.querySql(sql); const items: NovelReaderSettingsBackup[] = []; for (const record of resul...
https://github.com/DaLongZhuaZi/manxia
4d7e652090a9f0dc46eafba49e7f271b0ec8adbb
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/FinancialHealth.ets
arkts
generateAdvicesFromDimensions
根据维度评分生成理财建议 @param dimensions 维度评分
static generateAdvicesFromDimensions(dimensions: HealthDimensions): FinancialAdvice[] { const advices: FinancialAdvice[] = []; let adviceIndex = 1; // 储蓄率建议 if (dimensions.savingsRate.score < 60) { const expectedImpact: ExpectedImpact = { dimension: '储蓄率', scoreIncrease: 15 ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left generateAdvicesFromDimensions AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left dimensions AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right ...
static generateAdvicesFromDimensions(dimensions: HealthDimensions): FinancialAdvice[] { const advices: FinancialAdvice[] = []; let adviceIndex = 1; // 储蓄率建议 if (dimensions.savingsRate.score < 60) { const expectedImpact: ExpectedImpact = { dimension: '储蓄率', scoreIncrease: 15 ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
c1ec8b1dac031fc84f5b1863083fb1f2ca70e3f3
github
HarmonyOS_Samples/guide-snippets
Ability/UIAbilityLifecycle/entry/src/main/ets/entryability/EntryAbility.ets
arkts
onWindowStageWillDestroy
[StartExclude onWindowStageCreate] [StartExclude onWindowStageDestroy]
onWindowStageWillDestroy(windowStage: window.WindowStage): void { // 释放通过windowStage对象获取的资源 // 在onWindowStageWillDestroy()中注销WindowStage事件订阅(获焦/失焦、切到前台/切到后台、前台可交互/前台不可交互) try { if (this.windowStage) { this.windowStage.off('windowStageEvent'); } } catch (err) { let code = (err...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onWindowStageWillDestroy 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#identifier#Left window AST#id...
onWindowStageWillDestroy(windowStage: window.WindowStage): void { // 释放通过windowStage对象获取的资源 // 在onWindowStageWillDestroy()中注销WindowStage事件订阅(获焦/失焦、切到前台/切到后台、前台可交互/前台不可交互) try { if (this.windowStage) { this.windowStage.off('windowStageEvent'); } } catch (err) { let code = (err...
https://gitcode.com/HarmonyOS_Samples/guide-snippets
50ae479ab613e836a677a1b14ce47d305bb89383
gitcode
AlkaidLab/moonlight-harmony
entry/src/main/ets/utils/BackgroundImageUtil.ets
arkts
downloadImage
下载图片数据 @param url 图片 URL @returns 图片二进制数据
private async downloadImage(url: string): Promise<ArrayBuffer | null> { try { // 处理 URL,移除可能的时间戳参数以获取稳定的图片 let cleanUrl = url; let redirectCount = 0; const maxRedirects = 5; // 循环处理重定向 while (redirectCount < maxRedirects) { const httpRequest = http.createHttp(); ...
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 downloadImage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : A...
private async downloadImage(url: string): Promise<ArrayBuffer | null> { try { // 处理 URL,移除可能的时间戳参数以获取稳定的图片 let cleanUrl = url; let redirectCount = 0; const maxRedirects = 5; // 循环处理重定向 while (redirectCount < maxRedirects) { const httpRequest = http.createHttp(); ...
https://github.com/AlkaidLab/moonlight-harmony
b773840321a7fa267c65ea8dba728d1a1d6c3954
github
yangyongzhen/hmmovie
entry/src/main/ets/pages/home/Home.ets
arkts
pushData
在列表末尾添加数据并通知监听器
pushData(data: T): void { this.dataArray.push(data); this.notifyDataAdd(this.dataArray.length - 1); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left pushData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left data AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right AST#ERROR#Right AST#)#Left ) AST#)#Right...
pushData(data: T): void { this.dataArray.push(data); this.notifyDataAdd(this.dataArray.length - 1); }
https://github.com/yangyongzhen/hmmovie
6f8e00b785d8a27790b53d6e3025680e1496ede7
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewAuthManager.ets
arkts
saveCredentials
保存用户名与密码(不直接登录,供工作流或页面使用)
async saveCredentials(sourceId: number, username: string, password: string): Promise<void> { await this.dataManager.saveSourceCredentials(sourceId, username, password); logger.info(TAG, `已保存图源凭据: sourceId=${sourceId}`); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveCredentials 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#Left AST#:#Le...
async saveCredentials(sourceId: number, username: string, password: string): Promise<void> { await this.dataManager.saveSourceCredentials(sourceId, username, password); logger.info(TAG, `已保存图源凭据: sourceId=${sourceId}`); }
https://github.com/DaLongZhuaZi/manxia
e24f5b491394e2d3d51389188273d01f33369c85
github
erosTeam/NextE
shared/src/main/ets/settings/SearchHistorySettings.ets
arkts
remove
Remove one query from history, preserving the rest in order.
static async remove(context: common.UIAbilityContext, query: string): Promise<void> { const q: string = query.trim() if (q.length === 0) { return } const next: string[] = [] connectSearchHistory().items.forEach((item: string) => { if (item !== q && next.length < MAX_HISTORY) { ...
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 remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#R...
static async remove(context: common.UIAbilityContext, query: string): Promise<void> { const q: string = query.trim() if (q.length === 0) { return } const next: string[] = [] connectSearchHistory().items.forEach((item: string) => { if (item !== q && next.length < MAX_HISTORY) { ...
https://github.com/erosTeam/NextE
86fa1f4cc4fe022b6ff76550cecc23334bbedee9
github
LJ666-ui/harmony-health-care
entry/src/main/ets/core/PermissionManager.ets
arkts
canViewPatientInfo
检查是否可以查看患者信息
public canViewPatientInfo(patientRoomId: string): boolean { if (!this.currentUser) { console.warn('PermissionManager: No current user'); return false; } const role = this.currentUser.role; // 护士长可以查看所有患者信息 if (role === UserRole.HEAD_NURSE) { return true; } // 护士只能查看负责房...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left canViewPatientInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left patientRoomId AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string A...
public canViewPatientInfo(patientRoomId: string): boolean { if (!this.currentUser) { console.warn('PermissionManager: No current user'); return false; } const role = this.currentUser.role; // 护士长可以查看所有患者信息 if (role === UserRole.HEAD_NURSE) { return true; } // 护士只能查看负责房...
https://github.com/LJ666-ui/harmony-health-care
4189b20eef86fc2d47cfd86b42069c9b27a5c649
github
HarmonyOS_Samples/guide-snippets
ArkTS/ArkTSCompilationToolchain/ArkBytecode/FundamentalsAndNamingConventions/entry/src/main/ets/pages/Index.ets
arkts
<arrow>
原函数名为"foo"
() => { }; // 原函数名为""
AST#program#Left AST#expression_statement#Left AST#arrow_function#Left AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#=>#Left => AST#=>#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#}#Left } AST#}#Right AST#statement_block#Right AST#arrow_funct...
() => { }; // 原函数名为""
https://gitcode.com/HarmonyOS_Samples/guide-snippets
d7c45694086281b3f969040685b2b65bc38e8a9b
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/MangaSourceActionEngine.ets
arkts
executeInput
执行输入操作
private async executeInput(action: InputAction, context: ActionContext): Promise<boolean> { const selector = this.replaceVariables(action.selector, context.variables); const value = this.replaceVariables(action.value, context.variables); logger.info(TAG, `输入文本: ${selector} = ${value}`); const exists ...
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 executeInput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left :...
private async executeInput(action: InputAction, context: ActionContext): Promise<boolean> { const selector = this.replaceVariables(action.selector, context.variables); const value = this.replaceVariables(action.value, context.variables); logger.info(TAG, `输入文本: ${selector} = ${value}`); const exists ...
https://github.com/DaLongZhuaZi/manxia
f4fe396c4f1602c06514e924243336cb3a7a007b
github
751496032/ZRouter
RouterApi/src/main/ets/api/Router.ets
arkts
animateMgr
获取动画管理类 @returns
public static animateMgr(): NavAnimationMgr { return ZRouter.getRouterMgr().animateMgr }
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 animateMgr AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le...
public static animateMgr(): NavAnimationMgr { return ZRouter.getRouterMgr().animateMgr }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/api/Router.ets#L218-L220
f7f77c80fe52989a33bb438ee00db0951969c88f
github
codelably/tuniao-ui
packages/main/src/main/ets/viewmodel/TnFormViewModel.ets
arkts
deleteSubject
删除学科 @param index 索引
deleteSubject(index: number): void { this.dynamicForm.subjects.splice(index, 1); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteSubject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) ...
deleteSubject(index: number): void { this.dynamicForm.subjects.splice(index, 1); }
https://github.com/codelably/tuniao-ui
12595d7aa27ff37aea3f9cf0e686154a19c6f6d4
github
openharmony/update_update_app
feature/ota/src/main/ets/manager/OtaUpdateManager.ets
arkts
getNewVersion
从due数据库取新版本信息 @return resolve 新版本信息/reject 错误信息
async getNewVersion(): Promise<UpgradeData<update.NewVersionInfo>> { return new Promise((resolve, reject) => { this.updateManager.getNewVersion().then((result: UpgradeData<update.NewVersionInfo>) => { if (result?.callResult === UpgradeCallResult.OK) { globalThis.cachedNewVersionInfo = resu...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getNewVersion AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#generi...
async getNewVersion(): Promise<UpgradeData<update.NewVersionInfo>> { return new Promise((resolve, reject) => { this.updateManager.getNewVersion().then((result: UpgradeData<update.NewVersionInfo>) => { if (result?.callResult === UpgradeCallResult.OK) { globalThis.cachedNewVersionInfo = resu...
https://gitee.com/openharmony/update_update_app.git
83e1e77b36f9963e492d1037f96ccc516dca540c
gitee
erosTeam/NextE
shared/src/main/ets/settings/ThemeSettings.ets
arkts
apply
Push the override into the framework + refresh the reactive signal. light/dark force the app colorMode; system clears it (NOT_SET → follow device).
static apply(context: common.UIAbilityContext, mode: string): void { const normalized: string = ThemeSettings.normalize(mode) let target: ConfigurationConstant.ColorMode = ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET if (normalized === ThemeSettings.MODE_DARK) { target = ConfigurationConstant....
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left apply AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#...
static apply(context: common.UIAbilityContext, mode: string): void { const normalized: string = ThemeSettings.normalize(mode) let target: ConfigurationConstant.ColorMode = ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET if (normalized === ThemeSettings.MODE_DARK) { target = ConfigurationConstant....
https://github.com/erosTeam/NextE
4f549072472f4fedc557f653c5c1314cba1bd944
github
harmonyos/codelabs
HarmonyOS_NEXT/TargetManagement/entry/src/main/ets/viewmodel/DataModel.ets
arkts
deleteData
Delete the selected data. @param selectArr: An array indicating whether historical data is selected.
deleteData(selectArr: Array<boolean>) { if (!selectArr) { Logger.error(TAG, 'Failed to delete data because selectArr is ' + selectArr); } let dataLen = this.targetData.length - CommonConstants.ONE_TASK; for (let i = dataLen; i >= 0; i--) { if (selectArr[i]) { this.targetData.splice...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left deleteData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#instantiation_expression#Left AST#identifier#Left selectArr AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left Array A...
deleteData(selectArr: Array<boolean>) { if (!selectArr) { Logger.error(TAG, 'Failed to delete data because selectArr is ' + selectArr); } let dataLen = this.targetData.length - CommonConstants.ONE_TASK; for (let i = dataLen; i >= 0; i--) { if (selectArr[i]) { this.targetData.splice...
https://gitee.com/harmonyos/codelabs.git
1354e3861371233a7462d9e89ba39856bc87ace6
gitee
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/calculator/UnitSunshineCalculator.ets
arkts
calculateUnitSunshineOptimized
优化的单元日照计算(使用预先计算的遮挡建筑和距离)
calculateUnitSunshineOptimized( buildings: BuildingModel[], targetBuilding: BuildingModel, blockingBuilding: BuildingModel, distance: number, latitude: number, longitude: number, year: number, timeZone: number, floor: number, unitIndex: number ): UnitSunshineData { const ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left calculateUnitSunshineOptimized 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#subscript_expression#Left AST#identi...
calculateUnitSunshineOptimized( buildings: BuildingModel[], targetBuilding: BuildingModel, blockingBuilding: BuildingModel, distance: number, latitude: number, longitude: number, year: number, timeZone: number, floor: number, unitIndex: number ): UnitSunshineData { const ...
https://github.com/qiuhaotc/Sunshine_HarmonyOS
3fd5170655c942987079be54d22ab3a0d9147a70
github
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/ThemeUtil.ets
arkts
getCurrentThemeConfig
获取当前主题配置
static getCurrentThemeConfig(): ThemeConfig { if (ThemeUtil.currentTheme === ThemeType.AUTO) { // 根据系统主题返回对应配置 return ThemeUtil.isDarkMode() ? ThemeUtil.DARK_THEME : ThemeUtil.LIGHT_THEME; } return ThemeUtil.currentTheme === ThemeType.DARK ? ThemeUtil.DARK_THEME : ThemeUtil.LIGHT_THEME; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCurrentThemeConfig 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 ...
static getCurrentThemeConfig(): ThemeConfig { if (ThemeUtil.currentTheme === ThemeType.AUTO) { // 根据系统主题返回对应配置 return ThemeUtil.isDarkMode() ? ThemeUtil.DARK_THEME : ThemeUtil.LIGHT_THEME; } return ThemeUtil.currentTheme === ThemeType.DARK ? ThemeUtil.DARK_THEME : ThemeUtil.LIGHT_THEME; }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
7d7b9550be6f8276fea5fccd5c62f1fd4326f87a
github
openharmony-tpc/openharmony_tpc_samples
OhosVideoCache/library/src/main/ets/HttpProxyCacheServer.ets
arkts
isCached
Checks is cache contains fully cached file for particular url. @param url an url cache file will be checked for. @return {@code true} if cache contains fully cached file for passed in parameters url.
public isCached(url: string): boolean { Preconditions.checkNotNull(url, "Url can't be null!"); return fs.accessSync(this.getCacheFile(url)) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isCached AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left url AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A...
public isCached(url: string): boolean { Preconditions.checkNotNull(url, "Url can't be null!"); return fs.accessSync(this.getCacheFile(url)) }
https://gitee.com/openharmony-tpc/openharmony_tpc_samples.git
c21e24c873209056ca70f71bf1499fc493ff2731
gitee
aimilin6688/KeePassHO
entry/src/main/ets/common/oauth2/OAuth2TokenStorageService.ets
arkts
saveToken
保存OAuth2令牌 @param token 令牌信息 @param config 存储配置
public async saveToken(token: OAuth2Token, config: OAuth2TokenStorageConfig): Promise<void> { this.init(); if (!this.preferences) { throw new Error('OAuth2TokenStorageService not initialized'); } try { // 生成令牌键名 const tokenKey = config.tokenKey || this.getDefaultTokenKey(config.prov...
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 saveToken AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left token AST#identifier#Right AST#:#Left : AST#:#...
public async saveToken(token: OAuth2Token, config: OAuth2TokenStorageConfig): Promise<void> { this.init(); if (!this.preferences) { throw new Error('OAuth2TokenStorageService not initialized'); } try { // 生成令牌键名 const tokenKey = config.tokenKey || this.getDefaultTokenKey(config.prov...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/oauth2/OAuth2TokenStorageService.ets#L73-L110
59cc6d8960493570c6142f366c3f4ac9b21ee89f
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
from
Creates an array from an array-like object. @param { ArrayLike<T> } arrayLike - An array-like object to convert to an array. @param { function } mapfn - A mapping function to call on every element of the array. @returns { Uint8Array } - A new Uint8Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number): Uint8Array { let res = new Uint8Array(arrayLike.length) // NOTE (ikorobkov): Please don't replace idx as int[1] with int-variable, because of value of single variable doesn't change (idx++) into lambda call by unknow...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#from#Left from AST#from#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identif...
public static from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number): Uint8Array { let res = new Uint8Array(arrayLike.length) // NOTE (ikorobkov): Please don't replace idx as int[1] with int-variable, because of value of single variable doesn't change (idx++) into lambda call by unknow...
https://gitcode.com/iop123123/arkts-static-skills
a7ccc20593e13021875c40cb5539ce36e1241308
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/ReflectInternals.ets
arkts
identity_cast
Performs identity conversion, directly returns the input array-like object. @static @param { ArrayLike<T> } array The array-like object to be converted. @returns { ArrayLike<T> } The same array-like object as the input. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static identity_cast<T>(array: ArrayLike<T>): ArrayLike<T> { return array }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#binary_expression#Left AST#identifier#Left identity_cast AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Rig...
public static identity_cast<T>(array: ArrayLike<T>): ArrayLike<T> { return array }
https://gitcode.com/iop123123/arkts-static-skills
54ce52c0825dc6ed2f711e3ea5905c74792b5d02
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/JArrayList.ets
arkts
toArray
显示当前列表的元素
toArray(a?: T[]): T[] { if (a == undefined || a == null) { return this.dataSource } if (a.length < this.length()) { return new Array<T>(); } return a; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toArray AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left a AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#L...
toArray(a?: T[]): T[] { if (a == undefined || a == null) { return this.dataSource } if (a.length < this.length()) { return new Array<T>(); } return a; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
43531e00e55d6379f3777fbfcf4faff017fe4153
gitee
jjjjjjava/ffmpeg_tools
src/main/ets/ffmpeg/FFmpegCommandBuilder.ets
arkts
hwDecode
启用硬件解码
public hwDecode(): FFmpegCommandBuilder { this.useHwDecode = true; return this; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hwDecode 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 FFmpegCommand...
public hwDecode(): FFmpegCommandBuilder { this.useHwDecode = true; return this; }
https://github.com/jjjjjjava/ffmpeg_tools
6e1e1affe78713323dcda1100baeba30b0c60396
github
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test17_original_index.ets
arkts
findFirstNegative
--- Countdown loop with early return ---
function findFirstNegative(arr: number[]): number { for (let i: number = 0; i < arr.length; i++) { if (arr[i] < 0) { return i; } } return -1; }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left findFirstNegative AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:...
function findFirstNegative(arr: number[]): number { for (let i: number = 0; i < arr.length; i++) { if (arr[i] < 0) { return i; } } return -1; }
https://github.com/miaochiahao/ark-ghidra
303417a3920366ab6842dbe318541ea803347c6e
github
openharmony/codelabs
ETSUI/PositioningDemo/entry/src/main/ets/service/ReminderService.ets
arkts
getSettings
获取提醒设置
getSettings(): ReminderSettings { return this.settings; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getSettings 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 ReminderSettings AST#identifier#Right AST#ERROR#Ri...
getSettings(): ReminderSettings { return this.settings; }
https://gitcode.com/openharmony/codelabs
5eff6f24b9d10d63386f6395e17bef351947fc32
gitcode
openharmony-sig/shimmer-ohos
library/src/main/ets/components/MainPage/Shimmer.ets
arkts
setShape
Sets the shape of the shimmer. See {@link Shape}.
setShape(shape: number): Shimmer { this.shape = shape return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setShape AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left shape AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)...
setShape(shape: number): Shimmer { this.shape = shape return this }
https://gitee.com/openharmony-sig/shimmer-ohos.git
67848701ad1a25257e5d61b0f7238034b90946b9
gitee
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/utils/AudioManager.ets
arkts
setPlayMode
设置播放模式 @param mode 播放模式
setPlayMode(mode: PlayMode): void { this.playMode = mode; this.isLoop = mode === PlayMode.SINGLE || mode === PlayMode.LOOP; this.isRandom = mode === PlayMode.RANDOM; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setPlayMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left PlayMode AST#identifier#Right AST#)#Left ) A...
setPlayMode(mode: PlayMode): void { this.playMode = mode; this.isLoop = mode === PlayMode.SINGLE || mode === PlayMode.LOOP; this.isRandom = mode === PlayMode.RANDOM; }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
c8c55ae64a6637da641c80887c16e7236f83f9d0
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebDAV/WebDAVClient.ets
arkts
getFullPath
兼容旧方法
private getFullPath(relativePath: string): string { return this.getFullUrl(relativePath); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getFullPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left relativePath AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
private getFullPath(relativePath: string): string { return this.getFullUrl(relativePath); }
https://github.com/DaLongZhuaZi/manxia
757879b6994d6cb1c7ea4958dbbea932911ff7aa
github
openharmony/applications_dlp_manager
entry/src/main/ets/OpenDlpFile/manager/OpeningDialogManager.ets
arkts
loadOpeningDialog
根据文件打包类型,文件大小判断是否拉起弹框
public async loadOpeningDialog(context: common.ServiceExtensionContext, fileSize: number, openDlpFileData: OpenDlpFileData, state: DecryptState, parseType?: FileParseType): Promise<void> { HiLog.info(TAG, `OpeningDialogManager loadOpeningDialog fileSize: ${fileSize} parseType: ${parseType}`); if ((parseTy...
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 loadOpeningDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Lef...
public async loadOpeningDialog(context: common.ServiceExtensionContext, fileSize: number, openDlpFileData: OpenDlpFileData, state: DecryptState, parseType?: FileParseType): Promise<void> { HiLog.info(TAG, `OpeningDialogManager loadOpeningDialog fileSize: ${fileSize} parseType: ${parseType}`); if ((parseTy...
https://gitee.com/openharmony/applications_dlp_manager.git
f515e0dbaacbb5900f49c970c40819e8e6f30fc1
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewMangaLoader.ets
arkts
loadPagesWithConcurrency
并发加载页面
private loadPagesWithConcurrency( chapter: ChapterInfoDatabaseRecord, pageUrls: string[], config: ChapterLoadConfig ): PageInfoDatabaseRecord[] { const results: PageInfoDatabaseRecord[] = []; const loadPage = (url: string, index: number): PageInfoDatabaseRecord | null => { try { ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left loadPagesWithConcurrency AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left chapter AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#i...
private loadPagesWithConcurrency( chapter: ChapterInfoDatabaseRecord, pageUrls: string[], config: ChapterLoadConfig ): PageInfoDatabaseRecord[] { const results: PageInfoDatabaseRecord[] = []; const loadPage = (url: string, index: number): PageInfoDatabaseRecord | null => { try { ...
https://github.com/DaLongZhuaZi/manxia
62cd3f591a5d1bb0715f46e37c2d6bb91c1d34ce
github
CLMC2025/Vignette
entry/src/main/ets/algorithm/Algorithm.ets
arkts
minutesToDays
Convert minutes to days (fraction)
private minutesToDays(minutes: number): number { return minutes / (24 * 60); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left minutesToDays AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left minutes AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#numbe...
private minutesToDays(minutes: number): number { return minutes / (24 * 60); }
https://github.com/CLMC2025/Vignette
9b395e0b771462fb244c0a32189d44c1acc38d44
github
openharmony/applications_notes
common/utils/src/main/ets/default/model/databaseModel/FolderData.ets
arkts
toFolderObject
转化为folder_table表的valueBucket
toFolderObject(): relationalStore.ValuesBucket { return { "name": this.name, "uuid": this.uuid, "color": this.color, "folder_type": this.folder_type, "is_deleted": this.is_deleted, "created_time": this.created_time, "modified_time": this.modified_time } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toFolderObject 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#member_expression#Left AST#identifier#Left relationalStore AST#...
toFolderObject(): relationalStore.ValuesBucket { return { "name": this.name, "uuid": this.uuid, "color": this.color, "folder_type": this.folder_type, "is_deleted": this.is_deleted, "created_time": this.created_time, "modified_time": this.modified_time } }
https://gitee.com/openharmony/applications_notes.git
22ef8bcee7e5725425649b80e85a97601ae6c795
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/model/SmartCategory.ets
arkts
learnFromBill
从历史账单学习并创建关键词映射
static learnFromBill( bill: Bill, category: Category, userId: number, existingKeywords: CategoryKeyword[] ): CategoryKeyword[] { const newKeywords: CategoryKeyword[] = []; const noteKeywords = SmartCategoryUtils.extractKeywords(bill.note); const now = new Date().toISOString(); for (...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left learnFromBill AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left bill AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Bi...
static learnFromBill( bill: Bill, category: Category, userId: number, existingKeywords: CategoryKeyword[] ): CategoryKeyword[] { const newKeywords: CategoryKeyword[] = []; const noteKeywords = SmartCategoryUtils.extractKeywords(bill.note); const now = new Date().toISOString(); for (...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
7e65e11de8419373702cf43752002805cd790cf6
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
copyWithin
Makes a copy of internal elements to targetPos from begin to end of Int16Array. See rules of parameters normalization on {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin | MDN} @param { int } target - insert index to place copied elements @returns { Int16Array } @...
public copyWithin(target: int): Int16Array { this.copyWithinImpl(target, 0, this.lengthInt) return this }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left copyWithin AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left target AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#...
public copyWithin(target: int): Int16Array { this.copyWithinImpl(target, 0, this.lengthInt) return this }
https://gitcode.com/iop123123/arkts-static-skills
b82870dbd605bb17391f43d95e4b54fc36830569
gitcode