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
richshaw2015/nds
ohos/entry/src/main/ets/utils/NdsRomCache.ets
arkts
addCacheChangeListener
添加缓存变化监听器
addCacheChangeListener(listener: CacheChangeListener): void { this.cacheChangeListeners.push(listener); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left addCacheChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left CacheChangeListener AST#ident...
addCacheChangeListener(listener: CacheChangeListener): void { this.cacheChangeListeners.push(listener); }
https://github.com/richshaw2015/nds
0136d93d6f25727baf7a39d77feebb2f36e51e0e
github
arkui-x/samples
CodeLab/Cases/feature/bottompanelslide/src/main/ets/view/BottomPanelSlide.ets
arkts
aboutToAppear
手指按下屏幕起始纵坐标
aboutToAppear(): void { // 构造视频列表数据 for (let index = 0; index < Constants.VIDEO_LIST_LENGTH; index++) { let temp: PanelDataType = new PanelDataType(`收藏夹名称${index + 1}`, `${index + 1}个内容`) this.panelList.pushData(temp); } // 构造panel数据 for (let index = 0; index < Constants.PANEL_LIST_LE...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToAppear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bloc...
aboutToAppear(): void { // 构造视频列表数据 for (let index = 0; index < Constants.VIDEO_LIST_LENGTH; index++) { let temp: PanelDataType = new PanelDataType(`收藏夹名称${index + 1}`, `${index + 1}个内容`) this.panelList.pushData(temp); } // 构造panel数据 for (let index = 0; index < Constants.PANEL_LIST_LE...
https://gitcode.com/arkui-x/samples
6b0c31a656ce89b419f94183fa07adc366f620a7
gitcode
zmuxuny/ai-guardian-star
entry/src/main/ets/database/DatabaseHelper.ets
arkts
getStore
── 安全获取 store(断言已初始化)─────────────────────────
private getStore(): relationalStore.RdbStore { if (!this.store) throw new Error("DatabaseHelper 未初始化,请先调用 init(context)"); return this.store; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left getStore AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#member_expression#Left AST...
private getStore(): relationalStore.RdbStore { if (!this.store) throw new Error("DatabaseHelper 未初始化,请先调用 init(context)"); return this.store; }
https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/database/DatabaseHelper.ets#L264-L267
6be997822218218d5dd4d48386a8e4d7a3836016
github
openharmony-sig/applications_calculator
common/src/main/ets/util/CommonUtil.ets
arkts
setFinalTextInputIndex
finalTextInputIndex 返回复制粘贴后最新的坐标
public static setFinalTextInputIndex(value :string,index:number,displayExpression:string) : number{ let trueIndex: number = CommonUtil.getTrueIndex(index,displayExpression); let globalExp = AppStorage.get<string>('globalExpression') ?? ''; trueIndex = CommonUtil.displayIndexToExpIndex(displayExpression, t...
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 setFinalTextInputIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left value AST#identifier#Right AST#ERROR#Left AST#:...
public static setFinalTextInputIndex(value :string,index:number,displayExpression:string) : number{ let trueIndex: number = CommonUtil.getTrueIndex(index,displayExpression); let globalExp = AppStorage.get<string>('globalExpression') ?? ''; trueIndex = CommonUtil.displayIndexToExpIndex(displayExpression, t...
https://gitee.com/openharmony-sig/applications_calculator.git
bfe534acdfcf3695582867d8af2e14b2c521ec11
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Type.ets
arkts
of
Returns Type of value @param {FixedArray<double>} v value @returns {Type} Type instance of this value @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(v: FixedArray<double>): Type { return ArrayType.getInstance(Class.of(v), TypeAPI.getTypeDescriptor(new Double())) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left v AST#identifier#Right AST#:#...
public static of(v: FixedArray<double>): Type { return ArrayType.getInstance(Class.of(v), TypeAPI.getTypeDescriptor(new Double())) }
https://gitcode.com/iop123123/arkts-static-skills
8db0b6eb785fb2e219e0df9af2518075786ceb12
gitcode
Cool_foolisher1/ArkTSRepository
GraphicalCode/features/algorithm/src/main/ets/viewmodel/CardComponentDataViewModel.ets
arkts
sendEvent
发送事件 @param eventParam CardComponentDataEventParam @returns void | boolean
public sendEvent<T>(eventParam: CardComponentDataEventParam<T>): void | boolean { const eventType: CardComponentDataEventTypeEnum | BaseHomeEventTypeEnum = eventParam.type if (eventType === CardComponentDataEventTypeEnum.LOAD_COMPONENT) { return this.loadComponent() } else if (eventType === CardComp...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#binary_expression#Left AST#identifier#Left sendEvent AST#identifier#Right AST#<#Left < AST#<#Right AST#identifier#Left T AST#identifier#Right AST#binary_expression#Right AST#>#Left > AST#>#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Rig...
public sendEvent<T>(eventParam: CardComponentDataEventParam<T>): void | boolean { const eventType: CardComponentDataEventTypeEnum | BaseHomeEventTypeEnum = eventParam.type if (eventType === CardComponentDataEventTypeEnum.LOAD_COMPONENT) { return this.loadComponent() } else if (eventType === CardComp...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
49b36bc7af14cdfb11848f844b8e8b31209f3da9
gitcode
arkui-x/samples
CodeLab/Cases/feature/customscan/src/main/ets/components/CustomScanCameraComp.ets
arkts
updateCameraSurfaceSize
动态更新XComponent的Suerface尺寸 @param {number} width 新宽度 @param {number} height 新高度 @returns {void}
updateCameraSurfaceSize(width: number, height: number): void { this.cameraSurfaceController.setXComponentSurfaceRect({ surfaceWidth: vp2px(width), surfaceHeight: vp2px(height), }) logger.info(`setXComponentSurfaceRect: ${width}, ${height}`); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left updateCameraSurfaceSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left width AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST...
updateCameraSurfaceSize(width: number, height: number): void { this.cameraSurfaceController.setXComponentSurfaceRect({ surfaceWidth: vp2px(width), surfaceHeight: vp2px(height), }) logger.info(`setXComponentSurfaceRect: ${width}, ${height}`); }
https://gitcode.com/arkui-x/samples
0545aef98243faea449c23b7b6f499ebab88cd4e
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets
arkts
$_invoke
Constructs a new RangeError instance with provided message and error specific information @param { String | undefined } message - Error text @param { ErrorOptions | undefined } options - Error options @returns { RangeError } @static @syscap SystemCapability.Utils.Lang
static $_invoke(message?: String, options?: ErrorOptions): RangeError { return new RangeError(message, options) }
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#identifier#Left message AST#identifier#Right AST#ERROR#Left AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#identifier#...
static $_invoke(message?: String, options?: ErrorOptions): RangeError { return new RangeError(message, options) }
https://gitcode.com/iop123123/arkts-static-skills
7723cebfa64e2141aa4515c983827ce3e76edbb3
gitcode
HarmonyOS_Samples/MusicHome
features/player/src/main/ets/model/MediaService.ets
arkts
abilityContext
UIAbility context from application runtime; used for resources, want agent, and background task.
private get abilityContext(): common.UIAbilityContext | undefined { return getAppRuntime().context; }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#identifier#Left get AST#identifier#Right AST#call_expression#Left AST#identifier#Left abilityContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
private get abilityContext(): common.UIAbilityContext | undefined { return getAppRuntime().context; }
https://gitcode.com/HarmonyOS_Samples/MusicHome
f7a779afbae561b101ac2e536c987333de856767
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets
arkts
loadExistingOnlineManga
加载已存在的在线漫画(从数据库)
private async loadExistingOnlineManga(comicInfo: ComicInfo, params: MangaDetailLoadParams): Promise<MangaDetailLoadResult> { const result: MangaDetailLoadResult = { success: false, manga: null, chapters: [], isFavorite: false, isLocalManga: false, sourceId: Number(comicInfo.sou...
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 loadExistingOnlineManga AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left comicInfo AST#identifier#Righ...
private async loadExistingOnlineManga(comicInfo: ComicInfo, params: MangaDetailLoadParams): Promise<MangaDetailLoadResult> { const result: MangaDetailLoadResult = { success: false, manga: null, chapters: [], isFavorite: false, isLocalManga: false, sourceId: Number(comicInfo.sou...
https://github.com/DaLongZhuaZi/manxia
0f153f2787cdadda76be04efd623d76e1bebf68c
github
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/TypedUArrays.ets
arkts
constructor
Creates a copy of Uint16Array. @param other data initializer
public constructor(other: Uint16Array) { this.buffer = other.buffer.slice(0, other.buffer.byteLength) this.byteLength = other.byteLength this.length = other.length }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left other AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Uin...
public constructor(other: Uint16Array) { this.buffer = other.buffer.slice(0, other.buffer.byteLength) this.byteLength = other.byteLength this.length = other.length }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
ed89d70484ec33ceac769a78b28f839fed2a0e8c
gitee
harmonyos/codelabs
HarmonyOS_NEXT/MusicHome/common/mediaCommon/src/main/ets/utils/MediaService.ets
arkts
updateOnDestroy
Update card data on destroy.
public async updateOnDestroy() { if (this.formIds === null || this.formIds === undefined) { Logger.error(TAG, 'formIds is null'); return; } let formData: Record<string, boolean> = { 'isPlay': false } let formInfo = formBindingData.createFormBindingData(formData); for (let ind...
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 updateOnDestroy AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#...
public async updateOnDestroy() { if (this.formIds === null || this.formIds === undefined) { Logger.error(TAG, 'formIds is null'); return; } let formData: Record<string, boolean> = { 'isPlay': false } let formInfo = formBindingData.createFormBindingData(formData); for (let ind...
https://gitee.com/harmonyos/codelabs.git
2302665e6e65ef665aa415252a4be8a2f0ed5adb
gitee
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/json.ets
arkts
createCharFromJSONValue
Creates a Char instance based on JSONValue @param { Char } this JSONValue - a JSON representation @param { JSONValue } json @returns { Char } - true if JSON encodes true literal, false if JSON encodes false literal @throws { JSONTypeError } if json does not encode a valid boolean literal
function createCharFromJSONValue(json: JSONValue): Char { if (json instanceof JSONString) { let str = (json as JSONString).value if (str.getLength() == 1) { return new Char(str.charAt(0)) } } throw new JSONTypeError('Cannot create Char from JSON', {cause: json as Object} ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left createCharFromJSONValue AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left json AST#identifier#Right AST#type_annotation#Left AST#:#Left ...
function createCharFromJSONValue(json: JSONValue): Char { if (json instanceof JSONString) { let str = (json as JSONString).value if (str.getLength() == 1) { return new Char(str.charAt(0)) } } throw new JSONTypeError('Cannot create Char from JSON', {cause: json as Object} ...
https://gitcode.com/iop123123/arkts-static-skills
53e64744066190c645920e9d20a7c5f60fd052c4
gitcode
openharmony/vendor_unionman
unionpi_tiger/sample_hzu/IFPS/IFPS-APP/entry/src/main/ets/pages/Index.ets
arkts
readTemperatureAndHumidity
函数:读取温湿度数据
function readTemperatureAndHumidity() { // 调用传感器软重启函数 const softResetResult = ifpsnapidemo.Sht3xSoftReset(); console.log('Sensor Sht3xSoft Reset Result:', softResetResult); // 设置传感器测量模式 const mps = 2; // 2Hz const repeatability = 1; // 中刷新率 const modeSetResult = ifpsnapidemo.Sht3xModeSet(mps, repeatabili...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left readTemperatureAndHumidity AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#statement_block#Left AST#{#Left { AST#{#Right AST#...
function readTemperatureAndHumidity() { // 调用传感器软重启函数 const softResetResult = ifpsnapidemo.Sht3xSoftReset(); console.log('Sensor Sht3xSoft Reset Result:', softResetResult); // 设置传感器测量模式 const mps = 2; // 2Hz const repeatability = 1; // 中刷新率 const modeSetResult = ifpsnapidemo.Sht3xModeSet(mps, repeatabili...
https://gitee.com/openharmony/vendor_unionman.git
42928e0587b7bade3693ce7e16d300986c98657f
gitee
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SmartCategoryDAO.ets
arkts
getStatistics
获取规则统计
static async getStatistics(userId: number): Promise<RuleStatistics> { try { const store = DatabaseManager.getDatabase(); const sql = ` SELECT COUNT(*) as total_rules, SUM(CASE WHEN is_active = 1 THEN 1 ELSE 0 END) as active_rules, SUM(CASE WHEN rule_type = 'system...
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 getStatistics AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#:#Left : A...
static async getStatistics(userId: number): Promise<RuleStatistics> { try { const store = DatabaseManager.getDatabase(); const sql = ` SELECT COUNT(*) as total_rules, SUM(CASE WHEN is_active = 1 THEN 1 ELSE 0 END) as active_rules, SUM(CASE WHEN rule_type = 'system...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
c1788c3989e126ec5ffff7753f8454c64b232b9e
github
LongLiveY96/chatcube
entry/src/main/ets/services/AIApiService.ets
arkts
hasAttachments
检查是否包含任何附件(图片或文件)
hasAttachments(): boolean { return this.attachments.length > 0 && this.attachments.some(a => a.base64Data !== '' || a.parsedText !== '') }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasAttachments AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#stat...
hasAttachments(): boolean { return this.attachments.length > 0 && this.attachments.some(a => a.base64Data !== '' || a.parsedText !== '') }
https://github.com/LongLiveY96/chatcube
7955354e75f4cf520a75bb8a740c3e2f1aa61144
github
DaLongZhuaZi/manxia
entry/src/main/ets/pages/MangaDetailPage.ets
arkts
notifyDataReload
数据源变更通知 - ArkUI要求在数据变化时通知列表进行刷新
private notifyDataReload(): void { const listenersSnapshot: DataChangeListener[] = this.listeners.slice(); for (const listener of listenersSnapshot) { listener.onDataReloaded(); } }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left notifyDataReload 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...
private notifyDataReload(): void { const listenersSnapshot: DataChangeListener[] = this.listeners.slice(); for (const listener of listenersSnapshot) { listener.onDataReloaded(); } }
https://github.com/DaLongZhuaZi/manxia
921f5fcc83e59b0e518ca229f4ef535202b08fd1
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Utils/TypeGuards.ets
arkts
toSafeString
安全的字符串转换 @param value - 要转换的值 @param defaultValue - 默认值 @returns 字符串值
static toSafeString(value: Object, defaultValue: string = ''): string { if (TypeGuards.isString(value)) { return value as string; } return defaultValue; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left toSafeString 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 Ob...
static toSafeString(value: Object, defaultValue: string = ''): string { if (TypeGuards.isString(value)) { return value as string; } return defaultValue; }
https://github.com/DaLongZhuaZi/manxia
e9d1a58c0b4f06134a027dc90a7e6daf4cdaf5e4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/DownloadManager.ets
arkts
requestDownloadDirAccess
请求Download目录访问权限
public async requestDownloadDirAccess(): Promise<boolean> { return this.downloadDirManager.requestAccess(); }
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 requestDownloadDirAccess AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#R...
public async requestDownloadDirAccess(): Promise<boolean> { return this.downloadDirManager.requestAccess(); }
https://github.com/DaLongZhuaZi/manxia
946f5e46e012f4bd49b05b43cdafc4be7bf29094
github
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 FixedArray<BigInt>. @param { FixedArray<BigInt> } arr - An instance of the FixedArray type to convert to an array. @returns { BigInt64Array } - A new BigInt64Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arr: FixedArray<BigInt>): BigInt64Array { let result = new BigInt64Array(arr.length) result.ofBigInt(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: FixedArray<BigInt>): BigInt64Array { let result = new BigInt64Array(arr.length) result.ofBigInt(arr) return result }
https://gitcode.com/iop123123/arkts-static-skills
586f4f6ade47c0c32993e36ccd0eaf45c5b888b7
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Workflow/WorkflowCapabilities.ets
arkts
hasCapabilityInContext
检查上下文是否有某个能力
hasCapabilityInContext(context: WorkflowContext, type: CapabilityType): boolean { return context.capabilities.has(type); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left hasCapabilityInContext AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left WorkflowContext AST#identifier...
hasCapabilityInContext(context: WorkflowContext, type: CapabilityType): boolean { return context.capabilities.has(type); }
https://github.com/DaLongZhuaZi/manxia
1bd0dd8bf59ffbc7e3b4739498d7fc88859c38f4
github
LZZLHY/hlib
entry/src/main/ets/storage/PreferencesStore.ets
arkts
remove
─── 删除 / 清空 ───
static async remove(group: PrefGroup, key: string): Promise<void> { const p: preferences.Preferences = PreferencesStore.pick(group); try { await p.delete(key); await p.flush(); } catch (err) { PreferencesStore.logErr(`remove(${key})`, err); } }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left remove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left group AST#identifier#Right AST#:#Left : AST#:#Rig...
static async remove(group: PrefGroup, key: string): Promise<void> { const p: preferences.Preferences = PreferencesStore.pick(group); try { await p.delete(key); await p.flush(); } catch (err) { PreferencesStore.logErr(`remove(${key})`, err); } }
https://github.com/LZZLHY/hlib
eeb50934ed7d89ba0fb4bb7a4601fbc598f39ac7
github
LJ666-ui/harmony-health-care
entry/src/main/ets/medicalimaging/ImagePreprocessor.ets
arkts
preprocess
预处理图像 @param pixelMap 原始图像 @param imagingType 影像类型 @returns 预处理后的图像
async preprocess( pixelMap: image.PixelMap, imagingType: ImagingType ): Promise<image.PixelMap> { try { // 1. 获取目标尺寸 const targetSize = this.getTargetSize(imagingType); // 2. 缩放图像到目标尺寸 const resized = await this.resize(pixelMap, targetSize.width, targetSize.height); ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left preprocess AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left pixelMap AST#identifier#Right AST#type_annotation#Left AST#:#Left : ...
async preprocess( pixelMap: image.PixelMap, imagingType: ImagingType ): Promise<image.PixelMap> { try { // 1. 获取目标尺寸 const targetSize = this.getTargetSize(imagingType); // 2. 缩放图像到目标尺寸 const resized = await this.resize(pixelMap, targetSize.width, targetSize.height); ...
https://github.com/LJ666-ui/harmony-health-care
d9d0b1407dbf7ec38b5fcfb5eff9f26ad87e3d28
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
of
Returns a new array from a set of elements. @param { FixedArray<int> } items - a set of elements to include in the new array object. @returns { Float64Array } - a new Float64Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static of(...items: FixedArray<int>): Float64Array { let res = new Float64Array(items.length.toInt()) res.ofInt(stub.toValueArray(items)) return res }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left public AST#identifier#Right AST#ERROR#Left AST#identifier#Left static AST#identifier#Right AST#of#Left of AST#of#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#spread_element#Left AST#...#Left ... AST#...#Right AST#ERROR...
public static of(...items: FixedArray<int>): Float64Array { let res = new Float64Array(items.length.toInt()) res.ofInt(stub.toValueArray(items)) return res }
https://gitcode.com/iop123123/arkts-static-skills
23535858497efc38f6315afe7bdb3ff56afce770
gitcode
YANGZX22/Voot
entry/src/main/ets/storage/OnboardingStorage.ets
arkts
isSetupCompleted
检查配置引导是否完成 @param ctx UI Ability Context @returns true 表示配置引导已完成
static async isSetupCompleted(ctx: common.UIAbilityContext): Promise<boolean> { const prefs = await OnboardingStorage.getPrefs(ctx); const completed: boolean = (await prefs.get(OnboardingStorage.KEY_SETUP_COMPLETED, false)) as boolean; return completed; }
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 isSetupCompleted AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ctx AST#identifier#Right AST#:#Left : A...
static async isSetupCompleted(ctx: common.UIAbilityContext): Promise<boolean> { const prefs = await OnboardingStorage.getPrefs(ctx); const completed: boolean = (await prefs.get(OnboardingStorage.KEY_SETUP_COMPLETED, false)) as boolean; return completed; }
https://github.com/YANGZX22/Voot
d095e678798ea39399d80166ad08da20d5826e24
github
somnio-software/my-bot-pal
entry/src/main/ets/features/chat/view/pages/ChatPage.ets
arkts
build
The build method defines the UI layout for the ChatPage. It utilizes various components to display chat messages, loading indicators, suggestions, and the input area.
build() { Stack() { // Display the curved top text background MyBotPalCurvedTopText() .margin({ top: 1 }) .width('100%') .height('100%'); Column() { // Scrollable container for the messages and chat content Scroll(this.scrollController) { Column...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left build AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AST#object#Left AST#{#Left { AST#{#Right AST#method_def...
build() { Stack() { // Display the curved top text background MyBotPalCurvedTopText() .margin({ top: 1 }) .width('100%') .height('100%'); Column() { // Scrollable container for the messages and chat content Scroll(this.scrollController) { Column...
https://github.com/somnio-software/my-bot-pal
db10ced75798e13cc4e6a915a2757f0f12fe32b1
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@ohos.util.stream.ets
arkts
cork
After the call, all Write operations will be forced to write to the buffer instead of being flushed. @returns { boolean } Setting successful returns true, setting failed returns false.
cork(): boolean { this.writableCorkedInner += 1; return true; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left cork AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boolean#Right AST#ERROR#Right AST#statement_bloc...
cork(): boolean { this.writableCorkedInner += 1; return true; }
https://gitcode.com/iop123123/arkts-static-skills
1b2c9fe06e7716c74cb1ea28212a8f428c20880e
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/charts/BarChartModel.ets
arkts
isDrawValueAboveBarEnabled
returns true if drawing values above bars is enabled, false if not @return
public isDrawValueAboveBarEnabled(): boolean { return this.mDrawValueAboveBar; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left isDrawValueAboveBarEnabled 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#Lef...
public isDrawValueAboveBarEnabled(): boolean { return this.mDrawValueAboveBar; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
225019aca081f820171ed457d982302ae019caba
gitee
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ChangelogManager.ets
arkts
forceShowChangelog
强制显示更新日志(不标记为已显示)
async forceShowChangelog(): Promise<void> { await this.showChangelog(false); }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left forceShowChangelog AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#g...
async forceShowChangelog(): Promise<void> { await this.showChangelog(false); }
https://github.com/DaLongZhuaZi/manxia
3b2f076065788ae24db66255929d37b6e1fac263
github
Amaz1ny/HarmonyDO-public
entry/src/main/ets/common/utils/EmojiResolver.ets
arkts
resolveEmojiUrl
解析 emoji 名称 -> 图片 URL - 支持 ":name:" / "name" - 支持直接传 URL/相对路径(原样 resolve)
static resolveEmojiUrl(emoji: string | null): string { const raw: string = emoji !== null && emoji !== undefined ? emoji.toString().trim() : ''; if (raw.length === 0) return ''; if (EmojiResolver.isUrlLike(raw)) { return UrlUtils.resolveUrl(raw); } const name: string = EmojiResolver.normal...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left resolveEmojiUrl AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left emoji AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#binary_expressi...
static resolveEmojiUrl(emoji: string | null): string { const raw: string = emoji !== null && emoji !== undefined ? emoji.toString().trim() : ''; if (raw.length === 0) return ''; if (EmojiResolver.isUrlLike(raw)) { return UrlUtils.resolveUrl(raw); } const name: string = EmojiResolver.normal...
https://github.com/Amaz1ny/HarmonyDO-public
72ca950bd321f8f3fa5d4c7533558267fed8a970
github
Joker-x-dev/CoolMallArkTS
core/network/src/main/ets/interceptors/LogInterceptor.ets
arkts
buildRequestUrl
拼接请求地址 @param {InternalAxiosRequestConfig} config - 请求配置 @returns {string} 拼接后的请求地址
function buildRequestUrl(config: InternalAxiosRequestConfig): string { const baseUrl: string = config.baseURL ?? ""; const url: string = config.url ?? ""; if (url.startsWith("http://") || url.startsWith("https://")) { return url; } // 处理 baseURL 与 url 的拼接,避免双斜杠 if (baseUrl.endsWith("/") && url.startsWit...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left buildRequestUrl AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left config AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#...
function buildRequestUrl(config: InternalAxiosRequestConfig): string { const baseUrl: string = config.baseURL ?? ""; const url: string = config.url ?? ""; if (url.startsWith("http://") || url.startsWith("https://")) { return url; } // 处理 baseURL 与 url 的拼接,避免双斜杠 if (baseUrl.endsWith("/") && url.startsWit...
https://github.com/Joker-x-dev/CoolMallArkTS
a97d4460c4fd4f65af1b44ad3d02b63158a92427
github
arkui-x/samples
CodeLab/Cases/common/utils/src/main/ets/component/GlobalStateDialog.ets
arkts
fillGlobalStateDialog
填充全局状态保留能力弹窗的布局以及内容 @param wrapBuilder 布局 @param params 内容
fillGlobalStateDialog(wrapBuilder: WrappedBuilder<[ESObject]>, params: ESObject) { this.wrapBuilder = wrapBuilder; this.params = params; this.refreshNode(); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fillGlobalStateDialog AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left wrapBuilder AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Lef...
fillGlobalStateDialog(wrapBuilder: WrappedBuilder<[ESObject]>, params: ESObject) { this.wrapBuilder = wrapBuilder; this.params = params; this.refreshNode(); }
https://gitcode.com/arkui-x/samples
f423178741ee8c539759953f0a102331885fc951
gitcode
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/utils/ObjectPool.ets
arkts
recycle
Recycle an instance of Poolable that this pool is capable of generating. The T instance passed must not already exist inside this or any other ObjectPool instance. @param object An object of type T to recycle
public recycle(object: T) { if (object.currentOwnerId != Poolable.NO_OWNER) { if (object.currentOwnerId == this.poolId) { throw new Error("The object passed is already stored in this pool!"); } else { throw new Error("The object to recycle already belongs to poolId " + object.currentOw...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left recycle AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left object AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left T AST#identifier#Right...
public recycle(object: T) { if (object.currentOwnerId != Poolable.NO_OWNER) { if (object.currentOwnerId == this.poolId) { throw new Error("The object passed is already stored in this pool!"); } else { throw new Error("The object to recycle already belongs to poolId " + object.currentOw...
https://gitee.com/openharmony-tpc/ohos_mpchart.git
df70047919344f88dda654729d9d68e79f891150
gitee
Cool_foolisher1/ArkTSRepository
GuardianAssistant/entry/src/main/ets/manager/AVPlayerManager.ets
arkts
playByRawSrc
加载 src/main/resources/rawfile 的文件
async playByRawSrc(rawFdPath: string) { const player = await this.getAVPlayerInstance() // 先释放原来的资源 await player.reset() // 获取文件信息 const context = new UIContext().getHostContext() as Context // 加载 src/main/resources/rawfile 文件夹中的文件 const fileDescriptor = await context.resourceManager.getRa...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left playByRawSrc AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left rawFdPath AST#identifier#Right AST#type_annotation#Left AST#:#Left...
async playByRawSrc(rawFdPath: string) { const player = await this.getAVPlayerInstance() // 先释放原来的资源 await player.reset() // 获取文件信息 const context = new UIContext().getHostContext() as Context // 加载 src/main/resources/rawfile 文件夹中的文件 const fileDescriptor = await context.resourceManager.getRa...
https://gitcode.com/Cool_foolisher1/ArkTSRepository
a314946cdcf70385903133b1ae5cce09ff2eb90f
gitcode
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedArrays.ets
arkts
from
Creates an array from an array-like or iterable object. @param { ArrayLike<number> } arrayLike - An array-like or iterable object to convert to an array. @returns { BigInt64Array } - A new BigInt64Array @static @syscap SystemCapability.Utils.Lang @FaAndStageModel
public static from(arrayLike: ArrayLike<number>): BigInt64Array { throw new Error("BigInt64Array.from: not implemented") }
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 arrayLike AST#identifie...
public static from(arrayLike: ArrayLike<number>): BigInt64Array { throw new Error("BigInt64Array.from: not implemented") }
https://gitcode.com/iop123123/arkts-static-skills
fe0990fff5a393acc5705b558be308853ef42260
gitcode
openharmony/codelabs
Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/pages/index.ets
arkts
sendMessageToRemoteService
连接成功后发送消息
async function sendMessageToRemoteService(score) { console.log('[game]connectRemoteService sendMessageToRemoteService:') if (mRemote == null) { console.log('[game]connectRemoteService mRemote == null') // prompt.showToast({ // message: "mRemote is null" // }); return; } let option...
AST#program#Left AST#function_declaration#Left AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left sendMessageToRemoteService AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left score AST#identifier#R...
async function sendMessageToRemoteService(score) { console.log('[game]connectRemoteService sendMessageToRemoteService:') if (mRemote == null) { console.log('[game]connectRemoteService mRemote == null') // prompt.showToast({ // message: "mRemote is null" // }); return; } let option...
https://gitee.com/openharmony/codelabs.git
84a8ed8270de373f96733e4c61beb9bc82501e8c
gitee
Gramony/Gramony
features/home/src/main/ets/viewmodel/Chat/ChatDataSource.ets
arkts
notifyDataMove
通知LazyForEach组件将from索引和to索引处的子组件进行交换
notifyDataMove(from: number, to: number): void { Logger.debug('notifyDataMove: ' + from + ' ' + to); this.listeners.forEach(listener => { listener.onDataMove(from, to); }) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left notifyDataMove AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left from AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#,#Left , ...
notifyDataMove(from: number, to: number): void { Logger.debug('notifyDataMove: ' + from + ' ' + to); this.listeners.forEach(listener => { listener.onDataMove(from, to); }) }
https://github.com/Gramony/Gramony
424deb9f2c791a3fcc8e33bce10a733e826640d2
github
chendi126/harmonyOS-TCP
entry/src/main/ets/common/GlassStyles.ets
arkts
getSecondaryTitleFontSize
获取次标题字体大小
static getSecondaryTitleFontSize(): number { return 20; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getSecondaryTitleFontSize 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 ...
static getSecondaryTitleFontSize(): number { return 20; }
https://github.com/chendi126/harmonyOS-TCP
a2ccd9541cdc96e8dc400000e1e36cf8f6d21dbb
github
openharmony/arkui_ace_engine
advanced_ui_component_static/assembled_advanced_ui_component/@ohos.arkui.advanced.GridObjectSortComponent.ets
arkts
goEdit
Enter edit function
goEdit(): void { this.getUIContext()?.animateTo({ duration: ENTER_EXIT_ICON_DURATION, curve: COMMON_BEZIER as ICurve, }, () => { this.gridComState = true; }); this.menuSwitch = true; this.isPointToEditTitleBarSaveButton = true; this.calcGridHeight(); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left goEdit 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 ...
goEdit(): void { this.getUIContext()?.animateTo({ duration: ENTER_EXIT_ICON_DURATION, curve: COMMON_BEZIER as ICurve, }, () => { this.gridComState = true; }); this.menuSwitch = true; this.isPointToEditTitleBarSaveButton = true; this.calcGridHeight(); }
https://gitcode.com/openharmony/arkui_ace_engine
bba65e78bd64dffeb69793dfd780b6ab4bfbcb53
gitcode
Joker-x-dev/CoolMallArkTS
feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets
arkts
toPay
跳转支付页面 @returns {void} 无返回值
toPay(): void { const order: Order = this.data ?? new Order(); const payPrice: number = order.price - order.discountPrice; OrderNavigator.toPay(order.id, payPrice); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toPay 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...
toPay(): void { const order: Order = this.data ?? new Order(); const payPrice: number = order.price - order.discountPrice; OrderNavigator.toPay(order.id, payPrice); }
https://github.com/Joker-x-dev/CoolMallArkTS
017f05b886a3f60e288969a2cb84dbd30baa9071
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/AppStateService.ets
arkts
getCurrentState
获取当前应用状态
getCurrentState(): AppState { return this.currentState; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getCurrentState 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 AppState AST#identifier#Right AST#ERROR#Right ...
getCurrentState(): AppState { return this.currentState; }
https://github.com/AlkaidLab/moonlight-harmony
24f42676715a28d99b406e78fca28a91a3d0993e
github
qiuhaotc/Sunshine_HarmonyOS
entry/src/main/ets/utils/CityDataService.ets
arkts
getCitiesByProvince
根据省份筛选城市
static getCitiesByProvince(province: string): CityModel[] { CityDataService.initCities(); return CityDataService.cities.filter((c: CityModel) => c.province === province); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getCitiesByProvince AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left province AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#s...
static getCitiesByProvince(province: string): CityModel[] { CityDataService.initCities(); return CityDataService.cities.filter((c: CityModel) => c.province === province); }
https://github.com/qiuhaotc/Sunshine_HarmonyOS
a435a805958271943d3a8c8b3bb04ac86d394ca6
github
DaLongZhuaZi/NGF
ngf_framework/src/main/ets/hardware/facades/LocationManagerFacade.ets
arkts
getCurrentLocation
获取当前位置(单次) 需要预先申请 ohos.permission.APPROXIMATELY_LOCATION 或 ohos.permission.LOCATION 权限 @ohos.permission ohos.permission.APPROXIMATELY_LOCATION
async getCurrentLocation(): Promise<geoLocationManager.Location | null> { try { const requestInfo: geoLocationManager.CurrentLocationRequest = { priority: geoLocationManager.LocationRequestPriority.FIRST_FIX, scenario: geoLocationManager.LocationRequestScenario.UNSET, maxAccuracy: 0 ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left getCurrentLocation AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#type_annotation#Left AST#:#Left : AST#:#Right AST#g...
async getCurrentLocation(): Promise<geoLocationManager.Location | null> { try { const requestInfo: geoLocationManager.CurrentLocationRequest = { priority: geoLocationManager.LocationRequestPriority.FIRST_FIX, scenario: geoLocationManager.LocationRequestScenario.UNSET, maxAccuracy: 0 ...
https://github.com/DaLongZhuaZi/NGF
c6eb643af82ade421265224c17d52f6235fb6314
github
zmuxuny/ai-guardian-star
entry/src/main/ets/common/ThemeManager.ets
arkts
constructor
当前主题模式
private constructor() { // 私有构造函数 }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left constructor AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left ...
private constructor() { // 私有构造函数 }
https://github.com/zmuxuny/ai-guardian-star/blob/87ab023d8b9aab4303a9fc1e97508e1f8ee01e07/entry/src/main/ets/common/ThemeManager.ets#L67-L69
63e8d9455b25cf6745f8f3be33029caa27376e7f
github
itrainhub/wu-ui
WuUI/wu_ui/src/main/ets/components/image/image-viewer.ets
arkts
calcImageDefaultSize
根据图片宽高比及窗口大小计算图片最合适的适配宽高,即,图片最适配屏幕的大小 @returns image.Size
calcImageDefaultSize(): image.Size { let width = 0 let height = 0 const winWidth = WuGlobalData.screenWidth const winHeight = WuGlobalData.screenHeight if (this.imageOriginalRatio > winWidth / winHeight) { // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示 width = winWidth height = winWidth / this.im...
AST#program#Left AST#expression_statement#Left AST#member_expression#Left AST#call_expression#Left AST#identifier#Left calcImageDefaultSize AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#...
calcImageDefaultSize(): image.Size { let width = 0 let height = 0 const winWidth = WuGlobalData.screenWidth const winHeight = WuGlobalData.screenHeight if (this.imageOriginalRatio > winWidth / winHeight) { // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示 width = winWidth height = winWidth / this.im...
https://github.com/itrainhub/wu-ui
802295f184644f0b263ba136b5986bd613b19470
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Set.ets
arkts
constructor
Creates a new Set instance with the specified number of buckets. NOTE: This API may be removed someday due #28030 internal issue @param { int } bucketsCount - The number of buckets for the internal map. @syscap SystemCapability.Utils.Lang @FaAndStageModel
constructor(bucketsCount: int) { this.elements = new FinalMap<K, K>(bucketsCount); }
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 bucketsCount AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left int AST#identifier#Right AST#ERROR#Ri...
constructor(bucketsCount: int) { this.elements = new FinalMap<K, K>(bucketsCount); }
https://gitcode.com/iop123123/arkts-static-skills
5d6a71b33857c194629de49c2b9bde3c25230f30
gitcode
xiaofenger_705/protobuf-arkts-generator
runtime/arkpb/JsonEncodingVisitor.ets
arkts
visitDouble
访问 double 字段 JSON: number or "NaN"/"Infinity"/"-Infinity"
visitDouble(value: number, fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) if (isNaN(value)) { this.json[fieldName] = "NaN" as Object } else if (value === Infinity) { this.json[fieldName] = "Infinity" as Object } else if (value === -Infinity) { this.json...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left visitDouble 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 , AS...
visitDouble(value: number, fieldNumber: number): void { const fieldName = this.getFieldName(fieldNumber) if (isNaN(value)) { this.json[fieldName] = "NaN" as Object } else if (value === Infinity) { this.json[fieldName] = "Infinity" as Object } else if (value === -Infinity) { this.json...
https://gitcode.com/xiaofenger_705/protobuf-arkts-generator
7c79f22752949fddc36c36a74b62ee331d24e455
gitcode
openharmony/applications_filepicker
entry/src/main/ets/databases/model/MimeType.ets
arkts
getResID
预留获取墨水屏显示默认图标能力
getResID(): Resource { return this.resID; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getResID 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 Resource AST#identifier#Right AST#ERROR#Right AST#sta...
getResID(): Resource { return this.resID; }
https://gitee.com/openharmony/applications_filepicker.git
b8f2a5caceeb2f972e337299c13eb5dee4c5c0c4
gitee
chenchl/GMLogger-HarmonyOS
gmlogger/src/main/ets/components/security/logger/Logger.ets
arkts
fatal
记录致命错误级别的日志。 @param message - 要记录的消息内容,必须是字符串。 @param tag - 可选的日志标签,用于标识日志的来源或类别。
fatal(message: string, tag?: string) { this.logLevel(hilog.LogLevel.FATAL, tag, message) }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left fatal 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#string#Left string AST#string#Right AST#ERROR#Right AST#,#Left ,...
fatal(message: string, tag?: string) { this.logLevel(hilog.LogLevel.FATAL, tag, message) }
https://github.com/chenchl/GMLogger-HarmonyOS
10ced631d82783cb3b82d3c40388b9577e46c1fb
github
LJ666-ui/harmony-health-care
entry/src/main/ets/deepseek/SiliconFlowClient.ets
arkts
buildMessages
==================== 私有方法 ==================== 构建完整消息列表
private buildMessages(messages: ChatMessage[], options?: ConversationOptions): ChatMessage[] { const fullMessages: ChatMessage[] = []; if (options?.systemPrompt) { fullMessages.push({ role: 'system', content: options.systemPrompt }); } fullMessages.push(...messages); ...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left buildMessages AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left messages AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#subscript_e...
private buildMessages(messages: ChatMessage[], options?: ConversationOptions): ChatMessage[] { const fullMessages: ChatMessage[] = []; if (options?.systemPrompt) { fullMessages.push({ role: 'system', content: options.systemPrompt }); } fullMessages.push(...messages); ...
https://github.com/LJ666-ui/harmony-health-care
e689eec4ffb4e76394036583e2635515cd2a7e92
github
LJ666-ui/harmony-health-care
entry/src/main/ets/ar/VoiceGuide.ets
arkts
clearQueue
清空播报队列
public clearQueue(): void { this.announcementQueue = []; console.log('[VoiceGuide] 清空播报队列'); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left clearQueue 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 clearQueue(): void { this.announcementQueue = []; console.log('[VoiceGuide] 清空播报队列'); }
https://github.com/LJ666-ui/harmony-health-care
312b906aace30c3aea92d6f3c8312e7021a67eb5
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Components/ContentPanel.ets
arkts
setGlobalStyleConfig
设置全局样式配置
setGlobalStyleConfig(config: Partial<PanelStyleConfig>): void { this.globalStyleConfig = this.mergeStyleConfig(this.globalStyleConfig, config); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left setGlobalStyleConfig AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#instantiation_expression#Left AST#identifier#Left...
setGlobalStyleConfig(config: Partial<PanelStyleConfig>): void { this.globalStyleConfig = this.mergeStyleConfig(this.globalStyleConfig, config); }
https://github.com/DaLongZhuaZi/manxia
f4837e29ac298042f493445a9a95e6c958eeeb2c
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/WebView/WebViewMangaLoader.ets
arkts
onLoadProgress
加载进度回调
onLoadProgress(request: ImageRequestInfo, progress: number): void { // 更新章节加载进度 this.updateChapterProgress(request.chapterId, false, false); // 转发给其他监听器 this.loadListeners.forEach(listener => { try { listener.onLoadProgress(request, progress); } catch (error) { logger....
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left onLoadProgress AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left request AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left ImageRequestInfo AST#identifier#Right ...
onLoadProgress(request: ImageRequestInfo, progress: number): void { // 更新章节加载进度 this.updateChapterProgress(request.chapterId, false, false); // 转发给其他监听器 this.loadListeners.forEach(listener => { try { listener.onLoadProgress(request, progress); } catch (error) { logger....
https://github.com/DaLongZhuaZi/manxia
5ffc51017499bab45229b0c8489241049f142ff7
github
Countly/countly-sdk-hos
library/src/main/ets/api/ViewsApi.ets
arkts
updateOrientation
Report a UI orientation change. Pass either `'portrait'` or `'landscape'`. Typical wiring: call from your UIAbility's `onConfigurationUpdate`, or from a `@ohos.display` `on('change', ...)` callback, the SDK does not subscribe to display events itself to avoid hard-depending on a UIAbilityContext. No-op if `trackOrienta...
public async updateOrientation(mode: string): Promise<void> { this.logger.i(`[Views] Calling updateOrientation, mode=[${mode}]`); await this.module.updateOrientation(mode); }
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 updateOrientation AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left mode AST#identifier#Right AST#:#Left :...
public async updateOrientation(mode: string): Promise<void> { this.logger.i(`[Views] Calling updateOrientation, mode=[${mode}]`); await this.module.updateOrientation(mode); }
https://github.com/Countly/countly-sdk-hos
262d49e93afd733a0c4b38fe1f6c0c09e4e9e72c
github
offlinecat-dev/OCNetORM
src/main/ets/mapping/ViewModelMapper.ets
arkts
constructor
构造函数 @param entityName 实体名称 @param factory ViewModel 工厂函数
constructor(entityName: string, factory: ViewModelFactory<T>) { this.entityName = entityName this.factory = factory }
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 entityName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST...
constructor(entityName: string, factory: ViewModelFactory<T>) { this.entityName = entityName this.factory = factory }
https://github.com/offlinecat-dev/OCNetORM
741eccd80ae21fbfe7c376f824b1abbd19a03258
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/KdbxUtils.ets
arkts
getGroupPath
获取分组路径 @param group 分组 @returns 分组路径字符串
public static getGroupPath(group: KdbxGroup | undefined, splitChar: string = '/', includeRoot: boolean = true): string { if (!group) { return ''; } const path: string[] = []; let currentGroup: KdbxGroup | undefined = group; while (currentGroup && currentGroup.name) { path.unshift(curr...
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 getGroupPath AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left group AST#identifier#Right AST#:#Left : AS...
public static getGroupPath(group: KdbxGroup | undefined, splitChar: string = '/', includeRoot: boolean = true): string { if (!group) { return ''; } const path: string[] = []; let currentGroup: KdbxGroup | undefined = group; while (currentGroup && currentGroup.name) { path.unshift(curr...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/KdbxUtils.ets#L703-L718
0cf67e3a7b369fd279a6cd727b14888356a89d66
github
SMAT-Lab/PhantomRendering
Harmoney_Next-Tiktok/entry/src/main/ets/utils/TiktokCollection.ets
arkts
addCollection
添加收藏 @param item 视频
static async addCollection(item: mediaType) { const store = TiktokCollection.getStore() const list = TiktokCollection.getCollectionData() if (!TiktokCollection.hasCollection(item)) { list.unshift(item) store.putSync(Constants.GLOBAL_VIDEO_COLLECTION, JSON.stringify(list)) await store.flu...
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 addCollection AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST...
static async addCollection(item: mediaType) { const store = TiktokCollection.getStore() const list = TiktokCollection.getCollectionData() if (!TiktokCollection.hasCollection(item)) { list.unshift(item) store.putSync(Constants.GLOBAL_VIDEO_COLLECTION, JSON.stringify(list)) await store.flu...
https://github.com/SMAT-Lab/PhantomRendering
38a3842dba79a1d9557eaf238051ddb0196ee6d1
github
honjow/Next2V
feature/detail/src/main/ets/model/TopicDetailScrollCoordinator.ets
arkts
replyIndexFromCenterListIndex
The displayed-row index whose reply IS this list (center) index — used to remember the read floor.
static replyIndexFromCenterListIndex(centerIndex: number): number { return centerIndex - TopicDetailScrollCoordinator.REPLY_LIST_OFFSET }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left replyIndexFromCenterListIndex AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left centerIndex AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left...
static replyIndexFromCenterListIndex(centerIndex: number): number { return centerIndex - TopicDetailScrollCoordinator.REPLY_LIST_OFFSET }
https://github.com/honjow/Next2V
79f65006c8a96b3dce3ed21f7d8b274b7261e479
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/DownloadsViewModel.ets
arkts
batchDeleteTasksByIds
@param ids 待删除的任务ID列表 底层辅助函数:根据 任务ID 列表批量删除任务 只负责删文件、删数据库、更新内存列表
private async batchDeleteTasksByIds(ids: string[]) { if (ids.length === 0) return; logger.info(`batchDeleteTasksByIds: 开始批量删除 ${ids.length} 个任务`); for (const id of ids) { const task = this.tasks.find(d => d.task_id === id); if (task) { try { // 复用单条删除(里面包含了删系统任务、删文件、删DB、更新 ...
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 batchDeleteTasksByIds AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left ids AST#identifier#Right AST#:#...
private async batchDeleteTasksByIds(ids: string[]) { if (ids.length === 0) return; logger.info(`batchDeleteTasksByIds: 开始批量删除 ${ids.length} 个任务`); for (const id of ids) { const task = this.tasks.find(d => d.task_id === id); if (task) { try { // 复用单条删除(里面包含了删系统任务、删文件、删DB、更新 ...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/DownloadsViewModel.ets#L566-L582
d6c337f572554334c237c8a29f89c8600d3d664c
github
arkui-x/samples
CodeLab/Cases/feature/cardswiperanimation/src/main/ets/model/CardModel.ets
arkts
getData
Return the data of index @param index - 集合 index @returns: 集合index项数据
getData(index: number): CardInfo { return this.list[index]; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getData AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left index AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left number AST#identifier#Right AST#)#Left ) AST#)#...
getData(index: number): CardInfo { return this.list[index]; }
https://gitcode.com/arkui-x/samples
179a3f8a4aaf406dd13c8bcdd5b4162a910398bb
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Loaders/MangaDetailLoader.ets
arkts
refreshOnlineMangaFromNetwork
从网络刷新在线漫画
private async refreshOnlineMangaFromNetwork(comicInfo: ComicInfo, result: MangaDetailLoadResult): Promise<void> { try { if (!this.currentSourceName || this.currentSourceId <= 0) { logger.warn(TAG, '无法刷新:图源信息不完整'); return; } // 初始化MangaEngine this.mangaEngine = await ...
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 refreshOnlineMangaFromNetwork AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left comicInfo AST#identifie...
private async refreshOnlineMangaFromNetwork(comicInfo: ComicInfo, result: MangaDetailLoadResult): Promise<void> { try { if (!this.currentSourceName || this.currentSourceId <= 0) { logger.warn(TAG, '无法刷新:图源信息不完整'); return; } // 初始化MangaEngine this.mangaEngine = await ...
https://github.com/DaLongZhuaZi/manxia
e09bbe7bd4e4bf240669b717091c5e5687d2b51c
github
wblxr408/SEU-SE-HarmonyExpense-App-
entry/src/main/ets/dao/SharedLedgerDAO.ets
arkts
insert
创建审批记录
static async insert(record: ApprovalRecord): Promise<number> { try { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); record.requestedAt = now; record.createdAt = now; record.updatedAt = now; const values: relationalStore.ValuesBucket = { ...
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#identifier#Left async AST#identifier#Right AST#call_expression#Left AST#identifier#Left insert AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left record AST#identifier#Right AST#:#Left : AST#:#Ri...
static async insert(record: ApprovalRecord): Promise<number> { try { const store = DatabaseManager.getDatabase(); const now = new Date().toISOString(); record.requestedAt = now; record.createdAt = now; record.updatedAt = now; const values: relationalStore.ValuesBucket = { ...
https://github.com/wblxr408/SEU-SE-HarmonyExpense-App-
673252667f2139b044da9118f1d273f72d912a97
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/BuiltinArraySort.ets
arkts
quickSortSplit
Split range [startIndex, endIndex) by pivot arr[startIndex] and return pivot position Elements equal to pivot go to the right
function quickSortSplit(arr: FixedArray<byte>, startIndex: int, endIndex: int): int { const pivot = arr[startIndex] let i = startIndex + 1 let j = endIndex - 1 // No bounds check because pivot is median of three elements while ((arr[i] < pivot)) { i++ } if (i == startIndex + 1) { ...
AST#program#Left AST#function_declaration#Left AST#function#Left function AST#function#Right AST#identifier#Left quickSortSplit AST#identifier#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left arr AST#identifier#Right AST#type_annotation#Left AST#:#Left : AST#:#Ri...
function quickSortSplit(arr: FixedArray<byte>, startIndex: int, endIndex: int): int { const pivot = arr[startIndex] let i = startIndex + 1 let j = endIndex - 1 // No bounds check because pivot is median of three elements while ((arr[i] < pivot)) { i++ } if (i == startIndex + 1) { ...
https://gitcode.com/iop123123/arkts-static-skills
b3aa1446aa0ff1d43bcc00e3bcd9e379476b4117
gitcode
fangmingtao/Ohs_ArkTs_Eyepetizer
entry/src/main/ets/datasource/BasicDataSource.ets
arkts
registerDataChangeListener
注册数据变化监听器
registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { // 没有在listeners里面,就添加 this.listeners.push(listener); } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left registerDataChangeListener AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left listener AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left DataChangeListener AST#id...
registerDataChangeListener(listener: DataChangeListener): void { if (this.listeners.indexOf(listener) < 0) { // 没有在listeners里面,就添加 this.listeners.push(listener); } }
https://gitcode.com/fangmingtao/Ohs_ArkTs_Eyepetizer
fee95f58c7b5122e302e67d0531b7bb90063a99c
gitcode
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Managers/ThemeManager.ets
arkts
getLightModeBlurStyle
获取浅色主题下的模糊样式
public getLightModeBlurStyle(): BlurStyle { return this.getGlassBlurStyleForLevel(GlassLevel.CARD); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getLightModeBlurStyle 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 ...
public getLightModeBlurStyle(): BlurStyle { return this.getGlassBlurStyleForLevel(GlassLevel.CARD); }
https://github.com/DaLongZhuaZi/manxia
9898fbea19a942e95dd4eb714cc79cf8929068cd
github
ZestBox-18/kitebook-frontend
features/home/src/main/ets/components/AssetAccountListSectionComponent.ets
arkts
AssetListHeader
构建资产账户列表头部,展示标题与账户数量。
private AssetListHeader() { Row() { Text('账户列表') .fontSize(13) .fontColor(this.themeState.fontSecondary) Text(`${this.assetAccounts.length} 个账户`) .fontSize(12) .fontColor(this.themeState.brand) } .width('100%') .justifyContent(FlexAlign.SpaceBetween) .pa...
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left AssetListHeader AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#ERROR#Right AST#expression_statement#Left AS...
private AssetListHeader() { Row() { Text('账户列表') .fontSize(13) .fontColor(this.themeState.fontSecondary) Text(`${this.assetAccounts.length} 个账户`) .fontSize(12) .fontColor(this.themeState.brand) } .width('100%') .justifyContent(FlexAlign.SpaceBetween) .pa...
https://github.com/ZestBox-18/kitebook-frontend
cc39fa84791bed46c2f0387c5ec660f0b8e49d36
github
openharmony/applications_contacts
entry/src/main/ets/util/CalendarUtil.ets
arkts
getLunarDate
公历转农历
getLunarDate(date: Date) { let calendar: i18n.Calendar = i18n.getCalendar('zh-CN', 'chinese'); calendar.setTime(date); let lunarYear: number = calendar.get('era') * YEAR_CYCLE + calendar.get('year') - YEAR_CONVERT; let lunarMonth: number = calendar.get('month'); let lunarDay: number = calendar.get...
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left getLunarDate AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left date AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left Date AST#identifier#Right AS...
getLunarDate(date: Date) { let calendar: i18n.Calendar = i18n.getCalendar('zh-CN', 'chinese'); calendar.setTime(date); let lunarYear: number = calendar.get('era') * YEAR_CYCLE + calendar.get('year') - YEAR_CONVERT; let lunarMonth: number = calendar.get('month'); let lunarDay: number = calendar.get...
https://gitee.com/openharmony/applications_contacts.git
9661f360b6394ea5c3abb9f124f5c95e2eba4192
gitee
OHPG/FinSdk
emby/src/main/ets/api/UserApi.ets
arkts
updateUserPassword
updateUserPassword @summary Updates a user\'s password. @param {UserApiUpdateUserPasswordRequest} requestParameters Request parameters. @throws {RequiredError} @memberof UserApi
public async updateUserPassword(requestParameters: UserApiUpdateUserPasswordRequest): Promise<void> { return this.apiClient.post({ path: `/Users/${requestParameters.userId}/Password`, data: requestParameters.updateUserPassword }) }
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 updateUserPassword AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left requestParameters AST#identifier#Righ...
public async updateUserPassword(requestParameters: UserApiUpdateUserPasswordRequest): Promise<void> { return this.apiClient.post({ path: `/Users/${requestParameters.userId}/Password`, data: requestParameters.updateUserPassword }) }
https://github.com/OHPG/FinSdk
f54690059870af741e4822168a84d8c6336d51a4
github
DaLongZhuaZi/manxia
entry/src/main/ets/Framework/Download/StreamDownloader.ets
arkts
tickProgress
每完成一个文件后调用,重置心跳计时
private tickProgress(): void { this.lastProgressTime = Date.now(); }
AST#program#Left AST#ERROR#Left AST#private#Left private AST#private#Right AST#call_expression#Left AST#identifier#Left tickProgress 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#expres...
private tickProgress(): void { this.lastProgressTime = Date.now(); }
https://github.com/DaLongZhuaZi/manxia
9b5da3e0b8f5153a5fcec21b02878fc70747261f
github
picklerick422/zju-learning-assistant-OH
entry/src/main/ets/services/NativeBridge.ets
arkts
getCourses
---------------- 学在浙大 ---------------- 注意:当前 SDK 尚未"校验" libzla_core.so,ArkTS 把 zla.* 视为 any, 故所有结果都显式标注类型,避免 arkts-no-any-unknown。
static async getCourses(): Promise<Course[]> { const json: string = await zla.getCourses(); return JSON.parse(json) as Course[]; }
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 getCourses AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Lef...
static async getCourses(): Promise<Course[]> { const json: string = await zla.getCourses(); return JSON.parse(json) as Course[]; }
https://github.com/picklerick422/zju-learning-assistant-OH
16ba54ad92d0cfcd5645a111d4070a892520c4aa
github
David8Idira/AI-OA
packages/harmonyos/commons/src/main/ets/services/IMService.ets
arkts
unpinConversation
取消置顶会话 @param conversationId 会话ID
async unpinConversation(conversationId: string): Promise<ApiResponse<any>> { return this.client.delete<any>(`/api/v1/im/conversations/${conversationId}/pin`) }
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left unpinConversation AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left conversationId AST#identifier#Right AST#type_annotation#Left ...
async unpinConversation(conversationId: string): Promise<ApiResponse<any>> { return this.client.delete<any>(`/api/v1/im/conversations/${conversationId}/pin`) }
https://github.com/David8Idira/AI-OA
c9f04e580fcafedfe8875b5f1ab5529a65b3faeb
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/TypedUArrays.ets
arkts
includes
Determines whether BigUint64Array includes a certain element, returning true or false as appropriate @param { BigInt } searchElement - The element to search for. @param { int } [fromIndex] - The position in this array at which to begin searching for searchElement If fromIndex is undefined, the search starts at index 0....
public includes(searchElement: BigInt, fromIndex?: int): boolean { if (searchElement < 0 || searchElement > BigUint64Array.unsignedLongMax) { return false; } return this.indexOf(searchElement, asIntOrDefault(fromIndex, 0)) != -1 }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left includes AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left searchElement AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#identifier#Left BigInt AST#ide...
public includes(searchElement: BigInt, fromIndex?: int): boolean { if (searchElement < 0 || searchElement > BigUint64Array.unsignedLongMax) { return false; } return this.indexOf(searchElement, asIntOrDefault(fromIndex, 0)) != -1 }
https://gitcode.com/iop123123/arkts-static-skills
29e056eca82f8fd6ec7e97c6caedcb4573e56b2d
gitcode
TDCQCX/ShiHuaMusic-Harmony
entry/src/main/ets/pages/Register/RegisterPage.ets
arkts
aboutToDisappear
页面即将消失
aboutToDisappear(): void { if (this.captchaTimer !== -1) { clearInterval(this.captchaTimer) } }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left aboutToDisappear AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b...
aboutToDisappear(): void { if (this.captchaTimer !== -1) { clearInterval(this.captchaTimer) } }
https://github.com/TDCQCX/ShiHuaMusic-Harmony
659dcc39304d7004fecb5027842a43480a71566c
github
aimilin6688/KeePassHO
entry/src/main/ets/common/utils/KdbxUtils.ets
arkts
isFavorite
检查条目或分组是否收藏 @param item 条目或分组 @returns 是否收藏
public static isFavorite(item: KdbxEntry | KdbxGroup): boolean { return item.tags && item.tags.includes(KdbxUtils.FAVORITE_TAG); }
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 isFavorite AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left item AST#identifier#Right AST#:#Left : AST#:...
public static isFavorite(item: KdbxEntry | KdbxGroup): boolean { return item.tags && item.tags.includes(KdbxUtils.FAVORITE_TAG); }
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/common/utils/KdbxUtils.ets#L448-L450
de98582c1eac6bc656abf513da352d0fd08a12d2
github
LZZLHY/hlib
entry/src/main/ets/api/DomainManifest.ets
arkts
isEnabled
─── 配置 ───────────────────────────────────────────
static isEnabled(): boolean { return DomainManifest.enabled; }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left isEnabled AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#boolean#Left boolean AST#boo...
static isEnabled(): boolean { return DomainManifest.enabled; }
https://github.com/LZZLHY/hlib
5c9b66f73fcee5f8594b1fe649e776ed3e20d73f
github
xblLab/HarmonyProjectTemplate
commons/lib_api/src/main/ets/services/AuthorService.ets
arkts
queryAuthorInfo
查询用户信息 @param userId @returns
public queryAuthorInfo(userId?: string, loginChannel?: string): AuthorResponse | undefined { if (loginChannel) { return this.signIn(loginChannel); } const raw = this.queryAuthorRaw(userId); if (raw) { return this.handleRawInfo(raw); } return undefined; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left queryAuthorInfo AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left userId AST#identifier#Right AST#?#Left ? AST#?#Right AST#:#Left : AST#:#Right AST#ERROR...
public queryAuthorInfo(userId?: string, loginChannel?: string): AuthorResponse | undefined { if (loginChannel) { return this.signIn(loginChannel); } const raw = this.queryAuthorRaw(userId); if (raw) { return this.handleRawInfo(raw); } return undefined; }
https://github.com/xblLab/HarmonyProjectTemplate
e9168ed8e036e7de1e215057a01c3b4e6557a179
github
iop123123/arkts-static-skills
cli/arkts-static-cli/runtime/ark/es2panda/linux/etc/sdk/api/@arkts.math.Decimal.ets
arkts
set
Configures the 'global' settings for this particular Decimal constructor. @param { DecimalConfig } config object with one or more of the following properties, precision {double} rounding {Rounding} toExpNeg {double} toExpPos {double} maxE {double} minE {double} modulo {Modulo} crypto {boolean...
static set(config: DecimalConfig): void { let useDefaults = (config.defaults != undefined && config.defaults === true); Decimal.precision = Utils.checkRange(config.precision, 1, MAX_DIGITS, useDefaults, [DEFAULTS_PRECISION, Decimal.precision]); Decimal.rounding = Utils.checkRange...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left static AST#identifier#Right AST#ERROR#Left AST#identifier#Left set AST#identifier#Right AST#ERROR#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left config AST#identifier#Right AST#:#Left : AST#:#Right AST#ERR...
static set(config: DecimalConfig): void { let useDefaults = (config.defaults != undefined && config.defaults === true); Decimal.precision = Utils.checkRange(config.precision, 1, MAX_DIGITS, useDefaults, [DEFAULTS_PRECISION, Decimal.precision]); Decimal.rounding = Utils.checkRange...
https://gitcode.com/iop123123/arkts-static-skills
470f947d3071eae741da74d2dde479aeb5eaec2d
gitcode
offlinecat-dev/OCNetORM
src/main/ets/logging/Logger.ets
arkts
logTransaction
记录事务日志 在 INFO 及以上级别记录,包含事务操作类型 @param action 事务操作(BEGIN/COMMIT/ROLLBACK)
logTransaction(action: string): void { // 事务日志在 INFO 及以上级别记录 if (!this.shouldLog(LogLevel.INFO)) { return } const message = this.formatMessage(LOG_TYPE_TRANSACTION, '-', action) this.recordToHistory(message) hilog.info(this.domain, this.tag, message) }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left logTransaction AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left action AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left string AST#identifier#Right AST#)#Left ...
logTransaction(action: string): void { // 事务日志在 INFO 及以上级别记录 if (!this.shouldLog(LogLevel.INFO)) { return } const message = this.formatMessage(LOG_TYPE_TRANSACTION, '-', action) this.recordToHistory(message) hilog.info(this.domain, this.tag, message) }
https://github.com/offlinecat-dev/OCNetORM
ea978fbf21ace28fa2028c35ca3ea189a1b210eb
github
ibestservices/ibest-ui
library/src/main/ets/components/numberKeyboard/index.ets
arkts
genDefaultKeys
获取默认keys
genDefaultKeys(): IBestNumberKeyboardType[] { return [ ...this.genBasicKeys(), { text: this.extraKey as string, type: 'extra' }, { text: "0" }, { text: this.deleteButtonText, type: 'delete' } ] }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left genDefaultKeys 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 IBestNumberKeyboardType AST#identifier#Right AS...
genDefaultKeys(): IBestNumberKeyboardType[] { return [ ...this.genBasicKeys(), { text: this.extraKey as string, type: 'extra' }, { text: "0" }, { text: this.deleteButtonText, type: 'delete' } ] }
https://github.com/ibestservices/ibest-ui/blob/4c1aee7f9a949ed2c5ef0f0fc9f6d8a2beb9a30e/library/src/main/ets/components/numberKeyboard/index.ets#L136-L143
d855c8fe9424144a38d8188401306f923678fd36
github
arkui-x/samples
CodeLab/Cases/feature/imagemosaic/src/main/ets/view/ImageMosaicView.ets
arkts
applyMosaic
图片马赛克处理函数
@Concurrent async function applyMosaic(dataArray: Uint8Array, imageWidth: number, imageHeight: number, blockSize: number, offMinX: number, offMinY: number, offMaxX: number, offMaxY: number): Promise<Uint8Array | undefined> { try { // 计算横排和纵排的块数 let xBlocks = Math.floor((Math.abs(offMaxX - offMinX)) / blockS...
AST#program#Left AST#function_declaration#Left AST#decorator#Left AST#@#Left @ AST#@#Right AST#identifier#Left Concurrent AST#identifier#Right AST#decorator#Right AST#async#Left async AST#async#Right AST#function#Left function AST#function#Right AST#identifier#Left applyMosaic AST#identifier#Right AST#formal_parameters...
@Concurrent async function applyMosaic(dataArray: Uint8Array, imageWidth: number, imageHeight: number, blockSize: number, offMinX: number, offMinY: number, offMaxX: number, offMaxY: number): Promise<Uint8Array | undefined> { try { // 计算横排和纵排的块数 let xBlocks = Math.floor((Math.abs(offMaxX - offMinX)) / blockS...
https://gitcode.com/arkui-x/samples
e2432a858469b05459f2da2c18eeb0e55e25f24a
gitcode
cpdd5201314/harmonyOS-music-app
products/phone/src/main/ets/pages/SearchHistoryManager.ets
arkts
getSearchHistory
获取搜索历史
static async getSearchHistory(): Promise<SearchRecord[]> { try { if (!SearchHistoryManager.checkInitialized()) { console.warn('[SearchHistory] 存储未初始化,返回空数组') return [] } const store = SearchHistoryManager.preferencesStore! const historyStr = await store.get(SearchHistoryMa...
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 getSearchHistory AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST...
static async getSearchHistory(): Promise<SearchRecord[]> { try { if (!SearchHistoryManager.checkInitialized()) { console.warn('[SearchHistory] 存储未初始化,返回空数组') return [] } const store = SearchHistoryManager.preferencesStore! const historyStr = await store.get(SearchHistoryMa...
https://github.com/cpdd5201314/harmonyOS-music-app
6525d0883c5bd5c96ffe95279f98c24396f13cd9
github
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets
arkts
fullscreenFull
Toggle the full fullscreen status of the window.
async fullscreenFull() { this.showMore = false; switch (this.fullscreenStatus) { case meowUiFullscreenStatus.NONE: this.fullscreenStatus = meowUiFullscreenStatus.FULLSCREEN_FULL; // Put this line first to avoid render / display flaws. // This seems helpless to the issue :P // Enter fulls...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left fullscreenFull AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{...
async fullscreenFull() { this.showMore = false; switch (this.fullscreenStatus) { case meowUiFullscreenStatus.NONE: this.fullscreenStatus = meowUiFullscreenStatus.FULLSCREEN_FULL; // Put this line first to avoid render / display flaws. // This seems helpless to the issue :P // Enter fulls...
https://github.com/awaLiny2333/LinysBrowser_NEXT
cf0b893d5da423d2a746fcdeb9e42461bd486b9f
github
XHXYT/Pixark
entry/src/main/ets/viewmodel/AppDataViewModel.ets
arkts
readJsonFile
读取文件并解析为严格的 ImportDataStructure
private async readJsonFile(uri: string): Promise<ImportDataStructure | null> { try { const file = fs.openSync(uri, fs.OpenMode.READ_ONLY); const stat = fs.statSync(file.fd); const buffer = new ArrayBuffer(stat.size); fs.readSync(file.fd, buffer); fs.closeSync(file); const textD...
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 readJsonFile AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left uri AST#identifier#Right AST#:#Left : AS...
private async readJsonFile(uri: string): Promise<ImportDataStructure | null> { try { const file = fs.openSync(uri, fs.OpenMode.READ_ONLY); const stat = fs.statSync(file.fd); const buffer = new ArrayBuffer(stat.size); fs.readSync(file.fd, buffer); fs.closeSync(file); const textD...
https://github.com/XHXYT/Pixark/blob/fd28e9760e7566d4db095653f7fc4664a819fa5c/entry/src/main/ets/viewmodel/AppDataViewModel.ets#L49-L70
8a590b3ce09d701b5e152e5a6887fdd89c9293e1
github
AlkaidLab/moonlight-harmony
entry/src/main/ets/service/streaming/NvHttp.ets
arkts
uploadClipboardBlob
上传剪贴板大 payload。返回扫描后的 id/mime/size,包装成 KIND_REF 由 调用方负责。与 Sunshine 对接,路径固定为 /api/v1/clipboard/blob。
async uploadClipboardBlob(mime: string, data: Uint8Array): Promise<ClipboardBlobUploadResult> { const headers: Record<string, string> = { 'X-Clipboard-Mime': mime } const response = await this.doBinaryHttpsPostWithFrpRetry( 'api/v1/clipboard/blob', data, undefined, NvHttp.CLIPBOARD_BLOB_TIMEOU...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left uploadClipboardBlob AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#required_parameter#Left AST#identifier#Left mime AST#identifier#Right AST#type_annotation#Left AST#:#Le...
async uploadClipboardBlob(mime: string, data: Uint8Array): Promise<ClipboardBlobUploadResult> { const headers: Record<string, string> = { 'X-Clipboard-Mime': mime } const response = await this.doBinaryHttpsPostWithFrpRetry( 'api/v1/clipboard/blob', data, undefined, NvHttp.CLIPBOARD_BLOB_TIMEOU...
https://github.com/AlkaidLab/moonlight-harmony
cd0af5e9b2f1a901b71219ed54c59475920c7095
github
751496032/ZRouter
RouterApi/src/main/ets/model/ConfigInitializer.ets
arkts
context
强烈建议初始化 @param value
public set context(value: Context) { this._context = value }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left set AST#identifier#Right AST#call_expression#Left AST#identifier#Left context AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left value AST#identifier#Right AST#:#Left : AST#:#Righ...
public set context(value: Context) { this._context = value }
https://github.com/751496032/ZRouter/blob/bacb12ccf3187546fe287cff3c63f2925ce941d6/RouterApi/src/main/ets/model/ConfigInitializer.ets#L91-L93
a441a50a4db6f5076a663ff1e3755dc1473b15b2
github
openharmony-tpc/ohos_mpchart
library/src/main/ets/components/components/YAxis.ets
arkts
setSpaceTop
Sets the top axis space in percent of the full range. Default 10f @param percent
public setSpaceTop(percent: number): void { this.mSpacePercentTop = percent; }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left setSpaceTop AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left percent AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#number#Left number AST#number#Rig...
public setSpaceTop(percent: number): void { this.mSpacePercentTop = percent; }
https://gitee.com/openharmony-tpc/ohos_mpchart.git
9fdb91b589f0828e7f7368df470db529b3135daa
gitee
awaLiny2333/LinysBrowser_NEXT
home/src/main/ets/hosts/system/windows/classes/meowUiHost.ets
arkts
initWorkingDir
Ensures the working directory exist and determines if isZone.
async initWorkingDir() { const alreadyExist = await ensureDirectoryExist(this.workingDir); // Opened tabs for this window. meow(`Ensured directory [${this.workingDir}]. isZone = [${this.isZone}]. alreadyExist = [${alreadyExist}].`, `meowUiHost][initWorkingDir][${this.windowId}`, meowLevel.WARN); // Load ...
AST#program#Left AST#ERROR#Left AST#async#Left async AST#async#Right AST#ERROR#Left AST#identifier#Left initWorkingDir AST#identifier#Right AST#ERROR#Right AST#formal_parameters#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#formal_parameters#Right AST#ERROR#Right AST#statement_block#Left AST#{#Left { AST#{...
async initWorkingDir() { const alreadyExist = await ensureDirectoryExist(this.workingDir); // Opened tabs for this window. meow(`Ensured directory [${this.workingDir}]. isZone = [${this.isZone}]. alreadyExist = [${alreadyExist}].`, `meowUiHost][initWorkingDir][${this.windowId}`, meowLevel.WARN); // Load ...
https://github.com/awaLiny2333/LinysBrowser_NEXT
2054b2d2b27f65f4d96042a6ee782f3d167b3856
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Errors.ets
arkts
constructor
Constructs a new InvalidAsyncOperationError 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("InvalidAsyncOperationError", 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("InvalidAsyncOperationError", message, options) }
https://gitcode.com/iop123123/arkts-static-skills
93b8ce1ba8e33609bcdbf5192fb43429bfa7310b
gitcode
aimilin6688/KeePassHO
entry/src/main/ets/services/store/DistributedKVService.ets
arkts
initDeviceManager
初始化设备管理器
private static initDeviceManager(): void { try { if (!DistributedKVService.appId) { hilog.error(DOMAIN, TAG, 'appId is not initialized'); return; } DistributedKVService.deviceManager = distributedDeviceManager.createDeviceManager(DistributedKVService.appId); // 监听设备状态变化(上线/...
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 initDeviceManager AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Righ...
private static initDeviceManager(): void { try { if (!DistributedKVService.appId) { hilog.error(DOMAIN, TAG, 'appId is not initialized'); return; } DistributedKVService.deviceManager = distributedDeviceManager.createDeviceManager(DistributedKVService.appId); // 监听设备状态变化(上线/...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/DistributedKVService.ets#L146-L159
8f0c6dc7b79c590671c624176c1b97822e8165ba
github
Joker-x-dev/CoolMallArkTS
feature/main/src/main/ets/viewmodel/HomeViewModel.ets
arkts
toRecommendPage
跳转到推荐商品页面 @returns {void} 无返回值
toRecommendPage(): void { const params: GoodsCategoryParam = { typeId: undefined, featured: false, recommend: true, keyword: undefined }; GoodsNavigator.toCategory(params); }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left toRecommendPage AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_bl...
toRecommendPage(): void { const params: GoodsCategoryParam = { typeId: undefined, featured: false, recommend: true, keyword: undefined }; GoodsNavigator.toCategory(params); }
https://github.com/Joker-x-dev/CoolMallArkTS
88102e86a9c5c0a453b126469e6e0b24c22f5dde
github
DaLongZhuaZi/manxia
entry/src/main/ets/Utils/NativeModuleManager.ets
arkts
getNativeModule
获取Native模块 @param moduleName 模块名称 @returns Native模块实例或undefined
public getNativeModule(moduleName: string): NativeXComponentModule | undefined { try { // 先从缓存中查找 if (this.nativeModules.has(moduleName)) { return this.nativeModules.get(moduleName); } // 从全局对象中获取requireNapi函数 if (!this.globalObject) { logger.error('NativeModuleManag...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left getNativeModule AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#identifier#Left moduleName AST#identifier#Right AST#ERROR#Left AST#:#Left : AST#:#Right AST#string#Left string AST#str...
public getNativeModule(moduleName: string): NativeXComponentModule | undefined { try { // 先从缓存中查找 if (this.nativeModules.has(moduleName)) { return this.nativeModules.get(moduleName); } // 从全局对象中获取requireNapi函数 if (!this.globalObject) { logger.error('NativeModuleManag...
https://github.com/DaLongZhuaZi/manxia
64d6074d714b6c2034178c6c18ba99440b56a531
github
DaLongZhuaZi/manxia
entry/src/main/ets/libs/htmlparser/HtmlEntities.ets
arkts
getNamedEntity
获取命名实体对应的字符
static getNamedEntity(name: string): string | undefined { return HtmlEntities.getNamedEntities().get(name); }
AST#program#Left AST#ERROR#Left AST#static#Left static AST#static#Right AST#call_expression#Left AST#identifier#Left getNamedEntity 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 s...
static getNamedEntity(name: string): string | undefined { return HtmlEntities.getNamedEntities().get(name); }
https://github.com/DaLongZhuaZi/manxia
6773f5238d3f7f2e079f722a38c27ee92c2899a2
github
aimilin6688/KeePassHO
entry/src/main/ets/services/store/SyncSettingsService.ets
arkts
initSync
初始化分布式同步服务(KVStore + 订阅 + 清理旧数据) 由 EntryAbility 在非核心服务初始化阶段调用
public static async initSync(context: common.UIAbilityContext): Promise<void> { await SyncSettingsService.initDeviceIdPreferences(context); await DistributedKVService.init(context).then(() => { SyncSettingsService.init(); }).catch((err: Error) => { hilog.error(DOMAIN, TAG, `Failed to init Dist...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#identifier#Left static AST#identifier#Right AST#async#Left async AST#async#Right AST#call_expression#Left AST#identifier#Left initSync AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left context A...
public static async initSync(context: common.UIAbilityContext): Promise<void> { await SyncSettingsService.initDeviceIdPreferences(context); await DistributedKVService.init(context).then(() => { SyncSettingsService.init(); }).catch((err: Error) => { hilog.error(DOMAIN, TAG, `Failed to init Dist...
https://github.com/aimilin6688/KeePassHO/blob/6ac299504782abfed903b23a13c736b0841388d9/entry/src/main/ets/services/store/SyncSettingsService.ets#L163-L170
2740fea5366b774dbb493119b6f6e3ca5db9a129
github
HarmonyOS_Samples/guide-snippets
Ability/UIAbilityUsage/entry/src/main/ets/context/BasicUsage.ets
arkts
startAbilityTest
[StartExclude terminateSelf]
startAbilityTest(): void { let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let want: Want = { // Want参数信息 // [StartExclude basicUsage] bundleName: 'com.samples.uiabilityusage', abilityName: 'UIAbilityB' // [EndExclude basicUsage] }; try { ...
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left startAbilityTest AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#void#Left void AST#void#Right AST#ERROR#Right AST#statement_b...
startAbilityTest(): void { let context = this.getUIContext().getHostContext() as common.UIAbilityContext; let want: Want = { // Want参数信息 // [StartExclude basicUsage] bundleName: 'com.samples.uiabilityusage', abilityName: 'UIAbilityB' // [EndExclude basicUsage] }; try { ...
https://gitcode.com/HarmonyOS_Samples/guide-snippets
fbb2697b568d53902560b65dc11151ec90459e3b
gitcode
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Date.ets
arkts
constructor
`Date` constructor. @param year @param month @see ECMA-262, 21.4.2.1 @description Initialize `Date` instance with year and month given.
constructor(year: long, month: long) { this.ms = ecmaMakeDate(ecmaMakeDay(year, month, 1 as long), ecmaMakeTime(0 as long, 0 as long, 0 as long, 0 as long)) this.TZOffset = Date.getLocalTimezoneOffset() }
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 year AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier#Left long AST#identifier#Right AST...
constructor(year: long, month: long) { this.ms = ecmaMakeDate(ecmaMakeDay(year, month, 1 as long), ecmaMakeTime(0 as long, 0 as long, 0 as long, 0 as long)) this.TZOffset = Date.getLocalTimezoneOffset() }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
09c1774d323ffeff7a4f0459928ec3e8b17734e2
gitee
openharmony-sig/arkcompiler_runtime_core
plugins/ets/stdlib/escompat/Array.ets
arkts
values
Returns an iterator over all values
public values(): ValuesIterator<T> { return new ValuesIterator<T>(this.data); }
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left values 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 values(): ValuesIterator<T> { return new ValuesIterator<T>(this.data); }
https://gitee.com/openharmony-sig/arkcompiler_runtime_core.git
fe7df28eeb4ae457b66b1ceccf8dcc094fd0bb41
gitee
openharmony-sig/applications_calculator
feature/calculation/src/main/ets/historyrecord/HistoryRecordController.ets
arkts
queryPhoneRecords
query all history records @param callback
public queryPhoneRecords(callback: Function): void { LogUtil.info(TAG, 'query phone records start'); this.expressionsModel.queryAllRecords((expList: Array<LooseObject>) => { if (expList !== null && expList.length !== 0) { this.isEmptyView = false; } this.expDataSource.refresh(expList...
AST#program#Left AST#ERROR#Left AST#public#Left public AST#public#Right AST#call_expression#Left AST#identifier#Left queryPhoneRecords AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#ERROR#Left AST#identifier#Left callback AST#identifier#Right AST#:#Left : AST#:#Right AST#ERROR#Right AST#identifier...
public queryPhoneRecords(callback: Function): void { LogUtil.info(TAG, 'query phone records start'); this.expressionsModel.queryAllRecords((expList: Array<LooseObject>) => { if (expList !== null && expList.length !== 0) { this.isEmptyView = false; } this.expDataSource.refresh(expList...
https://gitee.com/openharmony-sig/applications_calculator.git
9ee0735cbb9283c7b737ea33beb15ae9a624a7d7
gitee
ZestBox-18/kitebook-frontend
commons/base/src/main/ets/entities/BillBean.ets
arkts
getAccountDisplayText
获取账单展示使用的账户文案。
getAccountDisplayText(): string { if (this.type === BillTypeEnum.TRANSFER && this.targetAccount.trim().length > 0) { return `${this.account} -> ${this.targetAccount}`; } return this.account; }
AST#program#Left AST#ERROR#Left AST#call_expression#Left AST#identifier#Left getAccountDisplayText AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Left : AST#:#Right AST#string#Left string AST#string#Right AST#ERROR#Right AST#...
getAccountDisplayText(): string { if (this.type === BillTypeEnum.TRANSFER && this.targetAccount.trim().length > 0) { return `${this.account} -> ${this.targetAccount}`; } return this.account; }
https://github.com/ZestBox-18/kitebook-frontend
2dc0321083b6d953a5952fb96ad55cd105b51016
github
iop123123/arkts-static-skills
docs/ArkTS-Language-Guide/08-Stdlib/stdlib-source/std/core/Short.ets
arkts
toDouble
Returns value of this instance @returns { double } value as double @syscap SystemCapability.Utils.Lang @FaAndStageModel
public override toDouble(): double { return Short.toDouble(this.value); }
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 toDouble AST#identifier#Right AST#arguments#Left AST#(#Left ( AST#(#Right AST#)#Left ) AST#)#Right AST#arguments#Right AST#call_expression#Right AST#:#Le...
public override toDouble(): double { return Short.toDouble(this.value); }
https://gitcode.com/iop123123/arkts-static-skills
922343cd3aa9ee6ca35ec1f170b41f3d3ebaf0cc
gitcode
pangpang20/antennaPodHM
entry/src/main/ets/pages/MainPage.ets
arkts
startPlayUpdateTimer
启动播放状态更新定时器
startPlayUpdateTimer() { this.playUpdateTimer = setInterval(() => { this.checkCurrentEpisode(); }, 500); }
AST#program#Left AST#expression_statement#Left AST#call_expression#Left AST#identifier#Left startPlayUpdateTimer 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_blo...
startPlayUpdateTimer() { this.playUpdateTimer = setInterval(() => { this.checkCurrentEpisode(); }, 500); }
https://github.com/pangpang20/antennaPodHM
8eda45049d3f4b1769e23f6c20a35361b800d878
github