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
aimilin6688/KeePassHO
entry/src/main/ets/storage/FileStorageFactory.ets
arkts
hasStorage
检查指定类型的存储是否已注册 @param type 存储类型 @return boolean 是否已注册
public hasStorage(type: StorageType): boolean { return this.storageMap.has(type); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left hasStorage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Stora...
public hasStorage(type: StorageType): boolean { return this.storageMap.has(type); }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/storage/FileStorageFactory.ets#L77-L79
f573f410103f3a078eda75b918c3c0d37e4b7fbf
github
darcycui/DarcyHarmonyNext
entry/src/main/ets/abilitystage/EntryAbilityStage.ets
arkts
onAcceptWant
specified UIAbility 触发 @param want @returns 返回指定UiAbility的tag
onAcceptWant(want: Want): string { Log.log(`${this.TAG} onAcceptWant want=${JSON.stringify(want)}`) return "" }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onAcceptWant AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#)#Left ) AST#...
onAcceptWant(want: Want): string { Log.log(`${this.TAG} onAcceptWant want=${JSON.stringify(want)}`) return "" }
https://github.com/darcycui/DarcyHarmonyNext/blob/241d0ee75929f6b3f9e1fe5b550acf6c9533c15c/entry/src/main/ets/abilitystage/EntryAbilityStage.ets#L19-L22
a2c77ed1b3d1ea2c3bfb90e16e7a4450277ed0f7
github
openharmony/communication_wifi
wifi/application/wifi_direct_demo/entry/src/main/ets/MainAbility/common/StorageUtil.ets
arkts
delObjData
删除指定键数据
delObjData(key) { LogUtil.info('delObjData key == ' + key); mPreferences.delete(key); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left delObjData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left key AST#identifier#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#;#Left AST#;#Right AST#expressio...
delObjData(key) { LogUtil.info('delObjData key == ' + key); mPreferences.delete(key); }
https://gitee.com/openharmony/communication_wifi.git
c3c6294135e6aa2d36db242064c189b2686e0220
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
from
Creates an array from an object of std.core.Array<int>. @param { Array<int> } arr - An instance of the std.core.Array type to convert to an array. @returns { Int8Array } - A new Int8Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arr: Array<int>): Int8Array { let result = new Int8Array(arr.length) result.set(arr) return result }
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: Array<int>): Int8Array { let result = new Int8Array(arr.length) result.set(arr) return result }
https://gitcode.com/iop123123/arkts-static-skills
baf687f946cc8977e9eac4fea2240599da3d2a07
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BigInt.ets
arkts
$_invoke
Creates a new instance of BigInt from boolean @param { boolean } value boolean value @returns { BigInt } A new BigInt instance from boolean @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
static $_invoke(value: boolean): BigInt { return new BigInt(value) }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left $_invoke AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left boolea...
static $_invoke(value: boolean): BigInt { return new BigInt(value) }
https://gitcode.com/iop123123/arkts-static-skills
a4a8fa0515de44de13391d205afbe6c0277e9ff8
gitcode
itrainhub/wu-ui
WuUI/wu_ui/src/main/ets/components/image/types.ets
arkts
stash
保存本次缩放因子以备后用(以备下次捏合手势触发使用)
stash(): void { this.pinchValue = this.scaleValue }
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 { this.pinchValue = this.scaleValue }
https://github.com/itrainhub/wu-ui
6e90717adffcf9e5c1ff41bbe1f993ad6688afe5
github
tdcare/tdwebrtc
src/main/ets/utils/Base64Util.ets
arkts
decode
解码,通过输入参数解码后输出对应Uint8Array对象。 @param array @returns
static decode(array: Uint8Array | string, options?: util.Type): Promise<Uint8Array> { const base64 = new util.Base64Helper(); return base64.decode(array, options); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left decode 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#binary_expression#Left A...
static decode(array: Uint8Array | string, options?: util.Type): Promise<Uint8Array> { const base64 = new util.Base64Helper(); return base64.decode(array, options); }
https://github.com/tdcare/tdwebrtc
61642ad9b3ee5365515b48fd64af94332a9d8be2
github
DaLongZhuaZi/manxia
entry/src/main/ets/Models/EBookModels.ets
arkts
constructor
是否为NSFW内容
constructor( id: string, format: EBookFormat, filePath: string, fileSize: number, metadata: EBookMetadata, chapters: EBookChapter[] = [], status: EBookStatus = EBookStatus.UNREAD, readingProgress: EBookReadingProgress | null = null, readingSettings: EBookReadingSettings | null = nu...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST...
constructor( id: string, format: EBookFormat, filePath: string, fileSize: number, metadata: EBookMetadata, chapters: EBookChapter[] = [], status: EBookStatus = EBookStatus.UNREAD, readingProgress: EBookReadingProgress | null = null, readingSettings: EBookReadingSettings | null = nu...
https://github.com/DaLongZhuaZi/manxia
5c624367da145a2c866d278db3defa065b292062
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
length
Number of byte stored in Int8Array @returns { int } - the number of elements @syscap SystemCapability.Utils.Lang @FaAndStageModel
public get length(): int { return this.lengthInt }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left length AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AS...
public get length(): int { return this.lengthInt }
https://gitcode.com/iop123123/arkts-static-skills
cff42cbeacc42bb1d97fb122903983f09f5da9f5
gitcode
miaochiahao/ark-ghidra
data/test_hap/arkts-decompile-test49_original_index.ets
arkts
testExponent
=== Round 49: Exponent operator **, Array.some complex predicate, string hash function, simple HashMap with linear probing, sequential ternary assignments, nested Record access === --- Exponent operator ** ---
function testExponent(): string { let two: number = 2; let three: number = 3; let pow2_10: number = 1; for (let i: number = 0; i < 10; i++) { pow2_10 = pow2_10 * two; } let cube: number = 1; for (let i: number = 0; i < 3; i++) { cube = cube * three; } let square: number = 7 * 7; return Strin...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left testExponent 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_typ...
function testExponent(): string { let two: number = 2; let three: number = 3; let pow2_10: number = 1; for (let i: number = 0; i < 10; i++) { pow2_10 = pow2_10 * two; } let cube: number = 1; for (let i: number = 0; i < 3; i++) { cube = cube * three; } let square: number = 7 * 7; return Strin...
https://github.com/miaochiahao/ark-ghidra
2b371677310535e6b10c845de96c9db136d6aaeb
github
CLMC2025/Vignette
entry/src/main/ets/manager/UserStateManager.ets
arkts
initializeWordRoots
初始化词根映射
private initializeWordRoots(): void { // 常见的词根映射关系 this.wordRootMap.set('act', ['act', 'action', 'active', 'actor', 'actress']); this.wordRootMap.set('dict', ['dictate', 'dictionary', 'predict', 'contradict']); this.wordRootMap.set('port', ['port', 'import', 'export', 'transport', 'portable']); th...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left initializeWordRoots 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...
private initializeWordRoots(): void { // 常见的词根映射关系 this.wordRootMap.set('act', ['act', 'action', 'active', 'actor', 'actress']); this.wordRootMap.set('dict', ['dictate', 'dictionary', 'predict', 'contradict']); this.wordRootMap.set('port', ['port', 'import', 'export', 'transport', 'portable']); th...
https://github.com/CLMC2025/Vignette
d3e85fcff437810e8035338150faab16f1896251
github
HarmonyOS_Samples/MusicHome
common/musicbasic/src/main/ets/util/StringResourceUtil.ets
arkts
resolve
Returns the string as-is when already plain; otherwise loads sync from resource manager. @param context UIAbility context for resource manager. @param value Plain string or string resource reference. @returns Resolved text, or empty string on failure.
public static resolve(context: common.UIAbilityContext, value: string | Resource): string { if (typeof value === 'string') { return value; } try { return context.resourceManager.getStringSync(value.id); } catch (error) { Logger.error(TAG, `resolve failed: ${(error as Error).message ?...
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 resolve AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:...
public static resolve(context: common.UIAbilityContext, value: string | Resource): string { if (typeof value === 'string') { return value; } try { return context.resourceManager.getStringSync(value.id); } catch (error) { Logger.error(TAG, `resolve failed: ${(error as Error).message ?...
https://gitcode.com/HarmonyOS_Samples/MusicHome
67ddbee334b41afb2a641822002cbd2290ae1733
gitcode
LJ666-ui/harmony-health-care
entry/src/main/ets/ancientimage/AncientOCRService.ets
arkts
addMedicalTerms
批量添加医学术语 @param terms 术语列表
addMedicalTerms(terms: string[]): void { for (let i = 0; i < terms.length; i++) { this.medicalTerms.add(terms[i]); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addMedicalTerms AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left terms AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_expression#Left AST#identifier#Left string AS...
addMedicalTerms(terms: string[]): void { for (let i = 0; i < terms.length; i++) { this.medicalTerms.add(terms[i]); } }
https://github.com/LJ666-ui/harmony-health-care
864b939cfbe2e4715ada38d0f7f488ce40f415ca
github
terryma2024/happyword
harmonyos/entry/src/main/ets/services/DeviceBindingService.ets
arkts
redeemShortCode
Redeem a manually-typed 6-digit short code (no scan).
async redeemShortCode(code: string): Promise<void> { if (code.length !== 6) { this.fail('TOKEN_INVALID'); return; } this.transition('scanning'); await this.redeem('', code); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left async AST#identifier#Right AST#ERROR#Left AST#identifier#Left redeemShortCode AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left code AST#identifier#Right AST...
async redeemShortCode(code: string): Promise<void> { if (code.length !== 6) { this.fail('TOKEN_INVALID'); return; } this.transition('scanning'); await this.redeem('', code); }
https://github.com/terryma2024/happyword
3e49b6ff7924a47f2aa2ff643529b11a0954b203
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelReplaceRuleManager.ets
arkts
loadDefaultRules
加载默认替换净化规则
private async loadDefaultRules(): Promise<void> { // 使用函数逐个添加规则,避免ArkTS数组字面量类型推断问题 const addDefaultRule = async (name: string, pattern: string, replacement: string, isRegex: boolean, scope: ReplaceScope, enabled: boolean, order: number): Promise<void> => { const params: AddRuleParams = { name: n...
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 loadDefaultRules AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right ...
private async loadDefaultRules(): Promise<void> { // 使用函数逐个添加规则,避免ArkTS数组字面量类型推断问题 const addDefaultRule = async (name: string, pattern: string, replacement: string, isRegex: boolean, scope: ReplaceScope, enabled: boolean, order: number): Promise<void> => { const params: AddRuleParams = { name: n...
https://github.com/DaLongZhuaZi/manxia
2d50072e7470c944a9a31f9c86df23c2943700fd
github
offlinecat-dev/OCNetORM
src/main/ets/core/MetadataStorage.ets
arkts
getRelation
根据属性名获取特定的关联关系 @param entityName 实体名称 @param propertyName 属性名 @returns 关联关系元数据,如果不存在返回 null
getRelation(entityName: string, propertyName: string): RelationMetadata | null { const entityRelations = this.relations.get(entityName) if (!entityRelations) { return null } for (let i = 0; i < entityRelations.length; i++) { const relation = entityRelations[i] if (relation.propertyNa...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getRelation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#strin...
getRelation(entityName: string, propertyName: string): RelationMetadata | null { const entityRelations = this.relations.get(entityName) if (!entityRelations) { return null } for (let i = 0; i < entityRelations.length; i++) { const relation = entityRelations[i] if (relation.propertyNa...
https://github.com/offlinecat-dev/OCNetORM
cae671c0977d75a71da8cef858791a020cc859eb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
at
Returns an instance of primitive type at passed index. @param { int } index - index to look at @returns { Number | undefined } - a primitive at index @syscap SystemCapability.Utils.Lang @FaAndStageModel
public at(index: int): Number | undefined { let k: int if (index >= 0) { k = index } else { k = this.lengthInt + index } if (k < 0 || k >= this.lengthInt) { return undefined } return new Number(this.getUnsafe(k)) }
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left at AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left index AST#identifier#Right AST#ERR...
public at(index: int): Number | undefined { let k: int if (index >= 0) { k = index } else { k = this.lengthInt + index } if (k < 0 || k >= this.lengthInt) { return undefined } return new Number(this.getUnsafe(k)) }
https://gitcode.com/iop123123/arkts-static-skills
6a6c9b911b7d908cb2ccbd57144fbbb984b159bc
gitcode
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.TreeSet.ets
arkts
getLastValue
Return the value of the last element in the TreeSet @returns the value of the last element if exists
getLastValue(): T { return this.treeMap.getLastKey(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getLastValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right AST#ERROR#Right AST#statem...
getLastValue(): T { return this.treeMap.getLastKey(); }
https://gitcode.com/iop123123/arkts-static-skills
9ad58baa02be07083893f596b680d2176cf5d364
gitcode
offlinecat-dev/OCNetORM
src/main/ets/query/AggregateResult.ets
arkts
addRow
添加结果行 @param row 聚合结果行
addRow(row: AggregateRow): void { this.rows.push(row) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addRow AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left row AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left AggregateRow AST#identifier#Right AST#)#Left ) AST...
addRow(row: AggregateRow): void { this.rows.push(row) }
https://github.com/offlinecat-dev/OCNetORM
ca3cc435b2a975009116c26b06543412230838fc
github
LZZLHY/hlib
entry/src/main/ets/utils/Redact.ets
arkts
cookie
脱敏 cookie 串(name=value; name2=value2):所有值一律打码(cookie 默认敏感)。
static cookie(input: string): string { if (input.length === 0) { return input; } const parts: string[] = input.split(';'); const out: string[] = []; for (let i = 0; i < parts.length; i++) { const seg: string = parts[i].trim(); if (seg.length === 0) { continue; } ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left cookie AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left input AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string A...
static cookie(input: string): string { if (input.length === 0) { return input; } const parts: string[] = input.split(';'); const out: string[] = []; for (let i = 0; i < parts.length; i++) { const seg: string = parts[i].trim(); if (seg.length === 0) { continue; } ...
https://github.com/LZZLHY/hlib
14d9cdfea66ce7962b1973ff4469185ba5a46c75
github
HarmonyOS_Samples/BestPracticeSnippets
ArkUI/StateManagement/entry/src/main/ets/segment/segment5.ets
arkts
appendMsg
Define methods for changing state variables (intermediate variables are manipulated during method execution, state variables are modified only once)
appendMsg(newMsg: string) { let message = this.message; message += newMsg; message += ';'; message += '<br/>'; this.message = message; }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left appendMsg AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left newMsg AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right A...
appendMsg(newMsg: string) { let message = this.message; message += newMsg; message += ';'; message += '<br/>'; this.message = message; }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
7f3b4874afe04e07adebc6547586298a53bb6d4c
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/ChartModel.ets
arkts
isEmpty
Returns true if the chart is empty (meaning it's data object is either null or contains no entries). @return
public isEmpty(): boolean { if (this.mData == null) return true; else { if (this.mData.getEntryCount() <= 0) return true; else return false; } }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isEmpty 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#boole...
public isEmpty(): boolean { if (this.mData == null) return true; else { if (this.mData.getEntryCount() <= 0) return true; else return false; } }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
22d13cd70e5d9943e2fb12f7e604b28b5df07808
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Parsers/TxtMetadataExtractor.ets
arkts
extractTitle
提取标题(增强版,支持多种格式)
private static extractTitle(headerText: string, fileName: string): string { // 清理头部文本(移除广告等) const cleanedHeader = TxtMetadataExtractor.cleanHeaderText(headerText); // 1. 尝试从内容中提取书名号格式 for (const pattern of TxtMetadataExtractor.TITLE_PATTERNS) { const match = cleanedHeader.match(pattern); ...
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 extractTitle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left headerText AST#identifier#Right AST#ERROR#Left AST#:#L...
private static extractTitle(headerText: string, fileName: string): string { // 清理头部文本(移除广告等) const cleanedHeader = TxtMetadataExtractor.cleanHeaderText(headerText); // 1. 尝试从内容中提取书名号格式 for (const pattern of TxtMetadataExtractor.TITLE_PATTERNS) { const match = cleanedHeader.match(pattern); ...
https://github.com/DaLongZhuaZi/manxia
c9f9e6ed1d214d1ccf4485947228312da84cdc5b
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/usbdriver/SwitchProController.ets
arkts
setInputReportMode
设置输入报告模式
private async setInputReportMode(mode: number): Promise<boolean> { const result = await this.sendSubcommand(0x03, new Uint8Array([mode])); return result !== null; }
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 setInputReportMode AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Le...
private async setInputReportMode(mode: number): Promise<boolean> { const result = await this.sendSubcommand(0x03, new Uint8Array([mode])); return result !== null; }
https://github.com/AlkaidLab/moonlight-harmony
b2f9f4dcd3db481a585f75fc1df4bbf73e819433
github
cheinlu/HarmonyOS-groundhog-charging-system
TbsChargeHarmonyOs/common/src/main/ets/utils/StorageUtils.ets
arkts
getStringValueSync
适用于普通函数获取 @param key @param defaultValue @returns string
getStringValueSync(key: string, defaultValue: string) { return this.preferences?.getSync(key, defaultValue) as string }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getStringValueSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left key AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#R...
getStringValueSync(key: string, defaultValue: string) { return this.preferences?.getSync(key, defaultValue) as string }
https://github.com/cheinlu/HarmonyOS-groundhog-charging-system
c27caf2dffbce4235c695401f21185abf95f0184
github
openharmony/codelabs
ETSUI/PositioningDemo/entry/src/main/ets/service/StatisticsService.ets
arkts
calculateActivityDays
计算运动活跃度(最近30天的运动天数)
async calculateActivityDays(days: number = 30): Promise<number> { const records = await this.historyService.getSportRecords(); const now = new Date(); const startDate = new Date(now); startDate.setDate(now.getDate() - days); startDate.setHours(0, 0, 0, 0); const recentRecords = records.filter...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left calculateActivityDays AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left days AST#identifier#Right AST#type_annotation#Left AST#:#...
async calculateActivityDays(days: number = 30): Promise<number> { const records = await this.historyService.getSportRecords(); const now = new Date(); const startDate = new Date(now); startDate.setDate(now.getDate() - days); startDate.setHours(0, 0, 0, 0); const recentRecords = records.filter...
https://gitcode.com/openharmony/codelabs
c10b585fc451f80856a12ddc5a9fe2819703772a
gitcode
killetom/ktretrofit
entry/src/main/ets/example/RetrofitConfigExample.ets
arkts
deleteUserExample
Delete user
deleteUserExample(id: number): void { try { const userService = this.createUserService(); const call = userService.deleteUser(id); call.execute(); console.log('User deleted successfully'); } catch (error) { console.error('Failed to delete user:', error); throw error...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left deleteUserExample AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left id AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left )...
deleteUserExample(id: number): void { try { const userService = this.createUserService(); const call = userService.deleteUser(id); call.execute(); console.log('User deleted successfully'); } catch (error) { console.error('Failed to delete user:', error); throw error...
https://github.com/killetom/ktretrofit
234441960812df2b7ac7e6d5033bc9fa899db324
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/services/network/ApiClient.ets
arkts
updateUserNotificationLevel
更新用户通知级别(ignore/mute/regular 等)
async updateUserNotificationLevel(username: string, level: string, expiringAt: string = ''): Promise<void> { const trimmed: string = username !== undefined && username !== null ? username.trim() : ''; if (trimmed.length === 0) { return; } const path: string = ApiConstants.userNotificationLevel(t...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left updateUserNotificationLevel AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left username AST#identifier#Right AST#type_annotation#L...
async updateUserNotificationLevel(username: string, level: string, expiringAt: string = ''): Promise<void> { const trimmed: string = username !== undefined && username !== null ? username.trim() : ''; if (trimmed.length === 0) { return; } const path: string = ApiConstants.userNotificationLevel(t...
https://github.com/Amaz1ny/HarmonyDO-public
cbae180d89044a62c75c57699a7dab781cd83056
github
openharmony/codelabs
ETSUI/LifeTrack/entry/src/main/ets/pages/DataManager.ets
arkts
saveEvent
保存日程(新增或更新)
async saveEvent(eventData: Partial<CalendarEvent>): Promise<SaveResult> { try { // 验证必填字段 if (!eventData.title || !eventData.title.trim()) { return { success: false, error: '标题不能为空' }; } if (!eventData.startTime || !eventData.endTime) { return { success: false, error: '开始时...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveEvent AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left eventData AST#identifier#Right AST#type_annotation#Left AST#:#Left : ...
async saveEvent(eventData: Partial<CalendarEvent>): Promise<SaveResult> { try { // 验证必填字段 if (!eventData.title || !eventData.title.trim()) { return { success: false, error: '标题不能为空' }; } if (!eventData.startTime || !eventData.endTime) { return { success: false, error: '开始时...
https://gitcode.com/openharmony/codelabs
ed60985254875d84cedfe1a61c32b47fdc012581
gitcode
chendi126/harmonyOS-TCP
entry/src/main/ets/common/GlassStyles.ets
arkts
getMainBackgroundColor
获取主背景色
static getMainBackgroundColor(): string { return GlassColors.PRIMARY_GRADIENT_START; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getMainBackgroundColor 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...
static getMainBackgroundColor(): string { return GlassColors.PRIMARY_GRADIENT_START; }
https://github.com/chendi126/harmonyOS-TCP
b333d58f36d159082d793eba3f9b887f5e3f0456
github
openharmony-sig/applications_calculator
feature/calculation/src/main/ets/calculator/DigitPanelController.ets
arkts
getStandLists
getStandLists @return Array<Array<SimplePhysicsButtonInfo>>
public getStandLists(): Array<Array<SimplePhysicsButtonInfo>> { return this.digitPanelModel.getStandLists(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getStandLists 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#expressi...
public getStandLists(): Array<Array<SimplePhysicsButtonInfo>> { return this.digitPanelModel.getStandLists(); }
https://gitee.com/openharmony-sig/applications_calculator.git
603037e8e110d863498853aa5ae77df4d4bd1a02
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/ScraperManager.ets
arkts
searchByIsbn
按ISBN搜索电子书 @param isbn ISBN号(支持ISBN-10和ISBN-13)
public async searchByIsbn(isbn: string): Promise<MultiSourceSearchResult> { logger.info(TAG, `按ISBN搜索: ${isbn}`); const results = new Map<ScraperSource, ScraperSearchResult>(); const errors = new Map<ScraperSource, string>(); const allResults: ScrapedMetadata[] = []; // 并行搜索所有支持ISBN的源 co...
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 searchByIsbn AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left isbn AST#identifier#Right AST#:#Left : AST#...
public async searchByIsbn(isbn: string): Promise<MultiSourceSearchResult> { logger.info(TAG, `按ISBN搜索: ${isbn}`); const results = new Map<ScraperSource, ScraperSearchResult>(); const errors = new Map<ScraperSource, string>(); const allResults: ScrapedMetadata[] = []; // 并行搜索所有支持ISBN的源 co...
https://github.com/DaLongZhuaZi/manxia
8b41c9b4f5d3a3f0b0ebb02f0edad6d7d9a6d24a
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.List.ets
arkts
partition
Partitions the list for quicksort. @param list The list to partition. @param low The starting index of the partition. @param high The ending index of the partition. @param comparator The function to compare elements. @returns The index of the pivot element.
private partition(low: int, high: int, comparator: (firstValue: T, secondValue: T) => double): int { let compareNode: ListNode<T> = this.getNode(low)! let currentNode: ListNode<T> | undefined = compareNode.next! let pivotNode: ListNode<T> = compareNode let pivotNum: int = low ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left partition AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left low AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left int ...
private partition(low: int, high: int, comparator: (firstValue: T, secondValue: T) => double): int { let compareNode: ListNode<T> = this.getNode(low)! let currentNode: ListNode<T> | undefined = compareNode.next! let pivotNode: ListNode<T> = compareNode let pivotNum: int = low ...
https://gitcode.com/iop123123/arkts-static-skills
24bf3cb30acb85c72484caa841593c6161f4650b
gitcode
Tencent-RTC/TUIKit_Harmony
atomic_x/src/main/ets/messagelist/config/MessageListConfig.ets
arkts
isSupportCopy
Action configuration - disable all actions in merged detail view
get isSupportCopy(): boolean { return false; }
AST#program#Left AST#ERROR#Left AST#get#Left get AST#get#Right AST#call_expression#Left AST#identifier#Left isSupportCopy 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#...
get isSupportCopy(): boolean { return false; }
https://github.com/Tencent-RTC/TUIKit_Harmony
66703533a4635f5485051c1157900e88d0157be6
github
openharmony/multimedia_camera_framework
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/common/utils/DateTimeUtil.ets
arkts
getVideoTime
录制时间定时器 @param millisecond-数据值
getVideoTime(millisecond: number): string { let millisecond2minute = 60000; let millisecond2second = 1000; let minute = Math.floor(millisecond / millisecond2minute); let second = Math.floor((millisecond - minute * millisecond2minute) / millisecond2second); return `${this.fill(minute)} : ${this.fil...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getVideoTime AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left millisecond AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#)#Left ) AST...
getVideoTime(millisecond: number): string { let millisecond2minute = 60000; let millisecond2second = 1000; let minute = Math.floor(millisecond / millisecond2minute); let second = Math.floor((millisecond - minute * millisecond2minute) / millisecond2second); return `${this.fill(minute)} : ${this.fil...
https://gitee.com/openharmony/multimedia_camera_framework.git
495b5c9b67f61e49b0f71b09e1a370ca395ce003
gitee
Cool_foolisher1/ArkTSRepository
GraphicalCode/commons/src/main/ets/manager/PageContextManager.ets
arkts
navPathStack
获取页面栈 @returns NavPathStack
public get navPathStack(): NavPathStack { return this.pathStack }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left navPathStack AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
public get navPathStack(): NavPathStack { return this.pathStack }
https://gitcode.com/Cool_foolisher1/ArkTSRepository
defcdf7b690146ad5fb50a3a827848f89d0aa880
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/ChineseConverter.ets
arkts
convertObject
转换对象中的文本字段
convertObject(obj: Record<string, any>, config: ChineseConversionConfig): Record<string, any> { if (!config.enabled) { return obj; } const result: Record<string, any> = {}; Object.keys(obj).forEach(key => { const value = obj[key]; // 检查是否需要转换此字段 if (config.applyTo.includes(k...
AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left convertObject AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left obj AST#identifier#Right AST#:#Left : AST#:#Right AST#ERRO...
convertObject(obj: Record<string, any>, config: ChineseConversionConfig): Record<string, any> { if (!config.enabled) { return obj; } const result: Record<string, any> = {}; Object.keys(obj).forEach(key => { const value = obj[key]; // 检查是否需要转换此字段 if (config.applyTo.includes(k...
https://github.com/DaLongZhuaZi/manxia
a0ea081355e82b77687c62a1757317830dc857d6
github
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets
arkts
getIsolateServiceId
Returns an identifier for this executor's primary isolate. This identifier can be used in queries to the Dart service protocol.
getIsolateServiceId(): String { return this.isolateServiceId; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getIsolateServiceId 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 String AST#identifier#Right AST#ERROR#Righ...
getIsolateServiceId(): String { return this.isolateServiceId; }
https://gitee.com/openharmony-sig/flutter_engine.git
24a6968956a19d92d72adfbafb24c76fb33991f3
gitee
OHPG/FinSdk
jellyfin/src/main/ets/api/LibraryApi.ets
arkts
getSimilarAlbums
@summary Gets similar items. @param {LibraryApiGetSimilarAlbumsRequest} requestParameters Request parameters. @param {*} [options] Override http request option. @throws {RequiredError} @memberof LibraryApi
public async getSimilarAlbums(requestParameters: LibraryApiGetSimilarAlbumsRequest): Promise<BaseItemDtoQueryResult> { this.assertParam(requestParameters.itemId) return this.apiClient.get({path: `/Albums/${requestParameters.itemId}/Similar`, parameters: requestParameters}) }
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 getSimilarAlbums AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Right ...
public async getSimilarAlbums(requestParameters: LibraryApiGetSimilarAlbumsRequest): Promise<BaseItemDtoQueryResult> { this.assertParam(requestParameters.itemId) return this.apiClient.get({path: `/Albums/${requestParameters.itemId}/Similar`, parameters: requestParameters}) }
https://github.com/OHPG/FinSdk
a0ce78b198a7ea421977f1cfe1b52a3741010575
github
apap6628114/nga_oh
entry/src/main/ets/common/utils/LinkUtils.ets
arkts
isNgaDomain
判断主机名是否属于 NGA 域名
function isNgaDomain(hostname: string): boolean { const lower: string = hostname.toLowerCase() for (let i = 0; i < NGA_DOMAINS.length; i++) { if (lower === NGA_DOMAINS[i] || lower.endsWith('.' + NGA_DOMAINS[i])) { return true } } return false }
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left isNgaDomain AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left hostname AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#...
function isNgaDomain(hostname: string): boolean { const lower: string = hostname.toLowerCase() for (let i = 0; i < NGA_DOMAINS.length; i++) { if (lower === NGA_DOMAINS[i] || lower.endsWith('.' + NGA_DOMAINS[i])) { return true } } return false }
https://github.com/apap6628114/nga_oh/blob/5db5f8174b9a994685dc00fce666367b68c13f78/entry/src/main/ets/common/utils/LinkUtils.ets#L61-L69
437c4d921dfc01e7b9450565ede5eaadfb982956
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Database/DatabaseManager.ets
arkts
getTableAverage
获取表字段平均值(类型安全的聚合查询)
public async getTableAverage(tableName: string, columnName: string): Promise<number> { try { const sql = `SELECT AVG(${columnName}) as avg FROM ${tableName}`; const result = await this.queryAggregation<AvgQueryResult>(sql); if (!result) { logger.warn(TAG, `表 ${tableName} 字段 ${colu...
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 getTableAverage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left tableName AST#identifier#Right AST#ERROR#Left AST#:#Lef...
public async getTableAverage(tableName: string, columnName: string): Promise<number> { try { const sql = `SELECT AVG(${columnName}) as avg FROM ${tableName}`; const result = await this.queryAggregation<AvgQueryResult>(sql); if (!result) { logger.warn(TAG, `表 ${tableName} 字段 ${colu...
https://github.com/DaLongZhuaZi/manxia
3afa6a669585f6ada91570f3510f84d89d1eff18
github
RoooyHe/toona-ohos
toona/src/main/ets/services/MediaManager.ets
arkts
uploadMedia
核心的底层上传方法 (保持你原有的逻辑不变)
async uploadMedia( data: ArrayBuffer, contentType: string, fileName?: string ): Promise<MediaUploadResponse> { try { return await this.ensureHttpClient().uploadMedia(data, contentType, fileName); } catch (error) { this.logger.error('Failed to upload media:', error); const errMs...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left uploadMedia AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST...
async uploadMedia( data: ArrayBuffer, contentType: string, fileName?: string ): Promise<MediaUploadResponse> { try { return await this.ensureHttpClient().uploadMedia(data, contentType, fileName); } catch (error) { this.logger.error('Failed to upload media:', error); const errMs...
https://github.com/RoooyHe/toona-ohos
0423337c715a5a78a1a344dd018b27aef58cbd13
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SharedLedgerDAO.ets
arkts
updateContribution
更新贡献金额和账单数量
static async updateContribution(memberId: number, amount: number, billCount: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); const values: relationalStore.ValuesBucket = { contribution_amount: amount, bill_count: billCount, updated_at: new Date()...
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 updateContribution AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left memberId AST#identifier#Right AST#ERROR#Left AST#:#L...
static async updateContribution(memberId: number, amount: number, billCount: number): Promise<boolean> { try { const store = DatabaseManager.getDatabase(); const values: relationalStore.ValuesBucket = { contribution_amount: amount, bill_count: billCount, updated_at: new Date()...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
81934e2c592e0dc8b8328c71c41dd8bda954b04d
github
tianlongbaobao/idut-HarmonyOS-Next
entry/src/main/ets/pages/utils/permission.ets
arkts
requestCameraPermission
申请相机权限 @returns
static async requestCameraPermission() { let grantStatus = await PermissionsUtil.reqPermissionsFromUser() for (let i = 0; i < grantStatus.length; i++) { if (grantStatus[i] === 0) { return true; } } return false; }
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 requestCameraPermission AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Ri...
static async requestCameraPermission() { let grantStatus = await PermissionsUtil.reqPermissionsFromUser() for (let i = 0; i < grantStatus.length; i++) { if (grantStatus[i] === 0) { return true; } } return false; }
https://github.com/tianlongbaobao/idut-HarmonyOS-Next
68879cdaa372d92541a7a6c8ff0c337155b56d68
github
openharmony-sig/shimmer-ohos
library/src/main/ets/components/MainPage/Shimmer.ets
arkts
setRepeatDelay
Sets how long to wait in between repeats of the shimmering animation.
setRepeatDelay(millis: number): Shimmer { if (millis < 0) { throw new Error("Given a negative repeat delay: " + millis); } this.repeatDelay = millis; return this }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setRepeatDelay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left millis AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ...
setRepeatDelay(millis: number): Shimmer { if (millis < 0) { throw new Error("Given a negative repeat delay: " + millis); } this.repeatDelay = millis; return this }
https://gitee.com/openharmony-sig/shimmer-ohos.git
f69575d7752470c9df816343b8f34759e113ea35
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Float.ets
arkts
isFinite
Checks if the underlying float is a floating point value (not a NaN or infinity) @returns true if the underlying float is a floating point value
public isFinite(): boolean { return Float.isFinite(this.value); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isFinite 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#bool...
public isFinite(): boolean { return Float.isFinite(this.value); }
https://gitcode.com/iop123123/arkts-static-skills
6f50050d05f4fdf91353a41f4150236fd375a204
gitcode
zhubowen-bot/Bowen_ArkWeb_framework
entry/src/main/ets/delegate/IWebDownloadFile.ets
arkts
cleanupDownloadSession
清理下载会话
protected cleanupDownloadSession() { this.webDownloadItem = null this.downloadProgress = 0 }
AST#program#Left AST#ERROR#Left AST#protected#Left protected AST#protected#Right AST#call_expression#Left AST#identifier#Left cleanupDownloadSession AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block...
protected cleanupDownloadSession() { this.webDownloadItem = null this.downloadProgress = 0 }
https://github.com/zhubowen-bot/Bowen_ArkWeb_framework
70f239591739fef6055c045a3466be7d2277d736
github
Xiwei753/xiezuoruanjian
apps/harmony/entry/src/main/ets/pages/StarMapPage.ets
arkts
stablePhase
用 nodeId hash 算稳定 phase
stablePhase(nodeId: string): number { let hash = 0 for (let i = 0; i < nodeId.length; i++) { hash = ((hash << 5) - hash) + nodeId.charCodeAt(i) hash = hash & hash // Convert to 32bit integer } return (Math.abs(hash) % 360) * Math.PI / 180 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stablePhase AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left nodeId AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) A...
stablePhase(nodeId: string): number { let hash = 0 for (let i = 0; i < nodeId.length; i++) { hash = ((hash << 5) - hash) + nodeId.charCodeAt(i) hash = hash & hash // Convert to 32bit integer } return (Math.abs(hash) % 360) * Math.PI / 180 }
https://github.com/Xiwei753/xiezuoruanjian
d24dd0a717c8d042dc1c76b7f768b6a4827a820e
github
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/calculator/AdvancedSunshineCalculator.ets
arkts
getEquinoxDay
获取春分/秋分日序
private getEquinoxDay(season: 'spring' | 'autumn'): number { return season === 'spring' ? 79 : 266; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getEquinoxDay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left season AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expres...
private getEquinoxDay(season: 'spring' | 'autumn'): number { return season === 'spring' ? 79 : 266; }
https://github.com/qiuhaotc/Sunshine_HarmonyOS
f18f9df474bcee41de9c7719e945e4f5dffa1348
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/LegadoHtmlBridge.ets
arkts
parseChainRule
解析 Legado 链式规则 格式: class.xxx@tag.a.0@text
parseChainRule(rule: string): string { if (!this.root) return ''; const rules = this.splitByAt(rule); if (rules.length === 0) return ''; let elements: HTMLElement[] = [this.root]; const lastIndex = rules.length - 1; for (let i = 0; i < lastIndex; i++) { const newElements: HTMLElement[...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left parseChainRule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left rule AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ) ...
parseChainRule(rule: string): string { if (!this.root) return ''; const rules = this.splitByAt(rule); if (rules.length === 0) return ''; let elements: HTMLElement[] = [this.root]; const lastIndex = rules.length - 1; for (let i = 0; i < lastIndex; i++) { const newElements: HTMLElement[...
https://github.com/DaLongZhuaZi/manxia
039655dbce4ed3b48816a0a22c7015e088ed56b8
github
openharmony-sig/ohos_video_trimmer
entry/src/main/ets/pages/FileUtils.ets
arkts
stringToUint8Array
string 转 Uint8Array @param str 输入String
stringToUint8Array(str:string): Uint8Array { let arr = new Array<number>(); for (let i = 0, j = str.length; i < j; ++i) { arr.push(str.charCodeAt(i)); } let tmpUint8Array = new Uint8Array(arr); return tmpUint8Array }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left stringToUint8Array AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left str AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left...
stringToUint8Array(str:string): Uint8Array { let arr = new Array<number>(); for (let i = 0, j = str.length; i < j; ++i) { arr.push(str.charCodeAt(i)); } let tmpUint8Array = new Uint8Array(arr); return tmpUint8Array }
https://gitee.com/openharmony-sig/ohos_video_trimmer.git
601380806df496a8738332524c0fd6ed3b305186
gitee
smarthane/DrawerLayout
DrawerLayout/src/main/ets/components/DrawerLayout.ets
arkts
openOrCloseDrawer
打开或者关闭抽屉
openOrCloseDrawer() { this.animateDrawer(() => { switch (this.drawerType) { case Type.LEFT: this.drawerPositionX = this.drawerPositionX === 0 ? this.drawerWidth * -1 : 0; this.isDrawerOpen = this.drawerPositionX === 0 break; case Type.RIGHT: ...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left openOrCloseDrawer 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#...
openOrCloseDrawer() { this.animateDrawer(() => { switch (this.drawerType) { case Type.LEFT: this.drawerPositionX = this.drawerPositionX === 0 ? this.drawerWidth * -1 : 0; this.isDrawerOpen = this.drawerPositionX === 0 break; case Type.RIGHT: ...
https://github.com/smarthane/DrawerLayout
dc50f701bebcc1df4c4b69452ebfe12fcf20166a
github
mybricks/comlib-harmony-normal
packages/rt-arkts/entry/src/main/ets/utils/AppRouter.ets
arkts
popToName
返回到堆栈中最近的页面
public popToName(name: string) { if (this.isTabbarPage(name)) { // TODO return } // 如果是要回到首页,直接清楚所有堆栈即可 if (this.entryPageId === name) { this.clear(); return } this.navPathStack.popToName(name) const targetIndex: number = Array.from(this.routerStack).lastIndexOf(nam...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left popToName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string...
public popToName(name: string) { if (this.isTabbarPage(name)) { // TODO return } // 如果是要回到首页,直接清楚所有堆栈即可 if (this.entryPageId === name) { this.clear(); return } this.navPathStack.popToName(name) const targetIndex: number = Array.from(this.routerStack).lastIndexOf(nam...
https://github.com/mybricks/comlib-harmony-normal
68db54375222f1da966c330e4da19c7881cdc0fe
github
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/utils/SunshineRatingSystem.ets
arkts
generateRatingResult
生成评分结果
private static generateRatingResult( score: number, suggestions: string[], meetsStandard: boolean ): RatingResult { let rating: SunshineRating; let color: string; let stars: number; let summary: string; if (score >= 85) { rating = SunshineRating.EXCELLENT; color = '#...
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 generateRatingResult AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left score AST#identifier#Right AST#...
private static generateRatingResult( score: number, suggestions: string[], meetsStandard: boolean ): RatingResult { let rating: SunshineRating; let color: string; let stars: number; let summary: string; if (score >= 85) { rating = SunshineRating.EXCELLENT; color = '#...
https://github.com/qiuhaotc/Sunshine_HarmonyOS
1608c33b691e9a901e1be54bedf708db8ba7e4a5
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Date.ets
arkts
setUTCMilliseconds
Sets the milliseconds for a specified date according to universal time. @param { int } value new ms @returns { long } get new date value @syscap SystemCapability.Utils.Lang @FaAndStageModel
public setUTCMilliseconds(value: int): long { let ms = ecmaMsFromTime(this.ms); this.ms -= ms; this.ms += value; return this.ms; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setUTCMilliseconds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#iden...
public setUTCMilliseconds(value: int): long { let ms = ecmaMsFromTime(this.ms); this.ms -= ms; this.ms += value; return this.ms; }
https://gitcode.com/iop123123/arkts-static-skills
a20bac7cdbf41b6f3319871a089b542accf374d2
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
getConstantByName
Returns constant by name @param {string} name Constant name @returns {EnumConstant} Enum constant @throws {Error} Not implemented yet @syscap SystemCapability.Utils.Lang @FaAndStageModel
public getConstantByName(name: string): EnumConstant { // NOTE(shumilov-petr): not implemented throw new Error("not implemented") }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getConstantByName AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left name AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Lef...
public getConstantByName(name: string): EnumConstant { // NOTE(shumilov-petr): not implemented throw new Error("not implemented") }
https://gitcode.com/iop123123/arkts-static-skills
353b7c15e34c92f7e01b77df5e3220bea0f194bf
gitcode
openharmony/notification_distributed_notification_service
services/dialog_ui/enable_notification_dialog/entry/src/main/ets/common/displayUtils.ets
arkts
getCurWindowDisplay
@returns display.Display if success, undefined if failed
public static getCurWindowDisplay(win: window.Window): display.Display | undefined { try { let displayId: number | undefined = win.getWindowProperties().displayId; console.info(Constants.TAG, `get displayId by window, displayId=${displayId}.`); if (displayId !== undefined) { let currentD...
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 getCurWindowDisplay AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left win AST#identifier#Right AST#:#Left...
public static getCurWindowDisplay(win: window.Window): display.Display | undefined { try { let displayId: number | undefined = win.getWindowProperties().displayId; console.info(Constants.TAG, `get displayId by window, displayId=${displayId}.`); if (displayId !== undefined) { let currentD...
https://gitee.com/openharmony/notification_distributed_notification_service.git
bd88dd6dfa29963ec536caeae6499c09bdf0ba25
gitee
HarmonyOS_Samples/MultiVideoApplication
common/multivideobase/src/main/ets/utils/InputSecurityUtil.ets
arkts
sanitizeSearchInput
Sanitizes external text input by removing control chars and capping length.
static sanitizeSearchInput(raw: string): string { const normalized: string = raw.replace(/[\u0000-\u001F\u007F]/g, ''); return normalized.slice(0, InputSecurityUtil.MAX_INPUT_LENGTH); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left sanitizeSearchInput AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left raw AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Le...
static sanitizeSearchInput(raw: string): string { const normalized: string = raw.replace(/[\u0000-\u001F\u007F]/g, ''); return normalized.slice(0, InputSecurityUtil.MAX_INPUT_LENGTH); }
https://gitcode.com/HarmonyOS_Samples/MultiVideoApplication
d8739a4c9ae9908d7fc51e1c97b95d2a47b1084d
gitcode
erosTeam/NextE
shared/src/main/ets/parser/EhGalleryImageParser.ets
arkts
fillSpriteExtents
EH packs each preview page's thumbnails into one sprite sheet. The per-thumb style gives only the sub-rect (offset + size); the full sheet extent (needed to crop+scale) is derived here as the max right-edge / height across all thumbs sharing a sprite URL.
private static fillSpriteExtents(images: EhGalleryImage[]): void { const widths: Map<string, number> = new Map<string, number>() const heights: Map<string, number> = new Map<string, number>() const counts: Map<string, number> = new Map<string, number>() const hasOffset: Map<string, boolean> = new Map<...
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 fillSpriteExtents AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left images AST#identifier#Right AST#:#...
private static fillSpriteExtents(images: EhGalleryImage[]): void { const widths: Map<string, number> = new Map<string, number>() const heights: Map<string, number> = new Map<string, number>() const counts: Map<string, number> = new Map<string, number>() const hasOffset: Map<string, boolean> = new Map<...
https://github.com/erosTeam/NextE
687cc215d6f198cb663a3460d83f691d2328ea66
github
LJ666-ui/harmony-health-care
5-skill离线包/星云智联–分布式AI全周期智慧健康管理平台_skills/skills/HealthQuerySkill.ets
arkts
analyzeValue
分析数值是否正常
private static analyzeValue(type: HealthDataType, value: number): { trend: 'normal' | 'high' | 'low' | 'critical'; suggestion: string } { const ranges = { blood_pressure: { low: 90, high: 140, critical_low: 60, critical_high: 180 }, blood_glucose: { low: 3.9, high: 6.1, critical_low: 2.8, critical_hig...
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 analyzeValue AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left type AST#identifier#Right AST#:#Left : ...
private static analyzeValue(type: HealthDataType, value: number): { trend: 'normal' | 'high' | 'low' | 'critical'; suggestion: string } { const ranges = { blood_pressure: { low: 90, high: 140, critical_low: 60, critical_high: 180 }, blood_glucose: { low: 3.9, high: 6.1, critical_low: 2.8, critical_hig...
https://github.com/LJ666-ui/harmony-health-care
f8b4403bb6750bfde14c0e1833360c357f5a085a
github
tangwengang-del/freerdp-harmonyos
entry/src/main/ets/services/RdpSessionManager.ets
arkts
setOnReconnectingCallback
Set callback for reconnecting events
static setOnReconnectingCallback(callback: (attempt: number, maxAttempts: number) => void): void { onReconnectingCallback = callback; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left setOnReconnectingCallback AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#...
static setOnReconnectingCallback(callback: (attempt: number, maxAttempts: number) => void): void { onReconnectingCallback = callback; }
https://github.com/tangwengang-del/freerdp-harmonyos
3e1af6e58086cbf6e70e5bb1392f47582e6183d9
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/tests/ets-templates/03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ubyte.ets
arkts
main
--- desc: check prefix decrement for unsigned byte operand ---
function main(): void { let value: ubyte = {{v.value}} let result: ubyte = --value assert value == {{v.result}}
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left main 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#Left A...
function main(): void { let value: ubyte = {{v.value}} let result: ubyte = --value assert value == {{v.result}}
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
74db941ebdca954521f354af5bb9a7efe40a989b
gitee
HarmonyOS_Samples/guide-snippets
ArkData/DataObject/CrossDeviceMigration/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets
arkts
onCreate
2. 接收端在onCreate和onNewWant接口中创建分布式数据对象并加入组网进行数据恢复
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { if (want.parameters && want.parameters.distributedSessionId) { this.restoreDistributedObject(want); } } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onCreate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left want AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Want AST#identifier#Right AST#,#Left , AST#,#Ri...
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { if (launchParam.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { if (want.parameters && want.parameters.distributedSessionId) { this.restoreDistributedObject(want); } } }
https://gitcode.com/HarmonyOS_Samples/guide-snippets
914b6c282b4817d919abcadef783689d81a85bf4
gitcode
holg/eulumdat-rs
EulumdatHarmonyOS/Eulumdat/entry/src/main/ets/model/EulumdatEngine.ets
arkts
getGAngles
Get gamma angles array from the loaded file
public getGAngles(): number[] { return eulumdat_napi.getGAngles(); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getGAngles AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_...
public getGAngles(): number[] { return eulumdat_napi.getGAngles(); }
https://github.com/holg/eulumdat-rs
7872f5e5aa912f62fa1a80f1999ac1cea78c7e9c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Debug/HidebugPerformanceCollector.ets
arkts
enable
启用性能数据收集
public enable(): void { if (this.isEnabled) { return; } this.isEnabled = true; this.startAutoCollection(); logger.info(HIDEBUG_COLLECTOR_TAG, '性能数据收集已启用'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left enable AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#expression_stat...
public enable(): void { if (this.isEnabled) { return; } this.isEnabled = true; this.startAutoCollection(); logger.info(HIDEBUG_COLLECTOR_TAG, '性能数据收集已启用'); }
https://github.com/DaLongZhuaZi/manxia
57ba4cc14233e08d1e904c66c849b690da48361f
github
PollenWang6/HiXD
entry/src/main/ets/services/CasLoginService.ets
arkts
parseContinueForm
解析 CAS continue 页面中的表单字段
private parseContinueForm(html: string): Record<string, string> { const fields: Record<string, string> = {}; // 找 id="continue" 的 form 内的 input const formMatch: RegExpMatchArray | null = html.match(/<form[^>]*id="continue"[^>]*>([\s\S]*?)<\/form>/); if (!formMatch) { return fields; } con...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left parseContinueForm AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left html AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
private parseContinueForm(html: string): Record<string, string> { const fields: Record<string, string> = {}; // 找 id="continue" 的 form 内的 input const formMatch: RegExpMatchArray | null = html.match(/<form[^>]*id="continue"[^>]*>([\s\S]*?)<\/form>/); if (!formMatch) { return fields; } con...
https://github.com/PollenWang6/HiXD
ea76ed1d488a86a1440a2bb417f2af97273ebe14
github
wuba/omni-ui
omni_component/src/main/ets/components/guide/model/GuidePage.ets
arkts
newInstance
创建引导页实例 @returns
public static newInstance(): GuidePage { return new GuidePage(); }
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 newInstance AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#L...
public static newInstance(): GuidePage { return new GuidePage(); }
https://github.com/wuba/omni-ui
92f5df0409d4c4740651cd57fa850dfb7d4361d3
github
openharmony-sig/FastBle
library/src/main/ets/bluetooth/BleConnector.ets
arkts
setCharacteristicIndication
indicate setting
private setCharacteristicIndication(gatt: ble.GattClientDevice | null, characteristic: ble.BLECharacteristic, useCharacteristicDescriptor: boolean, enable: boolean, b...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left setCharacteristicIndication AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left gatt AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#b...
private setCharacteristicIndication(gatt: ble.GattClientDevice | null, characteristic: ble.BLECharacteristic, useCharacteristicDescriptor: boolean, enable: boolean, b...
https://gitee.com/openharmony-sig/FastBle.git
7a05fa6d904cb04a8457f462bea53e4ec04253e2
gitee
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets
arkts
set
Set value. @param left @param top @param right @param bottom
set(left: number, top: number, right: number, bottom: number): void { this.left = left; this.top = top; this.right = right; this.bottom = bottom; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left set AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left left AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST#,#Right...
set(left: number, top: number, right: number, bottom: number): void { this.left = left; this.top = top; this.right = right; this.bottom = bottom; }
https://gitee.com/openharmony/codelabs.git
942ff11ee8295cea9166b845f0c0477037a93b32
gitee
RoooyHe/toona-ohos
toona/src/main/ets/services/MediaManager.ets
arkts
uploadFile
✅ 修复 4:通用文件同理
async uploadFile(data: ArrayBuffer, fileName: string, mimeType: string = 'application/octet-stream'): Promise<string> { const response = await this.uploadMedia(data, mimeType, fileName); return response.content_uri; }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left uploadFile AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left data AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
async uploadFile(data: ArrayBuffer, fileName: string, mimeType: string = 'application/octet-stream'): Promise<string> { const response = await this.uploadMedia(data, mimeType, fileName); return response.content_uri; }
https://github.com/RoooyHe/toona-ohos
c0b6e5f9e6f7156309cf1c87be3a02b45b2842b2
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/containers/ConcurrentSet.ets
arkts
keys
Despite name, returns elements from the ConcurrentSet @returns { IterableIterator<T> } an iterable of the values in the ConcurrentSet
public override keys(): IterableIterator<T> { return this.elements.keys(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#member_expression#Left AST#member_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left override AST#identifier#Right AST#identifier#Left keys AST#...
public override keys(): IterableIterator<T> { return this.elements.keys(); }
https://gitcode.com/iop123123/arkts-static-skills
bbfbcc33e37a7809c2be903edf23a1168b489196
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Scraper/AniListScraper.ets
arkts
executeQuery
执行GraphQL查询
private async executeQuery(query: string, variables: AniListSearchVariables | AniListDetailVariables): Promise<AniListResponse> { const httpRequest = http.createHttp(); try { const response = await httpRequest.request(AniListScraper.GRAPHQL_URL, { method: http.RequestMethod.POST, header...
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 executeQuery AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left query AST#identifier#Right AST#:#Left : ...
private async executeQuery(query: string, variables: AniListSearchVariables | AniListDetailVariables): Promise<AniListResponse> { const httpRequest = http.createHttp(); try { const response = await httpRequest.request(AniListScraper.GRAPHQL_URL, { method: http.RequestMethod.POST, header...
https://github.com/DaLongZhuaZi/manxia
4b9f644844b5d74cb9816eb6878b6444858af5e0
github
HarmonyOS_Samples/BestPracticeSnippets
JSCrash/entry/src/main/ets/pages/utils.ets
arkts
showFatal
Outputs fatal-level logs. @param tag Identifies the log tag. @param format Indicates the log format string. @param args Indicates the log parameters. @since 7
static showFatal(tag: string, format: string, ...args: string[]): void { if (Log.isLoggable(tag, hilog.LogLevel.FATAL)) { hilog.fatal(DOMAIN, TAG, tag + SYMBOL + format, args); } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left showFatal AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left tag AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string ...
static showFatal(tag: string, format: string, ...args: string[]): void { if (Log.isLoggable(tag, hilog.LogLevel.FATAL)) { hilog.fatal(DOMAIN, TAG, tag + SYMBOL + format, args); } }
https://gitcode.com/HarmonyOS_Samples/BestPracticeSnippets
17443472c06da5a6e58e6a2ce72f31e0c395ad61
gitcode
SMAT-Lab/Homecheck-Sec2026
test/unittest/sample/ImageFormat/ets/common/src/main/ets/common/utils/LogUtil.ets
arkts
info
Show log in info level. @param args
public info(...args: string[]): void { hilog.info(this.domain, this.prefix, this.format, args); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left info AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR#Left AST#identifier#Left args...
public info(...args: string[]): void { hilog.info(this.domain, this.prefix, this.format, args); }
https://github.com/SMAT-Lab/Homecheck-Sec2026
23bb178cdcd8171f52ce48ef94c1192879c68aad
github
Yebingiscn/SweetVideo
entry/src/main/ets/utils/SelectFileUtil.ets
arkts
getDownloadUri
获取下载文件夹路径
static async getDownloadUri() { const documentViewPicker = new picker.DocumentViewPicker() let documentSaveResult = await documentViewPicker.save({ pickerMode: picker.DocumentPickerMode.DOWNLOAD }) const uri = new fileUri.FileUri(documentSaveResult[0]) SelectFileUtil.fileFolderUri = uri.path }
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 getDownloadUri AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#E...
static async getDownloadUri() { const documentViewPicker = new picker.DocumentViewPicker() let documentSaveResult = await documentViewPicker.save({ pickerMode: picker.DocumentPickerMode.DOWNLOAD }) const uri = new fileUri.FileUri(documentSaveResult[0]) SelectFileUtil.fileFolderUri = uri.path }
https://github.com/Yebingiscn/SweetVideo
9bbc6729e91abc5912a831795668041ed6a4140b
github
openharmony-sig/applications_calculator
common/src/main/ets/util/RdbHelper.ets
arkts
deleteItem
delete record @param timeStamp expression record time stamp @param callback for delete record rowId
async deleteItem(timeStamp: string, callback: Function): Promise<void> { await this.getRdbStore(); if (this.rdbStore === null) { LogUtil.error(TAG, 'rdbStore is null, deleteItem fail.'); return; } try { let predicates: relationalStore.RdbPredicates = new relationalStore.RdbPr...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left deleteItem AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left timeStamp AST#identifier#Right AST#type_annotation#Left AST#:#Left :...
async deleteItem(timeStamp: string, callback: Function): Promise<void> { await this.getRdbStore(); if (this.rdbStore === null) { LogUtil.error(TAG, 'rdbStore is null, deleteItem fail.'); return; } try { let predicates: relationalStore.RdbPredicates = new relationalStore.RdbPr...
https://gitee.com/openharmony-sig/applications_calculator.git
2a312dc26393b0c63b2a66bec76e64562bb7e04a
gitee
kumaleap/ArkLuban
library/src/main/ets/luban/Luban.ets
arkts
onSuccess
设置压缩成功回调函数(别名) @param callback 压缩成功时的回调函数 @returns 构建器实例
onSuccess(callback: (filePath: string) => void): LubanBuilder { return this.setOnSuccess(callback); }
AST#program#Left AST#ERROR#Left AST#identifier#Left onSuccess AST#identifier#Right AST#(#Left ( AST#(#Right AST#call_expression#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left callback AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#ERROR#Right AST#arguments#Left AST#(#Left...
onSuccess(callback: (filePath: string) => void): LubanBuilder { return this.setOnSuccess(callback); }
https://github.com/kumaleap/ArkLuban
abb4ed156340a4bbe2ffadd3e4bf078292287544
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedArrays.ets
arkts
findLast
Finds the last element in the Float64Array that satisfies the condition @param fn condition @returns the last element that satisfies fn
public findLast(fn: (val: double, index: int, array: Float64Array) => boolean): double { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Float64Array.findLast: not im...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left findLast AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left fn AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:...
public findLast(fn: (val: double, index: int, array: Float64Array) => boolean): double { for (let i = this.length - 1; i >= 0; --i) { let val = this.at(i) if (fn(val, i, this)) { return val } } throw new Error("Float64Array.findLast: not im...
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
4dcc750b32cec130ee5c46ff3f7853bdc4c9856d
gitee
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.LightWeightMap.ets
arkts
toString
Returns a string representation of the LightWeightMap @returns a string representation of the LightWeightMap
toString(): String { const strArray: Array<String> = new Array<String>(); this.forEach((value: V, key: K) => { strArray.push(`${key}:${value}`); }); return strArray.join(','); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toString 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 String AST#identifier#Right AST#ERROR#Right AST#state...
toString(): String { const strArray: Array<String> = new Array<String>(); this.forEach((value: V, key: K) => { strArray.push(`${key}:${value}`); }); return strArray.join(','); }
https://gitcode.com/iop123123/arkts-static-skills
aa3fe092de1f8eef1bd40d6f4b20b309c8e6f2de
gitcode
openharmony/codelabs
Media/ImageEdit/entry/src/main/ets/viewModel/CropShow.ets
arkts
setRatio
Set ratio. @param ratio
setRatio(ratio: CropRatioType) { switch (ratio) { case CropRatioType.RATIO_TYPE_FREE: this.ratio.set(CommonConstants.DEFAULT_RATIO, CommonConstants.DEFAULT_RATIO); break; case CropRatioType.RATIO_TYPE_HORIZONTAL: this.ratio.set(this.screenMaxSide, this.screenMinSide); b...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left setRatio AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ratio AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CropRatioType AST#identifier#Ri...
setRatio(ratio: CropRatioType) { switch (ratio) { case CropRatioType.RATIO_TYPE_FREE: this.ratio.set(CommonConstants.DEFAULT_RATIO, CommonConstants.DEFAULT_RATIO); break; case CropRatioType.RATIO_TYPE_HORIZONTAL: this.ratio.set(this.screenMaxSide, this.screenMinSide); b...
https://gitee.com/openharmony/codelabs.git
fba46a92921326b62f1de7e7c109a75e33794851
gitee
huaweicloud/huaweicloud-iot-device-sdk-arkts
huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets
arkts
firePropertiesChanged
通知服务属性变化 @param properties 变化的属性,不指定默认读取全部可读属性
public firePropertiesChanged(properties?: string[]): void { if (this.iotDevice === null || this.serviceId === null) { return; } this.iotDevice.firePropertiesChanged(this.serviceId, properties); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left firePropertiesChanged AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left properties AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right...
public firePropertiesChanged(properties?: string[]): void { if (this.iotDevice === null || this.serviceId === null) { return; } this.iotDevice.firePropertiesChanged(this.serviceId, properties); }
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts
72683df0b25a45abe14d911675e58b2feb9d1d62
github
openharmony-sig/fluttertpc_r_scan
ohos/src/main/ets/RScanCamera/RScanCameraMethodHandler.ets
arkts
instantiateCamera
初始化相机
private instantiateCamera(call: MethodCall, result: MethodResult): void { let cameraName: string = call.argument("cameraName"); Log.i(TAG, "instantiateCamera cameraName : " + cameraName); let resolutionPreset: string = call.argument("resolutionPreset"); Log.i(TAG, "instantiateCamera resolutionPreset :...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left instantiateCamera AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left call AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#...
private instantiateCamera(call: MethodCall, result: MethodResult): void { let cameraName: string = call.argument("cameraName"); Log.i(TAG, "instantiateCamera cameraName : " + cameraName); let resolutionPreset: string = call.argument("resolutionPreset"); Log.i(TAG, "instantiateCamera resolutionPreset :...
https://gitee.com/openharmony-sig/fluttertpc_r_scan.git
cbc4a4aba03a6f9564b201ce3690b27e0e65b960
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/std/core/Short.ets
arkts
compareTo
Compares this instance to other Short object The result is less than 0 if this instance lesser than provided object 0 if they are equal and greater than 0 otherwise. @param other Short object to compare with @returns result of the comparison
public override compareTo(other: Short): int { return (this.value - other.unboxed()) as int; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left override AST#identifier#Right AST#call_expression#Left AST#identifier#Left compareTo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST...
public override compareTo(other: Short): int { return (this.value - other.unboxed()) as int; }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
faae4b3baf6a197cfab70d03e3482730c52ce5c5
gitee
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/KnowledgeService.ets
arkts
fullTextSearch
全文搜索(高亮) @param keyword 关键词
async fullTextSearch(keyword: string, params?: { page?: number; pageSize?: number }): Promise<ApiResponse<KnowledgeSearchResult>> { return this.client.get<KnowledgeSearchResult>('/api/v1/knowledge/search/fulltext', { keyword, ...params } as Record<string, any>) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left fullTextSearch AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left keyword AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async fullTextSearch(keyword: string, params?: { page?: number; pageSize?: number }): Promise<ApiResponse<KnowledgeSearchResult>> { return this.client.get<KnowledgeSearchResult>('/api/v1/knowledge/search/fulltext', { keyword, ...params } as Record<string, any>) }
https://github.com/David8Idira/AI-OA
d448cc3ed4e6ceea69c93f1004719360347a77b4
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/input/InputInterceptorService.ets
arkts
start
启动鼠标拦截器 @returns 0 成功,其他为错误码
start(): number { if (this.active) { this.stop(); } if (!this.native) { console.warn('MouseInterceptor: Native 模块不可用'); return -1; } const result = this.native.addMouseInterceptor(); if (result === 0) { this.active = true; console.info('MouseInterceptor: 鼠标拦截器已启动...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left start AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#number#Left number AST#number#Right AST#ERROR#Right AST#statement_block#...
start(): number { if (this.active) { this.stop(); } if (!this.native) { console.warn('MouseInterceptor: Native 模块不可用'); return -1; } const result = this.native.addMouseInterceptor(); if (result === 0) { this.active = true; console.info('MouseInterceptor: 鼠标拦截器已启动...
https://github.com/AlkaidLab/moonlight-harmony
df507cf220a7b719fdbb01665a9bd264ddae9c51
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Data/DataManager.ets
arkts
saveSourceTabsConfig
==================== 标签页配置管理 ==================== 保存图源的标签页配置
async saveSourceTabsConfig(sourceId: number, configJson: string): Promise<void> { try { const sql = `UPDATE comic_source SET tabs_config = ? WHERE id = ?`; await this.databaseManager.executeSql(sql, [configJson, sourceId]); logger.info(TAG, `已保存图源标签配置: sourceId=${sourceId}`); } catch (error)...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left saveSourceTabsConfig 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...
async saveSourceTabsConfig(sourceId: number, configJson: string): Promise<void> { try { const sql = `UPDATE comic_source SET tabs_config = ? WHERE id = ?`; await this.databaseManager.executeSql(sql, [configJson, sourceId]); logger.info(TAG, `已保存图源标签配置: sourceId=${sourceId}`); } catch (error)...
https://github.com/DaLongZhuaZi/manxia
bade95176c93ddd457e7eef4e071ca194c12cb46
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/DataView.ets
arkts
getFloat64
=== Float64 === Read bytes as they represent given type @param byteOffset zero index to read @returns read value (big endian)
public getFloat64(byteOffset: number): number { return this.getFloat64(byteOffset as int) }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getFloat64 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left byteOffset AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#R...
public getFloat64(byteOffset: number): number { return this.getFloat64(byteOffset as int) }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
630a3ca56e3028e798739d5ec3ca9e0f5837579d
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Boolean.ets
arkts
$_invoke
Creates a new instance of a Boolean based on the specified value @returns { boolean } A new Boolean instance representing the specified value. @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
static $_invoke(): boolean { return Boolean.FALSE; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left $_invoke 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#bool...
static $_invoke(): boolean { return Boolean.FALSE; }
https://gitcode.com/iop123123/arkts-static-skills
16ae74a6bd84b1ec549c6c3e7f51b890e1f31bf9
gitcode
openharmony-sig/flutter_engine
shell/platform/ohos/flutter_embedding/flutter/src/main/ets/util/ByteBuffer.ets
arkts
writeInt16
Writes the next signed short. @param value The value. @param littleEndian If the value is little endian.
writeInt16(value: number, littleEndian?: boolean): void { this.checkWriteCapacity(2) this.setInt16(this.mByteOffset, value, littleEndian) this.mByteOffset += 2 }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left writeInt16 AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , AST...
writeInt16(value: number, littleEndian?: boolean): void { this.checkWriteCapacity(2) this.setInt16(this.mByteOffset, value, littleEndian) this.mByteOffset += 2 }
https://gitee.com/openharmony-sig/flutter_engine.git
52dde4de4523209c3a447d253b04986b59c8a0b6
gitee
richshaw2015/nds
ohos/entry/src/test/NativeSync.test.ets
arkts
getAllSettingsConfig
获取所有配置值 Requirements: 13.4
getAllSettingsConfig(): Record<string, SettingsConfigValue> { const result: Record<string, SettingsConfigValue> = {}; this.configStore.forEach((value, key) => { result[key] = value; }); return result; }
AST#program#Left AST#expression_statement#Left AST#sequence_expression#Left AST#binary_expression#Left AST#call_expression#Left AST#identifier#Left getAllSettingsConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left ...
getAllSettingsConfig(): Record<string, SettingsConfigValue> { const result: Record<string, SettingsConfigValue> = {}; this.configStore.forEach((value, key) => { result[key] = value; }); return result; }
https://github.com/richshaw2015/nds
55c9a8c71221c758473dd121b61c31789c6847fd
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
keys
Returns an list of keys in Uint8Array @returns { IterableIterator<int> } - iterator over keys @syscap SystemCapability.Utils.Lang @FaAndStageModel
public keys(): IterableIterator<int> { return new Uint8ArrayIteratorKeys(this) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left keys AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Righ...
public keys(): IterableIterator<int> { return new Uint8ArrayIteratorKeys(this) }
https://gitcode.com/iop123123/arkts-static-skills
ed046e44f0a8e5512782ca0693276e93b665d85e
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/data/BarLineScatterCandleBubbleDataSet.ets
arkts
setHighLightColor
Sets the color that is used for drawing the highlight indicators. Dont forget to resolve the color using ColorTemplate.colorRgb(...) or Color.Xxx or ChartColor.rgb(...). @param color
public setHighLightColor(color: number): void { this.mHighLightColor = color; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setHighLightColor 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 setHighLightColor(color: number): void { this.mHighLightColor = color; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
fc803854fbf7b854deae89c97b7c5f7b7b1e3ec3
gitee
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/utils/StringUtils.ets
arkts
camelToSnake
camelCase 转 snake_case
static camelToSnake(value: string): string { if (value.length === 0) { return value; } let result = ''; for (let i = 0; i < value.length; i++) { const ch = value.charAt(i); const upperCode = ch.charCodeAt(0); if (upperCode >= 65 && upperCode <= 90) { if (i > 0) { ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left camelToSnake AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left st...
static camelToSnake(value: string): string { if (value.length === 0) { return value; } let result = ''; for (let i = 0; i < value.length; i++) { const ch = value.charAt(i); const upperCode = ch.charCodeAt(0); if (upperCode >= 65 && upperCode <= 90) { if (i > 0) { ...
https://github.com/DaLongZhuaZi/NGF
94282065ed30f0c3d4b2f98d358d2fc6bdf8c402
github
xiaofenger_705/protobuf-arkts-generator
runtime/arkpb/JsonEncodingVisitor.ets
arkts
visitRepeatedUint32
访问 repeated uint32 字段 JSON: array of number
visitRepeatedUint32(value: number[], fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) this.json[fieldName] = [...value] as Object }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitRepeatedUint32 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#subscript_expression#Left AST#identifier#Left numbe...
visitRepeatedUint32(value: number[], fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) this.json[fieldName] = [...value] as Object }
https://gitcode.com/xiaofenger_705/protobuf-arkts-generator
4a194c106cdabe60df044532d9b11531273d3f7e
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets
arkts
constructor
Constructs a new SyntaxError instance with provided message and error specific information @param { String | undefined } message - Error text @param { ErrorOptions | undefined } options - Error options @syscap SystemCapability.Utils.Lang
constructor(message?: String, options?: ErrorOptions) { super("SyntaxError", message, options) }
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#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#Left String AST#identi...
constructor(message?: String, options?: ErrorOptions) { super("SyntaxError", message, options) }
https://gitcode.com/iop123123/arkts-static-skills
d1fdaf3322bdca11b59b42d2f841dcfa2b7c0fe9
gitcode
zhubowen-bot/Bowen_ArkWeb_framework
entry/src/main/ets/utiles/EmitterUtil.ets
arkts
post
发送事件 @param eventId 事件ID,string类型的eventId不支持空字符串。 @param data 发送的数据 @param EventPriority 事件被发送的优先级
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) { let genericEventData: emitter.GenericEventData<T> = { data: eventData }; let options: emitter.Options = { priority: priority }; emitter.emit(eventId.toString(), options, genericEventData)...
AST#program#Left AST#expression_statement#Left AST#binary_expression#Left AST#binary_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left post AST#identifier#Right AST#ERROR#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Righ...
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) { let genericEventData: emitter.GenericEventData<T> = { data: eventData }; let options: emitter.Options = { priority: priority }; emitter.emit(eventId.toString(), options, genericEventData)...
https://github.com/zhubowen-bot/Bowen_ArkWeb_framework
09da3aec2c8873cd33e9bd53757bc70680a6751d
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/SparseArray.ets
arkts
toSorted
Returns a new array with the elements sorted in ascending order. @returns { SparseArray<T> } A new sorted array. @syscap SystemCapability.Utils.Lang @FaAndStageModel
public toSorted(): SparseArray<T> { const ret: SparseArray<T> = new SparseArray<T>() ret.maxLength = this.maxLength const values: Array<T> = new Array<T>() for (let i: int = 0; i < this.maxLength; i++) { if (this.buffer.has(i)) { const v: T | undefined = ...
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#ERROR#Right AST#expression_st...
public toSorted(): SparseArray<T> { const ret: SparseArray<T> = new SparseArray<T>() ret.maxLength = this.maxLength const values: Array<T> = new Array<T>() for (let i: int = 0; i < this.maxLength; i++) { if (this.buffer.has(i)) { const v: T | undefined = ...
https://gitcode.com/iop123123/arkts-static-skills
516ec08e027f5001c3cdd9f8df54b4106adb7401
gitcode
OnceWeWere/Weather_HarmonyOS
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onForeground
3. 应用进入前台
onForeground(): void { // 从后台切回前台 // Ability has brought to foreground hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onForeground AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_block...
onForeground(): void { // 从后台切回前台 // Ability has brought to foreground hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onForeground'); }
https://github.com/OnceWeWere/Weather_HarmonyOS
1337787928d1c13bccd9248ef877ce570acce1ad
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/NovelSourceManager.ets
arkts
setSourceWeight
设置书源权重(用于置顶)
async setSourceWeight(sourceId: string, weight: number): Promise<boolean> { const source = this.sources.get(sourceId); if (!source) { return false; } source.weight = weight; try { const dataManager = getNovelDataManager(); await dataManager.saveSource(source); log...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left setSourceWeight 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 setSourceWeight(sourceId: string, weight: number): Promise<boolean> { const source = this.sources.get(sourceId); if (!source) { return false; } source.weight = weight; try { const dataManager = getNovelDataManager(); await dataManager.saveSource(source); log...
https://github.com/DaLongZhuaZi/manxia
bfc8507d145e31ef98a0450c342ed58ff81f4123
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Novel/LegadoRuleAnalyzer.ets
arkts
extractInnerHtml
提取元素的内部HTML
private extractInnerHtml(element: string): string { // 移除外层标签 const match = element.match(/^<[^>]+>([\s\S]*)<\/[^>]+>$/); return match ? match[1] : element; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left extractInnerHtml AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left element AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#st...
private extractInnerHtml(element: string): string { // 移除外层标签 const match = element.match(/^<[^>]+>([\s\S]*)<\/[^>]+>$/); return match ? match[1] : element; }
https://github.com/DaLongZhuaZi/manxia
de04edd753255164d3fabf0e624ef75935305565
github