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
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/services/TaskService.ets
arkts
进度记录接口
export interface Progress { id: number; dreamId?: number; taskId?: number; userId: number; description: string; images?: string; createdAt: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface Progress AST#object_type#Left { AST#type_member#Left id : 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 dreamId ? : AST#type_annotation#Left A...
export interface Progress { id: number; dreamId?: number; taskId?: number; userId: number; description: string; images?: string; createdAt: string; }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/services/TaskService.ets#L18-L26
d4e09557fea651bb0866a6c3549dbca4be180e5b
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/AuthRepository.ets
arkts
getSmsCode
获取短信验证码 @param {Record<string, string>} params - 验证码请求参数 @returns {Promise<NetworkResponse<string>>} 短信发送结果
async getSmsCode(params: Record<string, string>): Promise<NetworkResponse<string>> { return this.networkDataSource.getSmsCode(params); }
AST#method_declaration#Left async getSmsCode AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annot...
async getSmsCode(params: Record<string, string>): Promise<NetworkResponse<string>> { return this.networkDataSource.getSmsCode(params); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/AuthRepository.ets#L54-L56
a5b7cd27953c825131e2b7e027bba682d70bbc88
github
HarmonyCandies/loading_more_list.git
49ab379fb8baff92fc42f7c3bc6fcea87a1f4970
loading_more_list/src/main/ets/components/IndicatorWidget.ets
arkts
IndicatorWidget
namespace LoadingMoreList {
@Component export struct IndicatorWidget { /// Source list based on the [LoadingMoreBase]. indicatorStatus: IndicatorStatus = IndicatorStatus.none; sourceList: LoadingMoreBase<ESObject> | null = null; build() { if (this.indicatorStatus == IndicatorStatus.none) { Column() } else if (this.indicator...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct IndicatorWidget AST#component_body#Left { /// Source list based on the [LoadingMoreBase]. AST#property_declaration#Left indicatorStatus : AST#type_annotation#Left AST#primary_type#Left IndicatorStatus AST#primary_type...
@Component export struct IndicatorWidget { indicatorStatus: IndicatorStatus = IndicatorStatus.none; sourceList: LoadingMoreBase<ESObject> | null = null; build() { if (this.indicatorStatus == IndicatorStatus.none) { Column() } else if (this.indicatorStatus == IndicatorStatus.fullScreenBusying) ...
https://github.com/HarmonyCandies/loading_more_list.git/blob/49ab379fb8baff92fc42f7c3bc6fcea87a1f4970/loading_more_list/src/main/ets/components/IndicatorWidget.ets#L4-L57
8b834488791e5b54c9ddc89218b0b99131e1b102
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/akiusepractice/src/main/ets/view/AkiView.ets
arkts
AkiView
本示例介绍使用AKI编写的C++函数实现跨线程调用JS函数场景。在ArkTS侧使用AKI的JSBind.bindFunction绑定 JS函数akiAccumulate,然后使用AKI调用C++函数AkiThreadsCallJs。在C++侧AkiThreadsCallJs中创建子 线程去调用JS侧函数akiAccumulate,从而实现对变量value的加10操作,为开发者使用AKI提供参考。
@Component export struct AkiView { @StorageLink('akiViewValue') akiViewValue: number = 0; // 描述标题 @State title: Resource = $r('app.string.aki_use_practice_title'); // 描述详情 @State content: Resource = $r('app.string.aki_use_practice_content'); private val: number = 0; aboutToAppear(): void { // 页面加载重置变...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct AkiView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'akiViewValue' AST#expression#Right ) AST#decorator#Right akiViewValue : AST#type_annotation#Left ...
@Component export struct AkiView { @StorageLink('akiViewValue') akiViewValue: number = 0; @State title: Resource = $r('app.string.aki_use_practice_title'); @State content: Resource = $r('app.string.aki_use_practice_content'); private val: number = 0; aboutToAppear(): void { this.akiViewValue =...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/akiusepractice/src/main/ets/view/AkiView.ets#L26-L77
8560e2e8bdc9127425eb3a816da529f9fd5abef2
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/views/BgImage.ets
arkts
BgImage
背景图片组件
@Component export struct BgImage { build() { // Image($r('app.media.common_bg')) // 使用资源引用 // .width('100%') // 等同于 .resizable() + .frame // .height('100%') // .objectFit(ImageFit.Cover) // 等同于 .aspectRatio(contentMode: .fill) // .position({ x: 0, y: 0 }) // 确保从左上角开始布局 // ....
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BgImage AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { // Image($r('app.media.common_bg')) // 使用资源引用 // .width('100%') // 等同于 .resizable() + .frame // .height('100%') // ...
@Component export struct BgImage { build() { Rect() .width('100%') .height('100%') .fill($r('app.color.color_background')) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) } }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/BgImage.ets#L3-L20
75338986ffbad49326b9ea68077c119ca2c931ff
github
longchenxu123/HongmengDemoPandaCommunity.git
331aee32e89ac94764e63aa6d0c8c458201b7df8
entry/src/main/ets/units/homeViewTool/index.ets
arkts
生成订单信息对象
export class createdOrderMessageObj { icon: ResourceStr; state: string; message:string; newsTime:string; money: number; cellLocation:string; incidentType:string; abortTime: string; id:string; inType:any stateObj = { 1:"已关闭", 2: '已取消', 3: '待接单', 4: '已接单' } messageArr = [ "亲爱...
AST#export_declaration#Left export AST#ERROR#Left class createdOrderMessageObj { AST#property_declaration#Left icon : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left state : AST#type_annotation#Lef...
export class createdOrderMessageObj { icon: ResourceStr; state: string; message:string; newsTime:string; money: number; cellLocation:string; incidentType:string; abortTime: string; id:string; inType:any stateObj = { 1:"已关闭", 2: '已取消', 3: '待接单', 4: '已接单' } messageArr = [ "亲爱...
https://github.com/longchenxu123/HongmengDemoPandaCommunity.git/blob/331aee32e89ac94764e63aa6d0c8c458201b7df8/entry/src/main/ets/units/homeViewTool/index.ets#L2-L52
01ddee88b4b90c2c8787b29211d1a66c747e610b
github
hackeris/HiSH
6485c7b24ee47727fe464dc3a69484f44689e85b
entry/src/main/ets/lib/validateFolderName.ets
arkts
Validate a single POSIX folder name (path component). @param name - candidate folder name @param opts - optional settings (maxLength) @returns ValidationResult - { valid: boolean, reason?: string }
export function validateFolderName(name: string): boolean { const maxLength = 255 if (typeof name !== "string") { return false } if (name.length === 0) { return false } if (name === "." || name === "..") { return false } if (name.length > maxLength) { return false } if (name.in...
AST#export_declaration#Left export AST#function_declaration#Left function validateFolderName 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#Lef...
export function validateFolderName(name: string): boolean { const maxLength = 255 if (typeof name !== "string") { return false } if (name.length === 0) { return false } if (name === "." || name === "..") { return false } if (name.length > maxLength) { return false } if (name.in...
https://github.com/hackeris/HiSH/blob/6485c7b24ee47727fe464dc3a69484f44689e85b/entry/src/main/ets/lib/validateFolderName.ets#L21-L50
e6a959bdec02995ba5185331ca5e59cfde78a59c
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_commonAttrsLayout/ace_ets_module_commonAttrsLayout_nowear_api11/entry/src/main/ets/MainAbility/pages/getItemRect/waterFlow/WaterFlowDataSource.ets
arkts
WaterFlowDataSource.ets 实现IDataSource接口的对象,用于瀑布流组件加载数据
export class WaterFlowDataSource implements IDataSource { private dataArray: number[] = [] private listeners: DataChangeListener[] = [] constructor
AST#export_declaration#Left export AST#ERROR#Left class WaterFlowDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right { AST#property_declaration#Left private dataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_typ...
export class WaterFlowDataSource implements IDataSource { private dataArray: number[] = [] private listeners: DataChangeListener[] = [] constructor
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_commonAttrsLayout/ace_ets_module_commonAttrsLayout_nowear_api11/entry/src/main/ets/MainAbility/pages/getItemRect/waterFlow/WaterFlowDataSource.ets#L18-L22
ed6885de92d3185c96a5a44936d18e83ab5cabfd
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
getParentUri
通过URI或路径,获取对应文件父目录的URI。 @param uriOrPath URI或路径
static getParentUri(uriOrPath: string): string { return FileUtil.getFileUri(uriOrPath).getFullDirectoryUri(); }
AST#method_declaration#Left static getParentUri AST#parameter_list#Left ( AST#parameter#Left uriOrPath : 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 string AST#prima...
static getParentUri(uriOrPath: string): string { return FileUtil.getFileUri(uriOrPath).getFullDirectoryUri(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L215-L217
024c719f88fc8690c3216ee2003e455eaee46167
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/AboutSample/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Common constants for all features.
export class CommonConstants { /** * Font weight. */ static readonly FONT_WEIGHT: number = 500; /** * Scroll weight. */ static readonly SCROLL_WEIGHT: number = 1; /** * Application version example. */ static readonly APP_VERSION: string = '1.0.0'; /** * Detail page url. */ sta...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Font weight. */ AST#property_declaration#Left static readonly FONT_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 5...
export class CommonConstants { static readonly FONT_WEIGHT: number = 500; static readonly SCROLL_WEIGHT: number = 1; static readonly APP_VERSION: string = '1.0.0'; static readonly DETAIL_PAGE: string = 'pages/DetailPage'; static readonly AGREEMENT_PAGE: string = 'pages/AgreementPage'; ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/AboutSample/entry/src/main/ets/common/constants/CommonConstants.ets#L4-L99
cc9548b869d3d76fc48ba26c7d5c9c63d3bd5c34
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/VirtualEconomyService.ets
arkts
getUserWallet
获取用户钱包
getUserWallet(): UserWallet | null { return this.userWallet; }
AST#method_declaration#Left getUserWallet AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left UserWallet AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#block_statement#Lef...
getUserWallet(): UserWallet | null { return this.userWallet; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L252-L254
bcd799c7c0dd7fb959a6d606c3801076cb07912b
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/DataManager.ets
arkts
提供持久化数据的获取、设置、和删除操作 @class
export class DataManager { /** * 从缓存的Preferences实例中获取键对应的值 * @param { Context } Context - 应用上下文 * @param { function } callback - 回调函数 */ static getDate(context: Context, callback: (dateModel: DateModel) => void) { let dateModel: DateModel = getRealTimeDate(); try { // 获取Preferences实例 ...
AST#export_declaration#Left export AST#class_declaration#Left class DataManager AST#class_body#Left { /** * 从缓存的Preferences实例中获取键对应的值 * @param { Context } Context - 应用上下文 * @param { function } callback - 回调函数 */ AST#method_declaration#Left static getDate AST#parameter_list#Left ( AST#parameter#Left context ...
export class DataManager { static getDate(context: Context, callback: (dateModel: DateModel) => void) { let dateModel: DateModel = getRealTimeDate(); try { let promise = dataPreferences.getPreferences(context, 'date') promise.then((object: dataPreferences.Preferences) => { ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customcalendarpickerdialog/src/main/ets/components/DataManager.ets#L24-L144
60a880dee049dcbf47a7b844ec62fb150577a667
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/game/VirtualShopPage.ets
arkts
buildTabBar
构建标签栏
@Builder buildTabBar() { Scroll() { Row({ space: 0 }) { ForEach(this.tabs, (tab) => { Column({ space: 4 }) { Image($r(`app.media.ic_${tab.icon}`)) .width(20) .height(20) .fillColor(this.selectedCategory === tab.id ? $r('app.color.primar...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildTabBar 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_elem...
@Builder buildTabBar() { Scroll() { Row({ space: 0 }) { ForEach(this.tabs, (tab) => { Column({ space: 4 }) { Image($r(`app.media.ic_${tab.icon}`)) .width(20) .height(20) .fillColor(this.selectedCategory === tab.id ? $r('app.color.primar...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/game/VirtualShopPage.ets#L205-L243
696ec2d0f8c84167dd3e7aef241f7d0ebbc8f847
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildBanRemove.ets
arkts
Emitted whenever a member is unbanned from a guild. @event Client#guildBanRemove @param {Guild} guild The guild that the unban occurred in @param {User} user The user that was unbanned 应用约束61:使用export default代替module.exports
export default GuildBanRemoveHandler;
AST#export_declaration#Left export default AST#expression#Left GuildBanRemoveHandler AST#expression#Right ; AST#export_declaration#Right
export default GuildBanRemoveHandler;
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildBanRemove.ets#L21-L21
766370e46cfe26962904bd0abb3f2e6a30fdf9f0
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/structures/MessageCollector.ets
arkts
on
方法添加类型注解(约束1)
public on(eventName: string, listener: Function): void { // 移除util.deprecate相关代码(约束75) super.on(eventName, listener); }
AST#method_declaration#Left public on AST#parameter_list#Left ( AST#parameter#Left eventName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_ty...
public on(eventName: string, listener: Function): void { super.on(eventName, listener); }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/MessageCollector.ets#L58-L61
44701f5ead476585a8a52fa6cd687a45486a4a72
github
kumaleap/ArkSwipeDeck.git
5afa77b9b2a2a531595d31f895c54a3371e4249a
library/Index.ets
arkts
SwipeDirection
导出枚举
export { SwipeDirection, CardState } from './src/main/ets/types/SwipeCardTypes';
AST#export_declaration#Left export { SwipeDirection , CardState } from './src/main/ets/types/SwipeCardTypes' ; AST#export_declaration#Right
export { SwipeDirection, CardState } from './src/main/ets/types/SwipeCardTypes';
https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/Index.ets#L28-L28
a0d1ce21e54ff19619e743c27b24a29c80d568aa
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/utils/MD5.ets
arkts
hmacSync
消息认证码计算,同步 @param data 传入的消息 @param symKey 共享对称密钥。 @param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。
static hmacSync(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex'): string { return CryptoUtil.hmacSync(data, 'MD5', symKey, resultCoding); }
AST#method_declaration#Left static hmacSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left ...
static hmacSync(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex'): string { return CryptoUtil.hmacSync(data, 'MD5', symKey, resultCoding); }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/MD5.ets#L92-L95
767ae794bc1a7b655dd95bcf3e69781d497bb3ab
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
isFloat32Array
Check whether the entered value is of float32array array type. @param { Object } value - A Float32Array value @returns { boolean } Returns true if the value is a built-in Float32Array instance. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
isFloat32Array(value: Object): boolean;
AST#method_declaration#Left isFloat32Array AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object 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#...
isFloat32Array(value: Object): boolean;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1213-L1213
b0fdd6a760c68d0dd53a4de51c9e59a09d5611bd
gitee
lentozi/DailyPlan.git
96ce0bec8f545511c51b577c4aa8327c2c5bb0c8
entry/src/main/ets/tabcontent/HomeContent.ets
arkts
ButtonGroup
封装 ButtonGroup
@Builder ButtonGroup() { Row() { Image($r('app.media.ic_public_add')) .width('30vp') .onHover(() => { this.addPopup = true; }) // TODO .bindPopup(this.addPopup, { message: 'This is a popup with PopupOptions', }) .onClick(() => { ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right ButtonGroup 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#container_content_body#Left { AST#arkts_ui_element...
@Builder ButtonGroup() { Row() { Image($r('app.media.ic_public_add')) .width('30vp') .onHover(() => { this.addPopup = true; }) .bindPopup(this.addPopup, { message: 'This is a popup with PopupOptions', }) .onClick(() => { ...
https://github.com/lentozi/DailyPlan.git/blob/96ce0bec8f545511c51b577c4aa8327c2c5bb0c8/entry/src/main/ets/tabcontent/HomeContent.ets#L99-L139
16a8543a840d0425d0d64505ea7d9eff24b907d2
github
JackJiang2011/harmonychat.git
bca3f3e1ce54d763720510f99acf595a49e37879
entry/src/main/ets/pages/constants/UIEvent.ets
arkts
Copyright (C) 2024 即时通讯网(52im.net) & Jack Jiang. The MobileIMSDK-鸿蒙Next客户端 Project. All rights reserved. 联系邮件:jack.jiang@52im.net 联系微信:hellojackjiang 联系QQ: 413980957 技术社区:http://www.52im.net 应用层的各种通知事件类型,这些事件主要用于通知UI界面的更新等。 @author Jack Jiang(http://www.52im.net/thread-2792-1-1.html)
export default class UIEvent { /** UI事件:登录或掉线重连完成 */ static readonly UIEVENT_onIMAfterLoginComplete: string = "uievent.onIMAfterLoginComplete"; /** UI事件:掉线了 */ static readonly UIEVENT_onIMDisconnected: string = "uievent.onIMDisconnected"; /** UI事件:心跳了一次(发出的) */ static readonly UIEVENT_onIMPing: string = "ui...
AST#export_declaration#Left export default AST#class_declaration#Left class UIEvent AST#class_body#Left { /** UI事件:登录或掉线重连完成 */ AST#property_declaration#Left static readonly UIEVENT_onIMAfterLoginComplete : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expr...
export default class UIEvent { static readonly UIEVENT_onIMAfterLoginComplete: string = "uievent.onIMAfterLoginComplete"; static readonly UIEVENT_onIMDisconnected: string = "uievent.onIMDisconnected"; static readonly UIEVENT_onIMPing: string = "uievent.onIMPing"; static readonly UIEVENT_onIMPong: st...
https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/constants/UIEvent.ets#L16-L34
d5837a797fc8d5089e2a2b4c3425cfbd32096ea1
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/CartPage.ets
arkts
TopBarActions
顶部栏操作按钮
@Builder TopBarActions() { Text(this.isEditing ? '完成' : '编辑') .fontSize(AppTypography.fontSizeMedium) .fontColor(AppColors.textPrimary) .onClick(() => { this.isEditing = !this.isEditing; }) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TopBarActions 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 Text ( AST#expression#Left AST#conditional_expression#Left A...
@Builder TopBarActions() { Text(this.isEditing ? '完成' : '编辑') .fontSize(AppTypography.fontSizeMedium) .fontColor(AppColors.textPrimary) .onClick(() => { this.isEditing = !this.isEditing; }) }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/CartPage.ets#L58-L66
950ef1a54088f8241c7fde5099c417052f43a87f
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/view/DatabasePage.ets
arkts
SwipeCellContent
构建滑动单元格内容 @param {DemoEntity} item - 记录数据 @returns {void} 无返回值
@Builder private SwipeCellContent(item: DemoEntity): void { IBestCell({ title: this.getItemTitle(item), label: item.description ?? "", isLink: true, hasBorder: false, onCellClick: (): void => { this.vm.selectItem(item); } }); }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private SwipeCellContent AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left DemoEntity AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_a...
@Builder private SwipeCellContent(item: DemoEntity): void { IBestCell({ title: this.getItemTitle(item), label: item.description ?? "", isLink: true, hasBorder: false, onCellClick: (): void => { this.vm.selectItem(item); } }); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/DatabasePage.ets#L148-L159
c2ab9a6965def99da262508e64bb88771f56b495
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
eventbus/src/main/ets/EventBus.ets
arkts
postSticky
发布粘性消息 @param eventName 事件名 @param data 发送的数据
static postSticky(eventName: string, data: EventAllType): void { EventBusCore.getInstance().postSticky(eventName, data); }
AST#method_declaration#Left static postSticky AST#parameter_list#Left ( AST#parameter#Left eventName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left EventAllType AST#pr...
static postSticky(eventName: string, data: EventAllType): void { EventBusCore.getInstance().postSticky(eventName, data); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/eventbus/src/main/ets/EventBus.ets#L62-L64
981b7b2c407b70d58d827c4fec6f0c16c760bfe7
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
getDataWant
读取系统剪贴板Want内容,使用Promise异步回调。 @returns
static async getDataWant(): Promise<Want> { const pasteData: pasteboard.PasteData = await PasteboardUtil.getData(); return pasteData.getPrimaryWant(); }
AST#method_declaration#Left static async getDataWant 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 Want AST#primary_type#Right AST#type_annotation#Right > AST#ty...
static async getDataWant(): Promise<Want> { const pasteData: pasteboard.PasteData = await PasteboardUtil.getData(); return pasteData.getPrimaryWant(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L239-L242
576dfc8074dd843066a33784716e9f7250944a2f
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
getDataUri
读取系统剪贴板URI内容,使用Promise异步回调。 @returns
static async getDataUri(): Promise<string> { const pasteData: pasteboard.PasteData = await PasteboardUtil.getData(); return pasteData.getPrimaryUri(); }
AST#method_declaration#Left static async getDataUri 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 string AST#primary_type#Right AST#type_annotation#Right > AST#t...
static async getDataUri(): Promise<string> { const pasteData: pasteboard.PasteData = await PasteboardUtil.getData(); return pasteData.getPrimaryUri(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L202-L205
0e2a7f2031f2e0bc592e144af5d47b02b392ae12
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
eftool/src/main/ets/device/NetUtil.ets
arkts
unregister
取消注册
static unregister() { if (NetUtil.conn) { NetUtil.conn.unregister((error: BusinessError) => { if (error) { Logger.error(`网络取消异常, 编码: ${error.code} ,原因: ${error.message}`); } }); } }
AST#method_declaration#Left static unregister AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left NetUtil AST#expression#Right . conn AST#member_expression#Right AS...
static unregister() { if (NetUtil.conn) { NetUtil.conn.unregister((error: BusinessError) => { if (error) { Logger.error(`网络取消异常, 编码: ${error.code} ,原因: ${error.message}`); } }); } }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/device/NetUtil.ets#L138-L146
80d04d8911d01d602e4cda25d4bdc1d347069cb9
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/hashing/TextEncoder.ets
arkts
encode
将字符串编码为 UTF-8 字节数组 @param text 要编码的字符串 @returns UTF-8 编码的字节数组
public encode(text: string): Uint8Array { const bytes: number[] = []; for (let i: number = 0; i < text.length; i++) { const charCode: number = text.charCodeAt(i); if (charCode < 0x80) { // ASCII 字符 (1 字节) bytes.push(charCode); } else if (charCode < 0x800) { // 2 ...
AST#method_declaration#Left public encode AST#parameter_list#Left ( AST#parameter#Left text : 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 Uint8Array AST#primary_type...
public encode(text: string): Uint8Array { const bytes: number[] = []; for (let i: number = 0; i < text.length; i++) { const charCode: number = text.charCodeAt(i); if (charCode < 0x80) { bytes.push(charCode); } else if (charCode < 0x800) { bytes.push(0xC...
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/hashing/TextEncoder.ets#L10-L43
30a6f6b150956065101ff3952c685e48d976b1c6
github
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/strings/BruteForce.ets
arkts
findFirstMatch
查找模式串在文本中的第一个出现位置 @param text 文本字符串 @param pattern 模式串 @returns 第一个匹配位置,如果未找到则返回 -1
static findFirstMatch(text: string, pattern: string): number { if (!text || !pattern || pattern.length === 0) { return -1; } const n = text.length; const m = pattern.length; for (let i = 0; i <= n - m; i++) { let j = 0; while (j < m && text[i + j] === pattern[j]) { j++; ...
AST#method_declaration#Left static findFirstMatch AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pattern : AST#type_annotation#Left AST#primary_type#Left string AST#primar...
static findFirstMatch(text: string, pattern: string): number { if (!text || !pattern || pattern.length === 0) { return -1; } const n = text.length; const m = pattern.length; for (let i = 0; i <= n - m; i++) { let j = 0; while (j < m && text[i + j] === pattern[j]) { j++; ...
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/strings/BruteForce.ets#L69-L89
c79e394e66b4970bc9e880c667836e98a5ebac62
github
Neptune-EX/OS_System_Design.git
c728a82d48079ae0c52d50c4a2e2586b69f4ce55
entry/src/main/ets/common/utils/DeleteFile.ets
arkts
初始化(只需要调用一次)
export function initDeleteUtils(context: common.Context): void { const uiAbilityContext = context as common.UIAbilityContext; _filesDir = uiAbilityContext.filesDir; }
AST#export_declaration#Left export AST#function_declaration#Left function initDeleteUtils AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter...
export function initDeleteUtils(context: common.Context): void { const uiAbilityContext = context as common.UIAbilityContext; _filesDir = uiAbilityContext.filesDir; }
https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/src/main/ets/common/utils/DeleteFile.ets#L25-L28
6b7c28c9fd699dec24fc7dc4a705f3f39801ad4c
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderRefundPage.ets
arkts
OrderRefundContent
订单退款页面内容视图 @returns {void} 无返回值
@Builder private OrderRefundContent(): void { Scroll() { Column() { this.RefundInfoCard(this.getOrderData()); SpaceVerticalMedium(); ForEach(this.vm.cartList, (cart: Cart): void => { OrderGoodsCard({ data: cart, enableQuantityStepper: false ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private OrderRefundContent 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#arkts_ui_element#Left A...
@Builder private OrderRefundContent(): void { Scroll() { Column() { this.RefundInfoCard(this.getOrderData()); SpaceVerticalMedium(); ForEach(this.vm.cartList, (cart: Cart): void => { OrderGoodsCard({ data: cart, enableQuantityStepper: false ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderRefundPage.ets#L95-L119
537709332dbe0fb5d989c12053ed807930e52af9
github
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/pages/MainPage.ets
arkts
TabBuilder
防止重复检查登录状态
@Builder TabBuilder(index: number, name: string) { Column() { Image(this.bottomTabIndex === index ? BottomTabsList[index].iconSelected : BottomTabsList[index].icon) .width('40%') .height('40%') .objectFit(ImageFit.Contain) Text(BottomTabsList[index].text) .fontSize($r(...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TabBuilder 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#Left name : AST#type_annotation#Left AST...
@Builder TabBuilder(index: number, name: string) { Column() { Image(this.bottomTabIndex === index ? BottomTabsList[index].iconSelected : BottomTabsList[index].icon) .width('40%') .height('40%') .objectFit(ImageFit.Contain) Text(BottomTabsList[index].text) .fontSize($r(...
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/pages/MainPage.ets#L33-L52
bafda612ecbc85a94efe3b9a9459dd79be7d2ecc
github
jerryzhou2/ArkTS-news-app.git
6dfa8631948f1def4269be5a48554b99ee64a18d
fluent-news-homepage-master/entry/src/main/ets/viewmodel/NewsDataSource.ets
arkts
notifyDataChange
Notify the LazyForEach component that a subcomponent needs to be added to the index.
notifyDataChange(index: number): void { this.listeners.forEach(listener => { listener.onDataChange(index); }) }
AST#method_declaration#Left notifyDataChange 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#R...
notifyDataChange(index: number): void { this.listeners.forEach(listener => { listener.onDataChange(index); }) }
https://github.com/jerryzhou2/ArkTS-news-app.git/blob/6dfa8631948f1def4269be5a48554b99ee64a18d/fluent-news-homepage-master/entry/src/main/ets/viewmodel/NewsDataSource.ets#L74-L78
46d27a12ab5a74d9d87fa799e0eaf8d19b75bada
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Web/WebGetCameraImage/webgetcameraimage/src/main/ets/components/mainpage/MainPage.ets
arkts
invokeCamera
调用系统相机,拍照后返回图片地址 @param callback 回调接口,返回照片的路径
async invokeCamera(callback: (uri: string) => void) { try { let pathDir = (this.getUIContext().getHostContext() as Context).filesDir; this.filePath = pathDir + `/${new Date().getTime()}.jpg`; let pickerProfile: cameraPicker.PickerProfile = { cameraPosition: camera.CameraPosition.CAMERA_POS...
AST#method_declaration#Left async invokeCamera AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left 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#R...
async invokeCamera(callback: (uri: string) => void) { try { let pathDir = (this.getUIContext().getHostContext() as Context).filesDir; this.filePath = pathDir + `/${new Date().getTime()}.jpg`; let pickerProfile: cameraPicker.PickerProfile = { cameraPosition: camera.CameraPosition.CAMERA_POS...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Web/WebGetCameraImage/webgetcameraimage/src/main/ets/components/mainpage/MainPage.ets#L118-L136
2598c80d4c4529502c8dea2cfeac2a6dba217011
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/ui/src/main/ets/component/network/BaseNetWorkListView.ets
arkts
渲染列表请求状态视图 @returns {void} 无返回值
build() { Stack() { Column() { if (this.loadingBuilder) { this.loadingBuilder(); } else { this.buildDefaultLoading(); } } .opacity(this.uiState === BaseNetWorkListUiState.LOADING ? 1 : 0) .animation({ duration: 200, curve: Curve.EaseInOut }); ...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#ui_cont...
build() { Stack() { Column() { if (this.loadingBuilder) { this.loadingBuilder(); } else { this.buildDefaultLoading(); } } .opacity(this.uiState === BaseNetWorkListUiState.LOADING ? 1 : 0) .animation({ duration: 200, curve: Curve.EaseInOut }); ...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ui/src/main/ets/component/network/BaseNetWorkListView.ets#L77-L119
47b246d36cbda6e69f4ce66a49d5a1f34d0dc32a
github
buqiuz/Account.git
b843a38c24a833a9a4386f63cffec5fa5dadc674
oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/highlight/ChartHighlighter.ets
arkts
buildHighlights
An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex. @param set @param dataSetIndex @param xVal @param rounding @return
protected buildHighlights(set: IDataSet<EntryOhos>, dataSetIndex: number, xVal: number, rounding: Rounding): JArrayList<Highlight> { let highlights: JArrayList<Highlight> = new JArrayList<Highlight>(); //noinspection unchecked let entries: JArrayList<EntryOhos> | null = set.getEntriesForXValue(xVal); ...
AST#method_declaration#Left protected buildHighlights AST#parameter_list#Left ( AST#parameter#Left set : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left IDataSet AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left EntryOhos AST#primary_type#Right AST#type_annotation#Right > AST...
protected buildHighlights(set: IDataSet<EntryOhos>, dataSetIndex: number, xVal: number, rounding: Rounding): JArrayList<Highlight> { let highlights: JArrayList<Highlight> = new JArrayList<Highlight>(); let entries: JArrayList<EntryOhos> | null = set.getEntriesForXValue(xVal); if (entries) { if ...
https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/highlight/ChartHighlighter.ets#L183-L221
34c48877e3aeb62881bb03043e7e1124e8cc3c8f
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/common/util/DimensionUtils.ets
arkts
适配不同大小和长度的工具类。
export default class DimensionUtil { /** * 获取屏幕水平适配值。 * * @param value 需要适配的值 * @return 适配后的值 */ static adaptDimension(value: number): number { let deviceDisplay = GlobalContext.getContext().getObject('globalDisplay') as display.Display; let widthScale = deviceDisplay.width / DESIGN_WIDTH; ...
AST#export_declaration#Left export default AST#class_declaration#Left class DimensionUtil AST#class_body#Left { /** * 获取屏幕水平适配值。 * * @param value 需要适配的值 * @return 适配后的值 */ AST#method_declaration#Left static adaptDimension AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#p...
export default class DimensionUtil { static adaptDimension(value: number): number { let deviceDisplay = GlobalContext.getContext().getObject('globalDisplay') as display.Display; let widthScale = deviceDisplay.width / DESIGN_WIDTH; let virtualHeight = widthScale * DESIGN_HEIGHT; let designDim = Math...
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/common/util/DimensionUtils.ets#L19-L67
dd208b4889604f9cf4d47f2ee686c26ec6124715
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets
arkts
fillArc
Method of drawing arcs. @param fillArcData fillArcData. @param fillColor fillColor.
fillArc(fillArcData: FillArcData, fillColor: string) { if (CheckEmptyUtils.isEmptyObj(fillArcData) || CheckEmptyUtils.isEmptyStr(fillColor)) { Logger.error('[DrawModel][fillArc] fillArcData or fillColor is empty.'); return; } if (this.canvasContext !== undefined) { this.canvasContext.begin...
AST#method_declaration#Left fillArc AST#parameter_list#Left ( AST#parameter#Left fillArcData : AST#type_annotation#Left AST#primary_type#Left FillArcData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fillColor : AST#type_annotation#Left AST#primary_type#Left string AST#primar...
fillArc(fillArcData: FillArcData, fillColor: string) { if (CheckEmptyUtils.isEmptyObj(fillArcData) || CheckEmptyUtils.isEmptyStr(fillColor)) { Logger.error('[DrawModel][fillArc] fillArcData or fillColor is empty.'); return; } if (this.canvasContext !== undefined) { this.canvasContext.begin...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets#L73-L85
9262785da6609c22e75558bac31bd93eabec7113
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/constants/AppConstants.ets
arkts
缓存Key常量
export class CacheConstants { static readonly USER_SETTINGS: string = 'user_settings'; static readonly CONTACT_LIST: string = 'contact_list'; static readonly GREETING_LIST: string = 'greeting_list'; static readonly SEARCH_HISTORY: string = 'search_history'; static readonly LUNAR_CACHE: string = 'lunar_cache';...
AST#export_declaration#Left export AST#class_declaration#Left class CacheConstants AST#class_body#Left { AST#property_declaration#Left static readonly USER_SETTINGS : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'user_settings' AST#expressi...
export class CacheConstants { static readonly USER_SETTINGS: string = 'user_settings'; static readonly CONTACT_LIST: string = 'contact_list'; static readonly GREETING_LIST: string = 'greeting_list'; static readonly SEARCH_HISTORY: string = 'search_history'; static readonly LUNAR_CACHE: string = 'lunar_cache';...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/constants/AppConstants.ets#L74-L81
15268169e75a13f836961e485ce95eac99d01a07
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/BusinessSample/entry/src/main/ets/view/DetailListComponent.ets
arkts
DetailListComponent
Detail page list component.
@Component export struct DetailListComponent { build() { Column() { List() { ForEach(BusinessViewModel.getDetailPageListItems(), (item: ListItemData) => { ListItem() { Row() { Text(item.title) .fontSize($r('app.float.detail_title_size')) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailListComponent 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_b...
@Component export struct DetailListComponent { build() { Column() { List() { ForEach(BusinessViewModel.getDetailPageListItems(), (item: ListItemData) => { ListItem() { Row() { Text(item.title) .fontSize($r('app.float.detail_title_size')) ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/BusinessSample/entry/src/main/ets/view/DetailListComponent.ets#L8-L45
018240490efff4af12ab86ff92253439dc0008a4
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FormatUtil.ets
arkts
getFormatPercentage
格式化百分比,将数字转化从百分比字符串 @param value 小数值 @param decimalPlaces 保留的小数位数,默认为 2 @returns 格式化后的百分比字符串
static getFormatPercentage(value: number, decimalPlaces: number = 2): string { return `${(value * 100).toFixed(decimalPlaces)}%`; }
AST#method_declaration#Left static getFormatPercentage AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left decimalPlaces : AST#type_annotation#Left AST#primary_type#Left numbe...
static getFormatPercentage(value: number, decimalPlaces: number = 2): string { return `${(value * 100).toFixed(decimalPlaces)}%`; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FormatUtil.ets#L87-L89
7d3cdcdcbdc923bf2eec1faa5a01aed1876e79cf
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/entity/DialogOptions.ets
arkts
简单易用的ActionSheet的选中参数类
export class SelectSheet { position: number = 0; //选中位置 defaultIcon: ResourceStr = ''; //默认显示的图标 selectIcon: ResourceStr = ''; //选中显示的图标 }
AST#export_declaration#Left export AST#class_declaration#Left class SelectSheet AST#class_body#Left { AST#property_declaration#Left position : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Ri...
export class SelectSheet { position: number = 0; defaultIcon: ResourceStr = ''; selectIcon: ResourceStr = ''; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/entity/DialogOptions.ets#L113-L117
1704860e4c6a9d3528a9dfa0a3a5302202134925
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/chat/AIAssistantPage.ets
arkts
buildTypingIndicator
构建正在输入指示器
@Builder buildTypingIndicator() { Row({ space: 12 }) { Circle({ width: 32, height: 32 }) .fill($r('app.color.primary')) .overlay( Image($r('app.media.ic_robot')) .width(20) .height(20) .fillColor(Color.White) ) Row({ space: 4 }) { ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildTypingIndicator 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_p...
@Builder buildTypingIndicator() { Row({ space: 12 }) { Circle({ width: 32, height: 32 }) .fill($r('app.color.primary')) .overlay( Image($r('app.media.ic_robot')) .width(20) .height(20) .fillColor(Color.White) ) Row({ space: 4 }) { ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/chat/AIAssistantPage.ets#L332-L371
a8e438d5c86dbd1bd80ff2277d408887ddd428e2
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Ability/StageAbilityDemo/entry/src/main/ets/common/constants/DetailsConstants.ets
arkts
The constant of BottomBarComponent.
export class BottomBar { /** * The height of divider. */ static readonly DIVIDER_HEIGHT: number = 0.5; /** * The line height of text. */ static readonly TEXT_LINE_HEIGHT: number = 20; /** * The width of container. */ static readonly CONTAINER_SIZE_WIDTH: number = 195; /** * The he...
AST#export_declaration#Left export AST#class_declaration#Left class BottomBar AST#class_body#Left { /** * The height of divider. */ AST#property_declaration#Left static readonly DIVIDER_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression...
export class BottomBar { static readonly DIVIDER_HEIGHT: number = 0.5; static readonly TEXT_LINE_HEIGHT: number = 20; static readonly CONTAINER_SIZE_WIDTH: number = 195; static readonly CONTAINER_SIZE_HEIGHT: number = 40; static readonly BAR_PADDING_RIGHT: number = 12; static readonl...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/DetailsConstants.ets#L172-L213
52df59cb53dc3e7ba9493a43d95e28a864f6bb07
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets
arkts
digest
SHA256摘要 @param str 带摘要的字符串 @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式 @returns 摘要后的字符串
static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA256', resultCoding); }
AST#method_declaration#Left static digest 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#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Le...
static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> { return CryptoSyncUtil.digest(str, 'SHA256', resultCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets#L54-L56
5e38591297e4b9dd7690ee287a18f039ef44261e
gitee
smarthane/DrawerLayout.git
0f6e554c8451ff3bd28f5f718cc7d4329a5fa5ec
DrawerLayout/src/main/ets/components/DrawerLayout.ets
arkts
抽屉控制模型
export class Model { // 设备宽度 displayWidth: number = 0; // 设备高度 displayHeight: number = 0; // 设备DPI deviceDpi: number = Utils.DEVICE_DPI; // 设备状态栏高度 statusBarHeight: number = 0; // 抽屉类型枚举 private drawerType: Type = Type.LEFT; // 侧边栏的宽度 drawerWidth: number = 260; // 滑...
AST#export_declaration#Left export AST#class_declaration#Left class Model AST#class_body#Left { // 设备宽度 AST#property_declaration#Left displayWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declarat...
export class Model { displayWidth: number = 0; displayHeight: number = 0; deviceDpi: number = Utils.DEVICE_DPI; statusBarHeight: number = 0; private drawerType: Type = Type.LEFT; drawerWidth: number = 260; drawerOffsetX: number = -1 * this.drawerWidth / 3...
https://github.com/smarthane/DrawerLayout.git/blob/0f6e554c8451ff3bd28f5f718cc7d4329a5fa5ec/DrawerLayout/src/main/ets/components/DrawerLayout.ets#L224-L374
90b5c64c1e2c9f7a034a573a965e432329030bee
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/core/router/Router.ets
arkts
replace
Replace 跳转
async replace(path: string, params?: RouteParams): Promise<void> { const route = this.routes.get(path) || { path: path, name: '', params: params }; // 执行路由守卫 const canNavigate = await this.executeGuards(route); if (!canNavigate) { Logger.warn('Router', `Navigation blocked by guard for: ${path...
AST#method_declaration#Left async replace AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left params ? : AST#type_annotation#Left AST#primary_type#Left RouteParams AST#primary_...
async replace(path: string, params?: RouteParams): Promise<void> { const route = this.routes.get(path) || { path: path, name: '', params: params }; const canNavigate = await this.executeGuards(route); if (!canNavigate) { Logger.warn('Router', `Navigation blocked by guard for: ${path}`); ...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/router/Router.ets#L159-L209
e29ed28edc7a9bf1368b251c3e7f27f09e3e1701
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/containernestedslide/src/main/ets/model/NewsCommentModel.ets
arkts
totalCount
获取懒加载数据源的数据长度
totalCount(): number { return this.comments.length; }
AST#method_declaration#Left totalCount 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#member_expression#Le...
totalCount(): number { return this.comments.length; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/model/NewsCommentModel.ets#L120-L122
7a05d7279cc8ba38a5c5f5694919c151052a6d6c
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/model/SearchManager.ets
arkts
queryForFavorite
按 favoriteLevel 分段(倒序) searchText 可选:模糊查询(仅匹配 wordEn 与 wordJp) 仅包含 favoriteLevel > 0 的单词(与 Java 行为一致)
queryForFavorite(filtedWords: WordUser[]): SectionDatas<string, WordUser> { const sectionWords = new SectionDatas<string, WordUser>(); // 倒序排序:favoriteLevel 大的在前 filtedWords.sort((a, b) => { const A : number = a.favoriteLevel ?? 0; const B : number = b.favoriteLevel ?? 0; return B - A; /...
AST#method_declaration#Left queryForFavorite AST#parameter_list#Left ( AST#parameter#Left filtedWords : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left WordUser [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotati...
queryForFavorite(filtedWords: WordUser[]): SectionDatas<string, WordUser> { const sectionWords = new SectionDatas<string, WordUser>(); filtedWords.sort((a, b) => { const A : number = a.favoriteLevel ?? 0; const B : number = b.favoriteLevel ?? 0; return B - A; }); filtedWords.f...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L723-L741
a0daf61a5101a7f29db51cd64a7b7e080ab9f1b4
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets
arkts
createSwiperItem
创建banner单项布局 @param bannerInfo
@Builder createSwiperItem(bannerInfo: BannerInfo) { Column() { Text(bannerInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.White) } .width($r('app.string.video_create_gif_full_width')) .height($r('app.string.video_create_gif_full_width')) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right createSwiperItem AST#parameter_list#Left ( AST#parameter#Left bannerInfo : AST#type_annotation#Left AST#primary_type#Left BannerInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_fu...
@Builder createSwiperItem(bannerInfo: BannerInfo) { Column() { Text(bannerInfo.title) .fontSize($r('app.integer.video_create_gif_big_font_size')) .fontColor(Color.White) } .width($r('app.string.video_create_gif_full_width')) .height($r('app.string.video_create_gif_full_width')) ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets#L135-L157
7467b5c345eb77c5dd0e0a512790c9ca6c64ff19
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index_backup.ets
arkts
exportData
导出数据
private async exportData(): Promise<void> { try { console.log('[Settings] Starting data export...'); // 获取所有联系人数据 const contacts = await this.contactService.getAllContacts(); const settings = this.notificationSettings; const exportData: ExportData = { version: '1.0', ...
AST#method_declaration#Left private async exportData 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#ty...
private async exportData(): Promise<void> { try { console.log('[Settings] Starting data export...'); const contacts = await this.contactService.getAllContacts(); const settings = this.notificationSettings; const exportData: ExportData = { version: '1.0', exportTime: ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L1287-L1317
5f03dfc0aab842c416b463ccd5c444cc0369646d
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/task/TaskEditPage.ets
arkts
onSelectDream
使用明确的类型
onSelectDream(dream: Dream): void { if (dream) { this.selectedDream = dream; if (dream.id !== undefined && dream.id > 0) { this.task.dreamId = dream.id; } } }
AST#method_declaration#Left onSelectDream AST#parameter_list#Left ( AST#parameter#Left dream : AST#type_annotation#Left AST#primary_type#Left Dream 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#Right...
onSelectDream(dream: Dream): void { if (dream) { this.selectedDream = dream; if (dream.id !== undefined && dream.id > 0) { this.task.dreamId = dream.id; } } }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/task/TaskEditPage.ets#L503-L510
4a8d59cea8689581602e17e625aa5b70f389a82c
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets
arkts
totalCount
获取数据总数 @returns
public totalCount(): number { return this.dataArray.length; }
AST#method_declaration#Left public totalCount 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#member_expres...
public totalCount(): number { return this.dataArray.length; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/WaterFlowDataSource.ets#L94-L96
fe6e15b768f323384bb1228f9db5305a8f0be16d
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ViewPortHandler.ets
arkts
fitScreen
Resets all zooming and dragging and makes the chart fit exactly it's bounds. Output Matrix is available for those who wish to cache the object.
public fitScreen(outputMatrix?: Matrix): Matrix { let save: Matrix = (outputMatrix == null || outputMatrix == undefined) ? new Matrix() : outputMatrix; this.mMinScaleX = 1; this.mMinScaleY = 1; save.set(this.mMatrixTouch); let vals: number[] = save.getValues(); // reset all translations and ...
AST#method_declaration#Left public fitScreen AST#parameter_list#Left ( AST#parameter#Left outputMatrix ? : AST#type_annotation#Left AST#primary_type#Left Matrix AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Matrix AST#pri...
public fitScreen(outputMatrix?: Matrix): Matrix { let save: Matrix = (outputMatrix == null || outputMatrix == undefined) ? new Matrix() : outputMatrix; this.mMinScaleX = 1; this.mMinScaleY = 1; save.set(this.mMatrixTouch); let vals: number[] = save.getValues(); vals[Matrix.MTRANS_X] = 0...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ViewPortHandler.ets#L272-L291
4c4eda93d81c3368d8a2b784c57cee592eb3590c
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Column.ets
arkts
渲染布局 @returns {void} 无返回值 @example ColumnSpaceAround() { Text("A"); Text("B"); Text("C"); }
build(): void { ColumnBase({ options: this.options, justifyContent: FlexAlign.SpaceAround, alignItems: HorizontalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.mar...
AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expressio...
build(): void { ColumnBase({ options: this.options, justifyContent: FlexAlign.SpaceAround, alignItems: HorizontalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.mar...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Column.ets#L524-L539
2354ab6bdf91b74125552f07b934634a7853bdea
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/CircleClass.ets
arkts
ChamferInfo
凸起使用类
@Observed export class ChamferInfo extends CircleClass { // 悬浮球直径 @Track circleDiameter: number = 0; // 悬浮球半径 @Track circleRadius: number = 0; // 偏移量 @Track circleOffsetX: number = 0; @Track circleOffsetY: number = 0; // 悬浮球左右俩边倒角坐标 @Track chamferXY: [number, number] = [0, 0]; // 悬浮球俩测倒角半径...
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class ChamferInfo extends AST#type_annotation#Left AST#primary_type#Left CircleClass AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { // 悬浮球直径 AST#property_declaration#Left AST#decorator#Left @ Track AST...
@Observed export class ChamferInfo extends CircleClass { @Track circleDiameter: number = 0; @Track circleRadius: number = 0; @Track circleOffsetX: number = 0; @Track circleOffsetY: number = 0; @Track chamferXY: [number, number] = [0, 0]; @Track chamferRadius: number; constructo...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/CircleClass.ets#L154-L206
8686021fa6b0cf10cb6d4c7015f30d2e99471909
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/models/ContactModel.ets
arkts
updateLastContactDate
更新最后联系日期
updateLastContactDate(): Contact { this.contact.lastContactDate = new Date().toISOString(); this.contact.updatedAt = new Date().toISOString(); return this.getContact(); }
AST#method_declaration#Left updateLastContactDate AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Le...
updateLastContactDate(): Contact { this.contact.lastContactDate = new Date().toISOString(); this.contact.updatedAt = new Date().toISOString(); return this.getContact(); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/models/ContactModel.ets#L268-L272
2eba390bf6b12d4439b9ec10a99b4c4fa0096cb3
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets
arkts
updateDescInput
更新描述输入 @param {string} value - 输入内容 @returns {void} 无返回值
updateDescInput(value: string): void { this.descInput = value; }
AST#method_declaration#Left updateDescInput AST#parameter_list#Left ( AST#parameter#Left value : 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#primary_type#Ri...
updateDescInput(value: string): void { this.descInput = value; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets#L62-L64
2a872bca2805084fc86d5b43bd1c4082f643c5c5
github
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/pages/ExamPage.ets
arkts
快问快答Web
build() { NavDestination() { Column() { Scroll() { Web({ src: this.ExamUrl, controller: this.webController }) .backgroundColor(Color.Orange)//拦截资源请求,优化游戏流畅 .domStorageAccess(true) .onlineImageAccess(true) .imag...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavDestination ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AS...
build() { NavDestination() { Column() { Scroll() { Web({ src: this.ExamUrl, controller: this.webController }) .backgroundColor(Color.Orange) .domStorageAccess(true) .onlineImageAccess(true) .imageAccess(true) ...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/pages/ExamPage.ets#L48-L106
3567f378bc537098e6cbd68cf47c61bda844bd08
gitee
ericple/ohos-weather
f197791bce462c5eb1b22945c25f5bcd5fcc9f7c
libNMC/src/main/ets/Data/WeatherHourly.ets
arkts
This file is part of libNMC, which is the foundation of ohos-weather. Copyright (C) 2023 Tingjin<dev@peercat.cn> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (...
export interface WeatherHourly { fxTime: string; temp: string; icon: string; text:string; wind360: string; windDir: string; windScale: string; windSpeed: string; humidity: string; pop: string; precip: string; pressure: string; cloud: string; dew: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface WeatherHourly AST#object_type#Left { AST#type_member#Left fxTime : 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 temp : AST#type_annotation#Le...
export interface WeatherHourly { fxTime: string; temp: string; icon: string; text:string; wind360: string; windDir: string; windScale: string; windSpeed: string; humidity: string; pop: string; precip: string; pressure: string; cloud: string; dew: string; }
https://github.com/ericple/ohos-weather/blob/f197791bce462c5eb1b22945c25f5bcd5fcc9f7c/libNMC/src/main/ets/Data/WeatherHourly.ets#L16-L31
50c272c7e2d7e7cb84468a2224d13d9b43667370
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the different build host of the same baseline code. @syscap SystemCapability.Startup.SystemInfo @crossplatform @since 20 @arkts 1.2
static get buildHost(): string;
AST#method_declaration#Left static get AST#ERROR#Left build Host AST#ERROR#Right 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#method_declaration#Right
static get buildHost(): string;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L349-L349
5d3c9b3d1251d06732a2bf14cdca364bb2ba87a7
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Media/Camera/entry/src/main/ets/utlis/TimeUtils.ets
arkts
这是数字1000
export function tempNum(num: number): string { if (num < TEN) { return '0' + num; } return num.toString(); }
AST#export_declaration#Left export AST#function_declaration#Left function tempNum AST#parameter_list#Left ( AST#parameter#Left num : 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#primar...
export function tempNum(num: number): string { if (num < TEN) { return '0' + num; } return num.toString(); }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/Camera/entry/src/main/ets/utlis/TimeUtils.ets#L20-L25
fb0446254d91278c3a75ceded24430bd0e31a674
gitee
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.FormMenu.d.ets
arkts
Defines the form menu item style. @interface FormMenuItemStyle @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 12
export interface FormMenuItemStyle { /** * Defines options of the form menu. * * @type { ?MenuItemOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ options?: MenuItemOptions; }
AST#export_declaration#Left export AST#interface_declaration#Left interface FormMenuItemStyle AST#object_type#Left { /** * Defines options of the form menu. * * @type { ?MenuItemOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ AST#type_member#Left ...
export interface FormMenuItemStyle { options?: MenuItemOptions; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.FormMenu.d.ets#L30-L40
73cdc84c228fab1b2f558dbe32792dd8449a99ae
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_history.ets
arkts
index_of_first_record_at_or_after_time
Get the index of the first history item whose access_time is not smaller than Target. @param timestamp The limit of earliest timestamp. @returns A positive number, the index. @returns -1 if list is empty. @returns -2 if Target is bigger than all histories.
index_of_first_record_at_or_after_time(timestamp: number) { if (this.history_this_month.length == 0) { return -1; } if (timestamp > this.history_this_month[this.history_this_month.length - 1].accessed_time) { return -2; } if (timestamp <= this.history_this_month[0].accessed_time) { ...
AST#method_declaration#Left index_of_first_record_at_or_after_time 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#block_statement#Left { AST#statement#Left ...
index_of_first_record_at_or_after_time(timestamp: number) { if (this.history_this_month.length == 0) { return -1; } if (timestamp > this.history_this_month[this.history_this_month.length - 1].accessed_time) { return -2; } if (timestamp <= this.history_this_month[0].accessed_time) { ...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history.ets#L394-L432
2ed686e9bd69b3bfeafacf46d34901955e648f80
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/SearchPage.ets
arkts
buildGreetingResultItem
构建祝福语结果项
@Builder buildGreetingResultItem(greeting: Greeting) { Column({ space: 8 }) { Text(greeting.content) .fontSize(14) .fontColor('#333333') .lineHeight(20) .maxLines(2) .textOverflow({ overflow: TextOverflow.Ellipsis }) .width('100%') Row({ space: 8 ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildGreetingResultItem AST#parameter_list#Left ( AST#parameter#Left greeting : AST#type_annotation#Left AST#primary_type#Left Greeting AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder...
@Builder buildGreetingResultItem(greeting: Greeting) { Column({ space: 8 }) { Text(greeting.content) .fontSize(14) .fontColor('#333333') .lineHeight(20) .maxLines(2) .textOverflow({ overflow: TextOverflow.Ellipsis }) .width('100%') Row({ space: 8 ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/SearchPage.ets#L578-L625
09c121ff840f88894b7883a90539482acf1b3bef
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/network/src/main/ets/datasource/cs/CustomerServiceNetworkDataSourceImpl.ets
arkts
@file 客服相关数据源实现类 @author Joker.X
export class CustomerServiceNetworkDataSourceImpl implements CustomerServiceNetworkDataSource { /** * 创建客服会话 * @returns {Promise<NetworkResponse<CsSession>>} 会话信息 */ async createSession(): Promise<NetworkResponse<CsSession>> { const resp: AxiosResponse<NetworkResponse<CsSession>> = await NetworkC...
AST#export_declaration#Left export AST#class_declaration#Left class CustomerServiceNetworkDataSourceImpl AST#implements_clause#Left implements CustomerServiceNetworkDataSource AST#implements_clause#Right AST#class_body#Left { /** * 创建客服会话 * @returns {Promise<NetworkResponse<CsSession>>} 会话信息 */ AST#method_decl...
export class CustomerServiceNetworkDataSourceImpl implements CustomerServiceNetworkDataSource { async createSession(): Promise<NetworkResponse<CsSession>> { const resp: AxiosResponse<NetworkResponse<CsSession>> = await NetworkClient.http.post("cs/session/create"); return resp.data; } async ge...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/cs/CustomerServiceNetworkDataSourceImpl.ets#L10-L62
bbc33e12294517ce194d307073938d9e393e9e27
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/utils/NotificationUtils.ets
arkts
TODO 通知工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class NotificationUtils { private static defaultConfig: NotificationConfig = new NotificationConfig(); //默认配置 /** * 设置通知的默认统一配置 * @param configs */ static setDefaultConfig(configs: (config: NotificationConfig) => void): void { configs(NotificationUtils.defaultConfig); } /** * 查询通知是...
AST#export_declaration#Left export AST#class_declaration#Left class NotificationUtils AST#class_body#Left { AST#property_declaration#Left private static defaultConfig : AST#type_annotation#Left AST#primary_type#Left NotificationConfig AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expre...
export class NotificationUtils { private static defaultConfig: NotificationConfig = new NotificationConfig(); static setDefaultConfig(configs: (config: NotificationConfig) => void): void { configs(NotificationUtils.defaultConfig); } static async isNotificationEnabled(): Promise<boolean> { re...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/NotificationUtils.ets#L38-L592
af877e1ab9d102b762458dc5c38adb8a3180160b
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/field_sensitive/container/array_005_T.ets
arkts
Introduction 数组索引
export function array_005_T(taint_src : string) { let arr = ["_", "a", taint_src, "b", "c"] taint.Sink(arr[1+1]); }
AST#export_declaration#Left export AST#function_declaration#Left function array_005_T 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_statement#Left { ...
export function array_005_T(taint_src : string) { let arr = ["_", "a", taint_src, "b", "c"] taint.Sink(arr[1+1]); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/field_sensitive/container/array_005_T.ets#L6-L9
6d4ddf4200a874b3abcda391cc0b18cb6437cb65
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/entity/constraint.ets
arkts
2025-01-05 14:06
export const DATE_FORMAT3: string = "yyyy-MM-dd HH";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left DATE_FORMAT3 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "yyyy-MM-dd HH" AST#expression#Right AST#variable_declarator#Right ; AST#variabl...
export const DATE_FORMAT3: string = "yyyy-MM-dd HH";
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/entity/constraint.ets#L8-L8
fbd770aff076011edaeaa90dd205fb2d770b9717
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/entity/Banner.ets
arkts
@file 轮播图模型 @author Joker.X
export class Banner { /** * ID */ id: number = 0; /** * 描述 */ description: string = ""; /** * 跳转路径 */ path: string = ""; /** * 图片 */ pic: string = ""; /** * 排序 */ sortNum: number = 0; /** * 状态 1:启用 2:禁用 */ status: number = 1; /** * 创建时间 */ createTime...
AST#export_declaration#Left export AST#class_declaration#Left class Banner AST#class_body#Left { /** * ID */ AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declara...
export class Banner { id: number = 0; description: string = ""; path: string = ""; pic: string = ""; sortNum: number = 0; status: number = 1; createTime?: string | null = null; updateTime?: string | null = null; constructor(init?: Partial<Banner>) { if (!init) { retu...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/Banner.ets#L5-L52
128cca617ad5a274fb2c601a3e67cb4d395aec46
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets
arkts
updateCart
更新购物车中的商品 @param {Cart} cart 购物车商品 @returns {Promise<void>} Promise<void>
async updateCart(cart: Cart): Promise<void> { this.orm.save(this.toEntity(cart)); }
AST#method_declaration#Left async updateCart AST#parameter_list#Left ( AST#parameter#Left cart : AST#type_annotation#Left AST#primary_type#Left Cart 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_type#Left Prom...
async updateCart(cart: Cart): Promise<void> { this.orm.save(this.toEntity(cart)); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets#L53-L55
1547babaecec52c0036c6b52a2513e81ae1cc38f
github
Glace-Dev/Harmony_Projects.git
845cef3c5fdf5d049c942fe62cbf083c2c78e84a
basis/entry/src/main/ets/views/task/TaskStatistics.ets
arkts
card
统一的卡片样式
@Styles function card(){ .width('95%') .padding(20) .backgroundColor(Color.White) .borderRadius(15) .shadow({radius: 6, color: '#1F000000', offsetX: 2, offsetY: 4}) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right function card AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '95%' AST#expression#Right ) AST#modifier_chain_expression#Left . pa...
@Styles function card(){ .width('95%') .padding(20) .backgroundColor(Color.White) .borderRadius(15) .shadow({radius: 6, color: '#1F000000', offsetX: 2, offsetY: 4}) }
https://github.com/Glace-Dev/Harmony_Projects.git/blob/845cef3c5fdf5d049c942fe62cbf083c2c78e84a/basis/entry/src/main/ets/views/task/TaskStatistics.ets#L2-L8
d91ee245ff4053db7510b60481e7e2f9b100820b
github
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/view/AiAssistantComponent.ets
arkts
MessageBubble
构建消息气泡
@Builder MessageBubble(msg: ChatMessage) { Row() { if (msg.role === 'user') { Blank() } Column() { Text(msg.content) .fontSize(15) .fontColor(msg.role === 'user' ? Color.White : '#333333') .padding(12) .backgroundColor(msg.role === 'user' ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right MessageBubble AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left ChatMessage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_bo...
@Builder MessageBubble(msg: ChatMessage) { Row() { if (msg.role === 'user') { Blank() } Column() { Text(msg.content) .fontSize(15) .fontColor(msg.role === 'user' ? Color.White : '#333333') .padding(12) .backgroundColor(msg.role === 'user' ...
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/view/AiAssistantComponent.ets#L139-L163
f4b0ec803803ac1e8100fd1c4ae587db8937dede
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/constants/AppContext.ets
arkts
初始化 UIContext(在页面入口调用)
export function initUIContext(context: UIContext): void { AppContext.initUIContext(context) }
AST#export_declaration#Left export AST#function_declaration#Left function initUIContext AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Le...
export function initUIContext(context: UIContext): void { AppContext.initUIContext(context) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/constants/AppContext.ets#L88-L90
a113b36652097471455635d06101e56a412d96a5
github
huangwei021230/HarmonyFlow.git
427f918873b0c9efdc975ff4889726b1bfccc546
entry/src/main/ets/ime/popup/PopupSet.ets
arkts
A popup set for a single key. This set describes, if the key has a [main] character and other [relevant] popups. Note that a hint character cannot and should not be set in a json extended popup file, rather it should only be dynamically set by the LayoutManager. The order in which these defined popups will be shown d...
export abstract class PopupSet<T extends AbstractKeyData> { main: T | null; relevant: T[]; constructor(main: T | null = null, relevant: T[] = []) { this.main = main; this.relevant = relevant; } abstract getPopupKeys(keyHintConfiguration: KeyHintConfiguration): PopupKeys<T>; }
AST#export_declaration#Left export AST#class_declaration#Left abstract class PopupSet AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left AbstractKeyData AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#clas...
export abstract class PopupSet<T extends AbstractKeyData> { main: T | null; relevant: T[]; constructor(main: T | null = null, relevant: T[] = []) { this.main = main; this.relevant = relevant; } abstract getPopupKeys(keyHintConfiguration: KeyHintConfiguration): PopupKeys<T>; }
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/ime/popup/PopupSet.ets#L86-L96
35204e378bd1318747f9233ae88d0fcb8de0865a
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/services/data/ContactService.ets
arkts
updateContact
更新联系人 @param params 更新参数 @returns 更新后的联系人
async updateContact(params: UpdateContactParams): Promise<Contact> { try { // 验证数据 const validationResult = ContactModel.validate(params); if (!validationResult.isValid) { throw new Error(`数据验证失败: ${validationResult.errors.join(', ')}`); } // 获取原有联系人数据 const existingCont...
AST#method_declaration#Left async updateContact AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left UpdateContactParams AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#ge...
async updateContact(params: UpdateContactParams): Promise<Contact> { try { const validationResult = ContactModel.validate(params); if (!validationResult.isValid) { throw new Error(`数据验证失败: ${validationResult.errors.join(', ')}`); } const existingContact = await this.ge...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/data/ContactService.ets#L94-L143
5fa3f5376d004f18722420ed6602212274760108
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Media/Image/NdkPicture/entry/src/main/ets/utils/Logger.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 AppLog { constructor(tag: string) { this.tagName = tag } prefix : string = '[Sample_NdkPicture]' tagName: string log = (msg: string) => { console.info(this.prefix + this.tagName + ' ' + msg) } check_result = (msg: string, res: object | number) => { if (typeof res === "object") { ...
AST#export_declaration#Left export AST#class_declaration#Left class AppLog AST#class_body#Left { AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left tag : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AS...
export class AppLog { constructor(tag: string) { this.tagName = tag } prefix : string = '[Sample_NdkPicture]' tagName: string log = (msg: string) => { console.info(this.prefix + this.tagName + ' ' + msg) } check_result = (msg: string, res: object | number) => { if (typeof res === "object") { ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Media/Image/NdkPicture/entry/src/main/ets/utils/Logger.ets#L16-L38
af8450c1964ed6712a35de335aad25264507b4aa
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_settings.ets
arkts
import_json
Import settings from json. DOESN'T SAVE TO DISK! @param text the json
static import_json(text: string) { let jsonObject: Record<string, string> | null = null; if (text.length < 2) { return false; } try { jsonObject = JSON.parse(text); } catch (e) { console.log('[Meow][bunch_of_settings] Import settings failed! Json parse failed!'); return fals...
AST#method_declaration#Left static import_json AST#parameter_list#Left ( AST#parameter#Left text : 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#variable_declaration#...
static import_json(text: string) { let jsonObject: Record<string, string> | null = null; if (text.length < 2) { return false; } try { jsonObject = JSON.parse(text); } catch (e) { console.log('[Meow][bunch_of_settings] Import settings failed! Json parse failed!'); return fals...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_settings.ets#L241-L263
3e352015f1ebfa536dd62847853b5d202b863229
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/buffer/AbstractBuffer.ets
arkts
Initialization with buffer-size. @param size
constructor(size: number) { this.index = 0; for (let i = 0; i < size; i++) { this.buffer = new Array<number>(); } }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left size : 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#block_statement#Left { AST#statement#Left AST#expression_statement#Le...
constructor(size: number) { this.index = 0; for (let i = 0; i < size; i++) { this.buffer = new Array<number>(); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/buffer/AbstractBuffer.ets#L35-L40
0f8adf5dfa72e920b04b8cc14654639a5f6cacde
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/hashing/MD5.ets
arkts
leftRotate
左循环移位
private static leftRotate(n: number, rotate: number): number { return (n << rotate) | (n >>> (32 - rotate)); }
AST#method_declaration#Left private static leftRotate AST#parameter_list#Left ( AST#parameter#Left n : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rotate : AST#type_annotation#Left AST#primary_type#Left number AST#primar...
private static leftRotate(n: number, rotate: number): number { return (n << rotate) | (n >>> (32 - rotate)); }
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/hashing/MD5.ets#L31-L33
ab954f4234044383b61f5464802e1c796dab9e8b
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderConfirmPage.ets
arkts
PriceDetailCard
价格明细卡片 @returns {void} 无返回值
@Builder private PriceDetailCard() { Card() { IBestCellGroup({ inset: true, radius: $r("app.float.radius_medium"), outerMargin: 0 }) { // 标题 IBestCell({ hasBorder: true, titleBuilder: (): void => this.PriceDetailTitle() }); /...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private PriceDetailCard 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 Card ( ) AST#container_content_body#Left { AST#ark...
@Builder private PriceDetailCard() { Card() { IBestCellGroup({ inset: true, radius: $r("app.float.radius_medium"), outerMargin: 0 }) { IBestCell({ hasBorder: true, titleBuilder: (): void => this.PriceDetailTitle() }); ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderConfirmPage.ets#L129-L182
7464b619f6bf25849555638247869d781e8857f6
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/viewmodel/MainViewModel.ets
arkts
onDidBuild
组件构建完成时触发动画同步 @returns {void} 无返回值
onDidBuild(): void { super.onDidBuild(); this.syncCurrentAnimation(); }
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 { super.onDidBuild(); this.syncCurrentAnimation(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/MainViewModel.ets#L99-L102
891a00033488628c602c76d464e14cc5fe55972a
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets
arkts
createRouter
[End static_registerBuilder] 通过名称注册路由栈
public static createRouter(routerName: string, router: NavPathStack): void { RouterModule.routerMap.set(routerName, router); }
AST#method_declaration#Left public static createRouter 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#Left router : AST#type_annotation#Left AST#primary_type#Left NavPath...
public static createRouter(routerName: string, router: NavPathStack): void { RouterModule.routerMap.set(routerName, router); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NavigationRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L43-L45
1f345dea09d25a5f08dd399218ff9dae4c3db60e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/ZipTool.ets
arkts
unzip
MARK: - 解压文件
static async unzip(zipFile: string): Promise<string|null> { // 目标解压目录 const parentFolder = FileUtility.deleteLastPathComponent(zipFile) const unZipFolder = FileUtility.appendPathComponent(parentFolder, "_unzip") return ZipTool.unzipTo(zipFile, unZipFolder) // 删除已存在的解压目录 // FileUtility.deleteF...
AST#method_declaration#Left static async unzip AST#parameter_list#Left ( AST#parameter#Left zipFile : 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 AST#generic_type#Le...
static async unzip(zipFile: string): Promise<string|null> { const parentFolder = FileUtility.deleteLastPathComponent(zipFile) const unZipFolder = FileUtility.appendPathComponent(parentFolder, "_unzip") return ZipTool.unzipTo(zipFile, unZipFolder) }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ZipTool.ets#L98-L113
9200889eaa4a30fc50ccd8711d135c4f0560755b
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/encapsulationdialog/src/main/ets/dialog/dto/DialogBuilderParam.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 interface DialogBuilderParam { closeDialog?: () => void; onConfirm?: (isCloseDialog?: boolean, data?: ESObject) => void; data?: ESObject; }
AST#export_declaration#Left export AST#interface_declaration#Left interface DialogBuilderParam AST#object_type#Left { AST#type_member#Left closeDialog ? : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#primary_type#Left void AST#prima...
export interface DialogBuilderParam { closeDialog?: () => void; onConfirm?: (isCloseDialog?: boolean, data?: ESObject) => void; data?: ESObject; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/encapsulationdialog/src/main/ets/dialog/dto/DialogBuilderParam.ets#L16-L20
24905eb92eb2e6551beb22ab9f5c36d068a3d853
gitee
HomoArk/Homogram.git
8a6e85898b6194fdd04ead75e732d348888a0c07
common/base/src/main/ets/views/image/StandardIcon.ets
arkts
StandardIcon
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 StandardIcon { @Prop icon: Resource; build() { Image(this.icon) .width($r('app.float.icon_height_one')) .height($r('app.float.icon_width_one')) } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct StandardIcon AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right icon : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotat...
@Component export struct StandardIcon { @Prop icon: Resource; build() { Image(this.icon) .width($r('app.float.icon_height_one')) .height($r('app.float.icon_width_one')) } }
https://github.com/HomoArk/Homogram.git/blob/8a6e85898b6194fdd04ead75e732d348888a0c07/common/base/src/main/ets/views/image/StandardIcon.ets#L16-L25
6c96eea439cdc79384a7d56a956ff6f067f84bf3
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LogUtil.ets
arkts
warn
打印WARN级别日志 @param args
static warn(...args: string[] | object[]): void { LogUtil.uniLog(args, hilog.LogLevel.WARN); }
AST#method_declaration#Left static warn AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right | AST#primary_type#Left AST#array_type#Left object [ ] AST#array_type#Right AST#pr...
static warn(...args: string[] | object[]): void { LogUtil.uniLog(args, hilog.LogLevel.WARN); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LogUtil.ets#L102-L104
862de7f3af16df51fbca8d7f41b218ee8f6905e1
gitee
jerryzhou2/ArkTS-news-app.git
6dfa8631948f1def4269be5a48554b99ee64a18d
fluent-news-homepage-master/entry/src/main/ets/pages/CitySearch.ets
arkts
getCitySearch
Create the WrappedBuilder object and construct the page during dynamic route jumping.
@Builder export function getCitySearch(): void { CitySearch(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function getCitySearch 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#ui_custom_...
@Builder export function getCitySearch(): void { CitySearch(); }
https://github.com/jerryzhou2/ArkTS-news-app.git/blob/6dfa8631948f1def4269be5a48554b99ee64a18d/fluent-news-homepage-master/entry/src/main/ets/pages/CitySearch.ets#L122-L125
bac9f779c6b7e83a61a42eb9ba2855a323f1f134
github
fengmingdev/protobuf-arkts-generator.git
75888d404fd6ce52a046cba2a94807ecf1350147
runtime/arkpb/util.ets
arkts
ZigZag decode 32-bit signed integer
export function unZigZag32(n: number): number { return (n >>> 1) ^ -(n & 1) }
AST#export_declaration#Left export AST#function_declaration#Left function unZigZag32 AST#parameter_list#Left ( AST#parameter#Left n : 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 unZigZag32(n: number): number { return (n >>> 1) ^ -(n & 1) }
https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/util.ets#L117-L119
e8b27adf08fa920033658d7ed86d964cf9535b3f
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/model/SocketFactory.ets
arkts
创建Socket对象的工厂
export default class SocketFactory { /** * 根据协议类型创建对应的Socket * @param socketType */ public static createSocket(socketType: SocketType): Socket { switch (socketType) { case SocketType.UDP: return new UdpSocket(); case SocketType.TCP: return new TcpSocket(); case SocketT...
AST#export_declaration#Left export default AST#class_declaration#Left class SocketFactory AST#class_body#Left { /** * 根据协议类型创建对应的Socket * @param socketType */ AST#method_declaration#Left public static createSocket AST#parameter_list#Left ( AST#parameter#Left socketType : AST#type_annotation#Left AST#primary_ty...
export default class SocketFactory { public static createSocket(socketType: SocketType): Socket { switch (socketType) { case SocketType.UDP: return new UdpSocket(); case SocketType.TCP: return new TcpSocket(); case SocketType.TLS: return new TlsSocket(); } } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/model/SocketFactory.ets#L25-L40
e34b6c92145f28a32aea892841e8b49d21b4c45a
gitee
wustcat404/time-bar
d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8
time_bar/src/main/ets/components/viewModel/TimeBarModel.ets
arkts
updateTimeBounds
Recalculate and update time bounds (minTime/maxTime) based on timeRange.
private updateTimeBounds() { if (this._timeRange.length === 0) { this._minTime = Number.MIN_SAFE_INTEGER; this._maxTime = Number.MAX_SAFE_INTEGER; return; } // Compute earliest start time and latest end time const firstSeg = this._timeRange[0]; const lastSeg = this._timeRange[this...
AST#method_declaration#Left private updateTimeBounds AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_e...
private updateTimeBounds() { if (this._timeRange.length === 0) { this._minTime = Number.MIN_SAFE_INTEGER; this._maxTime = Number.MAX_SAFE_INTEGER; return; } const firstSeg = this._timeRange[0]; const lastSeg = this._timeRange[this._timeRange.length - 1]; this._minTime = parse...
https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/components/viewModel/TimeBarModel.ets#L123-L135
7bb4da90c9cbea488c2a729c8ea09f1ce95e601f
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/attribute/RowAttribute.ets
arkts
获取横向起始 + 垂直底部的 Row 对齐修饰器 @returns {AttributeModifier<RowAttribute>} Row 对齐修饰器 @example Row() { Text("Hi"); }.attributeModifier(rowStartBottom());
export function rowStartBottom(): AttributeModifier<RowAttribute> { return { applyNormalAttribute: (instance: RowAttribute): void => { instance.justifyContent(FlexAlign.Start); instance.alignItems(VerticalAlign.Bottom); } }; }
AST#export_declaration#Left export AST#function_declaration#Left function rowStartBottom AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left RowAttribute AST...
export function rowStartBottom(): AttributeModifier<RowAttribute> { return { applyNormalAttribute: (instance: RowAttribute): void => { instance.justifyContent(FlexAlign.Start); instance.alignItems(VerticalAlign.Bottom); } }; }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/attribute/RowAttribute.ets#L117-L124
437a948a988a3c11b66dc0f1c4471d76ebb7f4f5
github
huangwei021230/HarmonyFlow.git
427f918873b0c9efdc975ff4889726b1bfccc546
entry/src/main/ets/lib/Native.ets
arkts
Converts a native string to a JavaScript string.
export function toJavaString(nativeStr: NativeStr): string { return new util.TextDecoder().decode(nativeStr); }
AST#export_declaration#Left export AST#function_declaration#Left function toJavaString AST#parameter_list#Left ( AST#parameter#Left nativeStr : AST#type_annotation#Left AST#primary_type#Left NativeStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#L...
export function toJavaString(nativeStr: NativeStr): string { return new util.TextDecoder().decode(nativeStr); }
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/Native.ets#L22-L24
da63eae3d75f6747b576b8c9c067651e9e8bacff
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/home/favourite/FavouriteComponent.ets
arkts
FavouriteComponent
@Author peerless2012 @Email peerless2012@126.com @DateTime 2024/11/7 20:27 @Version V1.0 @Description Main
@Component export struct FavouriteComponent { private viewModel = new FavouriteViewModel(getContext()) @Builder favouriteGroupBuilder(group: GroupInfo, index: number) { FavouriteGroup({item: group}) } build() { Column() { HomeToolBar({ title: $r('app.string.home_favourite') }) ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FavouriteComponent AST#component_body#Left { AST#property_declaration#Left private viewModel = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#new_expression#Left new AST#expression#Left Favourite...
@Component export struct FavouriteComponent { private viewModel = new FavouriteViewModel(getContext()) @Builder favouriteGroupBuilder(group: GroupInfo, index: number) { FavouriteGroup({item: group}) } build() { Column() { HomeToolBar({ title: $r('app.string.home_favourite') }) ...
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/home/favourite/FavouriteComponent.ets#L18-L56
f4596e1662eb957d29ac3e0b119e53e65d24eb8f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/recommendation/RecommendationEngine.ets
arkts
价格区间接口
export interface PriceRange { min: number; max: number; preferred: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface PriceRange AST#object_type#Left { AST#type_member#Left min : 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 max : AST#type_annotation#Left AST#...
export interface PriceRange { min: number; max: number; preferred: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/recommendation/RecommendationEngine.ets#L133-L137
f0d57d69bec6fffbd9994c83bc5a4be0c891a554
github
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/pages/Index.ets
arkts
aboutToAppear
alertDialogController: CustomDialogController | null = new CustomDialogController({ builder: ControlCenterDialog(), alignment:DialogAlignment.Top, width:'100%', height:288, cornerRadius:0, backgroundColor:'#00000000', // openAnimation: { // duration: 500, // delay: 500, // playMode: PlayMode.Alternate, // onFin...
aboutToAppear(): void { PromptDialogHelper.setContext(this.ctx); PromptDialogHelper.setContentNode(this.contentNode); PromptDialogHelper.setOptions({ alignment: DialogAlignment.Top,onDidDisappear:()=>{ this.isShowWindow=false }}) }
AST#method_declaration#Left aboutToAppear 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...
aboutToAppear(): void { PromptDialogHelper.setContext(this.ctx); PromptDialogHelper.setContentNode(this.contentNode); PromptDialogHelper.setOptions({ alignment: DialogAlignment.Top,onDidDisappear:()=>{ this.isShowWindow=false }}) }
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/pages/Index.ets#L41-L47
a3d1d1d43828cb938e7433ea6dc9d93f0c10bc08
github
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/default/common/models/mainTabBarModel.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, softw...
export class MainTabBarModel { id: number name: Resource selectedResource: Resource unSelectedResource: Resource constructor
AST#export_declaration#Left export AST#ERROR#Left class MainTabBarModel { id AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#ERROR#Right AST#ERROR#Left name : Resource selectedResource : Resource unSelectedResource AST#ERROR#Right : Resourc...
export class MainTabBarModel { id: number name: Resource selectedResource: Resource unSelectedResource: Resource constructor
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/default/common/models/mainTabBarModel.ets#L15-L21
279a232098ec6f4cb14faac99fe286621ceb644c
gitee
Classaspen/ArkTS_PasswordManagement.git
66aea6e4f8ee3a78e5029c63186dba70707ca2d9
entry/src/main/ets/components/database/Database.ets
arkts
formatData
Format database data.
formatData(resultSet: relationalStore.ResultSet) { let list: DataEntity[] = []; const count: number = resultSet.rowCount; if (count !== 0 && typeof count === 'number') { try { resultSet.goToFirstRow(); for (let i = 0; i < count; i++) { const tmp: DataEntity = { n...
AST#method_declaration#Left formatData AST#parameter_list#Left ( AST#parameter#Left resultSet : 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_list#Right AST#...
formatData(resultSet: relationalStore.ResultSet) { let list: DataEntity[] = []; const count: number = resultSet.rowCount; if (count !== 0 && typeof count === 'number') { try { resultSet.goToFirstRow(); for (let i = 0; i < count; i++) { const tmp: DataEntity = { n...
https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/database/Database.ets#L236-L264
5b4632c6dde6b2d7f23287a535e255c481fc51cd
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
数据保留配置接口
export interface DataRetentionConfig { keepDeletedContacts: number; // 天数 keepGreetingHistory: number; // 天数 keepOperationLogs: number; // 天数 }
AST#export_declaration#Left export AST#interface_declaration#Left interface DataRetentionConfig AST#object_type#Left { AST#type_member#Left keepDeletedContacts : 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 keep...
export interface DataRetentionConfig { keepDeletedContacts: number; keepGreetingHistory: number; keepOperationLogs: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L99-L103
cb4c952a9d852bfb371044a02270946e544d0d82
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/static_function/static_function_002_F.ets
arkts
Introduction 静态函数
export function static_function_002_F(taint_src : string) { let _t = taint_src; let _clean = "clean"; A.f(_clean); }
AST#export_declaration#Left export AST#function_declaration#Left function static_function_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_stateme...
export function static_function_002_F(taint_src : string) { let _t = taint_src; let _clean = "clean"; A.f(_clean); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/static_function/static_function_002_F.ets#L5-L10
dc5bae0bf8d523a48f25110d8f86c36071e43aca
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/listener/EventControl.ets
arkts
setAllEventDisable
禁用所有事件
public setAllEventDisable() { this.eventMap.forEach((val, key, m) => { m.set(key, false); }) return this; }
AST#method_declaration#Left public setAllEventDisable 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#member_expression#Lef...
public setAllEventDisable() { this.eventMap.forEach((val, key, m) => { m.set(key, false); }) return this; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/listener/EventControl.ets#L50-L55
916f0963b018c4c54fbec9c9cfcdfddbc2eed772
gitee