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
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/home/result.ets
arkts
控制加载提示的显示
build() { Column() { this.topReturn()//顶部 Scroll(){ Column() { Column() { Row() { Text('腹部').fontSize(25) }.width('100%') Row() { Text('12课程').fontSize(15) }.width('100%') }.width('100%').justifyContent(FlexAlign.Star...
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#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#L...
build() { Column() { this.topReturn() Scroll(){ Column() { Column() { Row() { Text('腹部').fontSize(25) }.width('100%') Row() { Text('12课程').fontSize(15) }.width('100%') }.width('100%').justifyContent(FlexAlign.Start).p...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/home/result.ets#L108-L132
702eeff7c4a67a9fda378c9373e1af5ee012a9f5
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets
arkts
fixImageMove
Image move fix. @param rotated @param flipImage @returns offset.
static fixImageMove(rotated: Array<Point>, flipImage: RectF): Array<number> { let offsetX = 0; let offsetY = 0; for (let point of rotated) { if (point.x < flipImage.left) { offsetX = Math.min(offsetX, point.x - flipImage.left); } else if (point.x > flipImage.right) { offsetX = Ma...
AST#method_declaration#Left static fixImageMove AST#parameter_list#Left ( AST#parameter#Left rotated : 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 Point AST#primary_type#Right AST#type_annotation#Right > AST#type_arg...
static fixImageMove(rotated: Array<Point>, flipImage: RectF): Array<number> { let offsetX = 0; let offsetY = 0; for (let point of rotated) { if (point.x < flipImage.left) { offsetX = Math.min(offsetX, point.x - flipImage.left); } else if (point.x > flipImage.right) { offsetX = Ma...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets#L238-L254
a022969c932e3e3d21236e96c236021a9ceaed9e
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/http/HttpRequestDownload/entry/src/main/ets/pages/Index.ets
arkts
login
模拟登录
login() { //http请求对象 let httpRequest = http.createHttp(); //请求的登录名和密码参数 let params = "username=" + this.loginName + "&password=" + this.passwd let opt: http.HttpRequestOptions = { method: http.RequestMethod.POST, extraData: params, header: { 'Content-Type': 'application/x-www-form...
AST#method_declaration#Left login AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { //http请求对象 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left httpRequest = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#exp...
login() { let httpRequest = http.createHttp(); let params = "username=" + this.loginName + "&password=" + this.passwd let opt: http.HttpRequestOptions = { method: http.RequestMethod.POST, extraData: params, header: { 'Content-Type': 'application/x-www-form-urlencoded' }, e...
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/http/HttpRequestDownload/entry/src/main/ets/pages/Index.ets#L191-L219
1332b0b8c444526d5ac8da91df5acd9103eb36f4
gitee
queueit/harmony-sdk.git
ba7b4b38c03730bfbe305789acba6db0012d5f5c
queueit_sdk/src/main/ets/main/QueueItEngine.ets
arkts
runWithConnection
--- Internal Logic ---
private async runWithConnection(enqueueToken?: string, enqueueKey?: string): Promise<void> { try { const queueITWaitingRoomProviderResult = await this.provider.tryEnqueue(enqueueToken, enqueueKey); Logger.debug(QueueItEngine.TAG, `checkResult: ${JSON.stringify(queueITWaitingRoomProviderR...
AST#method_declaration#Left private async runWithConnection AST#parameter_list#Left ( AST#parameter#Left enqueueToken ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left enqueueKey ? : AST#type_annotation#Left AST#primary_ty...
private async runWithConnection(enqueueToken?: string, enqueueKey?: string): Promise<void> { try { const queueITWaitingRoomProviderResult = await this.provider.tryEnqueue(enqueueToken, enqueueKey); Logger.debug(QueueItEngine.TAG, `checkResult: ${JSON.stringify(queueITWaitingRoomProviderR...
https://github.com/queueit/harmony-sdk.git/blob/ba7b4b38c03730bfbe305789acba6db0012d5f5c/queueit_sdk/src/main/ets/main/QueueItEngine.ets#L130-L155
c74489c67071c2180321c3a4ff6af6f9718b8179
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/personal/UserPostsPage.ets
arkts
onPullDownRefresh
下拉刷新
onPullDownRefresh() { if (this.isRefreshing || this.isLoadingMore) { return; } this.loadData(true); }
AST#method_declaration#Left onPullDownRefresh AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#exp...
onPullDownRefresh() { if (this.isRefreshing || this.isLoadingMore) { return; } this.loadData(true); }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/personal/UserPostsPage.ets#L123-L128
55bae3c1c44d1cc47a4c708369e409dc2bc5b42e
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
eftool/src/main/ets/device/keyboard/TypeWritingUtil.ets
arkts
@Component export struct TypeWritingUtil { @Link text: string @State curIndex: number = 0 @State placeholderText: string = '请输入值' @State inputText: string = '' //字母输入区 @State inputTextHanzi: string[] = [] //汉字候选区 @State enChina: boolean = false //是否中英文false = 英文,true=中文 @State isUp: 0 | 1 | 2 = 0 //是否大小写 0=小写,1=短时大写,2...
export class keyValue { key: ResourceStr = '' value: ResourceStr = '' }
AST#export_declaration#Left export AST#class_declaration#Left class keyValue AST#class_body#Left { AST#property_declaration#Left key AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right value AST#ERROR#...
export class keyValue { key: ResourceStr = '' value: ResourceStr = '' }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/device/keyboard/TypeWritingUtil.ets#L1509-L1512
0fb4dd457f309f7afd5d0192f63ca1a1b10f9eb8
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/blocks/modules/meowWebView.ets
arkts
align_rules_main_tab
Kind of constants
align_rules_main_tab() { let align: AlignRuleOption; if (this.tablet_mode) { align = { left: { anchor: "__container__", align: HorizontalAlign.Start } } } else { align = { top: { anchor: "__container__", align: VerticalAlign.Top } } } return align; }
AST#method_declaration#Left align_rules_main_tab AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left align : AST#type_annotation#Left AST#primary_type#Left AlignRuleOption AST#primary_type#Right AST#type_annota...
align_rules_main_tab() { let align: AlignRuleOption; if (this.tablet_mode) { align = { left: { anchor: "__container__", align: HorizontalAlign.Start } } } else { align = { top: { anchor: "__container__", align: VerticalAlign.Top } } } return align; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowWebView.ets#L798-L806
52a2a9fd69f3783325b65518309bc7e6bcff6f33
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/utils/DateUtils.ets
arkts
dateToTimestamp
日期转时间戳
static dateToTimestamp(date: Date): number { return date.getTime(); }
AST#method_declaration#Left static dateToTimestamp AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date 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#primary_t...
static dateToTimestamp(date: Date): number { return date.getTime(); }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/utils/DateUtils.ets#L67-L69
f8533ce404322d848ca1f92e5e409d122c6c95d5
github
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/components/JhPickerTool.ets
arkts
isMultiStringArray
是否是多维字符串数组 @param arr @returns
public static isMultiStringArray(arr: ESObject[]) { // 如果不是数组,直接返回 false if (!Array.isArray(arr)) { return false } // 检查数组中的每个元素是否是字符串数组 return arr.every((item: ESObject): boolean => JhPickerTool.isOneStringArray(item)) }
AST#method_declaration#Left public static isMultiStringArray AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ESObject [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_s...
public static isMultiStringArray(arr: ESObject[]) { if (!Array.isArray(arr)) { return false } return arr.every((item: ESObject): boolean => JhPickerTool.isOneStringArray(item)) }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhPickerTool.ets#L251-L258
56535dff3c2294c2f4632485ce47a193e0d29eea
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/RandomUtil.ets
arkts
getRandomChineseChar
生成一个随机汉字('\u4E00'-'\u9FFF') @return 随机的汉字字符
static getRandomChineseChar(): string { const start = 0x4E00; //汉字起始Unicode编码,'\u4E00' const end = 0x9FFF; //汉字结束Unicode编码,'\u9FFF' const randomCode = start + Math.floor(Math.random() * (end - start + 1)); //生成一个随机码点 return String.fromCharCode(randomCode); //将随机码点转换为对应的汉字字符 }
AST#method_declaration#Left static getRandomChineseChar AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#...
static getRandomChineseChar(): string { const start = 0x4E00; const end = 0x9FFF; const randomCode = start + Math.floor(Math.random() * (end - start + 1)); return String.fromCharCode(randomCode); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/RandomUtil.ets#L68-L73
7d944a98312c804715c245d742db78d36c506455
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/analytics/AnalyticsService.ets
arkts
年龄分布数据接口
export interface AgeDistribution { ageGroup: string; count: number; percentage: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AgeDistribution AST#object_type#Left { AST#type_member#Left ageGroup : 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 count : AST#type_annotati...
export interface AgeDistribution { ageGroup: string; count: number; percentage: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AnalyticsService.ets#L22-L26
f89b066c277d4706561297150425adaacfa7723d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/multicolumndisplay/src/main/ets/data/ProductDataFormat.ets
arkts
首页瀑布流列表信息
export class ProductInfo { // id号 id: number; // 图片地址 imageSrc: ResourceStr; // 商品类型 type: string; // 标题 name?: string; // 描述信息 description?: string; constructor(id: number, imageSrc: ResourceStr, type: string, name?: string, description?: string) { this.id = id; this.imageSrc = imageSrc;...
AST#export_declaration#Left export AST#class_declaration#Left class ProductInfo AST#class_body#Left { // id号 AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 图片地址 AST#property_declaration#Left im...
export class ProductInfo { id: number; imageSrc: ResourceStr; type: string; name?: string; description?: string; constructor(id: number, imageSrc: ResourceStr, type: string, name?: string, description?: string) { this.id = id; this.imageSrc = imageSrc; this.type = type; this....
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multicolumndisplay/src/main/ets/data/ProductDataFormat.ets#L19-L38
e3edeb06e1917cfbee6d46c29acd825a41e8714c
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/DataModel.ets
arkts
A subclass inheriting from BasicDataSource has overridden the methods.
export class TopTabContent extends BasicDataSource { private tabContent: string[] = []; // Get the length of the array. public totalCount(): number { return this.tabContent.length; } // Retrieve data at the specified index. public getData(index: number): string { return this.tabContent[index]; }...
AST#export_declaration#Left export AST#class_declaration#Left class TopTabContent extends AST#type_annotation#Left AST#primary_type#Left BasicDataSource AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left private tabContent : AST#type_annotation#Left AST#primary_type#Lef...
export class TopTabContent extends BasicDataSource { private tabContent: string[] = []; public totalCount(): number { return this.tabContent.length; } public getData(index: number): string { return this.tabContent[index]; } public addData(index: number, data: string): void { this.tab...
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/DataModel.ets#L51-L79
650a507a4e55a55cf4e0ab81f82e74f24cce2439
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/PermissionUtils.ets
arkts
使用UIExtensionAbility:将common.UIAbilityContext 替换为common.UIExtensionContext
export function reqPermissionsFromUser(permissions: Permissions[], context: common.UIAbilityContext): void { // 1. 创建应用权限管理器 let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); // 2. 拉起弹框请求用户授权 requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 atManager.requestPermissionsFromUser(conte...
AST#export_declaration#Left export AST#function_declaration#Left function reqPermissionsFromUser AST#parameter_list#Left ( AST#parameter#Left permissions : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Permissions [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#paramet...
export function reqPermissionsFromUser(permissions: Permissions[], context: common.UIAbilityContext): void { let atManager: abilityAccessCtrl.AtManager = abilityAccessCtrl.createAtManager(); atManager.requestPermissionsFromUser(context, permissions).then((data) => { let grantStatus: number[] = data.authRe...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/UserFile/UserFileURI/entry/src/main/ets/common/PermissionUtils.ets#L67-L92
f4c498a8164f78f23766aaf4fa24a782b7cecff9
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxGroupIndicator.ets
arkts
CheckboxGroupIndicatorBuilder
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...
@Builder export function CheckboxGroupIndicatorBuilder(name: string, param: Object) { CheckboxGroupIndicatorExample() }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function CheckboxGroupIndicatorBuilder AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parame...
@Builder export function CheckboxGroupIndicatorBuilder(name: string, param: Object) { CheckboxGroupIndicatorExample() }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/checkbox/checkboxGroupIndicator.ets#L16-L19
eb909b8b52a9c776603c967072ba0d8bf51cf51d
gitee
huang7855196/ArkTs-iLearn.git
08590adaca7a58d5284416ba5cfc09117122af84
HomeModule/src/main/ets/components/HomeDayQuestionComp.ets
arkts
HomeDayQuestionComp
import { HmCalendar, HmCalendarType } from '@ohmos/calendar'
@Component export struct HomeDayQuestionComp { monthWords: string[] = [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ] monthText: string = this.monthWords[new Date().getMonth()] today: string = new Date().getDate().toString()....
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct HomeDayQuestionComp AST#component_body#Left { AST#property_declaration#Left monthWords : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#ty...
@Component export struct HomeDayQuestionComp { monthWords: string[] = [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ] monthText: string = this.monthWords[new Date().getMonth()] today: string = new Date().getDate().toString()....
https://github.com/huang7855196/ArkTs-iLearn.git/blob/08590adaca7a58d5284416ba5cfc09117122af84/HomeModule/src/main/ets/components/HomeDayQuestionComp.ets#L3-L74
bc92aefebcd104e226bed78151ad05f0c16e3842
github
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/pages/complex_share.ets
arkts
autoFillForm
自动填充表单(提取到信息后自动调用)
private autoFillForm() { if (this.extractedApps.length === 0) { return; } // 获取第一个应用信息 const app = this.extractedApps[0]; // 填充链接 if (app.link && !this.formData.appLink) { this.formData.appLink = app.link; } // 填充包名 if (ap...
AST#method_declaration#Left private autoFillForm AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#...
private autoFillForm() { if (this.extractedApps.length === 0) { return; } const app = this.extractedApps[0]; if (app.link && !this.formData.appLink) { this.formData.appLink = app.link; } if (app.packageName && !this.for...
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/pages/complex_share.ets#L502-L532
3034069212144e82ec5cc6e8ea354c40326a7ccb
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/entity/SelectedGoods.ets
arkts
@file 已选商品项模型 用于规格选择后返回的数据,表示用户选择的单个商品规格项 @author Joker.X
export class SelectedGoods { /** * 商品ID */ goodsId: number = 0; /** * 商品信息 */ goodsInfo?: Goods | null = null; /** * 规格 */ spec?: GoodsSpec | null = null; /** * 数量 */ count: number = 0; /** * @param {Partial<SelectedGoods>} init - 初始化数据 */ constructor(init?: Partial<Se...
AST#export_declaration#Left export AST#class_declaration#Left class SelectedGoods AST#class_body#Left { /** * 商品ID */ AST#property_declaration#Left goodsId : 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#pr...
export class SelectedGoods { goodsId: number = 0; goodsInfo?: Goods | null = null; spec?: GoodsSpec | null = null; count: number = 0; constructor(init?: Partial<SelectedGoods>) { if (!init) { return; } this.goodsId = init.goodsId ?? this.goodsId; this.goodsInfo = init.goo...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/SelectedGoods.ets#L10-L40
79e269efb9577980e8ea7affa2f69839e03bda6f
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets
arkts
notifyDataDelete
通知LazyForEach组件需要在index对应索引处删除该子组件 @param {number} index - 索引值。
notifyDataDelete(index: double): void { this.listeners.forEach(listener => { listener.onDataDelete(index); }) }
AST#method_declaration#Left notifyDataDelete AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left double AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R...
notifyDataDelete(index: double): void { this.listeners.forEach(listener => { listener.onDataDelete(index); }) }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example1/DataType.ets#L128-L132
6e7d1725e03e144d1efd4bb76df291c24b8f8d29
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildDelete.ets
arkts
scheduleForDeletion
应用约束10: 显式指定参数类型
private scheduleForDeletion(id: string): void { // 应用约束30: 使用as进行类型断言 this.client.setTimeout( () => this.deleted.delete(id), this.client.options.restWsBridgeTimeout as number ); }
AST#method_declaration#Left private scheduleForDeletion AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
private scheduleForDeletion(id: string): void { this.client.setTimeout( () => this.deleted.delete(id), this.client.options.restWsBridgeTimeout as number ); }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildDelete.ets#L59-L65
1fad3d011d637c8ec8f77f5c4457424e475a72e0
github
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegCommandBuilder.ets
arkts
FFmpeg 命令构建器 链式 API 构建复杂的 FFmpeg 命令,供高级用户定制使用 @author panruiqi @version 2.0.0 FFmpeg 命令构建器 @example ```typescript const cmd = new FFmpegCommandBuilder() .input('/path/to/input.mp4') .hwaccel() .filter('scale=1280:720') .videoCodec('libx264') .videoBitrate('2M') .output('/path/to/output.mp4') .build(); ```
export class FFmpegCommandBuilder { private static readonly HW_CODEC: string = 'h264_ohosavcodec'; private inputFiles: string[] = []; private outputPath: string = ''; private useHwDecode: boolean = false; private useHwEncode: boolean = false; private filters: string[] = []; private vCodec: string = ''; ...
AST#export_declaration#Left export AST#class_declaration#Left class FFmpegCommandBuilder AST#class_body#Left { AST#property_declaration#Left private static readonly HW_CODEC : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'h264_ohosavcodec' ...
export class FFmpegCommandBuilder { private static readonly HW_CODEC: string = 'h264_ohosavcodec'; private inputFiles: string[] = []; private outputPath: string = ''; private useHwDecode: boolean = false; private useHwEncode: boolean = false; private filters: string[] = []; private vCodec: string = ''; ...
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegCommandBuilder.ets#L24-L261
3f3c0c241430c010491f59c1e744d9cf0aeeb4a5
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/textoverflow/src/main/ets/components/model/TextFlowMode.ets
arkts
设定需要动态监听的model,以便于添加评论时,实现数据的动态监听从而进行lazyForeach懒加载。
export class CommentData extends BasicDataSource { // 懒加载数据 private comments: Array<CommentModel> = []; // 获取懒加载数据源的数据长度 totalCount(): number { return this.comments.length; } // 获取指定数据项 getData(index: number): CommentModel { return this.comments[index]; } // 获取指定数据项 getParentData(parentId...
AST#export_declaration#Left export AST#class_declaration#Left class CommentData extends AST#type_annotation#Left AST#primary_type#Left BasicDataSource AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { // 懒加载数据 AST#property_declaration#Left private comments : AST#type_annotation#Left AST#primary_typ...
export class CommentData extends BasicDataSource { private comments: Array<CommentModel> = []; totalCount(): number { return this.comments.length; } getData(index: number): CommentModel { return this.comments[index]; } getParentData(parentId: string): CommentModel | null { for (le...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/textoverflow/src/main/ets/components/model/TextFlowMode.ets#L115-L155
e205f24c6e9aa14e3fb261524a2aeb3dbb5c01e2
gitee
anhao0226/harmony-music-player.git
4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073
entry/src/main/ets/view_models/ArtistDetailModel.ets
arkts
ArtistMvModel
export class ArtistMvModel { id: number; name: string; imgurl: string; duration: number; publishTime: number; imgurl16v9: string; formJson(json: any): ArtistMvModel { this.id = json['id']; this.name = json['name']; this.imgurl = json['imgurl']; this.duration = json['duration']; this.p...
AST#export_declaration#Left export AST#class_declaration#Left class ArtistMvModel AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left name : AST#type...
export class ArtistMvModel { id: number; name: string; imgurl: string; duration: number; publishTime: number; imgurl16v9: string; formJson(json: any): ArtistMvModel { this.id = json['id']; this.name = json['name']; this.imgurl = json['imgurl']; this.duration = json['duration']; this.p...
https://github.com/anhao0226/harmony-music-player.git/blob/4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073/entry/src/main/ets/view_models/ArtistDetailModel.ets#L55-L72
c1ca6c2dfe69c01c9235e314aef17bb99ab55170
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BarDataSet.ets
arkts
getGradients
This method is deprecated. Use getFills() instead.
public getGradients(): JList<Fill> | null { return this.mFills; }
AST#method_declaration#Left public getGradients AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#generic_type#Left JList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Fill AST#primary_type#Right AST#type_annotation#R...
public getGradients(): JList<Fill> | null { return this.mFills; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L93-L95
dfff5174aef5043005f816aac56fa82ea1a52933
gitee
wcmzllx/axis-render
34a330085691968cf1c132095e5ce078aa7ee933
AxisRenderLibrary/src/main/ets/common/AxisRender.ets
arkts
setCallBackInterval
设置回调间隔, 以小格子为单位,默认1/10小刻度回调一次 示例:0.2 ,即2/10刻度回调一次 @param interval 回调间隔
setCallBackInterval(interval: number) { this.getInstance().setCallBackInterval(interval) }
AST#method_declaration#Left setCallBackInterval AST#parameter_list#Left ( AST#parameter#Left interval : 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#builder_function_body#Left { AST#expression_statement#Left AST...
setCallBackInterval(interval: number) { this.getInstance().setCallBackInterval(interval) }
https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L338-L340
7b2ce58655d1e0606a3ae92d6a45aa4f90a1a56b
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
update_loading_progress
Asks the tab to update its loading progress, usually called in the tab's loading progress.
update_loading_progress(progress: number) { this.loading_progress = progress; return progress; }
AST#method_declaration#Left update_loading_progress AST#parameter_list#Left ( AST#parameter#Left progress : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_s...
update_loading_progress(progress: number) { this.loading_progress = progress; return progress; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L856-L859
dcef064998af35a7ea1cc2742ecf9cdf5607b639
gitee
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/manager/OtaUpdateManager.ets
arkts
getStateObj
取状态对象 @param status 状态
getStateObj(status: number): BaseState { if (this.stateObj?.state === status) { return this.stateObj; } else { return StateManager.createInstance(status); } }
AST#method_declaration#Left getStateObj AST#parameter_list#Left ( AST#parameter#Left status : 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 BaseState AST#primary_type#...
getStateObj(status: number): BaseState { if (this.stateObj?.state === status) { return this.stateObj; } else { return StateManager.createInstance(status); } }
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L271-L277
687378f86689ece29b69a48fb8ad4fe419a49a05
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/module_city_select/src/main/ets/common/Utils.ets
arkts
日志类
export class Logger { private static domain: number; private static prefix: string; private static format: string = '%{public}s'; constructor(prefix: string = '[HouseholdTemplate]', domain: number = 0xFF00) { Logger.prefix = prefix; Logger.domain = domain; } static debug(...args: Object[]): void {...
AST#export_declaration#Left export AST#class_declaration#Left class Logger AST#class_body#Left { AST#property_declaration#Left private static domain : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left pri...
export class Logger { private static domain: number; private static prefix: string; private static format: string = '%{public}s'; constructor(prefix: string = '[HouseholdTemplate]', domain: number = 0xFF00) { Logger.prefix = prefix; Logger.domain = domain; } static debug(...args: Object[]): void {...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/module_city_select/src/main/ets/common/Utils.ets#L32-L57
6cee6198959bb7d81dbb186ef46553ce70b35660
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/editaddress/src/main/ets/common/CommonConstants.ets
arkts
Common constants for common component.
export default class CommonConstants { // opacity static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static readonly HALF_OPACITY: number = 0.5; // space static readonly SPACE_4: number = 4; static readonly SPACE_8: number = 8; static readonly SPACE_12...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { // opacity AST#property_declaration#Left static readonly FIRST_LEVEL_OPACITY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0....
export default class CommonConstants { static readonly FIRST_LEVEL_OPACITY: number = 0.9; static readonly SECOND_LEVEL_OPACITY: number = 0.6; static readonly HALF_OPACITY: number = 0.5; static readonly SPACE_4: number = 4; static readonly SPACE_8: number = 8; static readonly SPACE_12: number = 12; ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/editaddress/src/main/ets/common/CommonConstants.ets#L19-L97
071486fff6af4e722d47dabe724bae014cbd4975
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
loadUrl_onWorkingTab
Operations and Actions Loads a link on the current main tab. @description Will load url_default_blank() if the home_url of this bunch_of_tabs is not set.
loadUrl_onWorkingTab(url: string) { url = url_meow_to_resource(url); console.log('[bunch_of_tabs][loadUrl_onWorkingTab] ' + url); this.Tabs[this.main_tab_idx].controller?.loadUrl(url); }
AST#method_declaration#Left loadUrl_onWorkingTab 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_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#exp...
loadUrl_onWorkingTab(url: string) { url = url_meow_to_resource(url); console.log('[bunch_of_tabs][loadUrl_onWorkingTab] ' + url); this.Tabs[this.main_tab_idx].controller?.loadUrl(url); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L63-L67
a6c47cbaa8ba1f21272e7989a03ff08ddf09c7fc
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/CommonModel.ets
arkts
Topic Information.
export class TopicInfo { topicId: string; title: Resource; viewCount: string; constructor(topicId: string, title: Resource, viewCount: string) { this.topicId = topicId; this.title = title; this.viewCount = viewCount; } }
AST#export_declaration#Left export AST#class_declaration#Left class TopicInfo AST#class_body#Left { AST#property_declaration#Left topicId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left title : AST#ty...
export class TopicInfo { topicId: string; title: Resource; viewCount: string; constructor(topicId: string, title: Resource, viewCount: string) { this.topicId = topicId; this.title = title; this.viewCount = viewCount; } }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/CommonModel.ets#L71-L81
48bfb3330e283193a224791a22a94bd03c08b935
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/contacts/ContactEditPage.ets
arkts
buildBirthdaySection
构建生日信息区域
@Builder buildBirthdaySection() { Column({ space: 16 }) { Text('生日信息') .fontSize(20) .fontWeight(FontWeight.Bold) .fontColor('#333333') .alignSelf(ItemAlign.Start) // 生日类型选择 Column({ space: 8 }) { Text('生日类型') .fontSize(16) .font...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBirthdaySection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen...
@Builder buildBirthdaySection() { Column({ space: 16 }) { Text('生日信息') .fontSize(20) .fontWeight(FontWeight.Bold) .fontColor('#333333') .alignSelf(ItemAlign.Start) Column({ space: 8 }) { Text('生日类型') .fontSize(16) .fontColor('#3...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/contacts/ContactEditPage.ets#L515-L571
6e4c2a8c28655d11e2ae153cb76911c56a9f74b7
github
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/pages/IntroductionPage.ets
arkts
pageTransition
The transition animation from page to page.
pageTransition() { PageTransitionEnter({ duration: Const.SHARED_DURATION }) .slide(SlideEffect.Bottom) .scale({ x: 0, y: 0, z: 0, centerX: Const.HALF_PERCENT, centerY: Const.HALF_PERCENT }) PageTransitionExit({ delay: Const.SWIPER_DURATION }) .slid...
AST#method_declaration#Left pageTransition 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 PageTransitionEnter ( AST#component_parameters#Left { AST#component_parameter#Left duration : AST#expression...
pageTransition() { PageTransitionEnter({ duration: Const.SHARED_DURATION }) .slide(SlideEffect.Bottom) .scale({ x: 0, y: 0, z: 0, centerX: Const.HALF_PERCENT, centerY: Const.HALF_PERCENT }) PageTransitionExit({ delay: Const.SWIPER_DURATION }) .slid...
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/pages/IntroductionPage.ets#L117-L136
e20b8d13e0dd793b5a207734a0411a9edc4d46b8
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Sounds/Cloud/CSoundDbAccessor/CSoundDbAccessor.ets
arkts
createCSoundFromRs
MARK: - 结果集转换
private createCSoundFromRs(rs: relationalStore.ResultSet): CDBSound { const sound = new CDBSound(); sound.idxx = rs.getLong(rs.getColumnIndex(Tables.CSound.Col.idxx)); sound.lang = ResultSetTool.decodeString(rs, Tables.CSound.Col.lang); sound.text = ResultSetTool.decodeString(rs, Tables.CSound.Col.text)...
AST#method_declaration#Left private createCSoundFromRs AST#parameter_list#Left ( AST#parameter#Left rs : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ResultSet AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#R...
private createCSoundFromRs(rs: relationalStore.ResultSet): CDBSound { const sound = new CDBSound(); sound.idxx = rs.getLong(rs.getColumnIndex(Tables.CSound.Col.idxx)); sound.lang = ResultSetTool.decodeString(rs, Tables.CSound.Col.lang); sound.text = ResultSetTool.decodeString(rs, Tables.CSound.Col.text)...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/CSoundDbAccessor/CSoundDbAccessor.ets#L139-L146
b3152b1fb7d64974248527570893e1acd27b2387
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/common/utils/DateUtils.ets
arkts
getTodayKey
获取今天的日期键(用于数据存储) @returns YYYY-MM-DD 格式的今天日期键
static getTodayKey(): string { return DateUtils.formatDate(new Date(), 'YYYY-MM-DD'); }
AST#method_declaration#Left static getTodayKey AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_express...
static getTodayKey(): string { return DateUtils.formatDate(new Date(), 'YYYY-MM-DD'); }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/utils/DateUtils.ets#L37-L39
c12a37ceb49f8c9747f5da0bc947e660785c116b
github
fourseas1998/hos.RankingDemo.git
5a98167826252c3c2b5ac58fa9a3db29d5f49d02
entry/src/main/ets/view/ListItemComponent.ets
arkts
NormalText
排行-非前三个的容器样式
@Builder NormalText(){ Text(this.index.toString()) .width(ListItemComponentStyle.TEXT_RANKING_SIZE) .lineHeight(ListItemComponentStyle.TEXT_RANKING_SIZE) .fontWeight(FontWeight.Bold) .fontSize(FontSize.SMALL) .textAlign(TextAlign.Center) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right NormalText AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#call_expression#Left AST#express...
@Builder NormalText(){ Text(this.index.toString()) .width(ListItemComponentStyle.TEXT_RANKING_SIZE) .lineHeight(ListItemComponentStyle.TEXT_RANKING_SIZE) .fontWeight(FontWeight.Bold) .fontSize(FontSize.SMALL) .textAlign(TextAlign.Center) }
https://github.com/fourseas1998/hos.RankingDemo.git/blob/5a98167826252c3c2b5ac58fa9a3db29d5f49d02/entry/src/main/ets/view/ListItemComponent.ets#L82-L89
36de67cf1793ca18dabba1b3106d0a61bbacfb9a
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/login/ResetPasswordView.ets
arkts
/ 参数类型
export interface Param { email: string }
AST#export_declaration#Left export AST#interface_declaration#Left interface Param AST#object_type#Left { AST#type_member#Left email : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right } AST#object_type#Right AST#interface_declaration#Right AST#e...
export interface Param { email: string }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/login/ResetPasswordView.ets#L24-L26
c0402255d226aeb3e28979851ee3d9735377082c
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets
arkts
getData
获取指定索引数据 @param index @returns
public getData(index: number): Comment { return this.commentArray[index]; }
AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Comment AST#primary_type#...
public getData(index: number): Comment { return this.commentArray[index]; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets#L47-L49
c6d5a08ab40e843f3edaf81fe37991dfb2d48db1
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/feedback/src/main/ets/navigation/FeedbackGraph.ets
arkts
register
注册反馈模块导航路由
register(): void { RouteBuild.register(FeedbackRoutes.List, wrapBuilder(FeedbackListNav)); RouteBuild.register(FeedbackRoutes.Submit, wrapBuilder(FeedbackSubmitNav)); }
AST#method_declaration#Left register AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left...
register(): void { RouteBuild.register(FeedbackRoutes.List, wrapBuilder(FeedbackListNav)); RouteBuild.register(FeedbackRoutes.Submit, wrapBuilder(FeedbackSubmitNav)); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/feedback/src/main/ets/navigation/FeedbackGraph.ets#L14-L17
bfd7dcca525680652051f305e3de8233b94889f1
github
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/action/ToastUtil.ets
arkts
showLong
弹出土司,时长为:10s,距离底部默认为80vp @param message 提示消息 @param options (距离屏幕底部的位置、是否显示在应用之上)
static showLong(message: string | Resource, options: ToastOptions = new ToastOptions()) { if (message || (typeof message === 'string' && message.length > 0)) { options = ToastUtil.initToastDefault(options, 2); let toastOptions = options as promptAction.ShowToastOptions; toastOptions.message = mess...
AST#method_declaration#Left static showLong AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ,...
static showLong(message: string | Resource, options: ToastOptions = new ToastOptions()) { if (message || (typeof message === 'string' && message.length > 0)) { options = ToastUtil.initToastDefault(options, 2); let toastOptions = options as promptAction.ShowToastOptions; toastOptions.message = mess...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/action/ToastUtil.ets#L75-L82
c2ba4b638b17ed9ea63237739f12cf1e0986d656
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ResUtil.ets
arkts
isRawDir
用户判断指定路径是否是rawfile下的目录(true:表示是rawfile下的目录,false:表示不是rawfile下的目录) @param path rawfile路径。 @returns
static isRawDir(path: string): boolean { return ResUtil.getResourceManager().isRawDir(path); }
AST#method_declaration#Left static isRawDir AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#...
static isRawDir(path: string): boolean { return ResUtil.getResourceManager().isRawDir(path); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L566-L568
4b034cbce9576ba49d81bb14524ad9dbb2fde61b
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/DailySummary.ets
arkts
toRow
Convert to database row format
toRow(): DailySummaryData { return { date: this.date, summary: this.summary, key_topics: JSON.stringify(this.keyTopics), tasks_created: this.tasksCreated, memos_created: this.memosCreated, mood_trend: this.moodTrend, timestamp: this.timestamp }; }
AST#method_declaration#Left toRow AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left DailySummaryData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#...
toRow(): DailySummaryData { return { date: this.date, summary: this.summary, key_topics: JSON.stringify(this.keyTopics), tasks_created: this.tasksCreated, memos_created: this.memosCreated, mood_trend: this.moodTrend, timestamp: this.timestamp }; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/DailySummary.ets#L91-L101
451abe26ffae84900a32ce09bed15fd7eabb7ea5
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/url_tools.ets
arkts
Domains that can be loaded and displayed in web components @returns ['http', 'https', 'meow', 'resource', 'file']
export function viewable_domains() { return ['http', 'https', 'meow', 'resource', 'file']; }
AST#export_declaration#Left export AST#function_declaration#Left function viewable_domains AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#array_literal#Left [ AST#expression#Left 'http' AST#expression#Right , AS...
export function viewable_domains() { return ['http', 'https', 'meow', 'resource', 'file']; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/url_tools.ets#L301-L303
1ce5e59c7d577a8b60a59eec195c5f778f63f330
gitee
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets
arkts
数字管家服务端调用类
export class DistScheduleService { // static distScheduleServer: string = "http://81.71.17.188:8080/distschedule-api" static distScheduleServer: string = "http://139.9.102.131:8080/distschedule-api" static readTimeout: number = 3000 static connectTimeout: number = 3000 /** * 根据手机号,获取用户信息 * @param phone...
AST#export_declaration#Left export AST#class_declaration#Left class DistScheduleService AST#class_body#Left { // static distScheduleServer: string = "http://81.71.17.188:8080/distschedule-api" AST#property_declaration#Left static distScheduleServer : AST#type_annotation#Left AST#primary_type#Left string AST#primary_typ...
export class DistScheduleService { static distScheduleServer: string = "http://139.9.102.131:8080/distschedule-api" static readTimeout: number = 3000 static connectTimeout: number = 3000 static async getUserInfo(phone: string) { let httpRequest = http.createHttp(); let data = await httpRequest.r...
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets#L37-L452
3d4b6121b7f3e684dee01c89280b92017cbf69d9
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/constants/LayoutPercent.ets
arkts
10% 百分比
export const P10: string = "10%";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left P10 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "10%" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right...
export const P10: string = "10%";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/constants/LayoutPercent.ets#L19-L19
48ac166ff57352e8be081a096dc4e7ebfaa7bde7
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets
arkts
arrayToList
Created because Arrays.asList(...) does not support modification. @param array @return
private arrayToList(array: T[]): JArrayList<T> { let list = new JArrayList<T>(); for (let i = 0; i < array.length; i++) { let data: T = array[i]; list.add(data); } return list; }
AST#method_declaration#Left private arrayToList AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AS...
private arrayToList(array: T[]): JArrayList<T> { let list = new JArrayList<T>(); for (let i = 0; i < array.length; i++) { let data: T = array[i]; list.add(data); } return list; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/ChartData.ets#L83-L92
c335d69ed41d86231eb115d92b9fb2d2d5373694
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
Q1/grammar/entry/src/main/ets/pages/LifeCycle1.ets
arkts
onPageShow
页面显示
onPageShow() { console.log('page1...onPageShow') }
AST#method_declaration#Left onPageShow 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 console AST#expression#Right . log AST#member_express...
onPageShow() { console.log('page1...onPageShow') }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/Q1/grammar/entry/src/main/ets/pages/LifeCycle1.ets#L45-L47
19ba059078110cce4739d31c216b586b6f0c6ce5
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/healthchart/src/main/ets/view/LineCharts.ets
arkts
customUi
图表的Marker(标志气泡)组件 图表Marker(标志气泡)组件
@Builder customUi() { // 是否在图表content内 if (this.customUiInfo.isInbounds && this.customUiInfo.data) { Column() { Text(this.customUiInfo.getFormattedValue()) .fontColor(Color.White) .fontSize($r('app.integer.bar_chart_health_font_size_twelve')) .fontWeight(FontWeight....
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customUi AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 是否在图表content内 AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#membe...
@Builder customUi() { if (this.customUiInfo.isInbounds && this.customUiInfo.data) { Column() { Text(this.customUiInfo.getFormattedValue()) .fontColor(Color.White) .fontSize($r('app.integer.bar_chart_health_font_size_twelve')) .fontWeight(FontWeight.Bold) Te...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/healthchart/src/main/ets/view/LineCharts.ets#L74-L271
1b536c0eea43329c308cd04a6e883ae06ea35f43
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/DataRenderer.ets
arkts
drawHighlighted
Draws all highlight indicators for the values that are currently highlighted. @param c @param indices the highlighted values
public abstract drawHighlighted(indices: Highlight[]): Paint[];
AST#method_declaration#Left public abstract drawHighlighted AST#parameter_list#Left ( AST#parameter#Left indices : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Highlight [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#t...
public abstract drawHighlighted(indices: Highlight[]): Paint[];
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/DataRenderer.ets#L193-L193
ffb7bf4f9a661c39c3bb56b04525b6fa14ab74b4
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/i18n/I18nManager.ets
arkts
getCurrentLanguageInfo
获取当前语言信息
getCurrentLanguageInfo(): LanguageInfo | undefined { return this.supportedLanguages.get(this.currentLanguage); }
AST#method_declaration#Left getCurrentLanguageInfo AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left LanguageInfo AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#blo...
getCurrentLanguageInfo(): LanguageInfo | undefined { return this.supportedLanguages.get(this.currentLanguage); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/i18n/I18nManager.ets#L366-L368
9042708fe47838d8c5d1003e05c4962b91897576
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/BatteryStatsUtil.ets
arkts
getItemDataHardware
获取硬件耗电信息 @return {BatteryStatsModel} new BatteryStatsModel()
getItemDataHardware(type: batteryStats.ConsumptionType) { let power = 0; let percent = 0; try { // 根据耗电类型获取耗电百分比。 percent = batteryStats.getHardwareUnitPowerPercent(type); } catch (err) { logger.info(TAG, `getHardwareUnitPowerPercent failed:${type}, ${err}`); } let itemInfo: Ba...
AST#method_declaration#Left getItemDataHardware AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left batteryStats . ConsumptionType AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Rig...
getItemDataHardware(type: batteryStats.ConsumptionType) { let power = 0; let percent = 0; try { percent = batteryStats.getHardwareUnitPowerPercent(type); } catch (err) { logger.info(TAG, `getHardwareUnitPowerPercent failed:${type}, ${err}`); } let itemInfo: BatteryStatsModel =...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/BatteryStatsUtil.ets#L207-L222
34d25d590076e20c70ef30baffedc2ce7f8a2a23
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LogUtil.ets
arkts
setHilog
日志打印方式 @param isHilog,true-hilog、false-console
public static setHilog(isHilog: boolean) { LogUtil.isHilog = isHilog; }
AST#method_declaration#Left public static setHilog AST#parameter_list#Left ( AST#parameter#Left isHilog : 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 ...
public static setHilog(isHilog: boolean) { LogUtil.isHilog = isHilog; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LogUtil.ets#L77-L79
bc0f88443e6a12e00089adab5215403d6d7b05a0
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/api/Router.ets
arkts
pushByStackName
@deprecated @param stackName @param name @param param @param animated
public static pushByStackName(stackName: string, name: string, param?: ObjectOrNull, animated: boolean = true) { ZRouter.getRouterMgr().pushByStackName(stackName, name, param, animated) }
AST#method_declaration#Left public static pushByStackName AST#parameter_list#Left ( AST#parameter#Left stackName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string ...
public static pushByStackName(stackName: string, name: string, param?: ObjectOrNull, animated: boolean = true) { ZRouter.getRouterMgr().pushByStackName(stackName, name, param, animated) }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L583-L586
d6edc7ca9c914334f6e83bb08d7c5d3546c6ed27
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/pipwindow/src/main/ets/model/AVPlayer.ets
arkts
getPlay
播放视频
getPlay() { if (this.isCreate) { this.flag = true; // 视频准备完毕 this.avPlayer.play(); } }
AST#method_declaration#Left getPlay AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isCreate AST#member_expression#Right AST#express...
getPlay() { if (this.isCreate) { this.flag = true; this.avPlayer.play(); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pipwindow/src/main/ets/model/AVPlayer.ets#L85-L90
e71cbdbd5dd108890effd37a389fae845e219c79
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/Base64Util.ets
arkts
decodeSync
解码,通过输入参数解码后输出对应Uint8Array对象。 @param array @returns
static decodeSync(array: Uint8Array | string, options?: util.Type): Uint8Array { const base64 = new util.Base64Helper(); const result = base64.decodeSync(array, options); return result; }
AST#method_declaration#Left static decodeSync AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Uint8Array AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right...
static decodeSync(array: Uint8Array | string, options?: util.Type): Uint8Array { const base64 = new util.Base64Helper(); const result = base64.decodeSync(array, options); return result; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/Base64Util.ets#L85-L89
d9027ba0421e42d1ab4beeca398b01d7e1d6ee2d
gitee
zhongte/TaoYao
80850f3800dd6037216d3f7c58a2bf34a881c93f
taoyao/src/main/ets/shijing/taoyao/picker/document/DocumentBuilder.ets
arkts
setDefaultFilePathUri
指定选择的文件或者目录路径(可选) @param defaultFilePathUri @returns
public setDefaultFilePathUri(defaultFilePathUri: string): DocumentBuilder { this._defaultFilePathUri = defaultFilePathUri return this }
AST#method_declaration#Left public setDefaultFilePathUri AST#parameter_list#Left ( AST#parameter#Left defaultFilePathUri : 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#Lef...
public setDefaultFilePathUri(defaultFilePathUri: string): DocumentBuilder { this._defaultFilePathUri = defaultFilePathUri return this }
https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/taoyao/src/main/ets/shijing/taoyao/picker/document/DocumentBuilder.ets#L44-L47
e6f8f0169d9fca118522c18f8914ed888039409e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/NotificationManager.ets
arkts
calculateDaysUntilBirthday
计算距离生日的天数
private calculateDaysUntilBirthday(birthdayStr: string, today: Date): number { const birthday = new Date(birthdayStr); const thisYear = today.getFullYear(); const thisYearBirthday = new Date(thisYear, birthday.getMonth(), birthday.getDate()); let targetDate = thisYearBirthday; if (thisYearBirth...
AST#method_declaration#Left private calculateDaysUntilBirthday AST#parameter_list#Left ( AST#parameter#Left birthdayStr : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left today : AST#type_annotation#Left AST#primary_type#Left...
private calculateDaysUntilBirthday(birthdayStr: string, today: Date): number { const birthday = new Date(birthdayStr); const thisYear = today.getFullYear(); const thisYearBirthday = new Date(thisYear, birthday.getMonth(), birthday.getDate()); let targetDate = thisYearBirthday; if (thisYearBirth...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationManager.ets#L327-L339
9c1e93c72e8209ae93ed7c9c62d063bda7774ea9
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/model/base/INavDialogParams.ets
arkts
navigation弹窗页面参数
export interface IDialogParams<T extends IBaseDialogOptions> {//, V extends IObservedData builder?: WrappedBuilder<[T]> options?: T // observedData?: V }
AST#export_declaration#Left export AST#interface_declaration#Left interface IDialogParams AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left IBaseDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right A...
export interface IDialogParams<T extends IBaseDialogOptions> { builder?: WrappedBuilder<[T]> options?: T }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/base/INavDialogParams.ets#L7-L11
3a196a818eb648dc2423ac9adfcb43379b791281
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/h5cache/src/main/ets/common/DiskCacheManager.ets
arkts
submitToDisk
保存数据到磁盘中 @param key 键值 @param data 数据
submitToDisk(url: string, data: ResponseDataType) { this.cache.set(url, data); }
AST#method_declaration#Left submitToDisk 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 data : AST#type_annotation#Left AST#primary_type#Left ResponseDataType AST#primary_t...
submitToDisk(url: string, data: ResponseDataType) { this.cache.set(url, data); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/h5cache/src/main/ets/common/DiskCacheManager.ets#L55-L57
c51a418edda26f0e293f2f8225c77f86870595b9
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets
arkts
GridItemCard
网格卡片 @param {number} index - 序号 @returns {void} 无返回值
@Builder private GridItemCard(index: number): void { Column() { this.CardTitle($r("app.string.demo_screen_adapt_grid_item_format", index)); SpaceVerticalSmall(); this.CardDesc($r("app.string.demo_screen_adapt_grid_desc")); } .width(P100) .padding($r("app.float.space_padding_medium"...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private GridItemCard AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotati...
@Builder private GridItemCard(index: number): void { Column() { this.CardTitle($r("app.string.demo_screen_adapt_grid_item_format", index)); SpaceVerticalSmall(); this.CardDesc($r("app.string.demo_screen_adapt_grid_desc")); } .width(P100) .padding($r("app.float.space_padding_medium"...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets#L145-L158
27934b09c4c9bce269152ecb1ac93cb1df5eda67
github
2763981847/Accounting-app.git
cf8302a42588ecce1561b82e8533798157157257
entry/src/main/ets/pages/StatisticPage.ets
arkts
渲染页面
build() { Scroll(this.scroller) { Column({ space: CommonConstants.SPACE_M }) { Column() { // 日期选择组件 DateSelectComponent({ beginDate: $beginDate, endDate: $endDate, selectedIndex: 0 }).width(CommonConstants.EIGHTY_PERCENT); Ro...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . scroller AST#member_expression#Right AST#expression#Right ) AST#container_conte...
build() { Scroll(this.scroller) { Column({ space: CommonConstants.SPACE_M }) { Column() { DateSelectComponent({ beginDate: $beginDate, endDate: $endDate, selectedIndex: 0 }).width(CommonConstants.EIGHTY_PERCENT); Row() { ...
https://github.com/2763981847/Accounting-app.git/blob/cf8302a42588ecce1561b82e8533798157157257/entry/src/main/ets/pages/StatisticPage.ets#L37-L182
c75968b5df08cdcdd9bc899312c06cb150fdb7d5
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.atomicservice.AtomicServiceWeb.d.ets
arkts
refresh
Refreshes the current URL. @throws { BusinessError } 17100001 - Init error. The AtomicServiceWebController must be associated with a AtomicServiceWeb component. @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 12
refresh(): void;
AST#method_declaration#Left refresh 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#method_declaration#Right
refresh(): void;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceWeb.d.ets#L392-L392
957cfed28ba9b2de1c03fcc78e891ba9030ebe11
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/UdpClient_Server.ets
arkts
closeConnection
关闭连接
closeConnection() { let tcpMessage: TcpMessage = { type: 'disConnect' }; workerPort.postMessage(tcpMessage); workerPort.onmessage = (e: MessageEvents) => { const response: TcpMessage = e.data; if (response.type === 'close success') { this.msgHistory += `Connection closed.\n`...
AST#method_declaration#Left closeConnection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left tcpMessage : AST#type_annotation#Left AST#primary_type#Left TcpMessage AST#primary_type#Right AST#type_annotation#...
closeConnection() { let tcpMessage: TcpMessage = { type: 'disConnect' }; workerPort.postMessage(tcpMessage); workerPort.onmessage = (e: MessageEvents) => { const response: TcpMessage = e.data; if (response.type === 'close success') { this.msgHistory += `Connection closed.\n`...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/UdpClient_Server.ets#L266-L282
3af7e8f3bb3ae9b9e89b9cb272b085ea415ec9bf
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.atomicservice.AtomicServiceNavigation.d.ets
arkts
Indicates the options of Navigation's Titlebar. @typedef TitleOptions @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 12
export interface TitleOptions { /** * Background color. * * @type { ?ResourceColor } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ backgroundColor?: ResourceColor; /** * Whether to enable the blur effect. * * @type { ?boolean }. * @default true * ...
AST#export_declaration#Left export AST#interface_declaration#Left interface TitleOptions AST#object_type#Left { /** * Background color. * * @type { ?ResourceColor } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 */ AST#type_member#Left backgroundColor ? : AST#type_annotati...
export interface TitleOptions { backgroundColor?: ResourceColor; isBlurEnabled?: boolean; barStyle?: BarStyle; titleBarType?: TitleBarType; titleIcon?: Resource | SymbolGlyphModifier; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceNavigation.d.ets#L318-L372
2086ff08d66a4f09b78242fc9a60b9d4e50f1ad7
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/BookDetailPage.ets
arkts
recordDividerStyle
分割线样式
@Extend(Divider) function recordDividerStyle() { .vertical(true) .width(0.5) .height(24) .color('#40ffffff') }
AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Divider AST#expression#Right ) AST#decorator#Right function recordDividerStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . vertical ( AST#expression#Lef...
@Extend(Divider) function recordDividerStyle() { .vertical(true) .width(0.5) .height(24) .color('#40ffffff') }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/BookDetailPage.ets#L29-L35
8cf55adb3ef52914d6e5fbe0af1827ca27a18391
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/CombinedChartRenderer.ets
arkts
getSubRenderer
Returns the sub-renderer object at the specified index. @param index @return
public getSubRenderer(index: number): DataRenderer | null { if (index >= this.mRenderers.size() || index < 0) return null; else return this.mRenderers.get(index); }
AST#method_declaration#Left public getSubRenderer AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Lef...
public getSubRenderer(index: number): DataRenderer | null { if (index >= this.mRenderers.size() || index < 0) return null; else return this.mRenderers.get(index); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/CombinedChartRenderer.ets#L182-L187
d28a7ac1854da730a5e1058832979c4ec91afdbd
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkWeb/ManageWebPageInteracts/entry/src/main/ets/pages/OnIntKbdAttachSysCustIn.ets
arkts
customKeyboardBuilder
自定义键盘组件Builder
@Builder customKeyboardBuilder() { // 这里实现自定义键盘组件,对接WebKeyboardController实现输入、删除、关闭等操作。 Row() { Text('finish') .fontSize(20) .fontColor(Color.Blue) .onClick(() => { this.webKeyboardController.close(); }) // 插入字符。 Button('insertText').onClick(() => { ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customKeyboardBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 这里实现自定义键盘组件,对接WebKeyboardController实现输入、删除、关闭等操作。 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left...
@Builder customKeyboardBuilder() { Row() { Text('finish') .fontSize(20) .fontColor(Color.Blue) .onClick(() => { this.webKeyboardController.close(); }) Button('insertText').onClick(() => { this.webKeyboardController.insertText('insert '); ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/ManageWebPageInteracts/entry/src/main/ets/pages/OnIntKbdAttachSysCustIn.ets#L38-L71
a518b827dfe5324850ee13861509e603de4e0712
gitee
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/WuDangBuySellComponent.ets
arkts
WuDangBuySellComponent
买卖五档的基础组件
@Component export struct WuDangBuySellComponent { @Prop wuDangData: WuDangData private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private drawRect: DrawRect //可绘制内容的Rect private canvasW: number...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct WuDangBuySellComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right wuDangData : AST#type_annotation#Left AST#primary_type#Left WuDangData AST#primary_type#Righ...
@Component export struct WuDangBuySellComponent { @Prop wuDangData: WuDangData private settings: RenderingContextSettings = new RenderingContextSettings(true) private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private drawRect: DrawRect private canvasW: number private ...
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/WuDangBuySellComponent.ets#L8-L121
0d7da6506591968bad0366bfe2c8598024f2287f
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/AuthRepository.ets
arkts
getCaptcha
获取图片验证码 @returns {Promise<NetworkResponse<Captcha>>} 图片验证码
async getCaptcha(): Promise<NetworkResponse<Captcha>> { return this.networkDataSource.getCaptcha(); }
AST#method_declaration#Left async getCaptcha 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#generic_type#Left NetworkResponse AST#type_arguments#Left < AST#ty...
async getCaptcha(): Promise<NetworkResponse<Captcha>> { return this.networkDataSource.getCaptcha(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/AuthRepository.ets#L89-L91
46c908644bce94c84f946ddf926276aab71b859c
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/main/src/main/ets/viewmodel/HomeViewModel.ets
arkts
requestListData
重写请求列表数据方法来实现全部商品分页 @return 商品分页数据流
protected requestListData(): Promise<NetworkResponse<NetworkPageData<Goods>>> { const request = new GoodsSearchRequest(); request.page = this.currentPage; request.size = this.pageSize; return this.goodsRepository.getGoodsPage(request); }
AST#method_declaration#Left protected requestListData 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#generic_type#Left NetworkResponse AST#type_arguments#Left...
protected requestListData(): Promise<NetworkResponse<NetworkPageData<Goods>>> { const request = new GoodsSearchRequest(); request.page = this.currentPage; request.size = this.pageSize; return this.goodsRepository.getGoodsPage(request); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/HomeViewModel.ets#L31-L36
2f911d443a145d410f38940f7edff83a95239295
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PreferencesUtil.ets
arkts
getStringSync
获取string类型的缓存值 @param key @returns
static getStringSync(key: string, defValue: string = "", preferenceName: string = PreferencesUtil.defaultPreferenceName): string { return PreferencesUtil.getSync(key, defValue, preferenceName) as string; }
AST#method_declaration#Left static getStringSync 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 string AST#primary...
static getStringSync(key: string, defValue: string = "", preferenceName: string = PreferencesUtil.defaultPreferenceName): string { return PreferencesUtil.getSync(key, defValue, preferenceName) as string; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L129-L132
89fc00cdfe21671d892a7a795c0d70a4e6476dc5
gitee
tomorrowKreswell/Ledger.git
1f2783ae70b8540d677af8a27f29db1b4089ea69
ledger/entry/src/main/ets/view/AddDialogComponent.ets
arkts
构建对话框内容
build() { Column({ space: CommonConstants.SPACE_M }) { // 关闭按钮 Image($rawfile('half.png')) .width($r('app.float.component_size_L')) .height($r('app.float.component_size_S')) .onClick(() => { this.controller?.close(); }) // 顶部标签页切换 Tabs({ barPosition...
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#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left AST#member_expression#Left AST#expression#Left CommonConstants AST#expression#Right ....
build() { Column({ space: CommonConstants.SPACE_M }) { Image($rawfile('half.png')) .width($r('app.float.component_size_L')) .height($r('app.float.component_size_S')) .onClick(() => { this.controller?.close(); }) Tabs({ barPosition: BarPosition.Sta...
https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/view/AddDialogComponent.ets#L61-L104
eefeec5888c4967761f2ed55b3347049f8768186
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/citysearch/src/main/ets/view/CitySearch.ets
arkts
CitySearch
功能说明: 本示例介绍城市选择场景的使用:通过AlphabetIndexer实现首字母快速定位城市的索引条导航 推荐场景: 首字母快速定位的列表场景 核心组件: 1. AlphabetListView: 列表视图 实现步骤: 1. 数据准备。初始化城市列表和热门城市列表数组。 @example // 热门城市列表 hotCityList: HotCityListItemView[] = []; 城市列表 cityList: CityListItemView[] = []; aboutToAppear(): void { CITY_DATA.forEach((cityItem: CityType) => { this.city...
@Component export struct CitySearch { // 搜索值 @State changeValue: string = ''; // 热门城市列表 hotCityList: HotListItemView[] = []; // 城市列表 cityList: AlphabetListItemView[] = []; // 占位 placeholder: string = CommonConstants.PLACE_HOLDER_TEXT; // 搜索控制器 controller: SearchController = new SearchController(); ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CitySearch AST#component_body#Left { // 搜索值 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right changeValue : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#t...
@Component export struct CitySearch { @State changeValue: string = ''; hotCityList: HotListItemView[] = []; cityList: AlphabetListItemView[] = []; placeholder: string = CommonConstants.PLACE_HOLDER_TEXT; controller: SearchController = new SearchController(); @State isSearchState: boolean =...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/citysearch/src/main/ets/view/CitySearch.ets#L65-L226
8fa072995d79d0d3cd664e562031424ba319b54b
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/ui/src/main/ets/component/empty/EmptyError.ets
arkts
EmptyError
@file 错误缺省页 @author Joker.X
@ComponentV2 export struct EmptyError { /** * 描述文案 */ @Param description: ResourceStr = $r("app.string.empty_error"); /** * 操作按钮文案(仅当 onAction 存在时展示) */ @Param actionText: ResourceStr = $r("app.string.click_retry"); /** * 操作按钮点击回调(不传则不展示按钮) */ @Param onAction: (() => void) | undefi...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct EmptyError AST#component_body#Left { /** * 描述文案 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right description : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#prim...
@ComponentV2 export struct EmptyError { @Param description: ResourceStr = $r("app.string.empty_error"); @Param actionText: ResourceStr = $r("app.string.click_retry"); @Param onAction: (() => void) | undefined = undefined; build(): void { Empty({ description: this.description, ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/empty/EmptyError.ets#L7-L39
780934134bf8e8b2b7530d4213fb9639bba1cd4f
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/DateUtil.ets
arkts
getToday
获取今天的日期 @returns
static getToday(): Date { return new Date(); }
AST#method_declaration#Left static getToday AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Date 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#L...
static getToday(): Date { return new Date(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L83-L85
76349661039fe60713a85f37655de6adb2fc4fba
gitee
sea5241/PictureSelector
09bac407ebd61100d1ccbf6e6d3b6349cb0013d7
selector/src/main/ets/model/MediaData.ets
arkts
媒体文件数据 @Author sea @Date 2024/7/8
export class MediaData { path: string; constructor(path: string) { this.path = path; } }
AST#export_declaration#Left export AST#class_declaration#Left class MediaData AST#class_body#Left { AST#property_declaration#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#constructor_declaration#Left constructor AS...
export class MediaData { path: string; constructor(path: string) { this.path = path; } }
https://github.com/sea5241/PictureSelector/blob/09bac407ebd61100d1ccbf6e6d3b6349cb0013d7/selector/src/main/ets/model/MediaData.ets#L6-L12
a840383d10fc7671a50bbc778a59b5a7945a25f7
gitee
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegManager.ets
arkts
executeTask
执行单个任务 注意:taskFailed/failCode/failMsg 必须是局部变量,确保多任务环境下状态隔离
private async executeTask(task: Task): Promise<void> { FLog.info(FFmpegManager.TAG, `Executing task: ${task.getId()}`); // 回调:开始 this.dispatchCallback(task, 'start'); // 任务级别的状态变量(局部变量,确保多任务状态隔离) let taskFailed = false; let failCode = 0; let failMsg = ''; try { const...
AST#method_declaration#Left private async executeTask AST#parameter_list#Left ( AST#parameter#Left task : AST#type_annotation#Left AST#primary_type#Left Task AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#...
private async executeTask(task: Task): Promise<void> { FLog.info(FFmpegManager.TAG, `Executing task: ${task.getId()}`); this.dispatchCallback(task, 'start'); let taskFailed = false; let failCode = 0; let failMsg = ''; try { const commands = task.getCommands(); ...
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegManager.ets#L280-L334
f3fe3c97561a6ae6b3b9760debb2a595929d0b8d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets
arkts
toArray
获取注册标题集合 @returns: 包含所有注册标题的数组
public toArray(): string[] { if (this.keys.length > 0) { return this.keys; } let array: string[] = []; let keys: IterableIterator<string> = this.tabsInfo.keys() for (let keysElement of keys) { array.push(keysElement); } return array; }
AST#method_declaration#Left public toArray AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( A...
public toArray(): string[] { if (this.keys.length > 0) { return this.keys; } let array: string[] = []; let keys: IterableIterator<string> = this.tabsInfo.keys() for (let keysElement of keys) { array.push(keysElement); } return array; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets#L85-L95
5f1d0b4a52892efa6b82ca80b33d8d6bd2c98a52
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/setting/AdviceView.ets
arkts
refreshUIState
=== 功能方法 === 刷新UI状态
private refreshUIState() { if (this.pickedUri) { this.isSendButtonEnabled = true }else{ const trimmedContent = this.content.trim(); this.characterCount = trimmedContent.length; this.isSendButtonEnabled = this.characterCount > this.MIN_COUNT && this.characterCount <= thi...
AST#method_declaration#Left private refreshUIState AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . pickedUri AST#member_expression#R...
private refreshUIState() { if (this.pickedUri) { this.isSendButtonEnabled = true }else{ const trimmedContent = this.content.trim(); this.characterCount = trimmedContent.length; this.isSendButtonEnabled = this.characterCount > this.MIN_COUNT && this.characterCount <= thi...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/setting/AdviceView.ets#L159-L170
61b2e93db305fb805950ae18f1de3c340e76b15c
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/GameificationService.ets
arkts
连击数据接口
export interface StreakData { type: string; current: number; best: number; lastActionDate: string; isActive: boolean; }
AST#export_declaration#Left export AST#interface_declaration#Left interface StreakData AST#object_type#Left { AST#type_member#Left type : 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 current : AST#type_annotation#Left...
export interface StreakData { type: string; current: number; best: number; lastActionDate: string; isActive: boolean; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L190-L196
36412e6655768269c840dfd3128c0a2811f5ec1f
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/request/CreateOrderRequest.ets
arkts
@param {CreateOrderInit} init - 初始化数据
constructor(init: CreateOrderInit) { this.addressId = init.addressId; this.goodsList = init.goodsList.map((g) => new SelectedGoods(g)); if (init.remark !== undefined) { this.remark = init.remark; } if (init.couponId !== undefined) { this.couponId = init.couponId; } if (init.title...
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init : AST#type_annotation#Left AST#primary_type#Left CreateOrderInit AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_sta...
constructor(init: CreateOrderInit) { this.addressId = init.addressId; this.goodsList = init.goodsList.map((g) => new SelectedGoods(g)); if (init.remark !== undefined) { this.remark = init.remark; } if (init.couponId !== undefined) { this.couponId = init.couponId; } if (init.title...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/request/CreateOrderRequest.ets#L86-L98
bcb88e940459fb4cdeaa614c3152ec4332514cf0
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
bptaMultiWindow/entry/src/main/ets/components/WindowUtil.ets
arkts
recover
[EndExclude recover] [StartExclude maximize]
recover(): void { try { if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { this.mainWindowClass!.recover() .then(() => { hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in recovering the window.`); }) .catch((err: Busin...
AST#method_declaration#Left recover 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#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_st...
recover(): void { try { if (this.mainWindowClass!.getWindowStatus() === window.WindowStatusType.FULL_SCREEN) { this.mainWindowClass!.recover() .then(() => { hilog.info(0x0000, 'testTag', '%{public}s', `Succeed in recovering the window.`); }) .catch((err: Busin...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/bptaMultiWindow/entry/src/main/ets/components/WindowUtil.ets#L50-L65
9ce38d11f7bc13bab097ca7f366fe4ff7b8937a8
gitee
cljhwt/Gemini3_to_ArkTS.git
11507c45be72ecccef2f757eaf024c2b8617ad34
ArtTs-Demo/ImageGetAndSave-master/entry/src/main/ets/common/utils/Utils.ets
arkts
Copy the source image into sandbox. @param src - source image path @param path - sandbox path @returns Promise<string>
export async function copyImg2Sandbox(src: string, path: string): Promise<string> { try { let srcImage = fs.openSync(src, fs.OpenMode.READ_ONLY); let destImage = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); fs.copyFileSync(srcImage.fd, destImage.fd); fs.closeSync(srcImage); fs.c...
AST#export_declaration#Left export AST#function_declaration#Left async function copyImg2Sandbox AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left path : AST#type_annotation#Le...
export async function copyImg2Sandbox(src: string, path: string): Promise<string> { try { let srcImage = fs.openSync(src, fs.OpenMode.READ_ONLY); let destImage = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); fs.copyFileSync(srcImage.fd, destImage.fd); fs.closeSync(srcImage); fs.c...
https://github.com/cljhwt/Gemini3_to_ArkTS.git/blob/11507c45be72ecccef2f757eaf024c2b8617ad34/ArtTs-Demo/ImageGetAndSave-master/entry/src/main/ets/common/utils/Utils.ets#L29-L41
aaf81ad762ba7b771f78c9a12273680c6d95d035
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets
arkts
icon
展示的图片资源 @param icon 支持ResourceStr或PixelMap对象 @param iconSize 图片尺寸 默认:{ width: 64vp, height: 64vp } @returns
icon(icon: ResourceStr | PixelMap, iconSize?: SizeOptions) { this.builderOptions.icon = icon this.builderOptions.iconSize = iconSize return this }
AST#method_declaration#Left icon AST#parameter_list#Left ( AST#parameter#Left icon : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ResourceStr AST#primary_type#Right | AST#primary_type#Left PixelMap AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#para...
icon(icon: ResourceStr | PixelMap, iconSize?: SizeOptions) { this.builderOptions.icon = icon this.builderOptions.iconSize = iconSize return this }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/ToastIconBuilderProxy.ets#L50-L54
b91beb0c014e61ef1db05df0bb890a3593f62ac4
github
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/pages/QuestionBankPage.ets
arkts
aboutToAppear
控制题目类型展开状态
aboutToAppear() { // 处理路由参数 const params = router.getParams() as Record<string, string> if (params && params.category) { this.selectedCategory = params.category } this.loadQuestions() }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 处理路由参数 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left params = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#call_expression#Left AST#exp...
aboutToAppear() { const params = router.getParams() as Record<string, string> if (params && params.category) { this.selectedCategory = params.category } this.loadQuestions() }
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/pages/QuestionBankPage.ets#L44-L51
1a7db1b728dcc2ebfbc9c883187ff67226d62c0c
github
seasonZhu/HarmonyStudy.git
b55e58c962e9b39d5211337590bdd45f2c2349b3
entry/src/main/ets/pages/WebExample.ets
arkts
WebExample
应用侧调用前端页面函数 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/web-in-app-frontend-page-function-invoking-V5 前端页面调用应用侧函数 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/web-in-page-app-function-invoking-V5
@Entry({routeName: RouterName.WebExample}) @Component export struct WebExample { webviewController: webview.WebviewController = new webview.WebviewController(); // 声明需要注册的对象 @State javaScriptObject: JavaScriptInterface = new JavaScriptInterface(); build() { Navigation() { Column() { // Web组件加...
AST#decorated_export_declaration#Left AST#decorator#Left @ Entry ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left routeName AST#property_name#Right : AST#expression#Left AST#member_expression#Left AST#expression#Left RouterName AST#expression#Right . WebExample AST#mem...
@Entry({routeName: RouterName.WebExample}) @Component export struct WebExample { webviewController: webview.WebviewController = new webview.WebviewController(); @State javaScriptObject: JavaScriptInterface = new JavaScriptInterface(); build() { Navigation() { Column() { Web({ src: $...
https://github.com/seasonZhu/HarmonyStudy.git/blob/b55e58c962e9b39d5211337590bdd45f2c2349b3/entry/src/main/ets/pages/WebExample.ets#L63-L113
f625730cbf97149651619e8b9015e78930a221d7
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/DeviceUtils.ets
arkts
getDeviceType
获取设备类型
static getDeviceType(): string { return DeviceUtil.DEVICE_TYPE; }
AST#method_declaration#Left static getDeviceType AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_exp...
static getDeviceType(): string { return DeviceUtil.DEVICE_TYPE; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DeviceUtils.ets#L48-L50
a4fcadc768d03746f9fb6c983a2215259fd0bf0f
github
weiwei0928/Eyepetizer-harmony.git
fd5947c6f616c22d42256f36ba752093b782a910
entry/src/main/ets/http/AxiosHttpRequest.ets
arkts
request
类型参数的作用,T决定AxiosResponse实例中data的类型
request<T = CommonType>(config?: HttpRequestConfig): Promise<T> { return new Promise<T>((resolve, reject) => { this.instance // 发送请求 .request<CommonType, T>(config) .then(res => { resolve(res); }) .catch((err:CommonType) => { loge("网络请求Request异常:", e...
AST#method_declaration#Left request AST#type_parameters#Left < AST#type_parameter#Left T = AST#type_annotation#Left AST#primary_type#Left CommonType AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left config ? : AST#type_anno...
request<T = CommonType>(config?: HttpRequestConfig): Promise<T> { return new Promise<T>((resolve, reject) => { this.instance .request<CommonType, T>(config) .then(res => { resolve(res); }) .catch((err:CommonType) => { loge("网络请求Request异常:", err?.toS...
https://github.com/weiwei0928/Eyepetizer-harmony.git/blob/fd5947c6f616c22d42256f36ba752093b782a910/entry/src/main/ets/http/AxiosHttpRequest.ets#L67-L83
070e40c47ab2ea5070052d3926a528c1fb0bf963
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkcompiler/esmodule/esmodule_dynamicimport/hardephar/Index.ets
arkts
MainPage
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 { MainPage, add } from './src/main/ets/components/mainpage/MainPage'
AST#export_declaration#Left export { MainPage , add } from './src/main/ets/components/mainpage/MainPage' AST#export_declaration#Right
export { MainPage, add } from './src/main/ets/components/mainpage/MainPage'
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkcompiler/esmodule/esmodule_dynamicimport/hardephar/Index.ets#L16-L16
f421879f8a9b2e5a27792de3429eaaa888bc2b39
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/udp/UdpDemo/entry/src/main/ets/pages/Index.ets
arkts
bind2Port
绑定本地端口
async bind2Port() { //本地地址 let localAddress = { address: "0.0.0.0", port: this.localPort, family: 1 } await udpSocket.bind(localAddress) .then(() => { this.msgHistory = 'bind success' + "\r\n"; }) .catch((e) => { this.msgHistory = 'bind fail' + e.message + "\r\n"; })...
AST#method_declaration#Left async bind2Port AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { //本地地址 AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left localAddress = AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name...
async bind2Port() { let localAddress = { address: "0.0.0.0", port: this.localPort, family: 1 } await udpSocket.bind(localAddress) .then(() => { this.msgHistory = 'bind success' + "\r\n"; }) .catch((e) => { this.msgHistory = 'bind fail' + e.message + "\r\n"; }) ...
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/udp/UdpDemo/entry/src/main/ets/pages/Index.ets#L150-L173
fa331da9f4c0600af27c7aebe7871dc7fff2cd42
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/groupavatar/src/main/ets/datasource/GroupAvatarModel.ets
arkts
群头像数据结构
export interface GroupAvatarModel { src: ResourceStr | image.PixelMap; width: number; height: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GroupAvatarModel AST#object_type#Left { AST#type_member#Left src : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ResourceStr AST#primary_type#Right | AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualif...
export interface GroupAvatarModel { src: ResourceStr | image.PixelMap; width: number; height: number; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/groupavatar/src/main/ets/datasource/GroupAvatarModel.ets#L20-L24
4c3a2ca683deb884db46e20f9939ec74d48f797f
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/module_city_select/src/main/ets/components/SingleBtn.ets
arkts
SingleBtn
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...
@ComponentV2 export struct SingleBtn { @Param city: string = ''; @Param fgColor: ResourceColor = Color.Black; @Event onClickEvent: () => void = () => { }; build() { Button() { Text(this.city) .fontSize(14) .fontColor(this.fgColor) .fontWeight(500) .textAlign(TextAlig...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SingleBtn AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right city : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotatio...
@ComponentV2 export struct SingleBtn { @Param city: string = ''; @Param fgColor: ResourceColor = Color.Black; @Event onClickEvent: () => void = () => { }; build() { Button() { Text(this.city) .fontSize(14) .fontColor(this.fgColor) .fontWeight(500) .textAlign(TextAlig...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/module_city_select/src/main/ets/components/SingleBtn.ets#L16-L43
25e59889df2f3bfc8ef1b847cb1f5bf1be93acfc
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/RSA.ets
arkts
verifySync
对数据进行验签,同步 @param dataBlob 待验签数据 @param signDataBlob 签名数据 @param pubKey 公钥 @param algName 指定签名算法(RSA1024|PKCS1|SHA256、RSA2048|PKCS1|SHA256、、等)。 @returns
static verifySync(dataBlob: cryptoFramework.DataBlob, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|SHA256'): boolean { return CryptoUtil.verifySync(dataBlob, signDataBlob, pubKey, algName); }
AST#method_declaration#Left static verifySync AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left signD...
static verifySync(dataBlob: cryptoFramework.DataBlob, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|SHA256'): boolean { return CryptoUtil.verifySync(dataBlob, signDataBlob, pubKey, algName); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/RSA.ets#L274-L276
9b301592300b748e86be49b90626b7ca8dda3f1b
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationContentUtil.ets
arkts
initNotificationPictureContent
init picture notification content @param basicContent @param notificationBriefText @param notificationExpandedTitle @param notificationPicture @return return the created NotificationContent
initNotificationPictureContent(basicContent: notification.NotificationBasicContent, notificationBriefText: string, notificationExpandedTitle: string, notificationPicture: image.PixelMap): notification.NotificationContent { return { contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, // 通知内容类型 ...
AST#method_declaration#Left initNotificationPictureContent AST#parameter_list#Left ( AST#parameter#Left basicContent : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left notification . NotificationBasicContent AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri...
initNotificationPictureContent(basicContent: notification.NotificationBasicContent, notificationBriefText: string, notificationExpandedTitle: string, notificationPicture: image.PixelMap): notification.NotificationContent { return { contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, pic...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Notification/CustomNotification/notification/src/main/ets/notification/NotificationContentUtil.ets#L89-L101
2ec32572d6324e11d3b2da8336cf009f72285419
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets
arkts
hash
bits per input character. 8 - ASCII; 16 - Unicode 散列哈希算法 @param value @returns
static hash(value: string): OutDTO<string> { let hash = new SHA1(); return OutDTO.OKByDataRow('SHA1散列算法成功~', hash.hex_sha1(value)); }
AST#method_declaration#Left static hash AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left OutDTO...
static hash(value: string): OutDTO<string> { let hash = new SHA1(); return OutDTO.OKByDataRow('SHA1散列算法成功~', hash.hex_sha1(value)); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHA1.ets#L37-L40
09c4b7b2d98b6fb19a72ae5aa1111f3a442a8bc0
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/member/EncourageManager.ets
arkts
getRewardCount
获取奖励数量(类似Swift中的rewardCount计算属性) 合并了原RewardPool.getRewardForType的功能
static getRewardCount(type: EncourageType): number { switch (type) { case EncourageType.wordPronRewardAd: return EncourageTypeHelper.rewardAd[0] || 10; // 默认值 case EncourageType.wordPronShareApp: return EncourageTypeHelper.shareApp[0] || 30; // 默认值 default: return 0; }
AST#method_declaration#Left static getRewardCount AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left EncourageType 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#p...
static getRewardCount(type: EncourageType): number { switch (type) { case EncourageType.wordPronRewardAd: return EncourageTypeHelper.rewardAd[0] || 10; case EncourageType.wordPronShareApp: return EncourageTypeHelper.shareApp[0] || 30; default: return 0; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/EncourageManager.ets#L63-L71
105674232686062f277c5a7cad250c7e0cf01a81
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/webDavService/WebdavService.ets
arkts
copy
复制方法
copy(value:string){ let pasteData: pasteboard.PasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN,value); const systemPasteboard = pasteboard.getSystemPasteboard() systemPasteboard.setData(pasteData) promptAction.showToast({ message: '复制成功', duration: 1000, }) }
AST#method_declaration#Left copy AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#...
copy(value:string){ let pasteData: pasteboard.PasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN,value); const systemPasteboard = pasteboard.getSystemPasteboard() systemPasteboard.setData(pasteData) promptAction.showToast({ message: '复制成功', duration: 1000, }) }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/webDavService/WebdavService.ets#L142-L150
90a65b886ea617c4fdcc51b508e7c153825afad8
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
主题配置接口
export interface ThemeConfig { mode: ThemeMode; type: ThemeType; colorTheme: ColorTheme; fontConfig: FontConfig; animationConfig: AnimationConfig; customizations: { enableGradients: boolean; enableShadows: boolean; enableBlur: boolean; borderRadius: number; cardElevation: number; ico...
AST#export_declaration#Left export AST#interface_declaration#Left interface ThemeConfig AST#ERROR#Left { AST#type_member#Left mode : AST#type_annotation#Left AST#primary_type#Left ThemeMode AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left type : AST#type_annotation#Left AST#...
export interface ThemeConfig { mode: ThemeMode; type: ThemeType; colorTheme: ColorTheme; fontConfig: FontConfig; animationConfig: AnimationConfig; customizations: { enableGradients: boolean; enableShadows: boolean; enableBlur: boolean; borderRadius: number; cardElevation: number; ico...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L97-L110
e689e45eebf255f3f39c35b507345fcef5b3268d
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Plan.ets
arkts
getLearns
/ 学习记录
getLearns(): Learn[] { return this.learns; }
AST#method_declaration#Left getLearns AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Learn [ ] 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...
getLearns(): Learn[] { return this.learns; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L90-L92
e30f1647bd5e53c58a087aad9685ebf5e6557c27
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/product/entry/src/main/ets/constants/HelperConstants.ets
arkts
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 class HelperConstants { static readonly HELPER_URL_PROTOTYPE: string = "https://gitee.com/harmonyos-cases/cases/blob/master/CommonAppDevelopment/feature/{placeholder}/README.md"; static readonly HELPER_URL_PROTOTYPE_PERFERMANCE: string = "https://gitee.com/harmonyos-cases/cases/blob/master/CommonAppDevelopme...
AST#export_declaration#Left export AST#class_declaration#Left class HelperConstants AST#class_body#Left { AST#property_declaration#Left static readonly HELPER_URL_PROTOTYPE : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "https://gitee.com/h...
export class HelperConstants { static readonly HELPER_URL_PROTOTYPE: string = "https://gitee.com/harmonyos-cases/cases/blob/master/CommonAppDevelopment/feature/{placeholder}/README.md"; static readonly HELPER_URL_PROTOTYPE_PERFERMANCE: string = "https://gitee.com/harmonyos-cases/cases/blob/master/CommonAppDevelopme...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/product/entry/src/main/ets/constants/HelperConstants.ets#L16-L22
47de690d6e6f11fa7c9d8152ee5fc73e1bad02ad
gitee