nwo
stringclasses
304 values
sha
stringclasses
304 values
path
stringlengths
9
214
language
stringclasses
1 value
identifier
stringlengths
0
49
docstring
stringlengths
1
34.2k
function
stringlengths
8
59.4k
ast_function
stringlengths
71
497k
obf_function
stringlengths
8
39.4k
url
stringlengths
102
324
function_sha
stringlengths
40
40
source
stringclasses
2 values
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/CategorySample/entry/src/main/ets/viewmodel/CategoryViewModel.ets
arkts
Category ability view model.
export class CategoryViewModel { /** * Get index list data on the left. * * @return {Array<IndexListItem>} indexListItems */ getIndexListData() { let indexListItems: Array<IndexListItem> = []; for (let index = 1; index <= CommonConstants.LIST_SIZE; index++) { let indexListItem = new IndexL...
AST#export_declaration#Left export AST#class_declaration#Left class CategoryViewModel AST#class_body#Left { /** * Get index list data on the left. * * @return {Array<IndexListItem>} indexListItems */ AST#method_declaration#Left getIndexListData AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_...
export class CategoryViewModel { getIndexListData() { let indexListItems: Array<IndexListItem> = []; for (let index = 1; index <= CommonConstants.LIST_SIZE; index++) { let indexListItem = new IndexListItem(); indexListItem.title = $r('app.string.list_item_text', index); indexListItems.pus...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/CategorySample/entry/src/main/ets/viewmodel/CategoryViewModel.ets#L10-L74
27de132eeefb156ebab930b95792d814a0bd4fe9
gitee
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/WuDangBuySellComponent.ets
arkts
_clearCanvas
清空画布的所有内容
_clearCanvas() { this.context.clearRect(0, 0, this.canvasW, this.canvasH) }
AST#method_declaration#Left _clearCanvas AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this...
_clearCanvas() { this.context.clearRect(0, 0, this.canvasW, this.canvasH) }
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/WuDangBuySellComponent.ets#L35-L37
a4eaf694b1c9f53f822084c9b3ca4a09520ad007
github
2763981847/Accounting-app.git
cf8302a42588ecce1561b82e8533798157157257
entry/src/main/ets/view/StatisticalCardComponent.ets
arkts
构建组件
build() { // 使用Column布局,嵌套Row布局来展示统计信息 Column() { // 第一行,展示今日支出、收入、结余 Row() { Column() { Text('今日支出') .fontSize($r('app.float.font_size_M')); Text(this.dayPay.toString()) .fontSize($r('app.float.font_size_MP')) .fontWeight(FontWeight.Bo...
AST#build_method#Left build ( ) AST#build_body#Left { // 使用Column布局,嵌套Row布局来展示统计信息 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 第一行,展示今日支出、收入、结余 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ...
build() { Column() { Row() { Column() { Text('今日支出') .fontSize($r('app.float.font_size_M')); Text(this.dayPay.toString()) .fontSize($r('app.float.font_size_MP')) .fontWeight(FontWeight.Bold); }.alignItems(HorizontalAlign.Start...
https://github.com/2763981847/Accounting-app.git/blob/cf8302a42588ecce1561b82e8533798157157257/entry/src/main/ets/view/StatisticalCardComponent.ets#L28-L96
317536c48e0c703776d1dcb387cebabb67fbb212
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/utils/auth/UserSession.ets
arkts
用户会话管理类
export class UserSession { private static instance: UserSession; private preferences: preferences.Preferences | null = null; private currentUser: UserInfo | null = null; private initialized: boolean = false; private readonly PREFERENCE_NAME: string = 'user_session'; private readonly KEY_USER_INFO: string = ...
AST#export_declaration#Left export AST#class_declaration#Left class UserSession AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left UserSession AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declarat...
export class UserSession { private static instance: UserSession; private preferences: preferences.Preferences | null = null; private currentUser: UserInfo | null = null; private initialized: boolean = false; private readonly PREFERENCE_NAME: string = 'user_session'; private readonly KEY_USER_INFO: string = ...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/auth/UserSession.ets#L33-L140
74229ae5aadc0b5d1e8fa69eb268ca61e75ce878
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/button/buttonModifier.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class DefaultButtonModifier implements AttributeModifier<ButtonAttribute> { private buttonType: ButtonType = ButtonType.Normal; private stateEffectValue: boolean = true; private fontSize: number = 16 private height: number = 42 private width: number | string = '100%' private borderRadius: number = 4 ...
AST#export_declaration#Left export AST#ERROR#Left class DefaultButtonModifier AST#implements_clause#Left implements AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ButtonAttribute AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Right...
export class DefaultButtonModifier implements AttributeModifier<ButtonAttribute> { private buttonType: ButtonType = ButtonType.Normal; private stateEffectValue: boolean = true; private fontSize: number = 16 private height: number = 42 private width: number | string = '100%' private borderRadius: number = 4 ...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/button/buttonModifier.ets#L16-L24
d5dc88a5b7c950748ccb602603e69d64513970c1
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.FoldSplitContainer.d.ets
arkts
The layout options for the container when the foldable screen is folded. @interface FoldedRegionLayoutOptions @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 12
export interface FoldedRegionLayoutOptions { /** * The ratio of the heights of two areas in the vertical direction. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ verticalSplitRatio?: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface FoldedRegionLayoutOptions AST#object_type#Left { /** * The ratio of the heights of two areas in the vertical direction. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12...
export interface FoldedRegionLayoutOptions { verticalSplitRatio?: number; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.FoldSplitContainer.d.ets#L143-L153
4b5676a4bff1c001842d736fdaa0f29e28dc54a9
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/greetings/GreetingSendPage.ets
arkts
buildContent
构建页面内容
@Builder buildContent() { Scroll() { Column({ space: 16 }) { // 联系人信息卡片 this.buildContactInfoCard() // 祝福语编辑区域 this.buildGreetingEditor() // AI建议 if (this.aiSuggestions.length > 0) { this.buildAISuggestions() } ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( ) AST#container_content_body#Left { AST#arkts_ui_ele...
@Builder buildContent() { Scroll() { Column({ space: 16 }) { this.buildContactInfoCard() this.buildGreetingEditor() if (this.aiSuggestions.length > 0) { this.buildAISuggestions() } this.buildSend...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/greetings/GreetingSendPage.ets#L226-L251
d18323a30f65c708b8f9cb4e2084b1767dc8a559
github
iichen-bycode/ArkTsWanandroid.git
ad128756a6c703d9a72cf7f6da128c27fc63bd00
entry/src/main/ets/view/LoadingDialog.ets
arkts
LoadingDialog
通用loading
@CustomDialog export struct LoadingDialog { loadingTips: string @State rotateAngle: number = 0 //弹窗控制器 controller: CustomDialogController aboutToAppear() { this.rotateAngle = 360 }
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct LoadingDialog AST#ERROR#Left { AST#property_declaration#Left loadingTips : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#...
@CustomDialog export struct LoadingDialog { loadingTips: string @State rotateAngle: number = 0 controller: CustomDialogController aboutToAppear() { this.rotateAngle = 360 }
https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/view/LoadingDialog.ets#L4-L13
f1127db12dbccd149c999631bf754b6001281179
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/detail/show/episode/ShowEpisodeViewModel.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2024/11/23 20:23 @Version V1.0 @Description
export class ShowEpisodeViewModel extends DetailViewModel { constructor(context: Context, args: FinItem) { super(context, { id: args.id!, name: args.name! }) this.userItemDto = args.data } }
AST#export_declaration#Left export AST#class_declaration#Left class ShowEpisodeViewModel extends AST#type_annotation#Left AST#primary_type#Left DetailViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left...
export class ShowEpisodeViewModel extends DetailViewModel { constructor(context: Context, args: FinItem) { super(context, { id: args.id!, name: args.name! }) this.userItemDto = args.data } }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/detail/show/episode/ShowEpisodeViewModel.ets#L11-L21
0f12f32aaaa3deea0bf959570a783aa96fb99378
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setTransparentCircleRadius
sets the radius of the transparent circle that is drawn next to the hole in the piechart in percent of the maximum radius (max = the radius of the whole chart), default 55% -> means 5% larger than the center-hole by default @param percent
public setTransparentCircleRadius(percent: number): void { this.mTransparentCircleRadiusPercent = percent; }
AST#method_declaration#Left public setTransparentCircleRadius AST#parameter_list#Left ( AST#parameter#Left percent : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void...
public setTransparentCircleRadius(percent: number): void { this.mTransparentCircleRadiusPercent = percent; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L662-L664
81e6617dd1d44fc2b089621bceec9ef2401ea0aa
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
VideoProcessBaseWeb/entry/src/main/ets/view/CustomPopupMenu.ets
arkts
customPopupMenuBuilder
[Start menu] src/main/ets/view/CustomPopupMenu.ets A custom popup menu Builder. @param uri - The URI for which the popup menu will be built. @param context - The UI context in which the popup menu will be used. This should be an instance of `common.UIAbilityContext`. @param openDownloadDialog - A function that, when ...
@Builder export function customPopupMenuBuilder( uri: string, context: common.UIAbilityContext, openDownloadDialog: Function, closeDownloadDialog: Function, changeIsShow: Function ) { Column() { Menu() { ForEach(menus, (menu: MenuItem) => { MenuItem({ content: menu.text }...
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function customPopupMenuBuilder AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left...
@Builder export function customPopupMenuBuilder( uri: string, context: common.UIAbilityContext, openDownloadDialog: Function, closeDownloadDialog: Function, changeIsShow: Function ) { Column() { Menu() { ForEach(menus, (menu: MenuItem) => { MenuItem({ content: menu.text }...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoProcessBaseWeb/entry/src/main/ets/view/CustomPopupMenu.ets#L62-L89
fd417d60027b7e953b331af534ce892f3fe27e97
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/util/src/main/ets/context/ContextUtil.ets
arkts
获取组件关联的 hostContext(UIAbilityContext) @param {WithUIContext | undefined} component 组件实例(需具备 getUIContext 方法) @returns {common.Context | undefined} hostContext;获取失败返回 undefined
export function getHostCtx(component?: WithUIContext): common.Context | undefined { const uiContext: UIContext | undefined = component?.getUIContext?.(); return uiContext?.getHostContext(); }
AST#export_declaration#Left export AST#function_declaration#Left function getHostCtx AST#parameter_list#Left ( AST#parameter#Left component ? : AST#type_annotation#Left AST#primary_type#Left WithUIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotati...
export function getHostCtx(component?: WithUIContext): common.Context | undefined { const uiContext: UIContext | undefined = component?.getUIContext?.(); return uiContext?.getHostContext(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/util/src/main/ets/context/ContextUtil.ets#L22-L25
452f845eacae997a3e822e27254a6030d78f85b0
github
robotzzh/AgricultureApp.git
7b12c588dd1d07cc07a8b25577d785d30bd838f6
entry/src/main/ets/DB/DistributedUtil.ets
arkts
getStoreData
获取指定键的值
async getStoreData(key: string) { if (!key) { return } if(!kvStore) { kvStore = await this.createKeyValueDB(); } return new Promise((resolve, reject) => { try { kvStore.get(key, (err, data) => { if (err != undefined) { console.error(`Failed to get da...
AST#method_declaration#Left async getStoreData AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_stat...
async getStoreData(key: string) { if (!key) { return } if(!kvStore) { kvStore = await this.createKeyValueDB(); } return new Promise((resolve, reject) => { try { kvStore.get(key, (err, data) => { if (err != undefined) { console.error(`Failed to get da...
https://github.com/robotzzh/AgricultureApp.git/blob/7b12c588dd1d07cc07a8b25577d785d30bd838f6/entry/src/main/ets/DB/DistributedUtil.ets#L105-L129
d8e732693087d24154f1547ee2fc2c112c779b23
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/dbUtils/ResultSetTool.ets
arkts
decodeStringOnlyBase64
/ToeicVocabulary的Word.sqlite没有加盐
static decodeStringOnlyBase64(rs: relationalStore.ResultSet, colName: string): string | null { return StringEncoder.decodedFromBase64(rs.getString(rs.getColumnIndex(colName))) }
AST#method_declaration#Left static decodeStringOnlyBase64 AST#parameter_list#Left ( AST#parameter#Left rs : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ResultSet AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Lef...
static decodeStringOnlyBase64(rs: relationalStore.ResultSet, colName: string): string | null { return StringEncoder.decodedFromBase64(rs.getString(rs.getColumnIndex(colName))) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/ResultSetTool.ets#L12-L14
198ee10b1c8c0da4b9687ff5cd9c0ef98e1819a8
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets
arkts
notifyDataAdd
通知控制器数据增加
notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) }
AST#method_declaration#Left notifyDataAdd AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Righ...
notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets#L40-L44
7d007f6f79e55c42b612da469cbb0b6ba9cf74b3
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/app.ets
arkts
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export default { onCreate() { console.info('Application onCreate') }, onDestroy() { console.info('Application onDestroy') }, }
AST#export_declaration#Left export default AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left onCreate AST#property_name#Right AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Le...
export default { onCreate() { console.info('Application onCreate') }, onDestroy() { console.info('Application onDestroy') }, }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/HandleGameApplication/GameEtsOpenHarmony/entry/src/main/ets/MainAbility/app.ets#L16-L23
5e7038f2dcd88f251af6e0693a33dcf1bd5454ba
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets
arkts
softwareModel
内部软件子型号
static softwareModel(): string { return deviceInfo.softwareModel }
AST#method_declaration#Left static softwareModel AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_exp...
static softwareModel(): string { return deviceInfo.softwareModel }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L64-L66
d0eceb67dbbc5fd8470e7a8e8e69836c97267858
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets
arkts
safe_add
Add integers, wrapping at 2^32. This uses 16-bit operations internally to work around bugs in some JS interpreters. 将32位数拆成高16位和低16位分别进行相加,从而实现 MOD 2^32 的加法
safe_add(x: number, y: number) { let lsw = (x & 0xFFFF) + (y & 0xFFFF); let msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }
AST#method_declaration#Left safe_add AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_...
safe_add(x: number, y: number) { let lsw = (x & 0xFFFF) + (y & 0xFFFF); let msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets#L161-L169
a2799227a4375647255156cb657ef56a03d60344
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_picker/ace_ets_module_picker_api12/entry/src/main/ets/MainAbility/pages/Slider/SliderContentModifier.ets
arkts
buildSlider
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Builder function buildSlider(config: SliderConfiguration) { Column({space: 5}) { Button('triggerChange') .onClick(()=>{ config.triggerChange(10, SliderChangeMode.Click) }) .id('SliderContentModifier_btn') Text('value'+ config.value).id('SliderContentModifier_text1') Text('min'...
AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildSlider AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left SliderConfiguration AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list...
@Builder function buildSlider(config: SliderConfiguration) { Column({space: 5}) { Button('triggerChange') .onClick(()=>{ config.triggerChange(10, SliderChangeMode.Click) }) .id('SliderContentModifier_btn') Text('value'+ config.value).id('SliderContentModifier_text1') Text('min'...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_picker/ace_ets_module_picker_api12/entry/src/main/ets/MainAbility/pages/Slider/SliderContentModifier.ets#L16-L30
44a21462b729417fb8474318e29e61af5de52738
gitee
WinWang/HarmoneyOpenEye.git
57f0542795336009aa0d46fd9fa5b07facc2ae87
entry/src/main/ets/pages/home/HomePage.ets
arkts
HomePage
首页
@Component export struct HomePage { @State viewState: string = ViewStateConstant.VIEW_STATE_LOADING @State isRefreshing: boolean = false @State dataList: HomeModelIssueListItemList[] = [] @State showLoading: boolean = false @Consume @Watch('onTabSelected') homeTabSelected: number aboutToAppear() { Home...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct HomePage AST#ERROR#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right viewState : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right...
@Component export struct HomePage { @State viewState: string = ViewStateConstant.VIEW_STATE_LOADING @State isRefreshing: boolean = false @State dataList: HomeModelIssueListItemList[] = [] @State showLoading: boolean = false @Consume @Watch('onTabSelected') homeTabSelected: number aboutToAppear() { Home...
https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/pages/home/HomePage.ets#L16-L29
729a73a4e0f6404e1d53e60974f28a7c48595e3b
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/BgCardImage.ets
arkts
BgCardImage
背景图片组件
@Component export struct BgCardImage { build() { Image($r('app.media.card_bg')) // 使用资源引用 .width('100%') // 等同于 .resizable() + .frame .height('100%') .objectFit(ImageFit.Cover) // 等同于 .aspectRatio(contentMode: .fill) .position({ x: 0, y: 0 }) // 确保从左上角开始布局 .expandSafeArea([...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BgCardImage AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#resource_e...
@Component export struct BgCardImage { build() { Image($r('app.media.card_bg')) .width('100%') .height('100%') .objectFit(ImageFit.Cover) .position({ x: 0, y: 0 }) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) Rect() ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/BgCardImage.ets#L3-L19
108bd982a0ad8f88051b9257a4f6da8ec816e39a
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/ECDSA.ets
arkts
TODO ECDSA工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/07/01
export class ECDSA { /** * 对数据进行签名,异步 * @param dataBlob 待签名数据 * @param priKey 私钥 * @returns */ static async sign(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey): Promise<cryptoFramework.DataBlob> { return CryptoUtil.sign(dataBlob,priKey,'ECC256|SHA256') } /** * 对数据进行...
AST#export_declaration#Left export AST#class_declaration#Left class ECDSA AST#class_body#Left { /** * 对数据进行签名,异步 * @param dataBlob 待签名数据 * @param priKey 私钥 * @returns */ AST#method_declaration#Left static async sign AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#prim...
export class ECDSA { static async sign(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey): Promise<cryptoFramework.DataBlob> { return CryptoUtil.sign(dataBlob,priKey,'ECC256|SHA256') } static signSync(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey): cryptoFramewor...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/ECDSA.ets#L25-L124
faf3b6361782ea5d179130ef8dc343c5f9119300
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets
arkts
代表自定义类型数据的接口。 @interface @property {string} desc - 描述。 @property {string} tag - 类别。
export interface CustomDataType { desc: string, tag: string, }
AST#export_declaration#Left export AST#interface_declaration#Left interface CustomDataType AST#object_type#Left { AST#type_member#Left desc : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left tag : AST#type_annotation#Left...
export interface CustomDataType { desc: string, tag: string, }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets#L23-L26
b44e94ceb459f298b080fa2890796467f2f469ef
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@abner+keyboard@1.0.2/oh_modules/@abner/keyboard/src/main/ets/components/BottomAnimationView.d.ets
arkts
BottomAnimationView
@keepTs @ts-nocheck
@Component export declare struct BottomAnimationView { @BuilderParam layout?: () => void; @State private _privateTransitionY; @State private _privateIsVisibility; @State bottomNavigationHeight: number; build(): void; private hideDialog; }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct BottomAnimationView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ BuilderParam AST#decorator#Right layout ? : AST#type_annotation#Left AST#function...
@Component export declare struct BottomAnimationView { @BuilderParam layout?: () => void; @State private _privateTransitionY; @State private _privateIsVisibility; @State bottomNavigationHeight: number; build(): void; private hideDialog; }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@abner+keyboard@1.0.2/oh_modules/@abner/keyboard/src/main/ets/components/BottomAnimationView.d.ets#L3-L15
eff0040dc1fb4c4459209254fe4fcc82be11c6a6
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/router/AppRouter.ets
arkts
路由路径常量
export class RoutePaths { // 主要页面 static readonly INDEX = 'pages/Index'; static readonly CONTACTS = 'pages/ContactsPage'; static readonly CALENDAR = 'pages/CalendarPage'; static readonly GREETINGS = 'pages/GreetingsPage'; static readonly SETTINGS = 'pages/SettingsPage'; // 联系人相关页面 static readonly CON...
AST#export_declaration#Left export AST#class_declaration#Left class RoutePaths AST#class_body#Left { // 主要页面 AST#property_declaration#Left static readonly INDEX = AST#expression#Left 'pages/Index' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly CONTACTS = AST#expressi...
export class RoutePaths { static readonly INDEX = 'pages/Index'; static readonly CONTACTS = 'pages/ContactsPage'; static readonly CALENDAR = 'pages/CalendarPage'; static readonly GREETINGS = 'pages/GreetingsPage'; static readonly SETTINGS = 'pages/SettingsPage'; static readonly CONTACT_DETAIL = 'pa...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/router/AppRouter.ets#L29-L60
b3aa061c2418ff50de6c006000f059305d7d8052
github
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/common/AppTheme.ets
arkts
应用主题管理
export interface AppColors { primary: string; onPrimary: string; secondary: string; onSecondary: string; surface: string; onSurface: string; background: string; onBackground: string; error: string; onError: string; outline: string; surfaceVariant: string; onSurfaceVariant: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AppColors AST#object_type#Left { AST#type_member#Left primary : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left onPrimary : AST#type_annotation#...
export interface AppColors { primary: string; onPrimary: string; secondary: string; onSecondary: string; surface: string; onSurface: string; background: string; onBackground: string; error: string; onError: string; outline: string; surfaceVariant: string; onSurfaceVariant: string; }
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/common/AppTheme.ets#L2-L16
57eb2c499411a7823c4c619e4e1e85753100878c
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/mine/settingPage.ets
arkts
otherBuilder
其他
@Builder otherBuilder() { Column() { this.title("其他") Column() { Row() { Text("消息通知") .fontSize(20) .margin({ left: 10 }) Image('/image/mine/rightBack.png').imgCommon() } .justifyContent(FlexAlign.SpaceBetween) .alignItems(Ve...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right otherBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#expression_s...
@Builder otherBuilder() { Column() { this.title("其他") Column() { Row() { Text("消息通知") .fontSize(20) .margin({ left: 10 }) Image('/image/mine/rightBack.png').imgCommon() } .justifyContent(FlexAlign.SpaceBetween) .alignItems(Ve...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/mine/settingPage.ets#L172-L207
7b85daee4a50514448456047293e91e25c3d1779
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/pages/typicalScene/multiScene/pages/player/Player.ets
arkts
Play
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Component export struct Play { build() { Column() { GridRow() { GridCol({ span: { sm: 12, md: 6, lg: 6 } }) { Row() { Image($r('app.media.sing')) .width(200) .height(200) .objectFit(ImageFit.Contain) }.margin({ bottom: 10 }) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct Play AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#...
@Component export struct Play { build() { Column() { GridRow() { GridCol({ span: { sm: 12, md: 6, lg: 6 } }) { Row() { Image($r('app.media.sing')) .width(200) .height(200) .objectFit(ImageFit.Contain) }.margin({ bottom: 10 }) ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/pages/typicalScene/multiScene/pages/player/Player.ets#L16-L77
7382d2510bd2590a1696d81b1a731192250b3439
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/PictureOptions.ets
arkts
encodingPictureNdk
Native多图图片编码 @param encodingType 编码类型(0:AUTO,1:SDR) @returns
async encodingPictureNdk(fileName: string, encodingObject: string, encodingResult: string): Promise<void> { logger.info(TAG, 'encodingPicture start'); this.pixelMap = await NDKPictureEncoding(fileName, encodingObject, encodingResult); if (!this.pixelMap) { logger.info(TAG, `decodingPicture no pixelMap...
AST#method_declaration#Left async encodingPictureNdk AST#parameter_list#Left ( AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left encodingObject : AST#type_annotation#Left AST#primary_type#Left str...
async encodingPictureNdk(fileName: string, encodingObject: string, encodingResult: string): Promise<void> { logger.info(TAG, 'encodingPicture start'); this.pixelMap = await NDKPictureEncoding(fileName, encodingObject, encodingResult); if (!this.pixelMap) { logger.info(TAG, `decodingPicture no pixelMap...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/PictureOptions.ets#L204-L220
afc1d3150bf04b221bedeeb02e1bb4b9dcbdeb48
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkWebrenderingframework/entry/src/main/ets/pages/webmessagepage.ets
arkts
[Start web]
build() { Column() { //The Web component loads the local index.html page. Web({ src: './Index', controller: new webview.WebviewController() }) //Inject objects into the web side. .javaScriptProxy({ object: nativeObj, name: "nativeObj", method...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { //The Web component loads the local index.html page. AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left We...
build() { Column() { Web({ src: './Index', controller: new webview.WebviewController() }) .javaScriptProxy({ object: nativeObj, name: "nativeObj", methodList: ["makePhoneCall"], controller: new webview.WebviewController() }) ...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkWebrenderingframework/entry/src/main/ets/pages/webmessagepage.ets#L10-L25
065c9305dabc975d15ec26a911808ef580ff59e3
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets
arkts
publishReminder
publishReminder
function publishReminder(params: PublishReminderInfo, context: Context) { if (!params) { Logger.error(Const.REMINDER_AGENT_TAG, 'publishReminder params is empty'); return; } let notifyId: string = params.notificationId.toString(); hasPreferencesValue(context, notifyId, (preferences: preferences.Preferen...
AST#function_declaration#Left function publishReminder AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left PublishReminderInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Le...
function publishReminder(params: PublishReminderInfo, context: Context) { if (!params) { Logger.error(Const.REMINDER_AGENT_TAG, 'publishReminder params is empty'); return; } let notifyId: string = params.notificationId.toString(); hasPreferencesValue(context, notifyId, (preferences: preferences.Preferen...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/service/ReminderAgent.ets#L25-L51
0031892200c97701679de782479c1e39a6c8d7fd
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/AssetUtil.ets
arkts
removeSync
删除关键资产,同步 @param key @returns
static removeSync(key: string): boolean { try { if (!AssetUtil.canIUse()) { LogUtil.error(`AssetStore-当前设备不支持该模块`); return false; } let query: asset.AssetMap = new Map(); query.set(asset.Tag.ALIAS, StrUtil.strToUint8Array(key)); asset.removeSync(query); return tru...
AST#method_declaration#Left static removeSync AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type...
static removeSync(key: string): boolean { try { if (!AssetUtil.canIUse()) { LogUtil.error(`AssetStore-当前设备不支持该模块`); return false; } let query: asset.AssetMap = new Map(); query.set(asset.Tag.ALIAS, StrUtil.strToUint8Array(key)); asset.removeSync(query); return tru...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AssetUtil.ets#L183-L198
7b720e4c6e14d28f51a5a1cb2d14b4fb35032f0c
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/managers/StorageManager.ets
arkts
getCachedItem
获取缓存数据 @param key 键 @param defaultValue 默认值 @returns 操作结果
static async getCachedItem<T>(key: string, defaultValue?: T): Promise<StorageResult<T>> { try { const result = await this.getItem<{ value: T; timestamp: number; ttl: number }>(`cache_${key}`); if (!result.success || !result.data) { return { success: true, data: defaultValue }; } ...
AST#method_declaration#Left static async getCachedItem AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#p...
static async getCachedItem<T>(key: string, defaultValue?: T): Promise<StorageResult<T>> { try { const result = await this.getItem<{ value: T; timestamp: number; ttl: number }>(`cache_${key}`); if (!result.success || !result.data) { return { success: true, data: defaultValue }; } ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/managers/StorageManager.ets#L309-L331
bc85a00c53c66ae12e9be3b8216b4203ff4c708a
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/WinLoadingUtil.ets
arkts
closeLoading
关闭窗口 @returns
static async closeLoading(): Promise<void> { if (WinLoadingUtil.cacheWindow) { await WinLoadingUtil.cacheWindow.destroyWindow(); } }
AST#method_declaration#Left static async closeLoading AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#t...
static async closeLoading(): Promise<void> { if (WinLoadingUtil.cacheWindow) { await WinLoadingUtil.cacheWindow.destroyWindow(); } }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/WinLoadingUtil.ets#L91-L95
2cb60bf974e773cc32e6456d31c37f4a611514c1
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/BusinessSample/entry/src/main/ets/viewmodel/BusinessViewModel.ets
arkts
getDetailPageListItems
Get detail page list items. @return {Array<ListItemData>} detailListItems.
getDetailPageListItems(): Array<ListItemData> { let detailListItems: Array<ListItemData> = []; for (let i = 0; i < CommonConstants.DETAIL_LIST_SIZE; i++) { let listItem = new ListItemData(); listItem.title = $r('app.string.list_item_title'); listItem.subTitle = $r('app.string.list_item_sub_tit...
AST#method_declaration#Left getDetailPageListItems AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ListItemData AST#primary_type#Right AST#type_annotation#Right > AS...
getDetailPageListItems(): Array<ListItemData> { let detailListItems: Array<ListItemData> = []; for (let i = 0; i < CommonConstants.DETAIL_LIST_SIZE; i++) { let listItem = new ListItemData(); listItem.title = $r('app.string.list_item_title'); listItem.subTitle = $r('app.string.list_item_sub_tit...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/BusinessSample/entry/src/main/ets/viewmodel/BusinessViewModel.ets#L53-L62
c500ad8b6725655e629e16ae87071f2868a61274
gitee
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/easy_demo/tcp_demo/tcp/entry/src/main/ets/pages/Index.ets
arkts
解析 标准系统开发板端 本地IP地址
export function resolveIP(ip: number): string { if (ip < 0 || ip > 0xFFFFFFFF) { console.log ('The number is not normal!'); } return (ip >>> 24) + '.' + (ip >> 16 & 0xFF) + '.' + (ip >> 8 & 0xFF) + '.' + (ip & 0xFF); }
AST#export_declaration#Left export AST#function_declaration#Left function resolveIP AST#parameter_list#Left ( AST#parameter#Left ip : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#prima...
export function resolveIP(ip: number): string { if (ip < 0 || ip > 0xFFFFFFFF) { console.log ('The number is not normal!'); } return (ip >>> 24) + '.' + (ip >> 16 & 0xFF) + '.' + (ip >> 8 & 0xFF) + '.' + (ip & 0xFF); }
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/easy_demo/tcp_demo/tcp/entry/src/main/ets/pages/Index.ets#L14-L19
210d1889f59d088c099a47af503a70dfa92be638
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/TodoTypes.ets
arkts
优先级统计接口
export interface PriorityStatistics { low: number; medium: number; high: number; urgent: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface PriorityStatistics AST#object_type#Left { AST#type_member#Left low : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left medium : AST#type_annotatio...
export interface PriorityStatistics { low: number; medium: number; high: number; urgent: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/TodoTypes.ets#L116-L121
cb5678e1b2c69f146691143ff1550158c612e70c
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/common/routermodule/src/main/ets/router/DynamicsRouter.ets
arkts
registerBuilder
通过名称注册builder
private static registerBuilder(builderName: string, builder: WrappedBuilder<[object]>): void { DynamicsRouter.builderMap.set(builderName, builder); }
AST#method_declaration#Left private static registerBuilder AST#parameter_list#Left ( AST#parameter#Left builderName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left builder : AST#type_annotation#Left AST#primary_type#Left A...
private static registerBuilder(builderName: string, builder: WrappedBuilder<[object]>): void { DynamicsRouter.builderMap.set(builderName, builder); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/common/routermodule/src/main/ets/router/DynamicsRouter.ets#L61-L63
25fa824ebc13470f756e8c5a8f2e7e422df166fc
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/launch/src/main/ets/viewmodel/SplashViewModel.ets
arkts
@file 启动页 ViewModel @author Joker.X
@ObservedV2 export default class SplashViewModel extends BaseViewModel { }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class SplashViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Right AST...
@ObservedV2 export default class SplashViewModel extends BaseViewModel { }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/launch/src/main/ets/viewmodel/SplashViewModel.ets#L7-L9
287f6f810fe3871ea7d768161b1049a44e61e00e
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BarDataSet.ets
arkts
setBarBorderColor
Sets the color drawing borders around the bars. @return
public setBarBorderColor(color: number): void { this.mBarBorderColor = color; }
AST#method_declaration#Left public setBarBorderColor AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
public setBarBorderColor(color: number): void { this.mBarBorderColor = color; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L253-L255
59d6b6a9bd4a99c756c8ae9da19f53791e15e12d
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/OfficeAttendance-master/commons/common_lib/src/main/ets/utils/RouterModule.ets
arkts
clear
清除栈中的所有页面
public static clear(animated?: boolean) { try { RouterModule._stack.clear(animated); } catch (err) { Logger.error(TAG, 'navigation stack clear failed::' + JSON.stringify(err)); } }
AST#method_declaration#Left public static clear AST#parameter_list#Left ( AST#parameter#Left animated ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement...
public static clear(animated?: boolean) { try { RouterModule._stack.clear(animated); } catch (err) { Logger.error(TAG, 'navigation stack clear failed::' + JSON.stringify(err)); } }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/OfficeAttendance-master/commons/common_lib/src/main/ets/utils/RouterModule.ets#L96-L102
b8831850267b5ec3fb9d0aede02e60b650af5827
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/FloatWindowController.ets
arkts
destroyFloatWindow
销毁悬浮窗
public async destroyFloatWindow() { Logger.info(TAG,` destroyWindow`); if (this.floatWindow) { await this.floatWindow.destroyWindow(); } }
AST#method_declaration#Left public async destroyFloatWindow AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . in...
public async destroyFloatWindow() { Logger.info(TAG,` destroyWindow`); if (this.floatWindow) { await this.floatWindow.destroyWindow(); } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/controller/FloatWindowController.ets#L98-L103
1babdd23e86f68b8f51a6b9888d79f79cd786888
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/services/storage/PreferencesService.ets
arkts
putObject
存储对象值(转换为JSON字符串) @param key 键 @param value 对象值
async putObject<T>(key: string, value: T): Promise<void> { try { const jsonString = JSON.stringify(value); await this.putString(key, jsonString); } catch (error) { const businessError = error as BusinessError; hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to put obje...
AST#method_declaration#Left async putObject AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri...
async putObject<T>(key: string, value: T): Promise<void> { try { const jsonString = JSON.stringify(value); await this.putString(key, jsonString); } catch (error) { const businessError = error as BusinessError; hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to put obje...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/storage/PreferencesService.ets#L201-L210
25adb4aef026e261d44721b505589af20a36171a
github
openharmony-tpc-incubate/photo-deal-demo
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
library/src/main/ets/components/textInput/TextEditNodeController.ets
arkts
hideAllTextNodeEdge
隐藏文本节点边框
hideAllTextNodeEdge(): void { let textNodes = Array.from(this.textRecords).filter((record: OperateRecord) => { return record.type === ImageEditFunctionType.TEXT; }); textNodes?.forEach((record: OperateRecord) => { this.setTextNodeActivated(record, false); }); }
AST#method_declaration#Left hideAllTextNodeEdge AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left textNod...
hideAllTextNodeEdge(): void { let textNodes = Array.from(this.textRecords).filter((record: OperateRecord) => { return record.type === ImageEditFunctionType.TEXT; }); textNodes?.forEach((record: OperateRecord) => { this.setTextNodeActivated(record, false); }); }
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/components/textInput/TextEditNodeController.ets#L231-L238
2de87bfd3011edfbbda50d7565495848c41f97b7
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeParser.ets
arkts
parseQRCodeImageFromCamera
解析从相机获取的二维码图片 @param cameraService @param canvasContext
parseQRCodeImageFromCamera(cameraService: CameraService, imageComponentType?: image.ComponentType): void { Logger.info("parseQRCodeImageFromCamera start") this.parseQRCodeImageWithNameFromCamera(cameraService, imageComponentType); Logger.info("parseQRCodeImageFromCamera end") ...
AST#method_declaration#Left parseQRCodeImageFromCamera AST#parameter_list#Left ( AST#parameter#Left cameraService : AST#type_annotation#Left AST#primary_type#Left CameraService AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left imageComponentType ? : AST#type_annotation#Left AST#p...
parseQRCodeImageFromCamera(cameraService: CameraService, imageComponentType?: image.ComponentType): void { Logger.info("parseQRCodeImageFromCamera start") this.parseQRCodeImageWithNameFromCamera(cameraService, imageComponentType); Logger.info("parseQRCodeImageFromCamera end") ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeParser.ets#L59-L64
7482afd90767d439339363196d7130d73d9d5780
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_audio/src/main/ets/audio/EfAVPlayer.ets
arkts
init
用于初始化多媒体播放器。 @param options - 播放选项对象,默认为当前实例的 efPlayOptions。 @returns 多媒体播放器实例。
async init(options: EFPlayOptions = this.efPlayOptions) { if (!this.avPlayer) { this.avPlayer = await media.createAVPlayer(); this.setPlayOptions(options); this._onError(); this._onStateChange(); this._onTimeUpdate(); } return this.avPlayer; }
AST#method_declaration#Left async init AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left EFPlayOptions AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . efPlayOptions AST#m...
async init(options: EFPlayOptions = this.efPlayOptions) { if (!this.avPlayer) { this.avPlayer = await media.createAVPlayer(); this.setPlayOptions(options); this._onError(); this._onStateChange(); this._onTimeUpdate(); } return this.avPlayer; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_audio/src/main/ets/audio/EfAVPlayer.ets#L110-L121
522d6e084bc28ea85cfe8f98f1b1ff23234277a4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ListBeExchange/ListExchange/src/main/ets/model/ListExchangeCtrl.ets
arkts
ListExchangeCtrl
列表项切换控制
@Observed export class ListExchangeCtrl<T> { private deductionData: Array<T> = []; // 列表数据 private modifier: Array<ListItemModifier> = []; // 属性数据 private dragRefOffset: number = 0; private offsetY: number = 0; private state: OperationStatus = OperationStatus.IDLE; initData(deductionData: Array<T>) { t...
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class ListExchangeCtrl AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#class_body#Left { AST#property_declaration#Left private deductionData : AST#type_annotation#...
@Observed export class ListExchangeCtrl<T> { private deductionData: Array<T> = []; private modifier: Array<ListItemModifier> = []; private dragRefOffset: number = 0; private offsetY: number = 0; private state: OperationStatus = OperationStatus.IDLE; initData(deductionData: Array<T>) { this.deductionD...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ListBeExchange/ListExchange/src/main/ets/model/ListExchangeCtrl.ets#L35-L211
ff6a41f0e306fd7e0debf86373728480e91e56c5
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ToolBar.d.ets
arkts
Declare enum ItemState @enum { ItemState } @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare enum ItemState @enum { ItemState } @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11 Declare enum ItemState @enum { ItemState } @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicserv...
export declare enum ItemState { /** * Enable type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Enable type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ /** * Enable type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crosspl...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ItemState AST#enum_body#Left { /** * Enable type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Enable type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * ...
export declare enum ItemState { ENABLE = 1, DISABLE = 2, ACTIVATE = 3 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ToolBar.d.ets#L47-L105
a9b99143dd23ff535e1e9370cb766c18455712d1
gitee
JackJiang2011/harmonychat.git
bca3f3e1ce54d763720510f99acf595a49e37879
entry/src/main/ets/pages/ChatPage.ets
arkts
addEvents
添加事件监听。
addEvents() { // 【1】增加了聊天消息 IMClientManager.getInstance().getEmitter().on(UIEvent.UIEVENT_messageAdded, this.meessageAddedEventCallback = (index: number) => { // 通知ListView的数据源,刷新消息显示 this.messagesDataSource.notifyDataAdd(index); // 滚动消息列表至底部(以备显示最新消息) this.scrollToBottom(); }); ...
AST#method_declaration#Left addEvents AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 【1】增加了聊天消息 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#...
addEvents() { IMClientManager.getInstance().getEmitter().on(UIEvent.UIEVENT_messageAdded, this.meessageAddedEventCallback = (index: number) => { this.messagesDataSource.notifyDataAdd(index); this.scrollToBottom(); }); IMClientManager.getInstance().getEmitter().on(UIEvent...
https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/ChatPage.ets#L101-L147
a9c95c8386627a779db5823ede61d4e106865f1b
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/listener/EventControl.ets
arkts
setEventDisable
根据事件类型禁用事件
public setEventDisable(evType: EventType) { this.setEvent(evType, false); return this; }
AST#method_declaration#Left public setEventDisable AST#parameter_list#Left ( AST#parameter#Left evType : AST#type_annotation#Left AST#primary_type#Left EventType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_s...
public setEventDisable(evType: EventType) { this.setEvent(evType, false); return this; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/listener/EventControl.ets#L64-L67
5f4abbacd0966427a383a6ea85b9b993af30af4c
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/DisplayUtil.ets
arkts
offCaptureStatusChange
关闭屏幕截屏、投屏、录屏状态变化的监听。 @param callback 需要取消注册的回调函数。表示设备截屏、投屏或录屏状态发生变化。true表示设备开始投屏或者录屏,false表示结束投屏或者录屏;截屏仅返回一次true。若无此参数,则取消注册截屏、投屏、录屏状态变化监听的所有回调函数。
static offCaptureStatusChange(callback?: Callback<boolean>) { display.off('captureStatusChange', callback); }
AST#method_declaration#Left static offCaptureStatusChange AST#parameter_list#Left ( AST#parameter#Left callback ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Ri...
static offCaptureStatusChange(callback?: Callback<boolean>) { display.off('captureStatusChange', callback); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DisplayUtil.ets#L223-L225
d1d69fa5e3704dd283a6211fcdf1cd2c2eb9820a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/managers/StorageManager.ets
arkts
cacheItem
缓存数据(临时存储) @param key 键 @param value 值 @param ttl 过期时间(毫秒),默认1小时 @returns 操作结果
static async cacheItem<T>(key: string, value: T, ttl: number = 3600000): Promise<StorageResult<void>> { const cacheData = { value: value, timestamp: Date.now(), ttl: ttl }; return this.setItem(`cache_${key}`, cacheData); }
AST#method_declaration#Left static async cacheItem AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#param...
static async cacheItem<T>(key: string, value: T, ttl: number = 3600000): Promise<StorageResult<void>> { const cacheData = { value: value, timestamp: Date.now(), ttl: ttl }; return this.setItem(`cache_${key}`, cacheData); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/managers/StorageManager.ets#L293-L301
a9f6615235b5465476a12778a026182a50427d65
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/SettingsPage.ets
arkts
buildUserInfoCard
构建用户信息卡片
@Builder buildUserInfoCard() { Row({ space: 16 }) { // 头像 Image($r('app.media.ic_user_avatar')) .width(60) .height(60) .borderRadius(30) .objectFit(ImageFit.Cover) // 用户信息 Column({ space: 4 }) { Text('生日提醒用户') .fontSize(18) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildUserInfoCard AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( AST#component_parameters#Left { AST#component_para...
@Builder buildUserInfoCard() { Row({ space: 16 }) { Image($r('app.media.ic_user_avatar')) .width(60) .height(60) .borderRadius(30) .objectFit(ImageFit.Cover) Column({ space: 4 }) { Text('生日提醒用户') .fontSize(18) .fontWeight...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/SettingsPage.ets#L349-L395
59795932300598069c3f269799389a2ee81690e1
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Box.ets
arkts
equals
MARK: - Equatable 等价比较 判断两个Box是否相等 @param other - 另一个Box对象
equals(other: Box): boolean { return this.distance === other.distance && this.num === other.num; }
AST#method_declaration#Left equals AST#parameter_list#Left ( AST#parameter#Left other : AST#type_annotation#Left AST#primary_type#Left Box AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#t...
equals(other: Box): boolean { return this.distance === other.distance && this.num === other.num; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Box.ets#L60-L62
b01a1628f0f4ff27d0dc801fd07c9655769d4cf7
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.file.RecentPhotoComponent.d.ets
arkts
Enumeration of PhotoSource type @enum { number } PhotoSource @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core @atomicservice @since 12
export declare enum PhotoSource { /** * all resource * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ ALL = 0, /** * camera resource * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 ...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum PhotoSource AST#enum_body#Left { /** * all resource * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 12 */ AST#enum_member#Left ALL = AST#expression#Left...
export declare enum PhotoSource { ALL = 0, CAMERA = 1, SCREENSHOT = 2 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.RecentPhotoComponent.d.ets#L204-L231
f4e2d26b9f2d9a859d309cfebd30d6f39263df13
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
onSaveTap
点击保存按钮 @returns {void} 无返回值
onSaveTap(): void { if (this.isSaving) { return; } this.formController.validate().then((result) => { if (!result.valid) { return; } this.saveAddress(); }); }
AST#method_declaration#Left onSaveTap AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#ex...
onSaveTap(): void { if (this.isSaving) { return; } this.formController.validate().then((result) => { if (!result.valid) { return; } this.saveAddress(); }); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L147-L157
8f7d7439169479066be9106e4ab544d31bb5762d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/fadingedge/src/main/ets/mainpage/MainPage.ets
arkts
controlBarItem
菜单栏组件。 @param image @param text
@Builder controlBarItem(image: ResourceStr, text: ResourceStr) { Column({ space: Const.MENU_ITEM_COL_SPACE }) { Image(image) .width($r('app.integer.fadingedge_menu_item_image_width')) .height($r('app.integer.fadingedge_menu_item_image_height')) Text(text) } .padding($r('app.int...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right controlBarItem AST#parameter_list#Left ( AST#parameter#Left image : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left text : AST#type_annotation...
@Builder controlBarItem(image: ResourceStr, text: ResourceStr) { Column({ space: Const.MENU_ITEM_COL_SPACE }) { Image(image) .width($r('app.integer.fadingedge_menu_item_image_width')) .height($r('app.integer.fadingedge_menu_item_image_height')) Text(text) } .padding($r('app.int...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/fadingedge/src/main/ets/mainpage/MainPage.ets#L134-L143
0538ec86cebeee6bb115d264625cce10f53e4adc
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/CheckEmptyUtils.ets
arkts
checkStrIsEmpty
Check str is empty. @param {string} str @return {boolean} true(empty)
checkStrIsEmpty(str: string): boolean { return str == undefined || str == null || str.trim().length == 0 }
AST#method_declaration#Left checkStrIsEmpty AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#R...
checkStrIsEmpty(str: string): boolean { return str == undefined || str == null || str.trim().length == 0 }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/CheckEmptyUtils.ets#L34-L36
e0e34d6e5b69153ef92a8325e06fdc0bf0483777
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/ChatLog.ets
arkts
getDisplayTime
Format timestamp to display time
getDisplayTime(): string { const date = new Date(this.timestamp); return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; }
AST#method_declaration#Left getDisplayTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left date = A...
getDisplayTime(): string { const date = new Date(this.timestamp); return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/ChatLog.ets#L94-L97
056904494523df17deb0389a94661220c8eb8a20
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/entity/Order.ets
arkts
优惠来源
export class DiscountSource { /** * 类型 0-优惠券 */ type?: number | null = null; /** * 对象ID */ objectId?: number | null = null; /** * 优惠信息 */ info?: DiscountInfo | null = null; constructor(init?: Partial<DiscountSource>) { if (!init) { return; } this.type = init.type ?? th...
AST#export_declaration#Left export AST#class_declaration#Left class DiscountSource AST#class_body#Left { /** * 类型 0-优惠券 */ AST#property_declaration#Left type ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST...
export class DiscountSource { type?: number | null = null; objectId?: number | null = null; info?: DiscountInfo | null = null; constructor(init?: Partial<DiscountSource>) { if (!init) { return; } this.type = init.type ?? this.type; this.objectId = init.objectId ?? this.objectId; ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/Order.ets#L136-L158
36b302a0d8b389c6022a24f35e904559911b985c
github
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkTSMusicPlayer/entry/src/main/ets/common/constants/PlayerConstants.ets
arkts
Constants for player area.
export class PlayerConstants { /** * The font size of the singer is smaller. */ static readonly FONT_REDUCE: number = 4; /** * The layout weight of player control. */ static readonly LAYOUT_WEIGHT_PLAYER_CONTROL: number = 1; /** * The display priority is 1. */ static readonly DISPLAY_PRI...
AST#export_declaration#Left export AST#class_declaration#Left class PlayerConstants AST#class_body#Left { /** * The font size of the singer is smaller. */ AST#property_declaration#Left static readonly FONT_REDUCE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Ri...
export class PlayerConstants { static readonly FONT_REDUCE: number = 4; static readonly LAYOUT_WEIGHT_PLAYER_CONTROL: number = 1; static readonly DISPLAY_PRIORITY_ONE: number = 1; static readonly DISPLAY_PRIORITY_TWO: number = 2; static readonly DISPLAY_PRIORITY_THREE: number = 3; sta...
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSMusicPlayer/entry/src/main/ets/common/constants/PlayerConstants.ets#L5-L45
6ff0c1af87862025ba970acbf25aff5a2f7ed3db
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customaddresspicker/src/main/ets/pages/AddressPickerSample.ets
arkts
AddressPickerSamplePage
功能描述:本示例介绍如何使用bindSheet,changeIndex,onAreaChange实现带切换动效的自定义地址选择组件。 推荐场景:需要弹窗选择省市区的地址选择场景。如常见的收货地址编辑页面中的'所在地区'选择 核心组件: 1.CustomAddressPicker 实现步骤: 1.创建AddressInfo对象(可以不传入省市区名,也可以传入有效的省市区名),然后作为参数传入自定义地址选择组件CustomAddressPicker 2.CustomAddressPicker中通过getRawFileContentSync从rawfile目录下读取省市区json文件数据,使用util.TextDecoder进行解码...
@Component export struct AddressPickerSamplePage { @State noAddress: AddressInfo = new AddressInfo(); // 不传入地址信息 @State hasAddress: AddressInfo = new AddressInfo('浙江省', '杭州市', '余杭区'); // 传入有效的地址信息 private addressInfo: string = ''; build() { Column({ space: SPACE }) { Column({ space: SPACE }) { ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct AddressPickerSamplePage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right noAddress : AST#type_annotation#Left AST#primary_type#Left AddressInfo AST#primary_type#Ri...
@Component export struct AddressPickerSamplePage { @State noAddress: AddressInfo = new AddressInfo(); @State hasAddress: AddressInfo = new AddressInfo('浙江省', '杭州市', '余杭区'); private addressInfo: string = ''; build() { Column({ space: SPACE }) { Column({ space: SPACE }) { Text($r('app.string....
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customaddresspicker/src/main/ets/pages/AddressPickerSample.ets#L40-L117
567046438c681bf0ed1d21d3deb5c2ffb72b0e3e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/card/wordcard/WordCardOne.ets
arkts
buildWordTitlePanel
构建单词卡片布局
@Builder buildWordTitlePanel() { Column({space: 10}) { // 单词标题行 this.buildWordTitleRow(); // 发音显示行 this.buildPronunciationRow(); // 日文翻译行 this.buildWordTranslationRow(); // 词性和分类图标行 //this.buildWordAttributesRow(); } //.width('100%') .padding({left: 1...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildWordTitlePanel AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component...
@Builder buildWordTitlePanel() { Column({space: 10}) { this.buildWordTitleRow(); this.buildPronunciationRow(); this.buildWordTranslationRow(); } .padding({left: 10, right: 10 , top: 10, bottom: 10}) .backgroundColor(this.word.deleted ? ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/card/wordcard/WordCardOne.ets#L140-L160
2ade0616f6f286f1f08ce8962c65c5e1840c480b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
重复提醒配置接口
export interface RepeatReminderConfig { enabled: boolean; interval: number; // 分钟 maxRepeats: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface RepeatReminderConfig AST#object_type#Left { AST#type_member#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left interval : AST#type_...
export interface RepeatReminderConfig { enabled: boolean; interval: number; maxRepeats: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L83-L87
49d1f50888aeed4baddeea233263bd31cc6e51b3
github
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/pages/MainPage.ets
arkts
aboutToAppear
生命周期钩子,在页面即将显示时触发
aboutToAppear() { this.filterAccounts(); }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . filterAccounts AST#mem...
aboutToAppear() { this.filterAccounts(); }
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/pages/MainPage.ets#L47-L49
a1d3a7f15049f33d41ee71ead69ada7cfaf1a121
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_key_shortcuts.ets
arkts
clear_combination
Clears current combination.
clear_combination() { // this.modifier = []; this.main_key = ''; }
AST#method_declaration#Left clear_combination AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // this.modifier = []; AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . main_key ...
clear_combination() { this.main_key = ''; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_key_shortcuts.ets#L182-L185
2cd86d08d9616d6f8d7cb57d2f4d24fd770383b8
gitee
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
通知列表响应
export interface NoticeListResponse { noticeList: NoticeItem[]; count: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface NoticeListResponse AST#object_type#Left { AST#type_member#Left noticeList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left NoticeItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#type_member#...
export interface NoticeListResponse { noticeList: NoticeItem[]; count: number; }
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L133-L136
cacced0af8421a73a14ec47883de649066bdd4d9
github
LiuAnclouds/Harmony-ArkTS-App.git
2119ce333927599b81a31081bc913e1416837308
WeatherMind/entry/src/main/ets/pages/Profile.ets
arkts
getUserInfo
获取用户详细信息
private async getUserInfo(account: string) { try { let httpRequest = http.createHttp(); let response = await httpRequest.request(`${Config.API.USER_INFO}/${account}`, { method: http.RequestMethod.GET, header: { "Content-Type": "application/json" } }); let r...
AST#method_declaration#Left private async getUserInfo AST#parameter_list#Left ( AST#parameter#Left account : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_stateme...
private async getUserInfo(account: string) { try { let httpRequest = http.createHttp(); let response = await httpRequest.request(`${Config.API.USER_INFO}/${account}`, { method: http.RequestMethod.GET, header: { "Content-Type": "application/json" } }); let r...
https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/Profile.ets#L89-L108
c24bd2ce7316846d1c163de00a2f6134f6f70c12
github
batiluoxuanwan/MomentFlow.git
e57aa461223abca74f48893afc2ccf7c2d73e9b8
frontend/entry/src/main/ets/api/AIApi.ets
arkts
analyzeDiary
发送日记给后端,由后端转调 DeepSeek @param userId 用户ID @returns AI 分析后的纯文字内容
static async analyzeDiary(userId: number): Promise<string> { // 💡 泛型传 string,因为我们后端的 R<T> 最终会返回处理好的字符串 const res = await request<string>('http://10.0.2.2:8080/api/ai/analyze', { method: http.RequestMethod.POST, header: { 'Content-Type': 'application/json' }, extraData: JSON.stringify({ userId...
AST#method_declaration#Left static async analyzeDiary AST#parameter_list#Left ( AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_t...
static async analyzeDiary(userId: number): Promise<string> { const res = await request<string>('http://10.0.2.2:8080/api/ai/analyze', { method: http.RequestMethod.POST, header: { 'Content-Type': 'application/json' }, extraData: JSON.stringify({ userId: userId }) }) return res ?? "AI ...
https://github.com/batiluoxuanwan/MomentFlow.git/blob/e57aa461223abca74f48893afc2ccf7c2d73e9b8/frontend/entry/src/main/ets/api/AIApi.ets#L38-L47
6136d43bef3f9d3dd7473e107431b87b62e45078
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/LineChartModel.ets
arkts
drawMarkers
draws all MarkerViews on the highlighted positions
protected drawMarkers(c: CanvasRenderingContext2D, isDraw?: boolean): void { if (this.mLastGesture != LastGesture.SINGLE_TAP || !isDraw) { return; } // if there is no marker view or drawing marker is disabled if (this.mMarker == null || !this.isDrawMarkersEnabled() || !this.valuesToHighlight()) ...
AST#method_declaration#Left protected drawMarkers AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left isDraw ? : AST#type_annotation#Left AST#primary_type#Left b...
protected drawMarkers(c: CanvasRenderingContext2D, isDraw?: boolean): void { if (this.mLastGesture != LastGesture.SINGLE_TAP || !isDraw) { return; } if (this.mMarker == null || !this.isDrawMarkersEnabled() || !this.valuesToHighlight()) return; if (this.mIndicesToHighlight && this.mDat...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/LineChartModel.ets#L68-L107
c7971f412ab787d9d6868d5bb450564ba4d18a85
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/TypeUtil.ets
arkts
isString
判断是否是String类型
static isString(value: Any): boolean { return typeof value === 'string'; }
AST#method_declaration#Left static isString AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Ri...
static isString(value: Any): boolean { return typeof value === 'string'; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L47-L49
eff0dcaef57ff964d61e2f41258d0155a56d447c
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/interfaces/dataprovider/ChartInterface.ets
arkts
Interface that provides everything there is to know about the dimensions, bounds, and range of the chart.
export default interface
AST#export_declaration#Left export default AST#expression#Left interface AST#expression#Right AST#export_declaration#Right
export default interface
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/interfaces/dataprovider/ChartInterface.ets#L27-L27
cbd90fcaccd7064d3f343d54ae0552dc6e9700c7
gitee
851432669/Smart-Home-ArkTs-Hi3861.git
0451f85f072ed3281cc23d9cdc2843d79f60f975
entry/src/main/ets/common/utils/GlobalDataManager.ets
arkts
设备状态接口
export interface DeviceStatus { id: string; name: string; isOn: boolean; temperature?: number; // 适用于空调 level?: number; // 适用于可调节设备 }
AST#export_declaration#Left export AST#interface_declaration#Left interface DeviceStatus AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AS...
export interface DeviceStatus { id: string; name: string; isOn: boolean; temperature?: number; level?: number; }
https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/common/utils/GlobalDataManager.ets#L14-L20
487920b305f7a41fe5465e6b8ef53d369377b69d
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets
arkts
getCenterY
Get the center point of y. @returns
getCenterY(): number { return (this.top + this.getHeight() / 2); }
AST#method_declaration#Left getCenterY AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#parenthesized_expres...
getCenterY(): number { return (this.top + this.getHeight() / 2); }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets#L98-L100
96859e59983de04a344553d3974a83b93a9a47d9
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/GetDate.ets
arkts
获取当前日期,年月日星期几
export function getRealTimeDate(): DateModel{ const nowDate = new Date(); // 创建Date对象,设置当前日期和时间 let currentMonth = nowDate.getMonth() + 1; // 获取当前月份,getMonth()获得的值是0~11,实际月份需要+1 let currentDay = nowDate.getDate(); // 获取当前日 let currentYear = nowDate.getFullYear(); // 获取当前年份 let currentWeekDay = new Date(curren...
AST#export_declaration#Left export AST#function_declaration#Left function getRealTimeDate AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left DateModel AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaratio...
export function getRealTimeDate(): DateModel{ const nowDate = new Date(); let currentMonth = nowDate.getMonth() + 1; let currentDay = nowDate.getDate(); let currentYear = nowDate.getFullYear(); let currentWeekDay = new Date(currentYear, currentMonth - 1, currentDay).getDay(); let nowDateModel = new Dat...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/GetDate.ets#L49-L61
2394db2c549d827038b63e1be7f07817dd6c0bef
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/onlinesearch/OnlineWordManager.ets
arkts
get
/ 获取单例实例
static get shared(): OnlineWordManager { if (!OnlineWordManager.instance) { OnlineWordManager.instance = new OnlineWordManager() } return OnlineWordManager.instance }
AST#method_declaration#Left static get AST#ERROR#Left shared AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left OnlineWordManager AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statem...
static get shared(): OnlineWordManager { if (!OnlineWordManager.instance) { OnlineWordManager.instance = new OnlineWordManager() } return OnlineWordManager.instance }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/onlinesearch/OnlineWordManager.ets#L16-L21
5c6a15dd35779001d0acd5f220b3d595e1297568
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/ui/src/main/ets/component/navdestination/AppNavDestination.ets
arkts
onDidBuild
组件构建完成(API 12+) @returns {void} 无返回值
onDidBuild(): void { this.viewModel.onDidBuild(); }
AST#method_declaration#Left onDidBuild AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Le...
onDidBuild(): void { this.viewModel.onDidBuild(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ui/src/main/ets/component/navdestination/AppNavDestination.ets#L97-L99
079caaf73f827e83c0b93a802958310da0fabb0f
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/RSA.ets
arkts
encrypt
加密,异步 @param data 加密或者解密的数据。data不能为null。 @param pubKey 指定加密公钥。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(RSA1024|PKCS1、RSA2048|PKCS1、等)。 @returns
static async encrypt(data: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, transformation: crypto.RSA_TRAN = 'RSA1024|PKCS1'): Promise<cryptoFramework.DataBlob> { return CryptoUtil.encrypt(data, pubKey, null, transformation); }
AST#method_declaration#Left static async encrypt AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pubKey...
static async encrypt(data: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, transformation: crypto.RSA_TRAN = 'RSA1024|PKCS1'): Promise<cryptoFramework.DataBlob> { return CryptoUtil.encrypt(data, pubKey, null, transformation); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/RSA.ets#L34-L37
a9da1ad231a378e6693e1a0c6a602946a7e359db
gitee
waylau/harmonyos-tutorial
74e23dfa769317f8f057cc77c2d09f0b1f2e0773
samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets
arkts
getLocalVideo
Scan the local video. @return Local video list data
async getLocalVideo() { this.videoLocalList = []; await this.assemblingVideoBean(); globalThis.videoLocalList = this.videoLocalList; return this.videoLocalList; }
AST#method_declaration#Left async getLocalVideo AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . videoLocalList AST#member_expr...
async getLocalVideo() { this.videoLocalList = []; await this.assemblingVideoBean(); globalThis.videoLocalList = this.videoLocalList; return this.videoLocalList; }
https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets#L15-L20
8d119c66927cc3ca1d659e8681361b8711189e03
gitee
conrad_sheeran/TickAuth
8ef852e12999d15cf70394cdab82d08ac5843143
features/homepage/src/main/ets/view/TOTPView.ets
arkts
aboutToAppear
生命周期
async aboutToAppear(): Promise<void> { try { this.oldDeleteItem = await this.preferences.get("WaitDeleteAlias", []) as Array<WaitDeleteItemParam>; this.oldDeleteItem.forEach((value, index) => { if (value.time <= Date.now()) { this.writeToJson.remove(value.alias).then((isNull: boolean) ...
AST#method_declaration#Left async aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_ar...
async aboutToAppear(): Promise<void> { try { this.oldDeleteItem = await this.preferences.get("WaitDeleteAlias", []) as Array<WaitDeleteItemParam>; this.oldDeleteItem.forEach((value, index) => { if (value.time <= Date.now()) { this.writeToJson.remove(value.alias).then((isNull: boolean) ...
https://github.com/conrad_sheeran/TickAuth/blob/8ef852e12999d15cf70394cdab82d08ac5843143/features/homepage/src/main/ets/view/TOTPView.ets#L136-L168
f4a180d44a48f0255b43afa5eb4891bf917fba3f
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagetheft/src/main/ets/constants/Constants.ets
arkts
column间隔
export const IMAGE_THEFT_COLUMN_SPACE: number = 10;
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left IMAGE_THEFT_COLUMN_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right AST#variable_declarator#Right ; AST#variable...
export const IMAGE_THEFT_COLUMN_SPACE: number = 10;
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagetheft/src/main/ets/constants/Constants.ets#L23-L23
1c191f85472dc963f4531354ed27e3040e14bc72
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/EmitterUtil.ets
arkts
post
发送事件 @param eventId 事件ID,string类型的eventId不支持空字符串。 @param data 发送的数据 @param EventPriority 事件被发送的优先级
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) { const genericEventData: emitter.GenericEventData<T> = { data: eventData }; const options: emitter.Options = { priority: priority }; emitter.emit(eventId.toString(), options, genericEventDat...
AST#method_declaration#Left static post AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left eventId : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Lef...
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) { const genericEventData: emitter.GenericEventData<T> = { data: eventData }; const options: emitter.Options = { priority: priority }; emitter.emit(eventId.toString(), options, genericEventDat...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/EmitterUtil.ets#L33-L37
1c40030cfe842c5ebc04f2b564b8da0f027aa841
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/arkweb/ArkJsObject.ets
arkts
setAppGrayScaleEasy
设置灰阶,APP一键置灰。 @param grayScale 该参数为浮点数,取值范围为[0.0, 1.0]。
setAppGrayScaleEasy(grayScale: number = 1.0):void { Tools.setGrayScale(grayScale); }
AST#method_declaration#Left setAppGrayScaleEasy AST#parameter_list#Left ( AST#parameter#Left grayScale : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1.0 AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotat...
setAppGrayScaleEasy(grayScale: number = 1.0):void { Tools.setGrayScale(grayScale); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkJsObject.ets#L79-L81
70667a76f3eac1b12d4e0713c03411ebfa05872a
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets
arkts
sendMail
发送邮件
async sendMail() { //发送发件人信箱 await this.exeCmdAndWait4Response(`mail from:<${this.mailFrom}>`) let rcptMails = this.rcptList.split(',') for(let i=0;i<rcptMails.length;i++){ //发送收件人信箱 let rcpt = rcptMails[i] await this.exeCmdAndWait4Response(`rcpt to:<${rcpt}>`) } //准备发送邮件内容 ...
AST#method_declaration#Left async sendMail AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { //发送发件人信箱 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left ...
async sendMail() { await this.exeCmdAndWait4Response(`mail from:<${this.mailFrom}>`) let rcptMails = this.rcptList.split(',') for(let i=0;i<rcptMails.length;i++){ let rcpt = rcptMails[i] await this.exeCmdAndWait4Response(`rcpt to:<${rcpt}>`) } await this.exeCmdAndWait4...
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets#L227-L248
c77392cb1f47120c1a82c9adb6ce993b8b81d6e6
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets
arkts
clear
[End static_pop] 获取页面栈并清空
public static clear(routerName: string): void { RouterModule.getRouter(routerName).clear(); }
AST#method_declaration#Left public static clear AST#parameter_list#Left ( AST#parameter#Left routerName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
public static clear(routerName: string): void { RouterModule.getRouter(routerName).clear(); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L70-L72
ebe86c29872576e82df2ad20bc1c58ec907fbc8c
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets
arkts
美式发音
export const titleCn1 = "item4";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left titleCn1 = AST#expression#Left "item4" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const titleCn1 = "item4";
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets#L25-L25
ecc20f79a15224d9561816b5fa2b59912a59fa25
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/member/MemberManager.ets
arkts
============================================================ MARK: - MemberManager
export class MemberManager { private static _shared: MemberManager | null = null public static get shared(): MemberManager { if (!MemberManager._shared) { MemberManager._shared = new MemberManager() MemberManager._shared.init() } return MemberManager._shared! } // 私有构造器 private cons...
AST#export_declaration#Left export AST#class_declaration#Left class MemberManager AST#class_body#Left { AST#property_declaration#Left private static _shared : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left MemberManager AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#u...
export class MemberManager { private static _shared: MemberManager | null = null public static get shared(): MemberManager { if (!MemberManager._shared) { MemberManager._shared = new MemberManager() MemberManager._shared.init() } return MemberManager._shared! } private constructor(...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/MemberManager.ets#L69-L388
2c125327fed5f1c2f0a1fdbf5a331264a827dcf8
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
buildPrivacyPolicy
隐私政策
@Builder buildPrivacyPolicy() { Column({ space: 16 }) { Text('🔒 隐私政策') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor(this.COLORS.textPrimary) .alignSelf(ItemAlign.Start) Column({ space: 12 }) { Text('我们严格保护您的隐私信息,所有数据仅存储在本地设备中。') .fontSize(...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildPrivacyPolicy AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_...
@Builder buildPrivacyPolicy() { Column({ space: 16 }) { Text('🔒 隐私政策') .fontSize(18) .fontWeight(FontWeight.Medium) .fontColor(this.COLORS.textPrimary) .alignSelf(ItemAlign.Start) Column({ space: 12 }) { Text('我们严格保护您的隐私信息,所有数据仅存储在本地设备中。') .fontSize(...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L3649-L3680
4766f4e28fe4537241813da043ca46239ef6edea
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/expression/basic_expression_operation/assign_expression_002_F.ets
arkts
Introduction 基础表达式运算-赋值表达式
export function assign_expression_002_F(taint_src : string) { let _t = taint_src; let clean = "clean"; taint.Sink(clean); }
AST#export_declaration#Left export AST#function_declaration#Left function assign_expression_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_state...
export function assign_expression_002_F(taint_src : string) { let _t = taint_src; let clean = "clean"; taint.Sink(clean); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/expression/basic_expression_operation/assign_expression_002_F.ets#L6-L10
cd980c351d28152b8b54f6469c49d65cd57db6a4
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/common/Utils.ets
arkts
isToday
Check if a timestamp is today @param timestamp - Unix timestamp in milliseconds @returns True if timestamp is today
static isToday(timestamp: number): boolean { return timestamp >= Utils.getStartOfToday() && timestamp <= Utils.getEndOfToday(); }
AST#method_declaration#Left static isToday AST#parameter_list#Left ( AST#parameter#Left timestamp : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_t...
static isToday(timestamp: number): boolean { return timestamp >= Utils.getStartOfToday() && timestamp <= Utils.getEndOfToday(); }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/Utils.ets#L64-L66
f9505779ab7a5007c407dbde34487786f306c849
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/TaskViewModel.ets
arkts
getWeekTasks
获取本周任务
getWeekTasks(): TaskItem[] { return this.tasks.filter(task => { if (task.scheduledDate) { return DateUtils.isThisWeek(task.scheduledDate); } return DateUtils.isThisWeek(task.createdAt); }); }
AST#method_declaration#Left getWeekTasks AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TaskItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left re...
getWeekTasks(): TaskItem[] { return this.tasks.filter(task => { if (task.scheduledDate) { return DateUtils.isThisWeek(task.scheduledDate); } return DateUtils.isThisWeek(task.createdAt); }); }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/TaskViewModel.ets#L430-L437
5f115712edb5d46003f4f9bc78f3f906c6d187d3
github
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/Recycle2.ets
arkts
buildTab
构建选项卡项
@Builder buildTab(tabText: string, status: string) { Column() { Text(tabText) .fontSize(16) .fontColor(this.selectedTab === status ? '#FFFFFF' : '#E0E0E0') .margin({ top: 10 }); if (this.selectedTab === status) { Column() {}.width(40).height(3).backgroundColor('#FFFFFF...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildTab AST#parameter_list#Left ( AST#parameter#Left tabText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left status : AST#type_annotation#Left A...
@Builder buildTab(tabText: string, status: string) { Column() { Text(tabText) .fontSize(16) .fontColor(this.selectedTab === status ? '#FFFFFF' : '#E0E0E0') .margin({ top: 10 }); if (this.selectedTab === status) { Column() {}.width(40).height(3).backgroundColor('#FFFFFF...
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/Recycle2.ets#L169-L187
73bf0e1f01216c8b75d79c3aba1b192da5202ef9
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/cigen/CigenWordHelper.ets
arkts
getSameRootDescByWord
============================================================ Word -> 同根描述 ============================================================
static async getSameRootDescByWord(word: Word): Promise<string | null> { const text = word.titleEn; if (!text) return null; return await CigenWordDbAccess.shared.getSameRootStringByText(text); }
AST#method_declaration#Left static async getSameRootDescByWord AST#parameter_list#Left ( AST#parameter#Left word : AST#type_annotation#Left AST#primary_type#Left Word AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gene...
static async getSameRootDescByWord(word: Word): Promise<string | null> { const text = word.titleEn; if (!text) return null; return await CigenWordDbAccess.shared.getSameRootStringByText(text); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/cigen/CigenWordHelper.ets#L52-L57
fc794780450a7e24fc27f4b6315bcb5772dc148f
github
wcmzllx/axis-render
34a330085691968cf1c132095e5ce078aa7ee933
AxisRenderLibrary/src/main/ets/common/AxisRender.ets
arkts
setOrientation
设置轴方向 @param orientation
setOrientation(orientation: AxisOrientation){ this.orientation = orientation this.getInstance().setOrientation(orientation.valueOf()) this.invalidate() }
AST#method_declaration#Left setOrientation AST#parameter_list#Left ( AST#parameter#Left orientation : AST#type_annotation#Left AST#primary_type#Left AxisOrientation AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#L...
setOrientation(orientation: AxisOrientation){ this.orientation = orientation this.getInstance().setOrientation(orientation.valueOf()) this.invalidate() }
https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L465-L469
78bd3c039afafc697afb797dcd7ea326fa86574f
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/arkts/@arkts.utils.d.ets
arkts
query
Query information about the specified lock. @param { string } name - name of the lock. @returns { AsyncLockState } Returns an instance of AsyncLockState. @throws { BusinessError } 401 - The input parameters are invalid. @throws { BusinessError } 10200030 - The lock does not exist. @static @syscap SystemCapability.Util...
static query(name: string): AsyncLockState;
AST#method_declaration#Left static query AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AsyncLockState AST#primary_t...
static query(name: string): AsyncLockState;
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.utils.d.ets#L89-L89
bdc0600450342ad93915e98620b5f6e7cfa11ec4
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/Base64Util.ets
arkts
encodeToStrSync
编码,通过输入参数编码后输出对应文本。 @param array @returns
static encodeToStrSync(array: Uint8Array, options?: util.Type): string { const base64 = new util.Base64Helper(); const result = base64.encodeToStringSync(array, options); return result; }
AST#method_declaration#Left static encodeToStrSync AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AST#quali...
static encodeToStrSync(array: Uint8Array, options?: util.Type): string { const base64 = new util.Base64Helper(); const result = base64.encodeToStringSync(array, options); return result; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/Base64Util.ets#L63-L67
36348207b3fbf87e9da2ff27c91ecf4a59f18255
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/MePage.ets
arkts
MenuItem
菜单项
@Builder MenuItem(title: string, icon: string, iconColor: string, showDivider: boolean = true) { Row({ space: AppDimensions.spaceMedium }) { Text(icon) .fontSize(20) Text(title) .fontSize(AppTypography.fontSizeMedium) .fontColor(AppColors.textPrimary) .layoutWeight(1) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right MenuItem AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left icon : AST#type_annotation#Left AST#p...
@Builder MenuItem(title: string, icon: string, iconColor: string, showDivider: boolean = true) { Row({ space: AppDimensions.spaceMedium }) { Text(icon) .fontSize(20) Text(title) .fontSize(AppTypography.fontSizeMedium) .fontColor(AppColors.textPrimary) .layoutWeight(1) ...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/MePage.ets#L286-L306
77702642a0d09697207cd8421a41d074637d8f6b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/share/SharePage.ets
arkts
buildCustomContentDialog
构建自定义内容对话框
@Builder buildCustomContentDialog() { Column({ space: UIConstants.LARGE_PADDING }) { Text('编辑分享内容') .fontSize(UIConstants.FONT_SIZE_HEADING) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.text_primary')) TextArea({ text: this.customContent, placeholder: '请输入分享内容...' }...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCustomContentDialog AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#comp...
@Builder buildCustomContentDialog() { Column({ space: UIConstants.LARGE_PADDING }) { Text('编辑分享内容') .fontSize(UIConstants.FONT_SIZE_HEADING) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.text_primary')) TextArea({ text: this.customContent, placeholder: '请输入分享内容...' }...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/share/SharePage.ets#L490-L528
21c36e1918248294e6ada524f9d277b81ba1b373
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.stateManagement.d.ets
arkts
@file State management API file @kit ArkUI @arkts 1.2
export * from './arkui/stateManagement/common';
AST#export_declaration#Left export * from './arkui/stateManagement/common' ; AST#export_declaration#Right
export * from './arkui/stateManagement/common';
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.stateManagement.d.ets#L22-L22
3c78579b1319744451cf3970966e909154297811
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/agent-assignment/99.0.0/package/index.ets
arkts
helloWorld
应用约束70:不支持对函数声明属性,改为单独导出helloWorld函数
export { helloWorld };
AST#export_declaration#Left export { helloWorld } ; AST#export_declaration#Right
export { helloWorld };
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/agent-assignment/99.0.0/package/index.ets#L14-L14
89213e1ba55ec338b64c977e3eaf5d72c211bb73
github