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
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/util/src/main/ets/permission/PermissionUtils.ets
arkts
openPermissionSettings
跳转到应用权限设置页面 @returns {Promise<void>} void
private async openPermissionSettings(): Promise<void> { const want: Want = { bundleName: 'com.huawei.hmos.settings', // 设置应用的bundleName abilityName: 'com.huawei.hmos.settings.MainAbility', // 设置应用的abilityName uri: 'application_info_entry', // 目标页面地址 parameters: { 'pushParams': ContextUtil.ge...
AST#method_declaration#Left private async openPermissionSettings 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#Ri...
private async openPermissionSettings(): Promise<void> { const want: Want = { bundleName: 'com.huawei.hmos.settings', abilityName: 'com.huawei.hmos.settings.MainAbility', uri: 'application_info_entry', parameters: { 'pushParams': ContextUtil.getUIAbilityCtx().abilityInfo.bundleName } ...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/util/src/main/ets/permission/PermissionUtils.ets#L101-L109
0d7d1800f2a258f0e1f646d9204f92d49688db35
github
seasonZhu/HarmonyStudy.git
b55e58c962e9b39d5211337590bdd45f2c2349b3
entry/src/main/ets/httpRequest/interceptors/SetCookieRequestInterceptor.ets
arkts
/ 这个函数不能写在这个SetCookieRequestInterceptor类中,否则所有的网络请求都报错
export function getCookieHeaderValue(): string { let username = AccountManager.shared().loginModel?.username ?? "" let password = AccountManager.shared().loginModel?.password ?? "" if (username.length == 0 && password.length == 0) { return "" } else { return "loginUserName=" + username + ";loginUserPas...
AST#export_declaration#Left export AST#function_declaration#Left function getCookieHeaderValue AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declarat...
export function getCookieHeaderValue(): string { let username = AccountManager.shared().loginModel?.username ?? "" let password = AccountManager.shared().loginModel?.password ?? "" if (username.length == 0 && password.length == 0) { return "" } else { return "loginUserName=" + username + ";loginUserPas...
https://github.com/seasonZhu/HarmonyStudy.git/blob/b55e58c962e9b39d5211337590bdd45f2c2349b3/entry/src/main/ets/httpRequest/interceptors/SetCookieRequestInterceptor.ets#L17-L26
815bd16def085318164b15cf41c4d4e850cb8b78
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/textoverflow/src/main/ets/components/mainpage/CommentInputDialog.ets
arkts
CommentInputDialog
输入评论弹窗,用于展示输入文字与被回复的用户昵称 实现步骤: 1.添加发布按钮 2.点击发布按钮,将评论添加到列表中
@CustomDialog export struct CommentInputDialog { // 选择的照片列表 @State selectedImages: string[] = []; // 输入的文字 @State text: string = ""; @Link textInComment: string; @State placeholder: string = ""; controller?: CustomDialogController; // 发布接口,用于主页面更新评论数据 publish: () => void = (): void => {}; build() {...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct CommentInputDialog AST#component_body#Left { // 选择的照片列表 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right selectedImages : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Le...
@CustomDialog export struct CommentInputDialog { @State selectedImages: string[] = []; @State text: string = ""; @Link textInComment: string; @State placeholder: string = ""; controller?: CustomDialogController; publish: () => void = (): void => {}; build() { Column() { RelativeContain...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/textoverflow/src/main/ets/components/mainpage/CommentInputDialog.ets#L29-L98
663773071b65a5cce235e92dcf618169c0d33c2e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/user/User.ets
arkts
from
通过 JSON 生成 User(类似 Kotlin 的 from(json) 或 Swift 的 init(from decoder))
static from(json: UserJson): User { const user = new User(); user.userId = json.user_id ?? null; user.userName = json.user_name ?? null; user.email = json.email ?? null; user.password = json.password ?? null; user.loginIdentifi...
AST#method_declaration#Left static from AST#parameter_list#Left ( AST#parameter#Left json : AST#type_annotation#Left AST#primary_type#Left UserJson AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left User AST#primary_type#Right...
static from(json: UserJson): User { const user = new User(); user.userId = json.user_id ?? null; user.userName = json.user_name ?? null; user.email = json.email ?? null; user.password = json.password ?? null; user.loginIdentifi...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/user/User.ets#L81-L99
4fcb650ef2f83f2793e403c090329a4542c87f7f
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+spinkit@1.0.5/oh_modules/@pura/spinkit/src/main/ets/components/SpinK.ets
arkts
SpinK
TODO SpinKit动画组件 author: 桃花镇童长老 since: 2024/05/01 仓库主页:https://ohpm.openharmony.cn/#/cn/detail/@pura%2Fspinkit github: https://github.com/787107497 gitee: https://gitee.com/tongyuyan/spinkit QQ交流群: 569512366
@ComponentV2 export struct SpinK { @Require @Param spinSize: number = 36; @Require @Param spinColor: ResourceColor; @Local round1: number = this.spinSize * 0.14 @Local opacity1: number = 0; @Local opacity2: number = 0; @Local opacity3: number = 0; @Local opacity4: number = 0; @Local opacity5: number = 0...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SpinK AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right spinSize : AST#type_annotation#Left AST#primary_type#Left...
@ComponentV2 export struct SpinK { @Require @Param spinSize: number = 36; @Require @Param spinColor: ResourceColor; @Local round1: number = this.spinSize * 0.14 @Local opacity1: number = 0; @Local opacity2: number = 0; @Local opacity3: number = 0; @Local opacity4: number = 0; @Local opacity5: number = 0...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+spinkit@1.0.5/oh_modules/@pura/spinkit/src/main/ets/components/SpinK.ets#L25-L358
f0e549378ed20026b0cb2fee24b4e1916263c4d2
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/mock/MockData.ets
arkts
3D立方体旋转动画Swiper数据
export const SWIPER_LIST: MySwiperItem[][] = [ [new MySwiperItem('农业资讯', '最新农业政策信息', $r('app.media.cube_animation_picture1')), new MySwiperItem('生活服务', '便民服务一站式办理', $r('app.media.cube_animation_picture2')), new MySwiperItem('健康养老', '智慧医疗养老服务', $r('app.media.cube_animation_picture3')), new MySwiperItem('文化...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SWIPER_LIST : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left MySwiperItem [ ] [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ A...
export const SWIPER_LIST: MySwiperItem[][] = [ [new MySwiperItem('农业资讯', '最新农业政策信息', $r('app.media.cube_animation_picture1')), new MySwiperItem('生活服务', '便民服务一站式办理', $r('app.media.cube_animation_picture2')), new MySwiperItem('健康养老', '智慧医疗养老服务', $r('app.media.cube_animation_picture3')), new MySwiperItem('文化...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cuberotateanimation/src/main/ets/mock/MockData.ets#L70-L79
55871e387b1294dd0bae5c7b79aa3374dee87e21
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
encodeIntoUint8Array
Encode string, write the result to dest array. @param { string } input - The string to be encoded. @param { Uint8Array } dest - Encoded numbers in accordance with the format @returns { EncodeIntoUint8ArrayInfo } Return the object, where read represents the number of characters that have been encoded, and written repre...
encodeIntoUint8Array(input: string, dest: Uint8Array): EncodeIntoUint8ArrayInfo;
AST#method_declaration#Left encodeIntoUint8Array AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dest : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#prima...
encodeIntoUint8Array(input: string, dest: Uint8Array): EncodeIntoUint8ArrayInfo;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1111-L1111
56f4b6b74f26f228899c877b69e6d9a9ec2b4642
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/DES.ets
arkts
decodeCBC
解密-CBC模式 @param str 加密的字符串 @param aesKey 3DES密钥 @param iv iv偏移量字符串 @returns
static async decodeCBC(str: string, desKey: string, iv: string): Promise<OutDTO<string>> { return CryptoUtil.decodeCBC(str, desKey, iv, '3DES192', '3DES192|CBC|PKCS7', 192); }
AST#method_declaration#Left static async decodeCBC 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 desKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary...
static async decodeCBC(str: string, desKey: string, iv: string): Promise<OutDTO<string>> { return CryptoUtil.decodeCBC(str, desKey, iv, '3DES192', '3DES192|CBC|PKCS7', 192); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/DES.ets#L74-L76
aa2295556d34aa695551a233cd26cb6c47851d26
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/VirtualEconomyService.ets
arkts
道具接口
export interface VirtualItem { id: string; name: string; description: string; type: ItemType; rarity: ItemRarity; icon: string; preview?: string; price: Map<CurrencyType, number>; isOwned: boolean; isEquipped?: boolean; quantity: number; maxQuantity: number; isLimited: boolean; limitedQuanti...
AST#export_declaration#Left export AST#interface_declaration#Left interface VirtualItem AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST...
export interface VirtualItem { id: string; name: string; description: string; type: ItemType; rarity: ItemRarity; icon: string; preview?: string; price: Map<CurrencyType, number>; isOwned: boolean; isEquipped?: boolean; quantity: number; maxQuantity: number; isLimited: boolean; limitedQuanti...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/VirtualEconomyService.ets#L54-L74
34f2b0b22bd1424fa790a8ad58394a57d2eacb48
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
PowerAnalysis/LowerPowerSample/entry/src/main/ets/pages/LowPower_Animate_Example.ets
arkts
MyAttrAnimationExample_AutoSkip
[Start Anim_power_case_2]
@Component export struct MyAttrAnimationExample_AutoSkip { @State widthSize: number = 250 @State heightSize: number = 100 @State rotateAngle: number = 0 @State flag: boolean = true @State duration:number = 2000 build() { Column() { Button('change size') .onClick(() => { ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MyAttrAnimationExample_AutoSkip AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right widthSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type...
@Component export struct MyAttrAnimationExample_AutoSkip { @State widthSize: number = 250 @State heightSize: number = 100 @State rotateAngle: number = 0 @State flag: boolean = true @State duration:number = 2000 build() { Column() { Button('change size') .onClick(() => { ...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/PowerAnalysis/LowerPowerSample/entry/src/main/ets/pages/LowPower_Animate_Example.ets#L64-L120
9ffa5ef30ca1f9b84578744e9fd29ca0d1ed78d0
gitee
kinghy949/kinghy_zufang.git
471cc1273fbea66b88a4b7803e3f08c83a2de7ce
entry/src/main/ets/api/home.ets
arkts
获取首页数据
export const getHomeDataApi = (): Promise<IHomeData> => { return http.get<IHomeData>('/home/info'); } // 获取首页周边房源数据
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left getHomeDataApi = AST#expression#Left AST#arrow_function#Left 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 < A...
export const getHomeDataApi = (): Promise<IHomeData> => { return http.get<IHomeData>('/home/info'); }
https://github.com/kinghy949/kinghy_zufang.git/blob/471cc1273fbea66b88a4b7803e3f08c83a2de7ce/entry/src/main/ets/api/home.ets#L6-L10
9fd1c81ee76de69f142575f5f17d7768a1e38171
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets
arkts
sceneChangeListen
[End wifi_change_listen] [Start scene_change_listen]
sceneChangeListen() { try { netQuality.on('netSceneChange', (list: Array<netQuality.NetworkScene>) => { if (list.length > 0) { list.forEach((networkScene) => { // Callback information processing hilog.info(0x0000, 'Sample', 'Succeeded receive netSceneChange info'); ...
AST#method_declaration#Left sceneChangeListen AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#mem...
sceneChangeListen() { try { netQuality.on('netSceneChange', (list: Array<netQuality.NetworkScene>) => { if (list.length > 0) { list.forEach((networkScene) => { hilog.info(0x0000, 'Sample', 'Succeeded receive netSceneChange info'); if (network...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets#L194-L220
6d6d2cc163ea1bf26917ac11e5d76b8327141ee8
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/processes/zone_actions.ets
arkts
Data Gets the tab open state of zone. @param storage The LocalStorage. @returns [continue_tabs_main_on, continue_tabs_sub_on].
export function stat_of_zone(storage: LocalStorage) { let dir = web_state_dir(storage); let tabs_stat = sandbox_read_text_sync(dir + '/stat'); if (tabs_stat != 'undefined') { // Set stat let stat = tabs_stat.split(' '); let continue_tabs_main_on = Number.parseInt(stat[0]); let continue_tabs_sub_on...
AST#export_declaration#Left export AST#function_declaration#Left function stat_of_zone AST#parameter_list#Left ( AST#parameter#Left storage : AST#type_annotation#Left AST#primary_type#Left LocalStorage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Le...
export function stat_of_zone(storage: LocalStorage) { let dir = web_state_dir(storage); let tabs_stat = sandbox_read_text_sync(dir + '/stat'); if (tabs_stat != 'undefined') { let stat = tabs_stat.split(' '); let continue_tabs_main_on = Number.parseInt(stat[0]); let continue_tabs_sub_on = Number.p...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/zone_actions.ets#L235-L246
d961425eb5db2b230a8721b9f85e687db25eacb7
gitee
JHB11Hinson/mineMointorAPP.git
b6b853cf534021ac39e66c9b3a35113896a272b2
entry/src/main/ets/view/dust/DustMonitorCard.ets
arkts
getAirQualityHint
辅助函数:根据PM值返回空气质量提示
private getAirQualityHint(pm25: number, pm10: number): string { const maxPm = Math.max(pm25, pm10); if (maxPm > 150) return '空气污染严重'; if (maxPm > 75) return '空气轻度污染'; return '空气质量良好'; }
AST#method_declaration#Left private getAirQualityHint AST#parameter_list#Left ( AST#parameter#Left pm25 : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pm10 : AST#type_annotation#Left AST#primary_type#Left number AST#prima...
private getAirQualityHint(pm25: number, pm10: number): string { const maxPm = Math.max(pm25, pm10); if (maxPm > 150) return '空气污染严重'; if (maxPm > 75) return '空气轻度污染'; return '空气质量良好'; }
https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/view/dust/DustMonitorCard.ets#L163-L168
abd8c6fc1021b1344b18970bab00efca061bcc32
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/TypeConversion.ets
arkts
stringToByte
string 转 Uint8Array @param str string @returns Uint8Array
static stringToByte(str: string): Uint8Array { let bytes: number[] = new Array() let unicode: number for (let i = 0; i < str.length; i++) { unicode = str.charCodeAt(i) if (unicode >= 0x010000 && unicode <= 0x10FFFF) { bytes.push(((unicode >> 18) & 0x07) | 0xf0) bytes.push(((unic...
AST#method_declaration#Left static stringToByte AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary...
static stringToByte(str: string): Uint8Array { let bytes: number[] = new Array() let unicode: number for (let i = 0; i < str.length; i++) { unicode = str.charCodeAt(i) if (unicode >= 0x010000 && unicode <= 0x10FFFF) { bytes.push(((unicode >> 18) & 0x07) | 0xf0) bytes.push(((unic...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/TypeConversion.ets#L54-L77
0cdbfdcbf4e74afa8f253c145dd48f2b7269e061
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
advanced_ui_component/treeview/source/treeview.ets
arkts
getNodeInfoNode
To gain the tree Node(NodeItem) while to alter node.
public getNodeInfoNode(): NodeItem { return this.node; }
AST#method_declaration#Left public getNodeInfoNode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left NodeItem 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...
public getNodeInfoNode(): NodeItem { return this.node; }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/treeview/source/treeview.ets#L621-L623
32800f9600f351c4faeb6f46994916b3f59b2bb7
gitee
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/common/StudyTimeManager.ets
arkts
stopTracking
停止学习时长统计
stopTracking(): void { if (!this.isTracking) { return } this.isTracking = false if (this.updateInterval) { clearInterval(this.updateInterval) this.updateInterval = 0 } // 最后更新一次学习时长 this.updateStudyTime() console.info('[StudyTimeManager] 停止学习时长统计') }
AST#method_declaration#Left stopTracking 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_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expr...
stopTracking(): void { if (!this.isTracking) { return } this.isTracking = false if (this.updateInterval) { clearInterval(this.updateInterval) this.updateInterval = 0 } this.updateStudyTime() console.info('[StudyTimeManager] 停止学习时长统计') }
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/common/StudyTimeManager.ets#L38-L54
b6210aabf04a436257061c3bec9ebeec310cf873
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/InteractiveGameService.ets
arkts
generateBirthdayQuestions
生成生日问答题目
private generateBirthdayQuestions(): QuizQuestion[] { return [ { id: 'q1', question: '世界上第一首生日歌是什么时候创作的?', options: ['1893年', '1901年', '1912年', '1925年'], correctAnswer: 0, explanation: 'Happy Birthday to You是在1893年由Patty Hill和Mildred J. Hill姐妹创作的。', difficulty: ...
AST#method_declaration#Left private generateBirthdayQuestions AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left QuizQuestion [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST...
private generateBirthdayQuestions(): QuizQuestion[] { return [ { id: 'q1', question: '世界上第一首生日歌是什么时候创作的?', options: ['1893年', '1901年', '1912年', '1925年'], correctAnswer: 0, explanation: 'Happy Birthday to You是在1893年由Patty Hill和Mildred J. Hill姐妹创作的。', difficulty: ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/InteractiveGameService.ets#L609-L662
4a1f0c4aea00759523e1e1535dbfdb36d1597575
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/Main.ets
arkts
getPieSlicePath
Get pie slice path (donut chart)
getPieSlicePath(percentage: number, startAngle: number): string { const centerX = 90; const centerY = 90; const outerRadius = 90; const innerRadius = 58; // 内圈半径,控制环的粗细 // 如果接近100%,稍微减小一点避免360度圆弧问题 let angle = (percentage / 100) * 360; if (angle >= 359.9) { angle = 359.9; } ...
AST#method_declaration#Left getPieSlicePath AST#parameter_list#Left ( AST#parameter#Left percentage : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left startAngle : AST#type_annotation#Left AST#primary_type#Left number AST#pri...
getPieSlicePath(percentage: number, startAngle: number): string { const centerX = 90; const centerY = 90; const outerRadius = 90; const innerRadius = 58; let angle = (percentage / 100) * 360; if (angle >= 359.9) { angle = 359.9; } const endAngle = startAngle + angle; ...
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/Main.ets#L259-L293
799ca2767950bf915f152986e7a2f146cf1d9ab4
github
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets
arkts
Defines the prefix icon option. @interface PrefixIconOptions @extends IconCommonOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @since 11 Defines the prefix icon option. @interface PrefixIconOptions @extends IconCommonOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @...
export interface PrefixIconOptions extends IconCommonOptions { }
AST#export_declaration#Left export AST#interface_declaration#Left interface PrefixIconOptions AST#extends_clause#Left extends IconCommonOptions AST#extends_clause#Right AST#object_type#Left { } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right
export interface PrefixIconOptions extends IconCommonOptions { }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets#L212-L213
5241c90209ece6bb17478b3233247664258276c9
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the major (M) version number, which increases with any updates to the overall architecture. <p>The M version number monotonically increases from 1 to 99. @syscap SystemCapability.Startup.SystemInfo @crossplatform @since 20 @arkts 1.2
static get majorVersion(): int;
AST#method_declaration#Left static get AST#ERROR#Left majorVersion AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left int AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
static get majorVersion(): int;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L245-L245
d7e8b8cd51dc958d0c5ba97cff88981966ee3868
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
The number of container type
export const enum CONTAINER_TYPE { FLEX = 1, COLUMN = 2, ROW = 3, STACK = 4, };
AST#export_declaration#Left export AST#enum_declaration#Left const enum CONTAINER_TYPE AST#enum_body#Left { AST#enum_member#Left FLEX = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left COLUMN = AST#expression#Left 2 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left...
export const enum CONTAINER_TYPE { FLEX = 1, COLUMN = 2, ROW = 3, STACK = 4, };
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/OHLayoutAlign/entry/src/main/ets/common/constants/CommonConstants.ets#L126-L131
3c178833abbd1390c28f7d7bb4d820ed50180ae6
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Media/Audio/entry/src/main/ets/pages/ParallelCapturer.ets
arkts
getStageFileDescriptor
start music player
async getStageFileDescriptor(fileName: string): Promise<resourceManager.RawFileDescriptor | undefined> { let fileDescriptor: resourceManager.RawFileDescriptor | undefined = undefined; if (this.appContext) { let mgr = this.appContext.resourceManager; await mgr.getRawFd(fileName).then(value => { ...
AST#method_declaration#Left async getStageFileDescriptor AST#parameter_list#Left ( AST#parameter#Left fileName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gene...
async getStageFileDescriptor(fileName: string): Promise<resourceManager.RawFileDescriptor | undefined> { let fileDescriptor: resourceManager.RawFileDescriptor | undefined = undefined; if (this.appContext) { let mgr = this.appContext.resourceManager; await mgr.getRawFd(fileName).then(value => { ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/Audio/entry/src/main/ets/pages/ParallelCapturer.ets#L500-L512
72183bbc126a6694635ea5204775299f4b49200b
gitee
de8gemaker/AccountApp.git
b5156cd90ac02239b39fd0f91d32851acad8ba42
entry/src/main/ets/service/account.ets
arkts
insert
插入一条记录 @param info @returns
insert(info: AccountInfo) { const createTime = dayjs().startOf('day').toDate().getTime(); return AccountModel.insert({ ...info, createTime }); }
AST#method_declaration#Left insert AST#parameter_list#Left ( AST#parameter#Left info : AST#type_annotation#Left AST#primary_type#Left AccountInfo 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#Left co...
insert(info: AccountInfo) { const createTime = dayjs().startOf('day').toDate().getTime(); return AccountModel.insert({ ...info, createTime }); }
https://github.com/de8gemaker/AccountApp.git/blob/b5156cd90ac02239b39fd0f91d32851acad8ba42/entry/src/main/ets/service/account.ets#L14-L17
0df4d449c26cb3eb72691eeea77c97f88a9b24e5
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
updateBirthdayStats
更新生日统计数据
private async updateBirthdayStats(): Promise<void> { try { const contactServiceStats = await this.contactService.getContactStatistics(); this.birthdayStats = { total: contactServiceStats.total, thisMonth: contactServiceStats.upcomingBirthdays.thisMonth, thisWeek: contactServiceSt...
AST#method_declaration#Left private async updateBirthdayStats 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...
private async updateBirthdayStats(): Promise<void> { try { const contactServiceStats = await this.contactService.getContactStatistics(); this.birthdayStats = { total: contactServiceStats.total, thisMonth: contactServiceStats.upcomingBirthdays.thisMonth, thisWeek: contactServiceSt...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L793-L807
99a1d400547cb41e3ae739a2fe5ec4c8a89f5630
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
persistPermissionEasy
对所选择的多个文件或目录URI持久化授权。(需要权限:ohos.permission.FILE_ACCESS_PERSIST) @param uris string 需要授予或使能权限的URI。 @param operationMode number 授予或使能权限的URI访问模式,参考OperationMode,例如: fileShare.OperationMode.READ_MODE :允许读授权。fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE :允许读写授权。 @returns 无返回结果的Promise对象。
static async persistPermissionEasy(uris: Array<string>, operationMode: number = fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE): Promise<void> { let policies: Array<fileShare.PolicyInfo> = new Array<fileShare.PolicyInfo>(); for (let index = 0; index < uris.length; index++) { le...
AST#method_declaration#Left static async persistPermissionEasy AST#parameter_list#Left ( AST#parameter#Left uris : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right >...
static async persistPermissionEasy(uris: Array<string>, operationMode: number = fileShare.OperationMode.READ_MODE | fileShare.OperationMode.WRITE_MODE): Promise<void> { let policies: Array<fileShare.PolicyInfo> = new Array<fileShare.PolicyInfo>(); for (let index = 0; index < uris.length; index++) { le...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L898-L906
fe80e4ab25c55b59ee8217dbe983cdb081e6dabf
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/danmakuplayer/src/main/ets/view/VideoView.ets
arkts
当前屏幕方向
export enum Directions { HORIZONTAL, VERTICAL };
AST#export_declaration#Left export AST#enum_declaration#Left enum Directions AST#enum_body#Left { AST#enum_member#Left HORIZONTAL AST#enum_member#Right , AST#enum_member#Left VERTICAL AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right ; AST#export_declaration#Right
export enum Directions { HORIZONTAL, VERTICAL };
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/danmakuplayer/src/main/ets/view/VideoView.ets#L23-L23
c05769dab67616727925c4db77e6c145cc5e5696
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/PullToRefresh/pulltorefresh/Index.ets
arkts
PullToRefreshNewsComponent
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 { PullToRefreshNewsComponent } from './src/main/ets/pages/PullToRefreshNews';
AST#export_declaration#Left export { PullToRefreshNewsComponent } from './src/main/ets/pages/PullToRefreshNews' ; AST#export_declaration#Right
export { PullToRefreshNewsComponent } from './src/main/ets/pages/PullToRefreshNews';
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/PullToRefresh/pulltorefresh/Index.ets#L16-L16
c663e5cba979a1b577e53a70f6fe3d0288a5c976
gitee
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/service/PodcastService.ets
arkts
getSubscribedPodcasts
获取所有订阅的播客
async getSubscribedPodcasts(): Promise<Podcast[]> { return await this.dbService.querySubscribedPodcasts(); }
AST#method_declaration#Left async getSubscribedPodcasts 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 AST#array_type#Left Podcast [ ] AST#array_type#Right AST#pr...
async getSubscribedPodcasts(): Promise<Podcast[]> { return await this.dbService.querySubscribedPodcasts(); }
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/PodcastService.ets#L97-L99
84f81b090237d39cd0cc62edad83207e3528faa1
github
Million-mo/tree-sitter-arkts.git
2fd0ad75e2d848709edcf4be038f27b178114ef6
examples/event_handling.ets
arkts
handleDoubleClick
双击事件处理
private handleDoubleClick() { this.eventData.updateEvent('doubleclick') this.selectedColor = this.selectedColor === Color.Blue ? Color.Red : Color.Blue }
AST#method_declaration#Left private handleDoubleClick AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#express...
private handleDoubleClick() { this.eventData.updateEvent('doubleclick') this.selectedColor = this.selectedColor === Color.Blue ? Color.Red : Color.Blue }
https://github.com/Million-mo/tree-sitter-arkts.git/blob/2fd0ad75e2d848709edcf4be038f27b178114ef6/examples/event_handling.ets#L50-L53
9fc49c6d30a907490efc1b6f6ba6cbe9f353ab0d
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/networks/Http.ets
arkts
_requestPromise
MARK: - 核心请求方法 执行实际HTTP请求(Promise封装) @param url 请求URL @param method HTTP方法 @param params 请求参数 @returns Promise封装的响应数据
private static async _requestPromise( url: string, method: HttpUtils.Method, params: HttpUtils.HttpParams ): Promise<string | null> { const httpRequest = http.createHttp(); // 创建HTTP请求实例 let finalUrl = url; let requestParams: string | null = null; // 1. 处理GET请求参数 if (method === HttpU...
AST#method_declaration#Left private static async _requestPromise AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left method : AST#type_annotation#Left AST#primary_type#Left AST#...
private static async _requestPromise( url: string, method: HttpUtils.Method, params: HttpUtils.HttpParams ): Promise<string | null> { const httpRequest = http.createHttp(); let finalUrl = url; let requestParams: string | null = null; if (method === HttpUtils.Method.GET && params) {...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/Http.ets#L169-L222
e0571ab2fc5ab5159f91382405cbf240c88501af
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
getFontSize
获取动态字体大小 @param baseSize 基础字体大小 @returns 调整后的字体大小
private getFontSize(baseSize: number): number { // 计算字体缩放比例:用户选择的字体大小 / 默认字体大小(16) const scale = this.selectedFontSize / 16; return Math.round(baseSize * scale); }
AST#method_declaration#Left private getFontSize AST#parameter_list#Left ( AST#parameter#Left baseSize : 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 number AST#primar...
private getFontSize(baseSize: number): number { const scale = this.selectedFontSize / 16; return Math.round(baseSize * scale); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L6011-L6015
ef4909762c8f75601db4e28200b70b221633879f
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/viewmodel/AlarmClockViewModel.ets
arkts
构造函数,用于初始化成员变量
private constructor() { // 初始化闹钟项数组为空数组 this.alarms = new Array(); // 创建 ReminderService 实例 this.reminderService = new ReminderService(); // 打开通知权限 this.reminderService.openNotificationPermission(); // 禁用已过期的提醒 this.disableExpiredReminders(); }
AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 初始化闹钟项数组为空数组 AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Righ...
private constructor() { this.alarms = new Array(); this.reminderService = new ReminderService(); this.reminderService.openNotificationPermission(); this.disableExpiredReminders(); }
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/AlarmClockViewModel.ets#L26-L35
860f4e0c8c80f93df9505a623912afcd30da90cd
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/groupavatar/Index.ets
arkts
ImageCombination
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { ImageCombination } from './src/main/ets/utils/ImageCombination';
AST#export_declaration#Left export { ImageCombination } from './src/main/ets/utils/ImageCombination' ; AST#export_declaration#Right
export { ImageCombination } from './src/main/ets/utils/ImageCombination';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/groupavatar/Index.ets#L16-L16
d5897ef8786026ba61fdef70a59faa495e7db808
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videotrimmer/src/main/ets/constants/DoanloadConstants.ets
arkts
上传下载常量 任务常量
export default class TaskConstants { static readonly TASK_MAX: number = 10; // 同时开启最大任务数 static readonly TASK_PAUSE_MSG: number = -1; // 暂停 static readonly TASK_RESUME_MSG: number = -2; // 继续下载 static readonly TASK_NET_PAUSE_MSG: number = -3; // 网络异常 static readonly TASK_NET_RESUME_MSG: number = -4; ...
AST#export_declaration#Left export default AST#class_declaration#Left class TaskConstants AST#class_body#Left { AST#property_declaration#Left static readonly TASK_MAX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 10 AST#expression#Right ; ...
export default class TaskConstants { static readonly TASK_MAX: number = 10; static readonly TASK_PAUSE_MSG: number = -1; static readonly TASK_RESUME_MSG: number = -2; static readonly TASK_NET_PAUSE_MSG: number = -3; static readonly TASK_NET_RESUME_MSG: number = -4; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/src/main/ets/constants/DoanloadConstants.ets#L21-L32
52625c880827faa9ab8f95be7c7686561d451b43
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/login_register/register.ets
arkts
*******************************build*******************************//
build() { Column() { Text().height(40) this.title() this.register() } .backgroundColor("#ffffff") .width("100%") .height("100%") }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#expression#Right ) AST#...
build() { Column() { Text().height(40) this.title() this.register() } .backgroundColor("#ffffff") .width("100%") .height("100%") }
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/login_register/register.ets#L203-L213
15adc588f04d3b937597bcf9305c545b44fd8949
github
openharmony/graphic_graphic_2d
46a11e91c9709942196ad2a7afea2e0fcd1349f3
frameworks/text/interface/export/ani/@ohos.graphics.text.ets
arkts
Describes text style. @typedef TextStyle @syscap SystemCapability.Graphics.Drawing @since 12
export interface TextStyle { /** * Decoration of text. * @type { ?Decoration } decoration for text * @syscap SystemCapability.Graphics.Drawing * @since 12 */ decoration?: Decoration; /** * Color of text. * @type { ?common2D.Color } it is uint32_t type data * @syscap ...
AST#export_declaration#Left export AST#interface_declaration#Left interface TextStyle AST#object_type#Left { /** * Decoration of text. * @type { ?Decoration } decoration for text * @syscap SystemCapability.Graphics.Drawing * @since 12 */ AST#type_member#Left decoration ? : AST#type_annotation#L...
export interface TextStyle { decoration?: Decoration; color?: common2D.Color; fontWeight?: FontWeight; fontStyle?: FontStyle; baseline?: TextBaseline; fontFamilies?: Array<string>; fontSize?: number; letterSpacing?: number; wordSpa...
https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/frameworks/text/interface/export/ani/@ohos.graphics.text.ets#L747-L908
e894786d55583fc715d4373cadaa47af89370987
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/OneAutumn/entry/src/main/ets/common/MyHttpUtils.ets
arkts
detectionFlag
判断当前诗词是否被自己收藏过 驱动UI显示
async detectionFlag(apiStr: string,userIdAndPoemId:CollectQueryParam) { // 发送当前诗词id 访问接口 响应boolean let res = await http.createHttp().request(apiStr, { header: { 'Content-Type': 'application/json' }, method: http.RequestMethod.POST, extraData: JSON.stringify(userId...
AST#method_declaration#Left async detectionFlag AST#parameter_list#Left ( AST#parameter#Left apiStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left userIdAndPoemId : AST#type_annotation#Left AST#primary_type#Left CollectQu...
async detectionFlag(apiStr: string,userIdAndPoemId:CollectQueryParam) { let res = await http.createHttp().request(apiStr, { header: { 'Content-Type': 'application/json' }, method: http.RequestMethod.POST, extraData: JSON.stringify(userIdAndPoemId) } ) ...
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/OneAutumn/entry/src/main/ets/common/MyHttpUtils.ets#L23-L37
b5a7aded8bb9acf5f444e28ec9b6d5bf8555a5e9
gitee
Vinson0709/arkdemo.git
793491fe04b387f55dadfef86b30e28d0535d994
entry/src/main/ets/pages/Selects.ets
arkts
bodyBuilder
内容展示(自定义builder渲染)
@Builder bodyBuilder() { Column(){ // Radio 单选 Text('Radio 单选') .fontSize(14) .margin({ top:20, bottom: 12}) Row() { ForEach(this.radioData, (item: string) => { Row() { Radio({ value: item, group: 'radioGroup' }) .checked(this.radioValue ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right bodyBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // Radio 单选 AST#a...
@Builder bodyBuilder() { Column(){ Text('Radio 单选') .fontSize(14) .margin({ top:20, bottom: 12}) Row() { ForEach(this.radioData, (item: string) => { Row() { Radio({ value: item, group: 'radioGroup' }) .checked(this.radioValue === item) ...
https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Selects.ets#L53-L207
049f8ed2fc8965c960d744441cc16f4916f38168
github
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegCommandBuilder.ets
arkts
audioCodec
设置音频编码器
public audioCodec(codec: string): FFmpegCommandBuilder { this.aCodec = codec; return this; }
AST#method_declaration#Left public audioCodec AST#parameter_list#Left ( AST#parameter#Left codec : 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 FFmpegCommandBuilder A...
public audioCodec(codec: string): FFmpegCommandBuilder { this.aCodec = codec; return this; }
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegCommandBuilder.ets#L87-L90
8ad13c303f490f6deb12358d6def6a5658dffd4e
github
ni202383/Chenguang-Calendar.git
c04543db2c394d662bc1336d098335134ff1e9a5
src/main/ets/pages/WeeklyTaskPage.ets
arkts
initializeSampleData
初始化示例数据
private initializeSampleData(): void { const now = new Date(); // 添加一些示例任务 this.weeklyTaskTimeRangeList.push( new TaskTimeRange( 'task1', '晨间会议', new Date(now.getFullYear(), now.getMonth(), now.getDate(), 9, 0), new Date(now.getFullYear(), now.getMonth(), now.getDa...
AST#method_declaration#Left private initializeSampleData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#L...
private initializeSampleData(): void { const now = new Date(); this.weeklyTaskTimeRangeList.push( new TaskTimeRange( 'task1', '晨间会议', new Date(now.getFullYear(), now.getMonth(), now.getDate(), 9, 0), new Date(now.getFullYear(), now.getMonth(), now.getDate(), 10, 0...
https://github.com/ni202383/Chenguang-Calendar.git/blob/c04543db2c394d662bc1336d098335134ff1e9a5/src/main/ets/pages/WeeklyTaskPage.ets#L126-L156
8d7edbe6fba304a9e75d6559aca9bb2c9c053462
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/data/FestivalData2025.ets
arkts
getFestivalPriority
获取节日优先级(用于显示排序)
public static getFestivalPriority(festival: FestivalInfo): number { if (festival.isLegal) return 1; if (festival.type === FestivalType.TRADITIONAL) return 2; if (festival.type === FestivalType.INTERNATIONAL) return 3; if (festival.type === FestivalType.WESTERN) return 4; if (festival.type === Festiv...
AST#method_declaration#Left public static getFestivalPriority AST#parameter_list#Left ( AST#parameter#Left festival : AST#type_annotation#Left AST#primary_type#Left FestivalInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Le...
public static getFestivalPriority(festival: FestivalInfo): number { if (festival.isLegal) return 1; if (festival.type === FestivalType.TRADITIONAL) return 2; if (festival.type === FestivalType.INTERNATIONAL) return 3; if (festival.type === FestivalType.WESTERN) return 4; if (festival.type === Festiv...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/data/FestivalData2025.ets#L308-L315
b19ce4783fdb300749e2102e3f60dec483399c09
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/ContactTypes.ets
arkts
纪念日基础信息接口
export interface Anniversary { id: string; name: string; // 纪念日名称 description?: string; // 描述 date: string; // 纪念日期 YYYY-MM-DD type: AnniversaryType; // 纪念日类型 isLunar: boolean; // 是否农历 lunarDate?: string; // 农历日期 relatedCon...
AST#export_declaration#Left export AST#interface_declaration#Left interface Anniversary AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST...
export interface Anniversary { id: string; name: string; description?: string; date: string; type: AnniversaryType; isLunar: boolean; lunarDate?: string; relatedContacts?: string[]; reminderDays?: number; ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L369-L382
048e4b385dfe9e0a7846fb6dd8af8e1f968d441d
github
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/timer/TimerDialog.ets
arkts
aboutToDisappear
组件销毁时清理计时器
aboutToDisappear() { this.stopTimer(); }
AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . stopTimer AST#membe...
aboutToDisappear() { this.stopTimer(); }
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/timer/TimerDialog.ets#L161-L163
94db9e5d210e0fe7100d8243682923ec58804888
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
AtomicService/DxinPoetry/entry/src/main/ets/model/MustLearnPoetryModel.ets
arkts
年级阶段:小学 初中 高中
export interface Phase { grade: string poetryList: Poetry[] }
AST#export_declaration#Left export AST#interface_declaration#Left interface Phase AST#object_type#Left { AST#type_member#Left grade : 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 poetryList : AST#type_annotation#Left AS...
export interface Phase { grade: string poetryList: Poetry[] }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/DxinPoetry/entry/src/main/ets/model/MustLearnPoetryModel.ets#L9-L13
0943adb7c010098e77b2abec31329255995e5e8a
gitee
IceTeacher/DrawingBook.git
c101a1b904388fcfa72de1ff402307bb9036b68b
entry/src/main/ets/pages/BookListPage.ets
arkts
getBookAudioList
请求中文音频书籍列表方法
async getBookAudioList(language: number, page: number) { this.canLoad = false; let httpObject = http.createHttp(); let url = `https://van.mama.cn/hb/api/goodsAudio/getList?page=${page}&language=${language}&perpage=10&sign=&uid=` let res = await httpObject.request(url) let bookAudioListRes: Arr...
AST#method_declaration#Left async getBookAudioList AST#parameter_list#Left ( AST#parameter#Left language : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left page : AST#type_annotation#Left AST#primary_type#Left number AST#prim...
async getBookAudioList(language: number, page: number) { this.canLoad = false; let httpObject = http.createHttp(); let url = `https://van.mama.cn/hb/api/goodsAudio/getList?page=${page}&language=${language}&perpage=10&sign=&uid=` let res = await httpObject.request(url) let bookAudioListRes: Arr...
https://github.com/IceTeacher/DrawingBook.git/blob/c101a1b904388fcfa72de1ff402307bb9036b68b/entry/src/main/ets/pages/BookListPage.ets#L42-L57
e0a5ef9d2115c34ed40fa0c310dc2d582fcc2f20
github
ashcha0/line-inspection-terminal-frontend_arkts.git
c82616097e8a3b257b7b01e75b6b83ce428b518c
entry/src/main/ets/pages/InitView.ets
arkts
startSystemCheck
开始系统检查
async startSystemCheck() { console.info('[InitView] 开始系统自检流程'); this.isChecking = true; this.allChecksPassed = false; // 重置所有检查项状态 const newCheckItems: CheckItem[] = []; for (let i = 0; i < this.checkItems.length; i++) { const item = this.checkItems[i]; const newItem: CheckItem ...
AST#method_declaration#Left async startSystemCheck 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 console AST#expression#Right...
async startSystemCheck() { console.info('[InitView] 开始系统自检流程'); this.isChecking = true; this.allChecksPassed = false; const newCheckItems: CheckItem[] = []; for (let i = 0; i < this.checkItems.length; i++) { const item = this.checkItems[i]; const newItem: CheckItem = { ...
https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/InitView.ets#L79-L109
bab8ed10f53cffb55ffaa038c85ac256f9ef3532
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/drag/DefaultDrag.ets
arkts
getDataFromUdmfRetry
[StartExclude generate_pix_map] [Start data_delayed_retry]
getDataFromUdmfRetry(event: DragEvent, callback: (data: DragEvent) => void) { try { let data: UnifiedData = event.getData(); if (!data) { return false; } let records: unifiedDataChannel.UnifiedRecord[] = data.getRecords(); if (!records || records.length <= 0) { return f...
AST#method_declaration#Left getDataFromUdmfRetry AST#parameter_list#Left ( AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left DragEvent AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#paramete...
getDataFromUdmfRetry(event: DragEvent, callback: (data: DragEvent) => void) { try { let data: UnifiedData = event.getData(); if (!data) { return false; } let records: unifiedDataChannel.UnifiedRecord[] = data.getRecords(); if (!records || records.length <= 0) { return f...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/drag/DefaultDrag.ets#L44-L60
04325be33df125dd273bcd64008a8f270409b984
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Plan.ets
arkts
getPieces
/ 将 words 划分为 piece 列表
getPieces(): Piece[] { return this.pieces; }
AST#method_declaration#Left getPieces AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Piece [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return A...
getPieces(): Piece[] { return this.pieces; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L80-L82
e534465c383d6cf63dcf88b041bf249ffe7242a2
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/storage/PreferencesService.ets
arkts
getKeys
获取所有键 @returns 键数组
async getKeys(): Promise<string[]> { try { this.checkInitialized(); // Note: HarmonyOS preferences API may not have getKeys method // This is a placeholder implementation // You may need to track keys separately or use alternative approach return []; } catch (error) { const b...
AST#method_declaration#Left async getKeys 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 AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Righ...
async getKeys(): Promise<string[]> { try { this.checkInitialized(); return []; } catch (error) { const businessError = error as BusinessError; hilog.error(0x0001, 'BirthdayReminder', `Failed to get keys: ${businessError.message}`); return []; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/storage/PreferencesService.ets#L282-L294
aab0fe2b528dca7b082b2b1eff33c39ffb8a40eb
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/data/src/main/ets/repository/GoodsRepository.ets
arkts
@file 商品相关仓库类,封装商品模块请求 @author Joker.X
export class GoodsRepository { /** * 商品网络数据源 */ private networkDataSource: GoodsNetworkDataSource; /** * 构造函数 * @param networkDataSource 可选的商品网络数据源实例 */ constructor(networkDataSource?: GoodsNetworkDataSource) { this.networkDataSource = networkDataSource ?? new GoodsNetworkDataSourceImpl(); ...
AST#export_declaration#Left export AST#class_declaration#Left class GoodsRepository AST#class_body#Left { /** * 商品网络数据源 */ AST#property_declaration#Left private networkDataSource : AST#type_annotation#Left AST#primary_type#Left GoodsNetworkDataSource AST#primary_type#Right AST#type_annotation#Right ; AST#property...
export class GoodsRepository { private networkDataSource: GoodsNetworkDataSource; constructor(networkDataSource?: GoodsNetworkDataSource) { this.networkDataSource = networkDataSource ?? new GoodsNetworkDataSourceImpl(); } async getGoodsPage(params: GoodsSearchRequest): Promise<NetworkResponse<Net...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/data/src/main/ets/repository/GoodsRepository.ets#L10-L41
824dcd90ad1ebc9f486144a78c4ebb933f689832
github
buqiuz/game-puzzle.git
605dc0fac0738466db308a8ba255b5e9094c52ac
entry/src/main/ets/common/CommonConstants.ets
arkts
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...
export class CommonConstants { /** * List space. */ static readonly LIST_SPACE: number = 5; /** * List width. */ static readonly LIST_WIDTH: string = '95%'; /** * Full width. */ static readonly FULL_WIDTH: string = '100%'; /** * Full height. */ static readonly FULL_HEIGHT: str...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * List space. */ AST#property_declaration#Left static readonly LIST_SPACE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 5 A...
export class CommonConstants { static readonly LIST_SPACE: number = 5; static readonly LIST_WIDTH: string = '95%'; static readonly FULL_WIDTH: string = '100%'; static readonly FULL_HEIGHT: string = '100%'; static readonly BUTTON_MARGIN: string = '25%'; static readonly IMAGE_WIDTH: str...
https://github.com/buqiuz/game-puzzle.git/blob/605dc0fac0738466db308a8ba255b5e9094c52ac/entry/src/main/ets/common/CommonConstants.ets#L16-L181
d7d1285701e5e5606e92436e71a0f7ecc60ec2b8
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationManagementUtil.ets
arkts
resetTypeNotificationState
重置状态
resetTypeNotificationState() { for (let i = 0; i < NOTIFICATION_TYPE_SIZE + 1; i++) { this.typeNotifications[i] = new Array(); } this.badgeNum = 0; this.countsByType.fill(0); }
AST#method_declaration#Left resetTypeNotificationState AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#for_statement#Left for ( AST#variable_declaration#Left let AST#variable_declarator#Left i = AST#expression#Left 0 AST#expression#Right AST#variable_declarator#Rig...
resetTypeNotificationState() { for (let i = 0; i < NOTIFICATION_TYPE_SIZE + 1; i++) { this.typeNotifications[i] = new Array(); } this.badgeNum = 0; this.countsByType.fill(0); }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationManagementUtil.ets#L61-L67
6ed387237ca0d33743995406f2ab0382f34e5bee
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/RadarData.ets
arkts
setLabels
Sets the labels that should be drawn around the RadarChart at the end of each web line. @param labels
public setLabels(labels: JArrayList<string>): void { this.mLabels = labels; }
AST#method_declaration#Left public setLabels AST#parameter_list#Left ( AST#parameter#Left labels : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_a...
public setLabels(labels: JArrayList<string>): void { this.mLabels = labels; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/RadarData.ets#L37-L39
54ddc9d41ed440ebfe5e0c42476cdb38f4b88237
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/view/AboutPage.ets
arkts
AboutPage
@file 关于我们页面视图 @author Joker.X
@ComponentV2 export struct AboutPage { /** * 关于我们页面 ViewModel */ @Local private vm: AboutViewModel = new AboutViewModel(); /** * 构建关于我们页面 * @returns {void} 无返回值 */ build() { AppNavDestination({ title: "关于我们", viewModel: this.vm }) { this.AboutContent(); } } /...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct AboutPage AST#component_body#Left { /** * 关于我们页面 ViewModel */ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left AboutViewM...
@ComponentV2 export struct AboutPage { @Local private vm: AboutViewModel = new AboutViewModel(); build() { AppNavDestination({ title: "关于我们", viewModel: this.vm }) { this.AboutContent(); } } @Builder private AboutContent() { Text("关于我们页面内容视图") } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/view/AboutPage.ets#L8-L37
31353c4eb06dfc2500387147bd420174bd9b76c4
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Performance/PerformanceLibrary/feature/smartPerfEditor/Index.ets
arkts
SmartPerfEditorView
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...
export { SmartPerfEditorView } from './src/main/ets/view/SmartPerfEditorView';
AST#export_declaration#Left export { SmartPerfEditorView } from './src/main/ets/view/SmartPerfEditorView' ; AST#export_declaration#Right
export { SmartPerfEditorView } from './src/main/ets/view/SmartPerfEditorView';
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Performance/PerformanceLibrary/feature/smartPerfEditor/Index.ets#L16-L16
306f2e336eb8c4ac05839191a2880605a7a5b887
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowDataSource.ets
arkts
Delete2ndItem
删除第二个元素
public Delete2ndItem(): void { this.dataArray.splice(1, 1); this.notifyDataDelete(1); }
AST#method_declaration#Left public Delete2ndItem 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#exp...
public Delete2ndItem(): void { this.dataArray.splice(1, 1); this.notifyDataDelete(1); }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowDataSource.ets#L110-L113
a55b18126a42eb7f3741f2eec0a65440409e5225
gitee
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/pages/favourite/FavouriteListArgs.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2024/11/19 22:32 @Version V1.0 @Description List args
export interface FavouriteListArgs { id: string, name: string, type: FinItemType }
AST#export_declaration#Left export AST#interface_declaration#Left interface FavouriteListArgs AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , AST#type_member#Left name : AST#type_annotation#Le...
export interface FavouriteListArgs { id: string, name: string, type: FinItemType }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/favourite/FavouriteListArgs.ets#L10-L18
6e92eec28067b367b26cef84583904bbf6091552
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/setting/SettingManager.ets
arkts
MARK: - 构造
private constructor() { this.initPreferences(getAppContext()); }
AST#constructor_declaration#Left private constructor 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 this AST#expression#Right ...
private constructor() { this.initPreferences(getAppContext()); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/setting/SettingManager.ets#L85-L87
9b6aab8ff53c77b584a97fa2e128f3b16cf0b709
github
magongshou/harmony-cordova
4b26bb5eeb3a9fd8ceb40165e6ac98b244474ee6
entry/src/main/ets/entryability/EntryAbility.ets
arkts
引入cordova sdk
export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); webview.WebviewController.initializeWebEngine();//webview引擎初始化 setSchemeHandler();//设置webview scheme pagePushNot...
AST#export_declaration#Left export default AST#class_declaration#Left class EntryAbility extends AST#type_annotation#Left AST#primary_type#Left UIAbility AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left onCreate AST#parameter_list#Left ( AST#parameter#Left want : AST#ty...
export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); webview.WebviewController.initializeWebEngine(); setSchemeHandler(); pagePushNotify(want.parameters); } ...
https://github.com/magongshou/harmony-cordova/blob/4b26bb5eeb3a9fd8ceb40165e6ac98b244474ee6/entry/src/main/ets/entryability/EntryAbility.ets#L7-L52
deeb562e506edf1653b4859ed23ecd3c50c6a6f5
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.Dialog.d.ets
arkts
TipsDialog
Declare CustomDialog TipsDialog @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare CustomDialog TipsDialog @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11 Declare CustomDialog TipsDialog @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
@CustomDialog export declare struct TipsDialog { /** * Sets the TipsDialog Controller. * @type { CustomDialogController }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * Sets the TipsDialog Controller. * @type { CustomDialogController }. * @syscap SystemCapability.ArkUI.Ark...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct TipsDialog AST#component_body#Left { /** * Sets the TipsDialog Controller. * @type { CustomDialogController }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since...
@CustomDialog export declare struct TipsDialog { controller: CustomDialogController; imageRes: ResourceStr | PixelMap; imageSize?: SizeOptions; title?: ResourceStr; content?: ResourceStr; checkTips?: ResourceStr; @Prop isChecked?: boo...
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Dialog.d.ets#L184-L457
518531beb852b5d7c8fcac022e39c853eb4c2ed0
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets
arkts
MARK: - 构造函数 构造函数 @param num - 天数编号 @param boxes - boxes数组
constructor(num: number, boxes: Box[]) { this._num = num; this._boxes = boxes; }
AST#constructor_declaration#Left constructor 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#Left boxes : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Box [...
constructor(num: number, boxes: Box[]) { this._num = num; this._boxes = boxes; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/DayOf.ets#L46-L49
31ec03f9bddb82a1f0b0386577e9ed3849db9f35
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/view/Index.ets
arkts
CustomDrawTabbarComponent
功能描述: 通过canvas,clipShape,radialGradient实现自定义TabBar选择时凸起点交界处的圆滑过渡动效以及扩展了一个凹陷选择时不遮挡原本内容的功能。 推荐场景: 自定义TabBar页签需要实现一圈圆弧外轮廓或者凹陷轮廓,点击TabBar页签之后需要改变图标显示,并有平移滑动切换页签动效的场景。 核心组件: 1. TabsRaisedCircle 2. TabsConcaveCircle 实现步骤: 1. TabBar页面实现有一圈圆弧外轮廓:单独绘制一个圆,然后将圆向上偏移1/3。通过 radialGradient 设置选中的圆心的背景色,然后在单独绘制左右俩边的圆角过渡。 2. TabBar页面...
@Component export struct CustomDrawTabbarComponent { @State currentIndex: number = 0; @State TabsMenu: TabMenusInterfaceIRequired[] = [ { text: $r("app.string.custom_tab_home"), image: $r("app.media.tab_home"), selectImage: $r("app.media.tab_community") }, { text: $r("app.string....
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CustomDrawTabbarComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right currentIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Ri...
@Component export struct CustomDrawTabbarComponent { @State currentIndex: number = 0; @State TabsMenu: TabMenusInterfaceIRequired[] = [ { text: $r("app.string.custom_tab_home"), image: $r("app.media.tab_home"), selectImage: $r("app.media.tab_community") }, { text: $r("app.string....
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/view/Index.ets#L34-L82
b772ada2e518a8341f76dd755d30ef96a6757c69
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LRUCacheUtil.ets
arkts
clear
清除缓存数据,并重置lruCache的大小
public clear() { this.lruCache.clear(); this.lruCache.updateCapacity(64); }
AST#method_declaration#Left public clear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this...
public clear() { this.lruCache.clear(); this.lruCache.updateCapacity(64); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LRUCacheUtil.ets#L107-L110
12f10c03bb985f66ce1c75a2cdaa015b5768f23a
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/action/DialogUtil.ets
arkts
showActionSheet
列表选择弹窗 (ActionSheetOptions) @param options
static showActionSheet(options: ActionSheetOptions) { DialogUtil.initDialogDefault(options); DialogUtil.initSheetOptions(options); ActionSheet.show({ title: options.title, subtitle: options.subtitle, message: options.message, alignment: options.alignment, offset: options.offset...
AST#method_declaration#Left static showActionSheet AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ActionSheetOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_stat...
static showActionSheet(options: ActionSheetOptions) { DialogUtil.initDialogDefault(options); DialogUtil.initSheetOptions(options); ActionSheet.show({ title: options.title, subtitle: options.subtitle, message: options.message, alignment: options.alignment, offset: options.offset...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/action/DialogUtil.ets#L86-L120
b2a5c643802fb3e35306e337f6abe1956504f2f3
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/network/src/main/ets/datasource/banner/BannerNetworkDataSourceImpl.ets
arkts
@file 轮播图相关数据源实现类 @author Joker.X
export class BannerNetworkDataSourceImpl implements BannerNetworkDataSource { /** * 查询轮播图列表 * @param params 请求参数 * @returns 轮播图列表响应 */ async getBannerList(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> { const resp: AxiosResponse<NetworkResponse<Unknown>> = await NetworkCl...
AST#export_declaration#Left export AST#class_declaration#Left class BannerNetworkDataSourceImpl AST#implements_clause#Left implements BannerNetworkDataSource AST#implements_clause#Right AST#class_body#Left { /** * 查询轮播图列表 * @param params 请求参数 * @returns 轮播图列表响应 */ AST#method_declaration#Left async getBanner...
export class BannerNetworkDataSourceImpl implements BannerNetworkDataSource { async getBannerList(params: Record<string, Unknown>): Promise<NetworkResponse<Unknown>> { const resp: AxiosResponse<NetworkResponse<Unknown>> = await NetworkClient.http.post("info/banner/list", params); return resp.data; ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/banner/BannerNetworkDataSourceImpl.ets#L10-L21
af80ff860d8f2001c522d81c4af65786c4d34dce
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/StateManagement/entry/src/main/ets/segment/segment8.ets
arkts
isCollected
3.Calculate whether the current article is favorite or not according to the favorite information array
isCollected(): boolean { return this.collectedIds.some((id: string) => id === this.articleItem.id); }
AST#method_declaration#Left isCollected AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Le...
isCollected(): boolean { return this.collectedIds.some((id: string) => id === this.articleItem.id); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/StateManagement/entry/src/main/ets/segment/segment8.ets#L79-L81
340b1924a33dcca0c1493b73f1d4e9dd4e0d1ffd
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/StringUtils.ets
arkts
base64ToStr
Base64字符串转字符串 @param base64Str Base64字符串 @returns
static base64ToStr(base64Str: string): string { let uint8Array = Base64Utils.decodeSync(base64Str) let result = StringUtils.unit8ArrayToStr(uint8Array) return result; }
AST#method_declaration#Left static base64ToStr AST#parameter_list#Left ( AST#parameter#Left base64Str : 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#primar...
static base64ToStr(base64Str: string): string { let uint8Array = Base64Utils.decodeSync(base64Str) let result = StringUtils.unit8ArrayToStr(uint8Array) return result; }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StringUtils.ets#L239-L243
50ffdb1da434bd82ac3edb5f4cc019f1626ec4bb
gitee
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/viewmodel/InterComData.ets
arkts
呼叫列表Item实体
export class CallListItemData { type: string = "" name: string imageSrc: ResourceStr constructor
AST#export_declaration#Left export AST#ERROR#Left class CallListItemData { type AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "" AST#expression#Right name : string imageSrc AST#ERROR#Right : ResourceStr AST#ERROR#Right AST#v...
export class CallListItemData { type: string = "" name: string imageSrc: ResourceStr constructor
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/InterComData.ets#L40-L45
527a01ac019c07b63895aff9df5723b2da4921c1
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/UserFile/ManagingExternalStorageDevices/entry/src/main/ets/pages/Index.ets
arkts
subscribeToEvents
[Start subscribe_events_2]
async subscribeToEvents() { Logger.info('subscribeToEvents() begin'); const subscribeInfo: commonEventManager.CommonEventSubscribeInfo = { events: [ 'usual.event.data.VOLUME_REMOVED', 'usual.event.data.VOLUME_UNMOUNTED', 'usual.event.data.VOLUME_MOUNTED', 'usual.event.data....
AST#method_declaration#Left async subscribeToEvents 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 Logger AST#expression#Right...
async subscribeToEvents() { Logger.info('subscribeToEvents() begin'); const subscribeInfo: commonEventManager.CommonEventSubscribeInfo = { events: [ 'usual.event.data.VOLUME_REMOVED', 'usual.event.data.VOLUME_UNMOUNTED', 'usual.event.data.VOLUME_MOUNTED', 'usual.event.data....
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/UserFile/ManagingExternalStorageDevices/entry/src/main/ets/pages/Index.ets#L90-L107
2adc590010c665c3ee91b9d51ee07094a5c75adb
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/healthchart/src/main/ets/view/LineCharts.ets
arkts
LineCharts
场景描述:当前组件为线形图组件 LineChartModel。 构造新的对象模型后通过模型的方法设置属性。 具体实现见aboutToAppear内注释。
@Component export struct LineCharts { @Prop type: string = HEART_RATE; // 设置线形图类型(心率或步数) @Prop referenceData: Array<number | null>; // 参考数据 @Prop todayData: Array<number | null>; // 当日数据 model: LineChartModel | null = null; // 线形图模型 private leftAxis: YAxis | null = null; // 左侧Y轴数据 private rightAxis: YAxis |...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct LineCharts AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#...
@Component export struct LineCharts { @Prop type: string = HEART_RATE; @Prop referenceData: Array<number | null>; @Prop todayData: Array<number | null>; model: LineChartModel | null = null; private leftAxis: YAxis | null = null; private rightAxis: YAxis | null = null; private xAxis: XAxis | null = n...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/healthchart/src/main/ets/view/LineCharts.ets#L61-L272
c9b7c44e8f81bf1162e80fd82f29f2d8017e2fb7
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/TypeUtil.ets
arkts
isArray
判断是否是数组类型
static isArray(value: Any): boolean { return Array.isArray(value) }
AST#method_declaration#Left static isArray AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Rig...
static isArray(value: Any): boolean { return Array.isArray(value) }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L61-L63
c4260e5cd9f655d60827ab02c320cbce8db3c7fd
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/StateManagement/entry/src/main/ets/commoncomponents/ViewCodeText.ets
arkts
ViewCodeText
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 ViewCodeText { @StorageLink('sideBarShow') sideBarShow: boolean = false; private webSrc: Resource = $rawfile('BaseTypeCode.ets.html'); build() { Column(){ Text($r('app.string.source_code')) .fontColor($r('app.color.source_code_font_color')) .fontSize($r('app.fl...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ViewCodeText AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'sideBarShow' AST#expression#Right ) AST#decorator#Right sideBarShow : AST#type_annotation#Le...
@Component export struct ViewCodeText { @StorageLink('sideBarShow') sideBarShow: boolean = false; private webSrc: Resource = $rawfile('BaseTypeCode.ets.html'); build() { Column(){ Text($r('app.string.source_code')) .fontColor($r('app.color.source_code_font_color')) .fontSize($r('app.fl...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/StateManagement/entry/src/main/ets/commoncomponents/ViewCodeText.ets#L16-L37
95f7b5b0a56a92f4601051112af638fdac47001f
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/utils/MD5.ets
arkts
hmacSegment
消息认证码计算,分段,异步 @param data 传入的消息 @param symKey 共享对称密钥。 @param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。 @param len 自定义的数据拆分长度
static async hmacSegment(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex', len: number = 128): Promise<string> { return CryptoUtil.hmacSegment(data, 'MD5', symKey, resultCoding, len); }
AST#method_declaration#Left static async hmacSegment 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_t...
static async hmacSegment(data: string, symKey: cryptoFramework.SymKey = MD5.symKey, resultCoding: crypto.BhCoding = 'hex', len: number = 128): Promise<string> { return CryptoUtil.hmacSegment(data, 'MD5', symKey, resultCoding, len); }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/MD5.ets#L105-L108
8f9cc812717d9b85c02fd3f20f0d1bc35a8e331c
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PreferencesUtil.ets
arkts
get
获取缓存值 @param key @param defValue @returns
static async get(key: string, defValue: preferences.ValueType, preferenceName: string = PreferencesUtil.defaultPreferenceName): Promise<preferences.ValueType> { let preferences = await PreferencesUtil.getPreferences(preferenceName); //获取实例 return preferences.get(key, defValue); }
AST#method_declaration#Left static async get AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defValue : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Lef...
static async get(key: string, defValue: preferences.ValueType, preferenceName: string = PreferencesUtil.defaultPreferenceName): Promise<preferences.ValueType> { let preferences = await PreferencesUtil.getPreferences(preferenceName); return preferences.get(key, defValue); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L117-L121
e05c52001f7c1b657b6840f1b4c75d268000bfc4
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagecompression/src/main/ets/view/ImageCompression.ets
arkts
packingImage
packing二分方式循环压缩 @param sourcePixelMap 原始待压缩图片的PixelMap @param compressedImageData 图片压缩的ArrayBuffer @param maxCompressedImageByte 压缩目标图像字节长度
async packingImage(sourcePixelMap: image.PixelMap, compressedImageData: ArrayBuffer, maxCompressedImageByte: number) { let imageQuality: number = 0; const DICHOTOMY_ACCURACY = this.minBisectUnit; // 图片质量参数范围为0-100,这里以minBisectUnit为最小二分单位创建用于packing二分图片质量参数的数组。 const packingArray: number[] = []; // 性...
AST#method_declaration#Left async packingImage AST#parameter_list#Left ( AST#parameter#Left sourcePixelMap : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left compress...
async packingImage(sourcePixelMap: image.PixelMap, compressedImageData: ArrayBuffer, maxCompressedImageByte: number) { let imageQuality: number = 0; const DICHOTOMY_ACCURACY = this.minBisectUnit; const packingArray: number[] = []; for (let i = 0; i <= 100; i += DICHOTOMY_ACCURACY) { pack...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecompression/src/main/ets/view/ImageCompression.ets#L332-L379
63a89464d1176a2b8044403eb3cc3411210d76f1
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/database/src/main/ets/datasource/demo/DemoLocalDataSource.ets
arkts
@file Demo 数据源接口,定义本地 CRUD 能力。 @author Joker.X
export interface DemoLocalDataSource { /** * 新增一条 Demo 记录 * @param {string} title - 标题 * @param {string} [description] - 描述 * @returns {Promise<number>} 新建记录主键 */ createItem(title: string, description?: string): Promise<number>; /** * 更新 Demo 记录 * @param {DemoEntity} entity - 待更新实体 * @ret...
AST#export_declaration#Left export AST#interface_declaration#Left interface DemoLocalDataSource AST#object_type#Left { /** * 新增一条 Demo 记录 * @param {string} title - 标题 * @param {string} [description] - 描述 * @returns {Promise<number>} 新建记录主键 */ AST#type_member#Left createItem AST#parameter_list#Left ( AST#...
export interface DemoLocalDataSource { createItem(title: string, description?: string): Promise<number>; updateItem(entity: DemoEntity): Promise<void>; deleteById(id: number): Promise<void>; clearAll(): Promise<number>; getAllItems(): Promise<DemoEntity[]>; getItemById(id: number): Pr...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/database/src/main/ets/datasource/demo/DemoLocalDataSource.ets#L7-L48
e49821797370afbf605e74dc3d4f029b468652ff
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ClickResponseOptimization/entry/src/main/ets/view/LoadingView.ets
arkts
startAnimation
[Start start_animation] 骨架图,通过渐显渐隐的方式呈现骨架动画
startAnimation(): void { this.getUIContext().animateTo(CommonConstants.SKELETON_ANIMATION, () => { this.listOpacity = CommonConstants.HALF_OPACITY; }); }
AST#method_declaration#Left startAnimation 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#expressio...
startAnimation(): void { this.getUIContext().animateTo(CommonConstants.SKELETON_ANIMATION, () => { this.listOpacity = CommonConstants.HALF_OPACITY; }); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ClickResponseOptimization/entry/src/main/ets/view/LoadingView.ets#L31-L35
06666150fb8d43334f60c54adc6e237b1dde0751
gitee
EL233/WeChat-HarmonyOS.git
b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e
entry/src/main/ets/http/Api.ets
arkts
登录
export function login(phone: string, code: string) { const data: loginData = { phone: phone, code: code }; return instance.post('/word/user/login', data); }
AST#export_declaration#Left export AST#function_declaration#Left function login AST#parameter_list#Left ( AST#parameter#Left phone : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left code : AST#type_annotation#Left AST#primary...
export function login(phone: string, code: string) { const data: loginData = { phone: phone, code: code }; return instance.post('/word/user/login', data); }
https://github.com/EL233/WeChat-HarmonyOS.git/blob/b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e/entry/src/main/ets/http/Api.ets#L15-L18
b118c424ab0ceb3dc05fb2292f78447ddf9a4ff6
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets
arkts
networkWeak
[End scene_change_listen] [Start network_weak]
networkWeak() { this.getUIContext().getPromptAction().showToast({ message: $r('app.string.weak_network_environment_message'), duration: 2000 }); }
AST#method_declaration#Left networkWeak AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#mem...
networkWeak() { this.getUIContext().getPromptAction().showToast({ message: $r('app.string.weak_network_environment_message'), duration: 2000 }); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets#L224-L229
6b8833223f7f4fd398c6f2dd7ab038e9760863f2
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/publishmultimediaupdates/Index.ets
arkts
PublishMultimediaUpdates
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { PublishMultimediaUpdates } from './src/main/ets/pages/PublishMultimediaUpdates';
AST#export_declaration#Left export { PublishMultimediaUpdates } from './src/main/ets/pages/PublishMultimediaUpdates' ; AST#export_declaration#Right
export { PublishMultimediaUpdates } from './src/main/ets/pages/PublishMultimediaUpdates';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/publishmultimediaupdates/Index.ets#L15-L15
19ffd08d6b8944ed4c05bf2f9cbe71073ead9d8e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/CommonTypes.ets
arkts
安全级别枚举
export enum SecurityLevel { LOW = 'low', MEDIUM = 'medium', HIGH = 'high' }
AST#export_declaration#Left export AST#enum_declaration#Left enum SecurityLevel AST#enum_body#Left { AST#enum_member#Left LOW = AST#expression#Left 'low' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MEDIUM = AST#expression#Left 'medium' AST#expression#Right AST#enum_member#Right , AST#enum_member#L...
export enum SecurityLevel { LOW = 'low', MEDIUM = 'medium', HIGH = 'high' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L283-L287
6ea0041655465f995a877ec55123285b30aafbb6
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/foldablescreencases/src/main/ets/model/WindowModel.ets
arkts
setMainWindowImmersive
当前主窗口是否开启沉浸模式 @param enable 是否开启 @returns {void}
setMainWindowImmersive(enable: boolean): void { if (this.windowStage === undefined) { logger.error('windowStage is undefined.'); return; } this.windowStage.getMainWindow((err, windowClass: window.Window) => { if (err.code) { logger.error(`Failed to obtain the main window. Code:${er...
AST#method_declaration#Left setMainWindowImmersive AST#parameter_list#Left ( AST#parameter#Left enable : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
setMainWindowImmersive(enable: boolean): void { if (this.windowStage === undefined) { logger.error('windowStage is undefined.'); return; } this.windowStage.getMainWindow((err, windowClass: window.Window) => { if (err.code) { logger.error(`Failed to obtain the main window. Code:${er...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/model/WindowModel.ets#L46-L60
ae53646b19dfef9fab93e9f514f87f48599df9bb
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
安全设置接口
export interface SecuritySettings { level: string; biometricAuth: boolean; appLock: boolean; dataEncryption: boolean; sessionTimeout: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SecuritySettings AST#object_type#Left { AST#type_member#Left level : 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 biometricAuth : AST#type_an...
export interface SecuritySettings { level: string; biometricAuth: boolean; appLock: boolean; dataEncryption: boolean; sessionTimeout: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L227-L233
57c9cfb97047166307e872be318f97a3b86f75ab
github
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/Viewmodel/HomeViewModel.ets
arkts
getAccountingListOfDay
获取本日记账详情
public getAccountingListOfDay(): AccountingInfo[] { if (this.selectedDayInfo && this.selectedDayInfo.accountingList.length > 0) { // 若信息存在且长度不为0 return this.selectedDayInfo.accountingList; } return []; }
AST#method_declaration#Left public getAccountingListOfDay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left AccountingInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#i...
public getAccountingListOfDay(): AccountingInfo[] { if (this.selectedDayInfo && this.selectedDayInfo.accountingList.length > 0) { return this.selectedDayInfo.accountingList; } return []; }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/Viewmodel/HomeViewModel.ets#L355-L360
512cf33bd69ca36fbb1020c54832b0103de36b32
github
zhuanyongtester/Cpay_arkts.git
4402a8a06963d0757952513d3cbf7d5919ceb74f
entry/src/main/ets/pages/musicView/DetailsPage.ets
arkts
DetailsPage
全屏播放页
@Component export struct DetailsPage { // 设置手势滑动方向为上下滑动。用于全屏播放页手指上下滑动动画。 private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down }); // 动画相关参数类 @ObjectLink animationInfo: AnimationInfo; // 动画对象 @Link animatorObject: AnimatorResult; @StorageLink('status...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailsPage AST#component_body#Left { // 设置手势滑动方向为上下滑动。用于全屏播放页手指上下滑动动画。 AST#property_declaration#Left private panOption : AST#type_annotation#Left AST#primary_type#Left PanGestureOptions AST#primary_type#Right AST#typ...
@Component export struct DetailsPage { private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down }); @ObjectLink animationInfo: AnimationInfo; @Link animatorObject: AnimatorResult; @StorageLink('statusHeight') statusHeight: number = 0; @Builder...
https://github.com/zhuanyongtester/Cpay_arkts.git/blob/4402a8a06963d0757952513d3cbf7d5919ceb74f/entry/src/main/ets/pages/musicView/DetailsPage.ets#L28-L303
1b60ca75824102a587ded5d95716601953a0809e
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
entry/src/main/ets/common/component/TextMatchUtils.ets
arkts
issueDetector
问吧匹配 @param text
static issueDetector(text: string): TextMatchResult[] { const regs: TextMatchRegExp[] = [ new TopicMatchRegExp(), new PhoneMatchRegExp(), new UrlMatchRegExp(), ] return TextMatchUtils.detectorWithRegs(text, regs) }
AST#method_declaration#Left static issueDetector 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 AST#array_type#Left ...
static issueDetector(text: string): TextMatchResult[] { const regs: TextMatchRegExp[] = [ new TopicMatchRegExp(), new PhoneMatchRegExp(), new UrlMatchRegExp(), ] return TextMatchUtils.detectorWithRegs(text, regs) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/common/component/TextMatchUtils.ets#L121-L128
fd565a22c5698d4d9d18c4547919d34100e2dd8a
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/Rect.ets
arkts
移植的Rect类 @param left @param top @param right @param bottom @param r
export default class MyRect { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; /** * Create a new rectangle with the specified coordinates. Note: no range * checking is performed, so the caller must ensure that left <= right and * top <= bottom. * * @param left The X...
AST#export_declaration#Left export default AST#class_declaration#Left class MyRect AST#class_body#Left { AST#property_declaration#Left left : 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#Rig...
export default class MyRect { left: number = 0; top: number = 0; right: number = 0; bottom: number = 0; constructor(left?: number, top?: number, right?: number, bottom?: number, r?: MyRect) { this.left = left == undefined ? 0 : left this.top = top == undefined ? 0 : top; this.right = right == ...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L24-L221
c8d118617870d73ffb515494a4eb64ec0b72198b
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/Camera/entry/src/main/ets/Dialog/SettingDialog.ets
arkts
getLocationBol
Persistent geographical location, re-enter to determine if the switch is turned on
getLocationBol(bol: boolean) { this.settingDataObj.locationBol = bol; }
AST#method_declaration#Left getLocationBol AST#parameter_list#Left ( AST#parameter#Left bol : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expressi...
getLocationBol(bol: boolean) { this.settingDataObj.locationBol = bol; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Camera/entry/src/main/ets/Dialog/SettingDialog.ets#L49-L51
0800bbdd015aeb28a9bd28e80337e8f5b62758d7
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/LineScatterCandleRadarDataSet.ets
arkts
setDrawHorizontalHighlightIndicator
Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. @param enabled
public setDrawHorizontalHighlightIndicator(enabled: boolean): void { this.mDrawHorizontalHighlightIndicator = enabled; }
AST#method_declaration#Left public setDrawHorizontalHighlightIndicator AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type...
public setDrawHorizontalHighlightIndicator(enabled: boolean): void { this.mDrawHorizontalHighlightIndicator = enabled; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/LineScatterCandleRadarDataSet.ets#L44-L46
6c1e5afb46e6cf9c8f4d2fc8365a38c5fb7f407e
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/RSA.ets
arkts
verify2048PKCS1
2048位验签-PKCS1 @param signStr 已签名的字符串 @param verifyStr 需要验签的字符串 @param pubKey 2048位RSA公钥 @returns 验签结果OutDTO对象,其中Msg为验签结果
static async verify2048PKCS1(signStr: string, verifyStr: string, pubKey: string): Promise<string> { return CryptoUtil.verify(signStr, verifyStr, pubKey, 'RSA2048', 'RSA2048|PKCS1|SHA256', 2048); }
AST#method_declaration#Left static async verify2048PKCS1 AST#parameter_list#Left ( AST#parameter#Left signStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left verifyStr : AST#type_annotation#Left AST#primary_type#Left strin...
static async verify2048PKCS1(signStr: string, verifyStr: string, pubKey: string): Promise<string> { return CryptoUtil.verify(signStr, verifyStr, pubKey, 'RSA2048', 'RSA2048|PKCS1|SHA256', 2048); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/RSA.ets#L145-L147
7aa0a57556ed9ea3cfe89dc10707f0d161be433b
gitee
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets
arkts
hasLogged
判断当前是否已登录 @returns
hasLogged(): boolean { return this.loginInfo !== null; }
AST#method_declaration#Left hasLogged AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Le...
hasLogged(): boolean { return this.loginInfo !== null; }
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets#L38-L40
9009ed345ea2f794251697b138d17342bdb09230
github
yiyefangzhou24/hmwechat
27d11056003843c7e331e683478720d8efa49d17
entry/src/main/ets/default/model/data/MessageData.ets
arkts
聊天页面聊天记录结构 消息流向 主要有:发送/接收
export enum msgIO { //发送 Send , //接收 Recv }
AST#export_declaration#Left export AST#enum_declaration#Left enum msgIO AST#enum_body#Left { //发送 AST#enum_member#Left Send AST#enum_member#Right , //接收 AST#enum_member#Left Recv AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_declaration#Right
export enum msgIO { Send , Recv }
https://github.com/yiyefangzhou24/hmwechat/blob/27d11056003843c7e331e683478720d8efa49d17/entry/src/main/ets/default/model/data/MessageData.ets#L9-L14
2f6f32ed1439baeba42cf50b2b1b2856d33aee08
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/OneAutumn/entry/src/main/ets/model/CollectInfo.ets
arkts
收藏功能相关的请求参数
export class CollectQueryParam{ userId:number poemId:number constructor
AST#export_declaration#Left export AST#ERROR#Left class CollectQueryParam { userId : number poemId : number AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#variable_declarator#Right AST#variable_declaration#Right AST#export_declaration#Right
export class CollectQueryParam{ userId:number poemId:number constructor
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/OneAutumn/entry/src/main/ets/model/CollectInfo.ets#L13-L17
27d8d9f41a02598c164b2f06a1d9f6edfc250ca0
gitee
lime-zz/Ark-ui_RubbishRecycleApp.git
c2a9bff8fbb5bc46d922934afad0327cc1696969
rubbish/rubbish/entry/src/main/ets/pages/gerenxinxixiugai.ets
arkts
confirmSelection
确认选择操作
confirmSelection() { if (this.selectedIndex !== -1) { // 将选中的图片设置为当前头像 this.currentAvatar = this.datas[this.selectedIndex].img; // 关闭选择器 this.showSelector = false; this.selectedIndex = -1; // 重置选中索引 } }
AST#method_declaration#Left confirmSelection 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 this AST#expression#...
confirmSelection() { if (this.selectedIndex !== -1) { this.currentAvatar = this.datas[this.selectedIndex].img; this.showSelector = false; this.selectedIndex = -1; } }
https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/gerenxinxixiugai.ets#L298-L306
101c2d8136db9d7ad63bf3023770a5d056bfa9c9
github
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/view/Detail/DetailTypeDialog.ets
arkts
DetailTypeDialog
自定义弹窗组件,用户选择筛选模式
@CustomDialog export struct DetailTypeDialog { @Link detailType: string; @Link selectedMouth: string; @Link selectedYear: string; @Link startTime: number; @Link endTime: number; confirm: Function = () => {}; @State thisDetailType: string = ''; tabController: TabsController = new TabsController(); ...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct DetailTypeDialog AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right detailType : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#t...
@CustomDialog export struct DetailTypeDialog { @Link detailType: string; @Link selectedMouth: string; @Link selectedYear: string; @Link startTime: number; @Link endTime: number; confirm: Function = () => {}; @State thisDetailType: string = ''; tabController: TabsController = new TabsController(); ...
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/view/Detail/DetailTypeDialog.ets#L6-L325
a89c0c65ecc25e95c8143157d677393a96b94bb4
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PreviewUtil.ets
arkts
getTypeDescriptor
根据文件后缀名获取TypeDescriptor(标准化数据类型的描述类) @param fileExtention 文件后缀名,例如:html txt doc ts mp3
static getTypeDescriptor(fileExtention: string): uniformTypeDescriptor.TypeDescriptor { const dataType = uniformTypeDescriptor.getUniformDataTypeByFilenameExtension(`.${fileExtention}`); const typeDescriptor = uniformTypeDescriptor.getTypeDescriptor(dataType); return typeDescriptor; }
AST#method_declaration#Left static getTypeDescriptor AST#parameter_list#Left ( AST#parameter#Left fileExtention : 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#qua...
static getTypeDescriptor(fileExtention: string): uniformTypeDescriptor.TypeDescriptor { const dataType = uniformTypeDescriptor.getUniformDataTypeByFilenameExtension(`.${fileExtention}`); const typeDescriptor = uniformTypeDescriptor.getTypeDescriptor(dataType); return typeDescriptor; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreviewUtil.ets#L130-L134
6c80d1a1a5c128b0dadafa853468f2e0eb2adf74
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customscan/src/main/ets/model/ScanSize.ets
arkts
折叠状态
constructor() { this.isLandscape = false; this.orientation = display.Orientation.PORTRAIT; this.foldStatus = display.FoldStatus.FOLD_STATUS_UNKNOWN; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isLandscape AST#memb...
constructor() { this.isLandscape = false; this.orientation = display.Orientation.PORTRAIT; this.foldStatus = display.FoldStatus.FOLD_STATUS_UNKNOWN; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customscan/src/main/ets/model/ScanSize.ets#L43-L47
0ad38323c5ee7afb2f2cb71a19cf4df90b872bd7
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/AIAssistantService.ets
arkts
联系人关系接口
export interface ContactRelationship { contactId: string; relationship: string; intimacyLevel: number; interactionFrequency: number; lastInteraction: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ContactRelationship AST#object_type#Left { AST#type_member#Left contactId : 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 relationship : AST#t...
export interface ContactRelationship { contactId: string; relationship: string; intimacyLevel: number; interactionFrequency: number; lastInteraction: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L139-L145
fc9c368906c0f07e93c093aa54e9276c5e5e6aa6
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/pages/VerifyPage.ets
arkts
promptTextStyle
TODO
@Extend(Text) function promptTextStyle() { .fontSize($r('app.float.small_text_size')) .width(CommonConstants.FULL_PARENT) .padding({ left: $r('app.float.verify_padding'), right: $r('app.float.verify_padding') }) }
AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Text AST#expression#Right ) AST#decorator#Right function promptTextStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . fontSize ( AST#expression#Left AST#...
@Extend(Text) function promptTextStyle() { .fontSize($r('app.float.small_text_size')) .width(CommonConstants.FULL_PARENT) .padding({ left: $r('app.float.verify_padding'), right: $r('app.float.verify_padding') }) }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/pages/VerifyPage.ets#L5-L13
a84e42241fc7f209c113e1469ae6d976658c9c99
gitee