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
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/easy_demo/float_windows/float_windows_3.5.15.23/entry/src/main/ets/controller/FloatWindowController.ets
arkts
悬浮窗控制类
export default class FloatWindowController { // 创建单例模式 private static mInstance: FloatWindowController | null = null; public static getInstance(): FloatWindowController { if (FloatWindowController.mInstance == null) { FloatWindowController.mInstance = new FloatWindowController(); } return Floa...
AST#export_declaration#Left export default AST#class_declaration#Left class FloatWindowController AST#class_body#Left { // 创建单例模式 AST#property_declaration#Left private static mInstance : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left FloatWindowController AST#primary_type#Right | AST#primary_type#Le...
export default class FloatWindowController { private static mInstance: FloatWindowController | null = null; public static getInstance(): FloatWindowController { if (FloatWindowController.mInstance == null) { FloatWindowController.mInstance = new FloatWindowController(); } return FloatWindowCo...
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/easy_demo/float_windows/float_windows_3.5.15.23/entry/src/main/ets/controller/FloatWindowController.ets#L12-L102
ae4f5921531d010676a57f0c0678015d6f7bdbac
gitee
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/net/wanAPI/response/IArticle.ets
arkts
玩安卓首页文章接口响应数据类
export interface IArticle { adminAdd: boolean; apkLink: string; audit: number; author: string; canEdit: boolean; chapterId: number; chapterName: string; collect: boolean; courseId: number; desc: string; descMd: string; envelopePic: string; fresh: boolean; host: string; id: number; isAdmi...
AST#export_declaration#Left export AST#interface_declaration#Left interface IArticle AST#object_type#Left { AST#type_member#Left adminAdd : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left apkLink : AST#type_annotation#L...
export interface IArticle { adminAdd: boolean; apkLink: string; audit: number; author: string; canEdit: boolean; chapterId: number; chapterName: string; collect: boolean; courseId: number; desc: string; descMd: string; envelopePic: string; fresh: boolean; host: string; id: number; isAdmi...
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/net/wanAPI/response/IArticle.ets#L6-L48
efe5077d615970dfcaf780e55e3c23cddd10486e
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/task/TaskProgressPage.ets
arkts
removeImage
删除已选图片
removeImage(index: number): void { // 创建新数组而不是修改原数组 const newSelectedImages: string[] = []; const newImageUris: string[] = []; for (let i = 0; i < this.selectedImages.length; i++) { if (i !== index) { newSelectedImages.push(this.selectedImages[i]); newImageUris.push(this.image...
AST#method_declaration#Left removeImage AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right ...
removeImage(index: number): void { const newSelectedImages: string[] = []; const newImageUris: string[] = []; for (let i = 0; i < this.selectedImages.length; i++) { if (i !== index) { newSelectedImages.push(this.selectedImages[i]); newImageUris.push(this.imageUris[i]); ...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/task/TaskProgressPage.ets#L125-L139
63fec5995bcb91bcedd23d2f7b523d6d13d39dca
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/blocks/modules/meowTabsHost.ets
arkts
try_scroll_to
Tries to scroll to a tab of specific index. @param idx The index of the target tab.
try_scroll_to(idx: number) { this.storage.set('meow_tabs_vertical_scroll_to_idx', idx); }
AST#method_declaration#Left try_scroll_to AST#parameter_list#Left ( AST#parameter#Left idx : 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#expression...
try_scroll_to(idx: number) { this.storage.set('meow_tabs_vertical_scroll_to_idx', idx); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowTabsHost.ets#L429-L431
377b0446c35ad3d636c2331321d4d5d1c341e1f6
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/ActionUtil.ets
arkts
@Author csx @DateTime 2024/1/24 19:32 @TODO ActionUtil 操作菜单工具类 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_ui
export class ActionUtil { /** * 显示操作菜单 * @param options: * { * title:标题, * btn:{text:显示文本,color:显示颜色,btnCallBack:点击菜单触发的事件} * showInSubWindow:某弹框需要显示在主窗口之外时,是否在子窗口显示此弹窗 * isModal:弹窗是否为模态窗口,模态窗口有蒙层,非模态窗口无蒙层 * } */ static showActionMenu(options: ActionOptions) { if (!options) { op...
AST#export_declaration#Left export AST#class_declaration#Left class ActionUtil AST#class_body#Left { /** * 显示操作菜单 * @param options: * { * title:标题, * btn:{text:显示文本,color:显示颜色,btnCallBack:点击菜单触发的事件} * showInSubWindow:某弹框需要显示在主窗口之外时,是否在子窗口显示此弹窗 * isModal:弹窗是否为模态窗口,模态窗口有蒙层,非模态窗口无蒙层 * } */ AST#m...
export class ActionUtil { static showActionMenu(options: ActionOptions) { if (!options) { options = new ActionOptions(); } if (options.btn.length <= 0) { ToastUtil.showToast('菜单按钮数量必须大于1,且小于6!'); return; } if (!options.title) { options.title = Const.ACTION_TITLE; } ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/ActionUtil.ets#L29-L220
095835e0dad1a32e0222ff3566d7d8440fc246b6
gitee
Vinson0709/arkdemo.git
793491fe04b387f55dadfef86b30e28d0535d994
entry/src/main/ets/common/Constant.ets
arkts
页面菜单列表显示
export interface PathParams{ type: string; // 类型 }
AST#export_declaration#Left export AST#interface_declaration#Left interface PathParams 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#object_type#Right AST#interface_declaration...
export interface PathParams{ type: string; }
https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/common/Constant.ets#L10-L12
277e0220cf7b4218f2f12128f6cacf79876aaffc
github
JHB11Hinson/mineMointorAPP.git
b6b853cf534021ac39e66c9b3a35113896a272b2
entry/src/main/ets/model/HomeModel.ets
arkts
getRecordList
获取历史记录
static async getRecordList(): Promise<RecordItem[]> { try { // 显式传入泛型 <RecordItem[]> return await Request.get<RecordItem[]>('/records?_sort=id&_order=desc'); } catch (e) { return []; } }
AST#method_declaration#Left static async getRecordList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left RecordItem [ ] AST#array_type#Right AST#...
static async getRecordList(): Promise<RecordItem[]> { try { return await Request.get<RecordItem[]>('/records?_sort=id&_order=desc'); } catch (e) { return []; } }
https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/model/HomeModel.ets#L116-L123
fce95e00c2e7b92f25be34f96ab355dda9019e02
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets
arkts
RowMainAlignRadioList
Set Main Alignment in Row
@Component export struct RowMainAlignRadioList { private rowModuleList: ContainerModuleItem[] = getRowModuleList(); private groupName: string = this.rowModuleList[0].groupName; private moduleName: Resource = this.rowModuleList[0].moduleName; private radioList: Array<string> = this.rowModuleList[0].attributeList...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct RowMainAlignRadioList AST#component_body#Left { AST#property_declaration#Left private rowModuleList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ContainerModuleItem [ ] AST#array_type#Right AST...
@Component export struct RowMainAlignRadioList { private rowModuleList: ContainerModuleItem[] = getRowModuleList(); private groupName: string = this.rowModuleList[0].groupName; private moduleName: Resource = this.rowModuleList[0].moduleName; private radioList: Array<string> = this.rowModuleList[0].attributeList...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets#L23-L55
5a845a3512fac49d1e092815a5208e21cd5ca1da
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/ability/NaturalLanguageExtract.ets
arkts
extractAppIDs
提取AppID - C开头 + 数字
private static extractAppIDs(text: string): string[] { const sampleText = text.substring(0, Math.min(200, text.length)); console.log("[提取调试] 输入文本样本:", sampleText); console.log("[提取调试] 文本总长度:", text.length); const patterns: PatternItem[] = [ { name: "严格模式 (C+10-25数字)", patter...
AST#method_declaration#Left private static extractAppIDs AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_ty...
private static extractAppIDs(text: string): string[] { const sampleText = text.substring(0, Math.min(200, text.length)); console.log("[提取调试] 输入文本样本:", sampleText); console.log("[提取调试] 文本总长度:", text.length); const patterns: PatternItem[] = [ { name: "严格模式 (C+10-25数字)", patter...
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/ability/NaturalLanguageExtract.ets#L133-L189
c128fc5041b43253cf70a1367d3b08e0a80e13a1
github
MoonlitDropOfBlood/websocket.git
0e93f2a243442fec0c16b511081a9d7fddceb821
entry/src/main/ets/WebSocketDemo.ets
arkts
创建websocket连接
export function connectWS(url:string): WebSocketClient { console.log("开始准备") let client = createWebSocket(); client.on('open', () => { let cmd: Cmd = { cmd: "connect", message: "hello" } client.send(JSON.stringify(cmd)) }); client.on('message', (data) => { console.log('message', da...
AST#export_declaration#Left export AST#function_declaration#Left function connectWS 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#type_annotation#Left AST#prim...
export function connectWS(url:string): WebSocketClient { console.log("开始准备") let client = createWebSocket(); client.on('open', () => { let cmd: Cmd = { cmd: "connect", message: "hello" } client.send(JSON.stringify(cmd)) }); client.on('message', (data) => { console.log('message', da...
https://github.com/MoonlitDropOfBlood/websocket.git/blob/0e93f2a243442fec0c16b511081a9d7fddceb821/entry/src/main/ets/WebSocketDemo.ets#L13-L41
640af38368b95dc6daa3f8c76085016fe93d7426
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/components/CustomCalendar.ets
arkts
DayInfo
一天的信息
@Observed export class DayInfo { year: number; // 年 month: number; // 月 date: number; // 日 week: number; // 月视图周信息。月视图上点击上个月日期进行月份切换时需要用到 constructor(year: number, month: number, date: number, week: number) { this.year = year; this.month = month; this.date = date; this.week = week; } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Observed AST#decorator#Right export class DayInfo AST#class_body#Left { AST#property_declaration#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 年 AST#propert...
@Observed export class DayInfo { year: number; month: number; date: number; week: number; 视图周信息。月视图上点击上个月日期进行月份切换时需要用到 constructor(year: number, month: number, date: number, week: number) { this.year = year; this.month = month; this.date = date; this.week = week; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/components/CustomCalendar.ets#L224-L237
b1eb01072d67b8f650bd605b5f9cddfd5170e1f1
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PermissionUtil.ets
arkts
TODO 申请授权工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class PermissionUtil { /** * 校验当前是否已经授权 * @param permissions 待判断的权限 * @returns 已授权true,未授权false */ static async checkPermissions(permissions: Permissions): Promise<boolean> { let grantStatus: abilityAccessCtrl.GrantStatus = await PermissionUtil.checkAccessToken(permissions); if (grantS...
AST#export_declaration#Left export AST#class_declaration#Left class PermissionUtil AST#class_body#Left { /** * 校验当前是否已经授权 * @param permissions 待判断的权限 * @returns 已授权true,未授权false */ AST#method_declaration#Left static async checkPermissions AST#parameter_list#Left ( AST#parameter#Left permissions : AST#type_...
export class PermissionUtil { static async checkPermissions(permissions: Permissions): Promise<boolean> { let grantStatus: abilityAccessCtrl.GrantStatus = await PermissionUtil.checkAccessToken(permissions); if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { return true; }...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PermissionUtil.ets#L28-L153
1acbfa4826d80b40d16999788ff83fdd74bc6da7
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/MessageUtil.ets
arkts
警告提示框入参
export interface MessageCfg { /** * 上下文对象 */ context: UIContext; message: string; icon?: ResourceStr; duration?: number; showClose?: boolean; center?: boolean; onClose?: Function; }
AST#export_declaration#Left export AST#interface_declaration#Left interface MessageCfg AST#object_type#Left { /** * 上下文对象 */ AST#type_member#Left context : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left message...
export interface MessageCfg { context: UIContext; message: string; icon?: ResourceStr; duration?: number; showClose?: boolean; center?: boolean; onClose?: Function; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/MessageUtil.ets#L273-L284
18d1098802513dc254159782479f2d385f0efaf7
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/common/types/GreetingTypes.ets
arkts
AI祝福语生成响应接口
export interface AIGreetingResponse { content: string; alternativeContents?: string[]; confidence: number; processingTime: number; tokensUsed?: number; model?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AIGreetingResponse AST#object_type#Left { AST#type_member#Left content : 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 alternativeContents ? :...
export interface AIGreetingResponse { content: string; alternativeContents?: string[]; confidence: number; processingTime: number; tokensUsed?: number; model?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/GreetingTypes.ets#L123-L130
c9dd528fdfa82c56a5304cc5936f60e12b665fc3
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/chatwithexpression/src/main/ets/model/Emoji.ets
arkts
表情模型类
export class EmojiModel { imgSrc: Resource; // 图片资源 meaning: string = ''; // 表情所表示的含义 constructor(imgSrc: Resource, meaning: string) { this.imgSrc = imgSrc; this.meaning = meaning; } }
AST#export_declaration#Left export AST#class_declaration#Left class EmojiModel AST#class_body#Left { AST#property_declaration#Left imgSrc : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 图片资源 AST#property_declaration#Left mean...
export class EmojiModel { imgSrc: Resource; meaning: string = ''; constructor(imgSrc: Resource, meaning: string) { this.imgSrc = imgSrc; this.meaning = meaning; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chatwithexpression/src/main/ets/model/Emoji.ets#L19-L27
7c2fe16533acfd5ac4762b59cd8a4afaf0ce54f6
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/model/ActionCoreArg.ets
arkts
TODO BaseActionCore类的参数 author: 桃花镇童长老ᥫ᭡ since: 2024/08/01
export interface ActionCoreArg { dialogId: string; uiContext: UIContext; componentContent: ComponentContent<Object>; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ActionCoreArg AST#object_type#Left { AST#type_member#Left dialogId : 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 uiContext : AST#type_annota...
export interface ActionCoreArg { dialogId: string; uiContext: UIContext; componentContent: ComponentContent<Object>; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/model/ActionCoreArg.ets#L22-L26
983b21e2aac5ce3260966903eef6b5ba0d193d13
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/components/menu/VHInviteDialog.ets
arkts
shareImage
图片分享
private async shareImage() { this.showActionMenu = false; const uiContext: UIContext = this.getUIContext(); if(this.filePath === ''){ try { // 等待截图完成并保存文件 await new Promise<void>((resolve, reject) => { componentSnapshot.get(this.targetId) .then(async (pixmap: imag...
AST#method_declaration#Left private async shareImage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . showActionMe...
private async shareImage() { this.showActionMenu = false; const uiContext: UIContext = this.getUIContext(); if(this.filePath === ''){ try { await new Promise<void>((resolve, reject) => { componentSnapshot.get(this.targetId) .then(async (pixmap: image.PixelMap) =>...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/menu/VHInviteDialog.ets#L77-L129
0fe79f737857809ff7e27a9079f8ae534bc53136
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets
arkts
The style of CardComponent.
export class CardStyle { /** * The horizontal margin of CardComponent. */ static readonly CARD_MARGIN_HORIZONTAL: number = 16; /** * The top margin of CardComponent. */ static readonly CARD_MARGIN_TOP: number = 24; /** * The vertical padding of CardComponent. */ static readonly CARD_PADD...
AST#export_declaration#Left export AST#class_declaration#Left class CardStyle AST#class_body#Left { /** * The horizontal margin of CardComponent. */ AST#property_declaration#Left static readonly CARD_MARGIN_HORIZONTAL : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotati...
export class CardStyle { static readonly CARD_MARGIN_HORIZONTAL: number = 16; static readonly CARD_MARGIN_TOP: number = 24; static readonly CARD_PADDING_VERTICAL: number = 25; static readonly CARD_PADDING_HORIZONTAL: number = 16; static readonly CARD_RADIUS: number = 18; };
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets#L60-L85
45eb7355968b0ccc84a5a09ba6a0fa248149ac9b
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Card/MovieCard/entry/src/main/ets/common/utils/CommonUtils.ets
arkts
insertForm
Insert form data. @param {FormBean} form Form entity @param {relationalStore.RdbStore} rdbStore RDB database @return {Promise<number>} return the row ID if the operation is successful. return -1 otherwise.
insertForm(form: FormBean, rdbStore: relationalStore.RdbStore) { if ((this.isEmpty(rdbStore)) || (this.isEmpty(form))) { Logger.error(CommonConstants.TAG_COMMON_UTILS, 'insertForm rdbStore or form is null'); return; } rdbStore.insert(CommonConstants.TABLE_NAME, form.toValuesBucket()).catch((erro...
AST#method_declaration#Left insertForm AST#parameter_list#Left ( AST#parameter#Left form : AST#type_annotation#Left AST#primary_type#Left FormBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rdbStore : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left r...
insertForm(form: FormBean, rdbStore: relationalStore.RdbStore) { if ((this.isEmpty(rdbStore)) || (this.isEmpty(form))) { Logger.error(CommonConstants.TAG_COMMON_UTILS, 'insertForm rdbStore or form is null'); return; } rdbStore.insert(CommonConstants.TABLE_NAME, form.toValuesBucket()).catch((erro...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Card/MovieCard/entry/src/main/ets/common/utils/CommonUtils.ets#L58-L66
755452837ee035e9d7db5bed51dc98a84c003605
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.Filter.d.ets
arkts
Declare FilterType @enum { FilterType } @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare FilterType @enum { FilterType } @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
export declare enum FilterType { /** * The multi_line_filter type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * The multi_line_filter type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 11 */ MULTI_LINE_FILTER = 0, ...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum FilterType AST#enum_body#Left { /** * The multi_line_filter type. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * The multi_line_filter type. * @syscap SystemCapability...
export declare enum FilterType { MULTI_LINE_FILTER = 0, LIST_FILTER = 1 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Filter.d.ets#L40-L66
25fcb6f680314b39c88f93cef4f3b45bfb3e20a6
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the device udid. @permission ohos.permission.sec.ACCESS_UDID @syscap SystemCapability.Startup.SystemInfo @since 20 @arkts 1.2
static get udid(): string;
AST#method_declaration#Left static get AST#ERROR#Left udid AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
static get udid(): string;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L382-L382
4ce6a8b3d6fa2643df290295c11f1d87249d159d
gitee
wuyuanwuhui99/harmony-arkts-music-app-ui.git
fc75b993b76293666f9122f527ea3bc6caf7f75c
entry/src/main/ets/pages/MusicIndexPage.ets
arkts
placehostBuilder
@description: 底部导航栏切换 @date: 2024-05-30 22:47 @author wuwenqiang
@Builder tabBuilder(index: number, title: string, selectedImage: Resource, normalImage: Resource) { Column() { Image(this.activeIndex == index ? selectedImage : normalImage) .width(size.middlIconSize) .height(size.middlIconSize) .margin({ top: size.smallPadding, bottom: size.smallPaddi...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right AST#ERROR#Left tabBuilder AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_ann...
@Builder tabBuilder(index: number, title: string, selectedImage: Resource, normalImage: Resource) { Column() { Image(this.activeIndex == index ? selectedImage : normalImage) .width(size.middlIconSize) .height(size.middlIconSize) .margin({ top: size.smallPadding, bottom: size.smallPaddi...
https://github.com/wuyuanwuhui99/harmony-arkts-music-app-ui.git/blob/fc75b993b76293666f9122f527ea3bc6caf7f75c/entry/src/main/ets/pages/MusicIndexPage.ets#L108-L130
33eb831d4ee34b1010c4431269307dcc0241929b
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/bookGroupUtils.ets
arkts
moveBookByGroupId
管理页面批量移动分组 @author 2008 @param oldGroup @param newGroup 分组批量移动
async moveBookByGroupId(oldGroup: number | number[], newGroup: number) { try { let Ids: number[] = toolsUtils.numberArrays(oldGroup) //如果Ids里面有存在newGroup则把Ids移除 if (Ids.includes(newGroup)) { Ids = Ids.filter(item => item !== newGroup); } // 根据旧的分组Id获取书籍Id const booksInGro...
AST#method_declaration#Left async moveBookByGroupId AST#parameter_list#Left ( AST#parameter#Left oldGroup : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#union_type#R...
async moveBookByGroupId(oldGroup: number | number[], newGroup: number) { try { let Ids: number[] = toolsUtils.numberArrays(oldGroup) if (Ids.includes(newGroup)) { Ids = Ids.filter(item => item !== newGroup); } const booksInGroup = await BooksDao.queryBooksByGroupId(Ids)...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/bookGroupUtils.ets#L50-L72
6b97602beda6d39d68b55d3d96d38b6711d85119
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/ui_tools.ets
arkts
Infers the index of window. @param id The windowClass id (string).
export function window_index_of_id(id: string) { let windowIds = AppStorage.get('windowIds') as string[]; let window_idx = windowIds.indexOf(id); return window_idx; }
AST#export_declaration#Left export AST#function_declaration#Left function window_index_of_id 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#block_statement#Left { ...
export function window_index_of_id(id: string) { let windowIds = AppStorage.get('windowIds') as string[]; let window_idx = windowIds.indexOf(id); return window_idx; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L449-L453
088700a1e88865b9c59e5ee7762691c5f0a94103
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
SetAndProp
Called when dynamic properties are set. @since 7 @deprecated since 10
static SetAndProp<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T> { return AppStorage.setAndProp(propName, defaultValue) }
AST#method_declaration#Left static SetAndProp AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#param...
static SetAndProp<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T> { return AppStorage.setAndProp(propName, defaultValue) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L101-L103
e7566e651ac615da1a0251c3851ba4ce6d381282
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SettingsTypes.ets
arkts
设置验证规则接口
export interface SettingsValidationRules { reminderTime: ReminderTimeValidationRule; advanceDays: AdvanceDaysValidationRule; animationDuration: AnimationDurationValidationRule; autoLockTimeout: AutoLockTimeoutValidationRule; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SettingsValidationRules AST#object_type#Left { AST#type_member#Left reminderTime : AST#type_annotation#Left AST#primary_type#Left ReminderTimeValidationRule AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_membe...
export interface SettingsValidationRules { reminderTime: ReminderTimeValidationRule; advanceDays: AdvanceDaysValidationRule; animationDuration: AnimationDurationValidationRule; autoLockTimeout: AutoLockTimeoutValidationRule; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L473-L478
a8668d8c487f7b50c97e601a8de3a7efd589748d
github
zhongte/TaoYao
80850f3800dd6037216d3f7c58a2bf34a881c93f
taoyao/src/main/ets/shijing/taoyao/TaoYao.ets
arkts
with
直接在UIExtensionAbility中申请权限 @param uiAbility @returns
static with(extensionAbility: UIExtensionAbility): IAccessControl;
AST#method_declaration#Left static with AST#parameter_list#Left ( AST#parameter#Left extensionAbility : AST#type_annotation#Left AST#primary_type#Left UIExtensionAbility AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left IAcce...
static with(extensionAbility: UIExtensionAbility): IAccessControl;
https://github.com/zhongte/TaoYao/blob/80850f3800dd6037216d3f7c58a2bf34a881c93f/taoyao/src/main/ets/shijing/taoyao/TaoYao.ets#L25-L25
f66790e5959023a72cf3fc7fcf4acb71e8110413
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videolinkagelist/src/main/ets/model/NewsListDataSource.ets
arkts
pushData
在数据尾部增加一个元素
public pushData(data: NewsItem): void { this.dataList.push(data); this.notifyDataAdd(this.dataList.length - 1); }
AST#method_declaration#Left public pushData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left NewsItem 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...
public pushData(data: NewsItem): void { this.dataList.push(data); this.notifyDataAdd(this.dataList.length - 1); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videolinkagelist/src/main/ets/model/NewsListDataSource.ets#L48-L51
267f08d26f480d95d2448291c05148565f6fb5df
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/utils/DownloadUtils.ets
arkts
setDownloadPath
下载文件Path。 设置下载文件夹路径,仅SDK内部使用
static setDownloadPath(path: string) { DownloadUtils.downloadPath = path; }
AST#method_declaration#Left static setDownloadPath 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#builder_function_body#Left { AST#expression_statement#Left AST#...
static setDownloadPath(path: string) { DownloadUtils.downloadPath = path; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/DownloadUtils.ets#L24-L26
24ec38402bd1b958a23d7c13000f7f084c3ecf90
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/goods/src/main/ets/view/GoodsDetailPage.ets
arkts
GoodsDetailList
商品详情滚动列表 @param {boolean} showBanner - 是否展示轮播图 @returns {void} 无返回值
@Builder private GoodsDetailList(showBanner: boolean): void { List({ scroller: this.listScroller }) { if (showBanner) { ListItem() { GoodsBanner({ bannerList: this.vm.data?.goodsInfo?.pics ?? [], autoPlay: false, loop: false, imageFit: ImageF...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private GoodsDetailList AST#parameter_list#Left ( AST#parameter#Left showBanner : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type...
@Builder private GoodsDetailList(showBanner: boolean): void { List({ scroller: this.listScroller }) { if (showBanner) { ListItem() { GoodsBanner({ bannerList: this.vm.data?.goodsInfo?.pics ?? [], autoPlay: false, loop: false, imageFit: ImageF...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/goods/src/main/ets/view/GoodsDetailPage.ets#L149-L232
da7d6f2c0b180b2208e74eddc1c6f0d389a5da4e
github
RedRackham-R/WanAndroidHarmoney.git
0bb2a7c8d7b49194a96e42a380d43b7e106cdb22
entry/src/main/ets/ui/pages/mine/MineComponent.ets
arkts
itemCoinLayout
TODO 坑:因为目前@State 修饰变量无法传递引用,所以专门多增加一个积分layout
@Builder itemCoinLayout(onClick: (event?: ClickEvent) => void) { Row() { Image($r('app.media.ic_integral')) .height(22) .width(22) .objectFit(ImageFit.Auto) .margin({ left: 20, }) Text('我的积分') .margin({ left: 32 }) .f...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right itemCoinLayout AST#parameter_list#Left ( AST#parameter#Left onClick : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left event ? : AST#type_annotation#Left AST#primary_type#Left ClickEvent AST#primary_...
@Builder itemCoinLayout(onClick: (event?: ClickEvent) => void) { Row() { Image($r('app.media.ic_integral')) .height(22) .width(22) .objectFit(ImageFit.Auto) .margin({ left: 20, }) Text('我的积分') .margin({ left: 32 }) .f...
https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/ui/pages/mine/MineComponent.ets#L98-L128
88d29629bd29cc317c4ce7574b21320ea2e3e13b
github
zhuanyongtester/Cpay_arkts.git
4402a8a06963d0757952513d3cbf7d5919ceb74f
entry/src/main/ets/comm/CommonConstants.ets
arkts
SkeletonData for SkeletonView
export const SkeletonData: SkeletonType[] = [ { isMine: false }, { isMine: false }, { isMine: false }, { isMine: true }, { isMine: false }, { isMine: true }, { isMine: true }, { isMine: false }, { isMine: false }, { isMine: false }, { ...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SkeletonData : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left SkeletonType [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#...
export const SkeletonData: SkeletonType[] = [ { isMine: false }, { isMine: false }, { isMine: false }, { isMine: true }, { isMine: false }, { isMine: true }, { isMine: true }, { isMine: false }, { isMine: false }, { isMine: false }, { ...
https://github.com/zhuanyongtester/Cpay_arkts.git/blob/4402a8a06963d0757952513d3cbf7d5919ceb74f/entry/src/main/ets/comm/CommonConstants.ets#L59-L105
4324f464545d379afe37b132c8d1680c185c70d5
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/KeyboardAvoid/casesfeature/keyboardavoid/Index.ets
arkts
KeyboardAvoid
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { KeyboardAvoid } from './src/main/ets/components/KeyboardAvoidIndex';
AST#export_declaration#Left export { KeyboardAvoid } from './src/main/ets/components/KeyboardAvoidIndex' ; AST#export_declaration#Right
export { KeyboardAvoid } from './src/main/ets/components/KeyboardAvoidIndex';
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/KeyboardAvoid/casesfeature/keyboardavoid/Index.ets#L15-L15
9eb915b84daee3f32490f7b5b02aa22fb7e39a43
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/CandleDataSet.ets
arkts
setBarSpace
Sets the space that is left out on the left and right side of each candle, default 0.1f (10%), max 0.45f, min 0f @param space
public setBarSpace(space: number): void { if (space < 0) space = 0; if (space > 0.45) space = 0.45; this.mBarSpace = space; }
AST#method_declaration#Left public setBarSpace AST#parameter_list#Left ( AST#parameter#Left space : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type...
public setBarSpace(space: number): void { if (space < 0) space = 0; if (space > 0.45) space = 0.45; this.mBarSpace = space; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/CandleDataSet.ets#L140-L148
e5706b7f406c80cbf8a278d84d6a6873376e8dc2
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/dealstridesolution/Index.ets
arkts
DealStrideSolutionComponent
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { DealStrideSolutionComponent } from './src/main/ets/components/MainPage'
AST#export_declaration#Left export { DealStrideSolutionComponent } from './src/main/ets/components/MainPage' AST#export_declaration#Right
export { DealStrideSolutionComponent } from './src/main/ets/components/MainPage'
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dealstridesolution/Index.ets#L29-L29
f7626bff703102898c4babd9a1f25cf3ae0da615
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/ContactTypes.ets
arkts
联系人详情页面数据接口
export interface ContactDetailData { contact: Contact; recentGreetings: RecentGreeting[]; upcomingEvents: UpcomingEvent[]; statistics: ContactStatisticsDetail; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ContactDetailData AST#object_type#Left { AST#type_member#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left recentGreetings : AST#t...
export interface ContactDetailData { contact: Contact; recentGreetings: RecentGreeting[]; upcomingEvents: UpcomingEvent[]; statistics: ContactStatisticsDetail; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L352-L357
9d4a536d7917446c7e6ca4fb1d9ed2c720d98191
github
wuyuanwuhui99/harmony-arkts-music-app-ui.git
fc75b993b76293666f9122f527ea3bc6caf7f75c
entry/src/main/ets/components/CommentComponent.ets
arkts
buildCommentInput
@author: wuwenqiang @description: 创建评论框 @date: 2024-05-26 14:26
@Builder buildCommentInput() { Column() { Row() { TextInput({ text: this.text, placeholder: this.replyComment ? `回复${this.replyComment.username}` : (this.firstComment ? `回复${this.firstComment.username}` : '评论') }).defaultFocus(true) .layoutWeight(1) .foc...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCommentInput AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_u...
@Builder buildCommentInput() { Column() { Row() { TextInput({ text: this.text, placeholder: this.replyComment ? `回复${this.replyComment.username}` : (this.firstComment ? `回复${this.firstComment.username}` : '评论') }).defaultFocus(true) .layoutWeight(1) .foc...
https://github.com/wuyuanwuhui99/harmony-arkts-music-app-ui.git/blob/fc75b993b76293666f9122f527ea3bc6caf7f75c/entry/src/main/ets/components/CommentComponent.ets#L75-L142
6af1407edbddda6f4ee90aaeee6c6290972e5a14
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ImageUtil.ets
arkts
packToFileFromImageSource
将ImageSource图片源编码后直接打包进文件。 @param source ImageSource-打包的图片源。 @param fd 文件描述符。 @param option 设置打包参数: format 目标格式。当前只支持"image/jpeg"、"image/webp"、"image/png"和"image/heif"12+(不同硬件设备支持情况不同)。 quality JPEG编码中设定输出图片质量的参数,取值范围为0-100。 bufferSize 接收编码数据的缓冲区大小,单位为Byte。默认为10MB。bufferSize需大于编码后图片大小。 @returns
static packToFileFromImageSource(source: image.ImageSource, fd: number, options: image.PackingOption): Promise<void> { const imagePacker: image.ImagePacker = image.createImagePacker(); return imagePacker.packToFile(source, fd, options).finally(() => { imagePacker.release(); //释放 }); }
AST#method_declaration#Left static packToFileFromImageSource AST#parameter_list#Left ( AST#parameter#Left source : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . ImageSource AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left...
static packToFileFromImageSource(source: image.ImageSource, fd: number, options: image.PackingOption): Promise<void> { const imagePacker: image.ImagePacker = image.createImagePacker(); return imagePacker.packToFile(source, fd, options).finally(() => { imagePacker.release(); }); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ImageUtil.ets#L236-L241
b70b7f0f78f4521709eace394b14577166d15cd1
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/view/FootprintPage.ets
arkts
构建足迹页面 @returns {void} 无返回值
build() { AppNavDestination({ title: "足迹", viewModel: this.vm }) { this.FootprintContent(); } }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left "足迹" AST#expression#Right AST#component_parameter#Right , AST#component_pa...
build() { AppNavDestination({ title: "足迹", viewModel: this.vm }) { this.FootprintContent(); } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/view/FootprintPage.ets#L20-L27
bd0377479ff474a4d6baa6f426f65473c46ab760
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/LanguageBaseClassLibrary/ConcurrentModule/entry/src/main/ets/fileFs/MyWorker.ets
arkts
readyFilesToWorker
worker file
readyFilesToWorker(): void { let content = CONTENT + CONTENT + new Date() + '\n'; let workerDir = this.baseDir + '/workerDir'; try { if (!fs.accessSync(workerDir)) { fs.mkdirSync(workerDir); } Logger.info(TAG, 'readyFilesToWorker dpath = ' + workerDir); for (let i = 0; i < F...
AST#method_declaration#Left readyFilesToWorker AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left content ...
readyFilesToWorker(): void { let content = CONTENT + CONTENT + new Date() + '\n'; let workerDir = this.baseDir + '/workerDir'; try { if (!fs.accessSync(workerDir)) { fs.mkdirSync(workerDir); } Logger.info(TAG, 'readyFilesToWorker dpath = ' + workerDir); for (let i = 0; i < F...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/LanguageBaseClassLibrary/ConcurrentModule/entry/src/main/ets/fileFs/MyWorker.ets#L54-L79
f4a2830d647282f237a181ea9a31c759324c1bc6
gitee
kumaleap/ArkSwipeDeck.git
5afa77b9b2a2a531595d31f895c54a3371e4249a
library/src/main/ets/types/SwipeCardTypes.ets
arkts
手势状态接口
export interface GestureState { startX: number; startY: number; currentX: number; currentY: number; deltaX: number; deltaY: number; velocity: number; isActive: boolean; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GestureState AST#object_type#Left { AST#type_member#Left startX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left startY : AST#type_annotation#L...
export interface GestureState { startX: number; startY: number; currentX: number; currentY: number; deltaX: number; deltaY: number; velocity: number; isActive: boolean; }
https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/types/SwipeCardTypes.ets#L180-L189
f3e127d76a8ccda56c36b44a658edbfd9236d8a3
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/DialogUtil.ets
arkts
@Author csx @DateTime 2024/1/24 19:31 @TODO DialogUtil 对话框工具类 @Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_ui
export class DialogUtil { /** * 弹出一个Dialog提示框 * @param options: { * title:标题默认为温馨提示, * msg:提示消息, * okText:确定按钮文本, * cancelText:取消按钮文本, * alignment:弹窗在竖直方向上的对齐方式, * maskRect:弹窗遮蔽层区域, * isModal:弹窗是否为模态窗口, * offset:弹窗相对alignment所在位置的偏移量, * okCallBack:确定按钮事件, * cancelCallBack:取消按钮事件 ...
AST#export_declaration#Left export AST#class_declaration#Left class DialogUtil AST#class_body#Left { /** * 弹出一个Dialog提示框 * @param options: { * title:标题默认为温馨提示, * msg:提示消息, * okText:确定按钮文本, * cancelText:取消按钮文本, * alignment:弹窗在竖直方向上的对齐方式, * maskRect:弹窗遮蔽层区域, * isModal:弹窗是否为模态窗口, * offset:弹窗相...
export class DialogUtil { static showDialog(options: DialogOptions) { if (!options) { options = new DialogOptions(); } if (!options.okText) { options.okText = Const.DIALOG_OK; } if (!options.title) { options.title = Const.DIALOG_TITLE; } if (!options.cancelText) { ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/DialogUtil.ets#L28-L248
d8bbd184cc783d7df3a10fb6904aa22f47e941a8
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/TargetManagement/entry/src/main/ets/common/utils/DateUtil.ets
arkts
Obtaining and formatting the current system time.
export default function getCurrentTime(): string { let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + CommonConstants.PLUS_ONE; let day = date.getDate(); let hours = date.getHours(); let minutes = date.getMinutes().toString(); if (Number.parseInt(minutes) < CommonConstants...
AST#export_declaration#Left export default AST#expression#Left AST#function_expression#Left function getCurrentTime 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 ...
export default function getCurrentTime(): string { let date = new Date(); let year = date.getFullYear(); let month = date.getMonth() + CommonConstants.PLUS_ONE; let day = date.getDate(); let hours = date.getHours(); let minutes = date.getMinutes().toString(); if (Number.parseInt(minutes) < CommonConstants...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TargetManagement/entry/src/main/ets/common/utils/DateUtil.ets#L21-L36
a678c31a1ae1ccd6b7648d10ec0d759abfe14438
gitee
texiwustion/chinese-herbal-shopping--arkts.git
3f71338f3c6d88bc74342e0322867f3a0c2c17d1
entry/src/main/ets/database/Rdb.ets
arkts
query
查询数据的方法,接收两个参数,谓词、回调函数
query(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { // 如果回调函数为空、或undefined 打印错误日志,退出方法 if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'query() has no callback!'); return; } // 如果rdbStore存在则执行...
AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left predicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . RdbPredicates AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback :...
query(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'query() has no callback!'); return; } if (this.rdbStore) { this.rdbStore...
https://github.com/texiwustion/chinese-herbal-shopping--arkts.git/blob/3f71338f3c6d88bc74342e0322867f3a0c2c17d1/entry/src/main/ets/database/Rdb.ets#L159-L183
cb9e9fa8f7ec5ea308ead1ae2216cc87f6bd8a6e
github
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/config/AppConfig.ets
arkts
@Author peerless2012 @Email peerless2012@126.com @DateTime 2026/1/17 16:22 @Version V1.0 @Description
export class AppConfig { public static readonly CONFIG = "config" private readonly context: Context sortBy: FinSortBy = FinSortBy.Name sortOrder: FinSortOrder = FinSortOrder.Ascending pageSize: FinPageSize = FinPageSize.Size_50 constructor
AST#export_declaration#Left export AST#ERROR#Left class AppConfig { AST#property_declaration#Left public static readonly CONFIG = AST#expression#Left "config" AST#expression#Right AST#property_declaration#Right private readonly context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST...
export class AppConfig { public static readonly CONFIG = "config" private readonly context: Context sortBy: FinSortBy = FinSortBy.Name sortOrder: FinSortOrder = FinSortOrder.Ascending pageSize: FinPageSize = FinPageSize.Size_50 constructor
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/config/AppConfig.ets#L11-L23
a6460b92f9bf17cb10512350d2468770a7756924
github
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
common/src/main/ets/viewmodel/AppViewModel.ets
arkts
AppTmpViewModel
暂存数据中心
@ObservedV2 export class AppTmpViewModel { // 是否有网 @Trace isNetwork: boolean = false; // 当前握持手 @Trace holdingHandStatus: motion.HoldingHandStatus = motion.HoldingHandStatus.NOT_HELD; // 是否正在系统分享 @Trace isSystemShare: boolean = false; // 当前系统分享图片uri @Trace systemShareImgUri: string = ''; // 是否开启应用接续 ...
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export class AppTmpViewModel AST#class_body#Left { // 是否有网 AST#property_declaration#Left AST#decorator#Left @ Trace AST#decorator#Right isNetwork : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#...
@ObservedV2 export class AppTmpViewModel { @Trace isNetwork: boolean = false; @Trace holdingHandStatus: motion.HoldingHandStatus = motion.HoldingHandStatus.NOT_HELD; @Trace isSystemShare: boolean = false; @Trace systemShareImgUri: string = ''; @Trace isContinue: boolean = false; @Trace con...
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/common/src/main/ets/viewmodel/AppViewModel.ets#L65-L84
7c9078422111616a5ee7640974fa0aea9d5425e9
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/todo/TodoEditPage.ets
arkts
loadTodo
加载代办事项
private async loadTodo(): Promise<void> { try { this.loading = true; this.todo = await this.todoService.getTodo(this.todoId); if (this.todo) { this.title = this.todo.title; this.description = this.todo.description || ''; this.date = this.todo.date; this.time ...
AST#method_declaration#Left private async loadTodo AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type...
private async loadTodo(): Promise<void> { try { this.loading = true; this.todo = await this.todoService.getTodo(this.todoId); if (this.todo) { this.title = this.todo.title; this.description = this.todo.description || ''; this.date = this.todo.date; this.time ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/todo/TodoEditPage.ets#L82-L104
48955eb667a2d49a3491b737c40a8a7ca0dd758d
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/containernestedslide/src/main/ets/common/CommonConstants.ets
arkts
Common constants for common component.
export 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: number...
AST#export_declaration#Left export 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.9 AST#ex...
export 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; static re...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/common/CommonConstants.ets#L19-L119
462fe4bd80d28a90491788b45d1af84124c3753a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/entryability/EntryAbility.ets
arkts
setupWindow
设置窗口属性 @param windowStage 窗口Stage
private async setupWindow(windowStage: window.WindowStage): Promise<void> { try { const windowClass = await windowStage.getMainWindow(); // 设置窗口全屏 await windowClass.setWindowSystemBarEnable(['status', 'navigation']); // 设置状态栏样式 await windowClass.setWindowSystemBarProperti...
AST#method_declaration#Left private async setupWindow AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#...
private async setupWindow(windowStage: window.WindowStage): Promise<void> { try { const windowClass = await windowStage.getMainWindow(); await windowClass.setWindowSystemBarEnable(['status', 'navigation']); await windowClass.setWindowSystemBarProperties({ status...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/entryability/EntryAbility.ets#L157-L180
429d9744e3fa7a236e99105ea42439da8c9d359f
github
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegCommandBuilder.ets
arkts
buildString
构建命令字符串(调试用)
public buildString(): string { return this.build().join(' '); }
AST#method_declaration#Left public buildString 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...
public buildString(): string { return this.build().join(' '); }
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegCommandBuilder.ets#L238-L240
841b8596e5528931e85e082d803796ddfdc52c2b
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/TcpClient.ets
arkts
connectToServer
连接到服务端
async connectToServer() { if (this.clientIp === '' || !this.clientPort || this.serverIp === '' || !this.serverPort) { this.msgHistory += 'Some required fields are missing.' + '\r\n'; Logger.error('Some required fields are missing.'); return; } let tcpMessage: TcpMessage = { type: '...
AST#method_declaration#Left async connectToServer 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#binary_expression#Left AST...
async connectToServer() { if (this.clientIp === '' || !this.clientPort || this.serverIp === '' || !this.serverPort) { this.msgHistory += 'Some required fields are missing.' + '\r\n'; Logger.error('Some required fields are missing.'); return; } let tcpMessage: TcpMessage = { type: '...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/TcpClient.ets#L184-L216
18e30c7124f3ae3a89bd81b79e495c8f2ef0591b
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Notification/CustomNotificationBadge/notification/index.ets
arkts
notificationUtil
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { notificationUtil } from './src/main/ets/notification/NotificationUtil';
AST#export_declaration#Left export { notificationUtil } from './src/main/ets/notification/NotificationUtil' ; AST#export_declaration#Right
export { notificationUtil } from './src/main/ets/notification/NotificationUtil';
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Notification/CustomNotificationBadge/notification/index.ets#L16-L16
9cf9bc00ef34d0c5add1dab802d5a42a0e032906
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ObjectPool.ets
arkts
An object pool for recycling of object instances extending Poolable. Cost/Benefit : Cost - The pool can only contain objects extending Poolable. Benefit - The pool can very quickly determine if an object is elligable for storage without iteration. Benefit - The pool can also know if an instance of Poolable is already...
export class ObjectPool<T extends Poolable> { private static ids = 0; public poolId: number = 0; private desiredCapacity: number = 0; private objects: Object[] | null = null; private objectsPointer: number = 0; private modelObject: T | null = null; private replenishPercentage: number = 0; /** * Retu...
AST#export_declaration#Left export AST#class_declaration#Left class ObjectPool AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left Poolable AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#class_body#Left { ...
export class ObjectPool<T extends Poolable> { private static ids = 0; public poolId: number = 0; private desiredCapacity: number = 0; private objects: Object[] | null = null; private objectsPointer: number = 0; private modelObject: T | null = null; private replenishPercentage: number = 0; public get...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ObjectPool.ets#L31-L173
ccfe2104a25fe23612e9b04b2cc9ae0b1a89522e
gitee
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/pages/MainPage.ets
arkts
aboutToAppear
页面加载时检查登录状态 Check login status when page loads Source: 集成登录功能
aboutToAppear() { }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToAppear() { }
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/pages/MainPage.ets#L59-L60
806f9d9b8709348c6863fc0ed6c2177dc8421580
github
fmtjava/Ohs_ArkTs_Eyepetizer.git
79578f394ccb926da1455e63b7fe0722df9b9a22
entry/src/main/ets/datasource/BasicDataSource.ets
arkts
unregisterDataChangeListener
取消注册数据变化监听器
unregisterDataChangeListener(listener: DataChangeListener): void { let index = this.listeners.indexOf(listener); if (index >= 0) { // 在listeners里面,就删除 this.listeners.splice(index, 1); } }
AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L...
unregisterDataChangeListener(listener: DataChangeListener): void { let index = this.listeners.indexOf(listener); if (index >= 0) { this.listeners.splice(index, 1); } }
https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/datasource/BasicDataSource.ets#L100-L106
9c48f036695f269078d2632d79d137a07e7252cf
github
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/Viewmodel/HomeViewModel.ets
arkts
getAccountingListOfMouth
获取某月记账列表
public getAccountingListOfMouth(year: string, mouth: string): string { this.customAccountingList = this.dateArr.reduce((accumulator, item) => { if ((item.date.getMonth() + 1).toString() === mouth && (item.date.getFullYear()).toString() === year) { accumulator = accumulator.concat(item.accountingList);...
AST#method_declaration#Left public getAccountingListOfMouth AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left mouth : AST#type_annotation#Left AST#primary_type#Left string AS...
public getAccountingListOfMouth(year: string, mouth: string): string { this.customAccountingList = this.dateArr.reduce((accumulator, item) => { if ((item.date.getMonth() + 1).toString() === mouth && (item.date.getFullYear()).toString() === year) { accumulator = accumulator.concat(item.accountingList);...
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/Viewmodel/HomeViewModel.ets#L363-L375
40f4fb8eb3fc2dd72266192471d18316a84a2b78
github
Vinson0709/arkdemo.git
793491fe04b387f55dadfef86b30e28d0535d994
entry/src/main/ets/pages/Grids.ets
arkts
bodyBuilder
内容展示(自定义builder渲染)
@Builder bodyBuilder() { Column(){ // Grid 栅格(行列分割) Text('Grid 栅格(行列分割)') .fontSize(14) .margin({ top:20, bottom: 12}) Grid() { ForEach(this.numberData, (item: number) => { ForEach(this.numberData, (subItem: number) => { GridItem() { Tex...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right bodyBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // Grid 栅格(行列分割) ...
@Builder bodyBuilder() { Column(){ Text('Grid 栅格(行列分割)') .fontSize(14) .margin({ top:20, bottom: 12}) Grid() { ForEach(this.numberData, (item: number) => { ForEach(this.numberData, (subItem: number) => { GridItem() { Text(subItem.toStri...
https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Grids.ets#L46-L139
dc10b68ea089b10e8bc037c18c31c13f0ea14658
github
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/CategorySample/entry/src/main/ets/common/bean/GridItemData.ets
arkts
Grid item data.
export class GridItemData { /** * Grid item content. */ content: Resource; }
AST#export_declaration#Left export AST#class_declaration#Left class GridItemData AST#class_body#Left { /** * Grid item content. */ AST#property_declaration#Left content : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right } AST...
export class GridItemData { content: Resource; }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/CategorySample/entry/src/main/ets/common/bean/GridItemData.ets#L4-L9
826c1a9df9f5a7c88232121b65c5aed7398fd4f5
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Piece.ets
arkts
lessThan
判断是否小于另一个Piece对象 @param other - 另一个Piece对象
lessThan(other: Piece): boolean { return this.compareTo(other) < 0; }
AST#method_declaration#Left lessThan AST#parameter_list#Left ( AST#parameter#Left other : AST#type_annotation#Left AST#primary_type#Left Piece AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right A...
lessThan(other: Piece): boolean { return this.compareTo(other) < 0; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Piece.ets#L93-L95
804aab9b59bb36bc986ca81df2aa5351f477ddc0
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/TypeUtil.ets
arkts
isPromise
检查是否为Promise类型。 @param value @returns
static isPromise(value: Object): boolean { return new util.types().isPromise(value); }
AST#method_declaration#Left static isPromise AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_typ...
static isPromise(value: Object): boolean { return new util.types().isPromise(value); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L249-L251
2df013c4dc9a4ae44cdd851ca4e9a3a754aaa645
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/i18n/I18nManager.ets
arkts
loadTranslations
私有方法 加载翻译资源
private async loadTranslations(): Promise<void> { // 这里应该从资源文件或网络加载翻译 // 目前使用硬编码的翻译作为示例 // 简体中文翻译 this.translations.set(SupportedLanguage.ZH_CN, { common: { ok: '确定', cancel: '取消', save: '保存', delete: '删除', edit: '编辑', add: '添加', search:...
AST#method_declaration#Left private async loadTranslations AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > ...
private async loadTranslations(): Promise<void> { this.translations.set(SupportedLanguage.ZH_CN, { common: { ok: '确定', cancel: '取消', save: '保存', delete: '删除', edit: '编辑', add: '添加', search: '搜索', settings: '设置', back: ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/i18n/I18nManager.ets#L501-L628
aa1a4239ea4eb34484492536bfcb9ecbc03ddf45
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/SyncTypes.ets
arkts
错误相关
export interface SyncError { code: SyncErrorCode; message: string; details?: Record<string, string | number | boolean>; timestamp: string; dataType?: DataType; itemId?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SyncError AST#object_type#Left { AST#type_member#Left code : AST#type_annotation#Left AST#primary_type#Left SyncErrorCode AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left message : AST#type_annotatio...
export interface SyncError { code: SyncErrorCode; message: string; details?: Record<string, string | number | boolean>; timestamp: string; dataType?: DataType; itemId?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SyncTypes.ets#L225-L232
7bbb47f1d0fd5f93c0c3aface3e89589bd0c127e
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/model/observe/LoadingObserved.ets
arkts
LoadingObserved
加载弹窗Observed数据(可实时变更文本) 可无需再次弹窗时,变更加载中的文本
@ObservedV2 export class LoadingObserved extends CommonObservedData { /** * 加载动画的提示文字(赋值后可实时变更) */ @Trace content?: ResourceStr; }
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export class LoadingObserved extends AST#type_annotation#Left AST#primary_type#Left CommonObservedData AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { /** * 加载动画的提示文字(赋值后可实时变更) */ AST#property_declarat...
@ObservedV2 export class LoadingObserved extends CommonObservedData { @Trace content?: ResourceStr; }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/observe/LoadingObserved.ets#L7-L14
4ad997765e178702adffb51e63f0f482e02284b8
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/subscription/SubscriptionInfoManager.ets
arkts
get
------------------------- Getter / Setter -------------------------
get isWaitingRefreshToServer(): boolean { return this._isWaitingRefreshToServer; }
AST#method_declaration#Left get AST#ERROR#Left isWait in gRefreshToServer AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left...
get isWaitingRefreshToServer(): boolean { return this._isWaitingRefreshToServer; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/subscription/SubscriptionInfoManager.ets#L42-L44
2276de71c49ba46ebeff561482a7bc7509f0585d
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/util/src/main/ets/notification/NotificationUtil.ets
arkts
发布模板的通知 @param {NotificationTemplateOptions} options 通知消息配置项 @returns {Promise<number>} number 返回通知ID
export async function sendTemplate(options: NotificationTemplateOptions): Promise<number> { const notificationId: number = Date.now(); // 通知ID基于时间戳生成,确保唯一性 const basicContent: notificationManager.NotificationBasicContent = { title: options.mainTitle, text: options.mainContent, } ...
AST#export_declaration#Left export AST#function_declaration#Left async function sendTemplate AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left NotificationTemplateOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right :...
export async function sendTemplate(options: NotificationTemplateOptions): Promise<number> { const notificationId: number = Date.now(); const basicContent: notificationManager.NotificationBasicContent = { title: options.mainTitle, text: options.mainContent, } if (options.suppleme...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/notification/NotificationUtil.ets#L178-L201
2564c2600ec68d8dd3d2a5434b1310049fbe344f
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/Language/AppLanguage.ets
arkts
AppLanguage.ets
export enum AppLanguage { Simplified = "zh-Hans", // 简体(默认) Traditional = "zh-Hant" // 繁体 }
AST#export_declaration#Left export AST#enum_declaration#Left enum AppLanguage AST#enum_body#Left { AST#enum_member#Left Simplified = AST#expression#Left "zh-Hans" AST#expression#Right AST#enum_member#Right , // 简体(默认) AST#enum_member#Left Traditional = AST#expression#Left "zh-Hant" AST#expression#Right AST#enum_member#...
export enum AppLanguage { Simplified = "zh-Hans", Traditional = "zh-Hant" }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Language/AppLanguage.ets#L2-L5
b71a0637e2b0f2211719bc1242f8c96e41bd0f76
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/pages/TitleWindowPage.ets
arkts
createSubscriberCallBack
创建订阅者回调
function createSubscriberCallBack(err, data) { subscriber = data; //订阅公共事件 CommonEvent.subscribe(subscriber, subscribeCallBack); }
AST#function_declaration#Left function createSubscriberCallBack AST#parameter_list#Left ( AST#parameter#Left err AST#parameter#Right , AST#parameter#Left data AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_exp...
function createSubscriberCallBack(err, data) { subscriber = data; CommonEvent.subscribe(subscriber, subscribeCallBack); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/pages/TitleWindowPage.ets#L93-L97
16f520b4b09ad1821ce2c400108ced48bd606701
gitee
robotzzh/AgricultureApp.git
7b12c588dd1d07cc07a8b25577d785d30bd838f6
entry/src/main/ets/models/Code.ets
arkts
01 03 00 00 00 01 84 0A 读取含水量 01 03 00 01 00 01 D5 CA 只读取温度 01 03 00 02 00 01 25 CA 读取电导率 01 03 00 03 00 01 74 0A 读取PH 01 03 00 04 00 01 C5 CB 读取K 01 03 00 05 00 01 94 0B 读取P 01 03 00 06 00 01 64 0B 读取K 01 03 00 07 00 01 35 CB 读取盐度 01 03 00 08 00 01 05 C8 读取总溶解固体 01 03 02 00 2A 39 9B 响应 00 2A 读取含水量 扩大十倍 01 03 02 00 F9...
export interface Item{ destination : number; code: string; name: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface Item AST#object_type#Left { AST#type_member#Left destination : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left code : AST#type_annotation#Left A...
export interface Item{ destination : number; code: string; name: string; }
https://github.com/robotzzh/AgricultureApp.git/blob/7b12c588dd1d07cc07a8b25577d785d30bd838f6/entry/src/main/ets/models/Code.ets#L21-L25
3babe6a06dd569f040f8e89154e257bf215b088c
github
CQULeaf/HarmonyOS-App-Development.git
91f6ab13be3dbf83f6c1c4d2958673f15faefe46
Lab1/entry/src/main/ets/pages/ResultPage.ets
arkts
if
打印查看传递过来的参数
if (myParam) { this.results = myParam.result; // 正确地访问data1并赋值给results }
AST#method_declaration#Left if AST#parameter_list#Left ( AST#parameter#Left myParam AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . ...
if (myParam) { this.results = myParam.result; }
https://github.com/CQULeaf/HarmonyOS-App-Development.git/blob/91f6ab13be3dbf83f6c1c4d2958673f15faefe46/Lab1/entry/src/main/ets/pages/ResultPage.ets#L12-L14
e8dfb26f860a0f88e4fa2d86d37c043226f63db2
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/notificationUtil/NotificationContentUtil.ets
arkts
initNotificationPictureContent
init picture notification content @param basicContent @param notificationBriefText @param notificationExpandedTitle @param notificationPicture @return return the created NotificationContent
initNotificationPictureContent(basicContent: notificationManager.NotificationBasicContent, notificationBriefText: string, notificationExpandedTitle: string, notificationPicture: image.PixelMap): notificationManager.NotificationContent { return { contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTU...
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 notificationManager . NotificationBasicContent AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#param...
initNotificationPictureContent(basicContent: notificationManager.NotificationBasicContent, notificationBriefText: string, notificationExpandedTitle: string, notificationPicture: image.PixelMap): notificationManager.NotificationContent { return { contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTU...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/notificationUtil/NotificationContentUtil.ets#L90-L102
378c3a0285f368cdd8881617a2471ba27a7dcd10
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/AbilityUtils.ets
arkts
openAppStore
打开应用商城 @param options
static openAppStore(appId: string, options?: StartOptions) { let want: Want = { action: 'ohos.want.action.appdetail', uri: 'store://appgallery.huawei.com/app/detail?id=C' + appId } let context = getContext() as common.UIAbilityContext context.startAbility(want, options) }
AST#method_declaration#Left static openAppStore AST#parameter_list#Left ( AST#parameter#Left appId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left StartOptions AST...
static openAppStore(appId: string, options?: StartOptions) { let want: Want = { action: 'ohos.want.action.appdetail', uri: 'store://appgallery.huawei.com/app/detail?id=C' + appId } let context = getContext() as common.UIAbilityContext context.startAbility(want, options) }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/AbilityUtils.ets#L68-L75
7c623526d8351b506e6666bc6ff93d47b806aea6
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/goods/src/main/ets/view/GoodsCategoryPage.ets
arkts
GoodsCategoryPage
@file 商品分类页面视图 @author Joker.X
@ComponentV2 export struct GoodsCategoryPage { /** * 商品分类页面 ViewModel */ @Local private vm: GoodsCategoryViewModel = new GoodsCategoryViewModel(); /** * 构建商品分类页面 * @returns {void} 无返回值 */ build() { AppNavDestination({ title: "商品分类", viewModel: this.vm }) { this.GoodsC...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct GoodsCategoryPage AST#component_body#Left { /** * 商品分类页面 ViewModel */ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Left Go...
@ComponentV2 export struct GoodsCategoryPage { @Local private vm: GoodsCategoryViewModel = new GoodsCategoryViewModel(); build() { AppNavDestination({ title: "商品分类", viewModel: this.vm }) { this.GoodsCategoryContent(); } } @Builder private GoodsCategoryContent() { ...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/goods/src/main/ets/view/GoodsCategoryPage.ets#L8-L37
06be2b4ed3dc141874ac6e1e26f34fe80bea0926
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Common constants for all features.
export class CommonConstants { /** * The prefix of app store key. */ public static readonly PREFIX: string = 'water_flow_sample_'; /** * The key of status bar height. */ public static readonly AS_KEY_STATUS_BAR_HEIGHT: string = `${CommonConstants.PREFIX}statusBarHeight`; /** * The key of naviga...
AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * The prefix of app store key. */ AST#property_declaration#Left public static readonly PREFIX : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST...
export class CommonConstants { public static readonly PREFIX: string = 'water_flow_sample_'; public static readonly AS_KEY_STATUS_BAR_HEIGHT: string = `${CommonConstants.PREFIX}statusBarHeight`; public static readonly AS_KEY_NAVIGATOR_BAR_HEIGHT: string = `${CommonConstants.PREFIX}navigatorBarHeight`; }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WaterFlowSample/entry/src/main/ets/common/constants/CommonConstants.ets#L19-L32
daade0dff109f1b9dec009790b760ee33163cb13
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
HDRVivid/AVRecorder/entry/src/main/ets/utils/RouterParams.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 RouterParams { text: string; data: string; constructor(str: string, data: string) { this.text = str; this.data = data; } }
AST#export_declaration#Left export AST#class_declaration#Left class RouterParams AST#class_body#Left { AST#property_declaration#Left text : 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 data : AST#typ...
export class RouterParams { text: string; data: string; constructor(str: string, data: string) { this.text = str; this.data = data; } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVRecorder/entry/src/main/ets/utils/RouterParams.ets#L16-L24
c1cd42eab604b5fb9233acac8dcc9a0f41d6fcca
gitee
iotjin/JhHarmonyDemo.git
819e6c3b1db9984c042a181967784550e171b2e8
JhCommon/src/main/ets/JhCommon/components/JhProgressHUD.ets
arkts
hide
/ 隐藏加载框
public static hide() { XTPromptHUD.hideAllToast() XTPromptHUD.hideAllLoading() XTPromptHUD.hideProgress() XTPromptHUD.hideCustomHUD() }
AST#method_declaration#Left public static hide 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 XTPromptHUD AST#expression#Right . hideAllToa...
public static hide() { XTPromptHUD.hideAllToast() XTPromptHUD.hideAllLoading() XTPromptHUD.hideProgress() XTPromptHUD.hideCustomHUD() }
https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhProgressHUD.ets#L89-L94
eda86eb2123cc05b0df92f3b1d0bf8f9ad8ba9f0
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/AI/MindSporeLiteCDemoASR/entry/src/main/ets/pages/player.ets
arkts
console
当播放模式不支持seek操作时继续播放到结尾。
console.info('MS_LITE_LOG: AVPlayer wait to play end.');
AST#method_declaration#Left console AST#ERROR#Left . in fo AST#ERROR#Right AST#parameter_list#Left ( AST#ERROR#Left 'MS_LITE_LOG: AVPlayer wait to play end.' AST#ERROR#Right ) AST#parameter_list#Right ; AST#method_declaration#Right
console.info('MS_LITE_LOG: AVPlayer wait to play end.');
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/AI/MindSporeLiteCDemoASR/entry/src/main/ets/pages/player.ets#L61-L61
98faf7dd0cf08dd0fccdaad634c8248160ae33e6
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets
arkts
购物车数据
export const mockCart: Cart[] = [ { goodsId: 1, goodsName: 'Redmi 14C', goodsMainPic: 'https://picsum.photos/300/300?random=1001', spec: [ { id: 1, specName: '星河蓝 8GB+256GB', price: 49900, count: 1, stock: 100 }, { id: 2, specName: '曜石黑 12GB+512GB', price: 59900, count: 2, stock: 50 } ...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left mockCart : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Cart [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#expression#L...
export const mockCart: Cart[] = [ { goodsId: 1, goodsName: 'Redmi 14C', goodsMainPic: 'https://picsum.photos/300/300?random=1001', spec: [ { id: 1, specName: '星河蓝 8GB+256GB', price: 49900, count: 1, stock: 100 }, { id: 2, specName: '曜石黑 12GB+512GB', price: 59900, count: 2, stock: 50 } ...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/data/MockData.ets#L134-L152
0c062cc78afc2895d4b3eae7b80d4eb88fc7cec7
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets
arkts
FlowItemView
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...
@Component export struct FlowItemView { @Link _position: Position; private componentKey: string; private parentWidth: number; private parentHeight: number; private parentComponentKey: string; private referenceComponentKey: string; build() { Column({ space: 2 }) { WaterFlow() { FlowItem(...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FlowItemView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right _position : AST#type_annotation#Left AST#primary_type#Left Position AST#primary_type#Right AST#type_an...
@Component export struct FlowItemView { @Link _position: Position; private componentKey: string; private parentWidth: number; private parentHeight: number; private parentComponentKey: string; private referenceComponentKey: string; build() { Column({ space: 2 }) { WaterFlow() { FlowItem(...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/position/FlowItemView.ets#L16-L57
c9ab4833fe03379773a92683ff8b58a17d30bf11
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets
arkts
computeTask
运行天体轨道计算程序 @param totalTimeSteps 时间推移量 @returns 计算时间
@Concurrent export function computeTask(totalTimeSteps: number): number { const tagInTask: string = 'computeTask'; const timeStep: number = 0.01; // 单位:hour const fractionDigits: number = 9; // 机械能数值小数位 let start: number = new Date().getTime(); // 建立孤立系统的动量守恒 offsetMomentum(); Logger.info(tagInTask, ener...
AST#decorated_export_declaration#Left AST#decorator#Left @ Concurrent AST#decorator#Right export function computeTask AST#parameter_list#Left ( AST#parameter#Left totalTimeSteps : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_l...
@Concurrent export function computeTask(totalTimeSteps: number): number { const tagInTask: string = 'computeTask'; const timeStep: number = 0.01; const fractionDigits: number = 9; let start: number = new Date().getTime(); offsetMomentum(); Logger.info(tagInTask, energy().toFixed(fractionDigits)); ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets#L39-L59
70ee242c13f068b78b4dc71a00e2265132748532
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/ArrayUtil.ets
arkts
append
拼接数据,使用扩展运算符,不影响原数组。 @param source @param item @returns
static append<T>(source: T[], item: T | T[]): T[] { if (Array.isArray(item)) { return [...source, ...item]; } else { return [...source, item]; } }
AST#method_declaration#Left static append AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left source : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right A...
static append<T>(source: T[], item: T | T[]): T[] { if (Array.isArray(item)) { return [...source, ...item]; } else { return [...source, item]; } }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ArrayUtil.ets#L105-L111
56c5bccbe427f1a59962526b405ace20a85eb9fd
gitee
salehelper/algorithm_arkts.git
61af15272038646775a4745fca98a48ba89e1f4e
entry/src/main/ets/strings/Horspool.ets
arkts
contains
检查文本是否包含模式串 @param text 文本字符串 @param pattern 模式串 @returns 是否包含模式串
static contains(text: string, pattern: string): boolean { if (!text || !pattern || pattern.length === 0) { return false; } const badCharTable = this.buildBadCharTable(pattern); const m = pattern.length; const n = text.length; let i = 0; while (i <= n - m) { let j = m - 1; ...
AST#method_declaration#Left static contains AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pattern : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static contains(text: string, pattern: string): boolean { if (!text || !pattern || pattern.length === 0) { return false; } const badCharTable = this.buildBadCharTable(pattern); const m = pattern.length; const n = text.length; let i = 0; while (i <= n - m) { let j = m - 1; ...
https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/strings/Horspool.ets#L49-L74
535fe04b6efa2ff986c7c9dd7963ce16e88a41e2
github
Duke_Bit/logan
37ce340f90e508cbf3914162df2254aca76a525a
core/src/main/ets/Logan.ets
arkts
@brief 立即写入日志文件
export function flush(): void { LoganControlCenter.instance().flush() }
AST#export_declaration#Left export AST#function_declaration#Left function flush 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#expression_statement#Left AST#expr...
export function flush(): void { LoganControlCenter.instance().flush() }
https://github.com/Duke_Bit/logan/blob/37ce340f90e508cbf3914162df2254aca76a525a/core/src/main/ets/Logan.ets#L30-L32
32d55670a415b68940e6df2a7055eef4d39d5b90
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/pages/Index.ets
arkts
showBlurAnim
显示模糊动效,模式切换触发
private async showBlurAnim() { Logger.info(TAG, 'showBlurAnim E'); // 获取已完成的surface截图 let shotPixel = BlurAnimateUtil.getSurfaceShot(); // 后置 if (this.curPosition === 0) { Logger.info(TAG, 'showBlurAnim BACK'); // 直板机后置截图旋转补偿90° await shotPixel.rotate(BlurAnimateUtil.IMG_ROTATE_ANG...
AST#method_declaration#Left private async showBlurAnim AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Ri...
private async showBlurAnim() { Logger.info(TAG, 'showBlurAnim E'); let shotPixel = BlurAnimateUtil.getSurfaceShot(); if (this.curPosition === 0) { Logger.info(TAG, 'showBlurAnim BACK'); await shotPixel.rotate(BlurAnimateUtil.IMG_ROTATE_ANGLE_90); this.shotImgRotatio...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/pages/Index.ets#L88-L125
74ee448e1a37dc0977f17d8fd2cdd0a944c34102
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SuperFeature/DistributedAppDev/DistributedFilemanager/entry/src/main/ets/pages/Index.ets
arkts
clearTempData
每次退出选择状态就降临时数据清空
clearTempData() { this.selectedFiles = []; this.needMoveFiles = []; }
AST#method_declaration#Left clearTempData AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . selectedFiles AST#member_expression#...
clearTempData() { this.selectedFiles = []; this.needMoveFiles = []; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SuperFeature/DistributedAppDev/DistributedFilemanager/entry/src/main/ets/pages/Index.ets#L86-L89
38ea9448a1c0fa133ba0f8da246f99baf9adc91c
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/pages/VideoPage.ets
arkts
NetworkDialogComponent
流量播放提示框
@CustomDialog export struct NetworkDialogComponent { controller?: CustomDialogController; // 标题 title: ResourceStr = ''; // 提示信息 message: ResourceStr = ''; // 取消事件 cancel: () => void = () => { }; // 确认事件 confirm: () => void = () => { }; build() { Column() { Text(this.title) .f...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct NetworkDialogComponent AST#component_body#Left { AST#property_declaration#Left controller ? : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right ;...
@CustomDialog export struct NetworkDialogComponent { controller?: CustomDialogController; title: ResourceStr = ''; message: ResourceStr = ''; cancel: () => void = () => { }; confirm: () => void = () => { }; build() { Column() { Text(this.title) .fontSize($r('app.integer.ne...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/NetworkObserver/entry/src/main/ets/pages/VideoPage.ets#L260-L330
0f5f79efc6f3dadf26e0e0f13aee4c6d003a295d
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videocreategif/src/main/ets/components/RangeSeekBarView.ets
arkts
showThumbText
设置条状物对应的时间 @param time @returns
showThumbText(time: number): string { return getTimeString(time); }
AST#method_declaration#Left showThumbText AST#parameter_list#Left ( AST#parameter#Left time : 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 string AST#primary_type#Rig...
showThumbText(time: number): string { return getTimeString(time); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/components/RangeSeekBarView.ets#L274-L276
771b15dd9d8c6a9393af78e677e5e92b7106fcbc
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/Solutions/InputMethod/KikaInputMethod/entry/src/main/ets/model/HardKeyUtils.ets
arkts
Copyright (c) 2022-2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
export function GetHardKeyValue(keyCode: number, isShift: boolean): string { let keyList: Map<number, string> = new Map<number, string>(); keyList.set(2000, '0'); keyList.set(2001, '1'); keyList.set(2002, '2'); keyList.set(2003, '3'); keyList.set(2004, '4'); keyList.set(2005, '5'); keyList.set(2006, '6'...
AST#export_declaration#Left export AST#function_declaration#Left function GetHardKeyValue AST#parameter_list#Left ( AST#parameter#Left keyCode : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left isShift : AST#type_annotation#L...
export function GetHardKeyValue(keyCode: number, isShift: boolean): string { let keyList: Map<number, string> = new Map<number, string>(); keyList.set(2000, '0'); keyList.set(2001, '1'); keyList.set(2002, '2'); keyList.set(2003, '3'); keyList.set(2004, '4'); keyList.set(2005, '5'); keyList.set(2006, '6'...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/InputMethod/KikaInputMethod/entry/src/main/ets/model/HardKeyUtils.ets#L16-L87
ee35268be68a486e641e72191073d815eacffd0a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
emitThemeEvent
发送主题事件
private emitThemeEvent(type: ThemeEvent['type'], data: any): void { const event: ThemeEvent = { type, data, timestamp: new Date().toISOString() }; this.themeEventListeners.forEach(listener => { try { listener(event); } catch (error) { hilog.error(LogConstants.D...
AST#method_declaration#Left private emitThemeEvent AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ThemeEvent [ AST#ERROR#Left 'type' AST#ERROR#Right ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#p...
private emitThemeEvent(type: ThemeEvent['type'], data: any): void { const event: ThemeEvent = { type, data, timestamp: new Date().toISOString() }; this.themeEventListeners.forEach(listener => { try { listener(event); } catch (error) { hilog.error(LogConstants.D...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L839-L853
d5fe6677bf9db1c6ce5681c29c1a92e84a993927
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/AESSync.ets
arkts
encodeCBC192
加密-CBC模式-192位 @param str 待加密的字符串 @param aesKey AES密钥 @param iv iv偏移量字符串 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param resultCoding 加密后数据的编码方式(hex/base64)-不传默认为base64 @returns
static encodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.encodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, resultCoding); }
AST#method_declaration#Left static encodeCBC192 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty...
static encodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.encodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, resultCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/AESSync.ets#L151-L154
f17a52f1f5d9c2321b757050ed590eab98069cf8
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment2.ets
arkts
FlowListStruct2
[End Counter_example1] [Start Case1]
@Component export struct FlowListStruct2 { build() { Column() { // ... } .backgroundColor('#FFFFFF') } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FlowListStruct2 AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#...
@Component export struct FlowListStruct2 { build() { Column() { } .backgroundColor('#FFFFFF') } }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/Component_Nesting_Optimization/entry/src/main/ets/segment/segment2.ets#L26-L34
a793e0cd1defacbfbc830a34f2a178bf76a4aab0
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_rcp/src/main/ets/rcp/EfRcp.ets
arkts
addBusinessCodeEvent
添加统一的业务级别编码拦截操作 @param businessCodeEvent 业务级别编码操作事件 efRcpConfig.businessCodeEvent @returns
addBusinessCodeEvent(businessCodeEvent: efRcpConfig.businessCodeEvent): EfRcp { if (this.cfg.interceptors) { this.cfg.interceptors.push(new EfBusinessCodeInterceptor(businessCodeEvent)); } else { this.cfg.interceptors = [new EfBusinessCodeInterceptor(businessCodeEvent)]; } return this; }
AST#method_declaration#Left addBusinessCodeEvent AST#parameter_list#Left ( AST#parameter#Left businessCodeEvent : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left efRcpConfig . businessCodeEvent AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#par...
addBusinessCodeEvent(businessCodeEvent: efRcpConfig.businessCodeEvent): EfRcp { if (this.cfg.interceptors) { this.cfg.interceptors.push(new EfBusinessCodeInterceptor(businessCodeEvent)); } else { this.cfg.interceptors = [new EfBusinessCodeInterceptor(businessCodeEvent)]; } return this; }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfRcp.ets#L236-L243
b7f4e12042320f45fdb11dbbd72f807ecab50dea
gitee
SeaEpoch/SepWeather.git
e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c
entry/src/main/ets/common/database/Rdb.ets
arkts
query
查询
query(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'query() has no callback!'); return; } if (this.rdbStore) { this.rdbStore.query(predicates...
AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left predicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . RdbPredicates AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback :...
query(predicates: relationalStore.RdbPredicates, callback: Function = () => { }) { if (!callback || typeof callback === 'undefined' || callback === undefined) { Logger.info(CommonConstants.RDB_TAG, 'query() has no callback!'); return; } if (this.rdbStore) { this.rdbStore.query(predicates...
https://github.com/SeaEpoch/SepWeather.git/blob/e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c/entry/src/main/ets/common/database/Rdb.ets#L109-L126
3481fce451095dbe426fb0826e36a218f45d32e9
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@system.prompt.d.ets
arkts
showToast
Displays the notification text. @param { ShowToastOptions } options - Options. @syscap SystemCapability.ArkUI.ArkUI.Full @since 3 Displays the notification text. @param { ShowToastOptions } options - Options. @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11
static showToast(options: ShowToastOptions): void;
AST#method_declaration#Left static showToast AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ShowToastOptions 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#pr...
static showToast(options: ShowToastOptions): void;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.prompt.d.ets#L407-L407
52ba7584661cb9ad1167c8a274402c073a026890
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
UseSendable/entry/src/main/ets/pages/InterThreadCommunication1.ets
arkts
InterThreadCommunication1
[EndExclude inter_thread_communication1]
@Component export struct InterThreadCommunication1 { build() { NavDestination() { Column() { Button($r('app.string.multithreaded_communication_title')) .width('100%') .onClick(() => { nativeModule.nativeCall((a: number) => { hilog.info(DOMAIN, TAG, FORMA...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct InterThreadCommunication1 AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left NavDestination ( ) AST#conta...
@Component export struct InterThreadCommunication1 { build() { NavDestination() { Column() { Button($r('app.string.multithreaded_communication_title')) .width('100%') .onClick(() => { nativeModule.nativeCall((a: number) => { hilog.info(DOMAIN, TAG, FORMA...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/UseSendable/entry/src/main/ets/pages/InterThreadCommunication1.ets#L27-L55
0f5cc8c5d5c7ee06f64081f9cbabd0796131c928
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/TabContentTouchHotZone/casesfeature/tabcontentoverflow/src/main/ets/view/Side.ets
arkts
高性能布局策略: 界面深度的增加会提升渲染和计算影响性能。推荐使用扁平化设计,如RelativeContainer,以简化布局结构,降低组件层级,从而提升渲染效率。 优化布局性能:https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/performance/reduce-view-nesting-levels.md
build() { RelativeContainer() { Image(this.head) .width($r('app.integer.tabcontentoverflow_head_image_width')) .height($r('app.integer.tabcontentoverflow_head_image_height')) .borderRadius(CONFIGURATION.TABCONTENT_OVERFLOW_HEADIMAGE_BORDER_RADIUS) .border({ width: $r(...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left RelativeContainer ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Image ( AST#expression#Left AST#member_expre...
build() { RelativeContainer() { Image(this.head) .width($r('app.integer.tabcontentoverflow_head_image_width')) .height($r('app.integer.tabcontentoverflow_head_image_height')) .borderRadius(CONFIGURATION.TABCONTENT_OVERFLOW_HEADIMAGE_BORDER_RADIUS) .border({ width: $r(...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/TabContentTouchHotZone/casesfeature/tabcontentoverflow/src/main/ets/view/Side.ets#L59-L202
90bb70c7894213fb82bbf4db1853079a8c2e6d6d
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plandb/PlanDbAccess.ets
arkts
MARK: - Box
export namespace Box { export const name = "P_Box";
AST#export_declaration#Left export AST#ERROR#Left namespace Box { export AST#ERROR#Right AST#variable_declaration#Left const AST#variable_declarator#Left name = AST#expression#Left "P_Box" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export namespace Box { export const name = "P_Box";
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plandb/PlanDbAccess.ets#L38-L39
7221c6b85f369639514793de9d200c25417a6b1a
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/constants/LayoutPercent.ets
arkts
35% 百分比
export const P35: string = "35%";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left P35 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "35%" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right...
export const P35: string = "35%";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/constants/LayoutPercent.ets#L44-L44
2966dd4dec02b3845811499653a419921c3e03b4
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
WaterFlowSample/entry/src/main/ets/pages/DataUpdateAndAnimationPage.ets
arkts
[EndExclude quick_start]
build() { Column({ space: 0 }) { Row() { Text($r('app.string.pull_down_refresh')) .width('100%') .fontSize(24) .fontWeight(FontWeight.Bold) .margin({ top: '18vp', left: '16vp', bottom: '8vp' }) } // 2、Pull-to-refresh control. Refresh({ refresh...
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 0 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Right...
build() { Column({ space: 0 }) { Row() { Text($r('app.string.pull_down_refresh')) .width('100%') .fontSize(24) .fontWeight(FontWeight.Bold) .margin({ top: '18vp', left: '16vp', bottom: '8vp' }) } Refresh({ refreshing: $$this.isRefreshing, bui...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WaterFlowSample/entry/src/main/ets/pages/DataUpdateAndAnimationPage.ets#L243-L317
5a1114f22c488120fda1f390934c7af99bd43cb9
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/Index.ets
arkts
@file designsystem 模块统一导出 @author Joker.X
export * from "./src/main/ets/constants/LayoutPercent";
AST#export_declaration#Left export * from "./src/main/ets/constants/LayoutPercent" ; AST#export_declaration#Right
export * from "./src/main/ets/constants/LayoutPercent";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/Index.ets#L6-L6
741ccde8d6a17c9e8e82772f8130e5b2bbb6e14f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index_backup.ets
arkts
updateBirthdayStats
更新生日统计数据
private async updateBirthdayStats(): Promise<void> { try { const contactServiceStats = await this.contactService.getContactStatistics(); this.birthdayStats = { total: contactServiceStats.total, thisMonth: contactServiceStats.upcomingBirthdays.thisMonth, thisWeek: contactServiceSt...
AST#method_declaration#Left private async updateBirthdayStats AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right...
private async updateBirthdayStats(): Promise<void> { try { const contactServiceStats = await this.contactService.getContactStatistics(); this.birthdayStats = { total: contactServiceStats.total, thisMonth: contactServiceStats.upcomingBirthdays.thisMonth, thisWeek: contactServiceSt...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L232-L246
8472e6bc5982c54daad957acea28f6d6a83c87a3
github