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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | eventbus/src/main/ets/EventBus.ets | arkts | offAll | 注销所有事件监听 | static offAll(): void {
EventBusCore.getInstance().offAll();
} | AST#method_declaration#Left static offAll AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression... | static offAll(): void {
EventBusCore.getInstance().offAll();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/eventbus/src/main/ets/EventBus.ets#L42-L44 | 39a01149cabc79dcb80e68c207020bde68157e8f | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/ContactTypes.ets | arkts | 联系人导入结果接口 | export interface ContactImportResult {
total: number;
successful: number;
failed: number;
errors: ImportError[];
warnings: ImportWarning[];
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ContactImportResult AST#object_type#Left { AST#type_member#Left total : 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 successful : AST#type_an... | export interface ContactImportResult {
total: number;
successful: number;
failed: number;
errors: ImportError[];
warnings: ImportWarning[];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L284-L290 | bb26bf9511e3a511a06d99316535dd3e1d25fa10 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/multicolumndisplay/src/main/ets/components/MultiColumnDisplayPage.ets | arkts | for | 通过商品数据类型初始化瀑布流分组信息 | for (let index = 0; index < waterFlowData.length; index++) {
const productInfo: ProductInfo = waterFlowData[index];
if (productInfo.type === this.imageFlowItemReuseId) {
// 仅展示图片时瀑布流是一列
sectionOptions.push(this.oneColumnSection);
} else if(productInfo.type === this.bottomFlowItem){
... | AST#method_declaration#Left for AST#parameter_list#Left ( AST#parameter#Left let AST#ERROR#Left in dex AST#ERROR#Right = AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left 0 AST#expression#Right AST#ERROR#Left ; AST#ERROR#Right in AST#expression#Left dex AS... | for (let index = 0; index < waterFlowData.length; index++) {
const productInfo: ProductInfo = waterFlowData[index];
if (productInfo.type === this.imageFlowItemReuseId) {
sectionOptions.push(this.oneColumnSection);
} else if(productInfo.type === this.bottomFlowItem){
s... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multicolumndisplay/src/main/ets/components/MultiColumnDisplayPage.ets#L98-L111 | 97d77720c2e15a0a7015f594117c4c0241ac32b6 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/SoundEffect/SEManager.ets | arkts | getIsInitialized | 检查是否已初始化 | public getIsInitialized(): boolean {
return this.isInitialized;
} | AST#method_declaration#Left public getIsInitialized AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member... | public getIsInitialized(): boolean {
return this.isInitialized;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/SoundEffect/SEManager.ets#L305-L307 | 459a726928d7246f1265dd4638d7a5fd0c5bd45f | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Security/DLPManager/entry/src/main/ets/pages/Index.ets | arkts | callFilePickerSelectFile | 拉起picker选择文件 | async callFilePickerSelectFile(): Promise<void> {
try {
let DocumentSelectOptions = new picker.DocumentSelectOptions();
DocumentSelectOptions.defaultFilePathUri = 'file://com.sample.dlpmanager/data/storage/el2/base/haps/entry/files';
DocumentSelectOptions.maxSelectNumber = 20;
let documentPi... | AST#method_declaration#Left async callFilePickerSelectFile 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 > ... | async callFilePickerSelectFile(): Promise<void> {
try {
let DocumentSelectOptions = new picker.DocumentSelectOptions();
DocumentSelectOptions.defaultFilePathUri = 'file://com.sample.dlpmanager/data/storage/el2/base/haps/entry/files';
DocumentSelectOptions.maxSelectNumber = 20;
let documentPi... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/DLPManager/entry/src/main/ets/pages/Index.ets#L79-L105 | bdc10f5a394c3fea916f40361b569b0e9b0c8739 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | PowerAnalysis/LowerPowerSample/entry/src/main/ets/pages/display_sync_example.ets | arkts | aboutToDisappear | [Start vsync_power_case_1] 组件卸载时,停止DisplaySync并置空,防止空跑与内存泄露 | aboutToDisappear() {
if (this.backDisplaySyncSlow) {
this.backDisplaySyncSlow.stop();
this.backDisplaySyncSlow = undefined;
}
if (this.backDisplaySyncFast) {
this.backDisplaySyncFast.stop();
this.backDisplaySyncFast = undefined;
}
} | AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . backDisplaySyncSlow AST#member_expressi... | aboutToDisappear() {
if (this.backDisplaySyncSlow) {
this.backDisplaySyncSlow.stop();
this.backDisplaySyncSlow = undefined;
}
if (this.backDisplaySyncFast) {
this.backDisplaySyncFast.stop();
this.backDisplaySyncFast = undefined;
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/PowerAnalysis/LowerPowerSample/entry/src/main/ets/pages/display_sync_example.ets#L96-L105 | 3b854df9aa2adddb705681ba28077db434eb89c1 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/MainViewModel.ets | arkts | updateCurrentPage | 更新当前页面索引
@param {number} index - 目标页面索引
@returns {void} 无返回值
@example
this.updateCurrentPage(1); | updateCurrentPage(index: number): void {
this.currentPageIndex = index;
} | AST#method_declaration#Left updateCurrentPage AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#... | updateCurrentPage(index: number): void {
this.currentPageIndex = index;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/MainViewModel.ets#L50-L52 | ead791bc6e5d68d2d7c986699f1382e81f59263b | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets | arkts | getErrnoToString | 获取系统错误码对应的详细信息
@param errno 错误码
@returns | static getErrnoToString(errno: number): string {
return util.errnoToString(errno);
} | AST#method_declaration#Left static getErrnoToString AST#parameter_list#Left ( AST#parameter#Left errno : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#prima... | static getErrnoToString(errno: number): string {
return util.errnoToString(errno);
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets#L284-L286 | 354c60341350d11dffe553b4e4ece1cae6c13c61 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/card/detail/DetailCardsView.ets | arkts | actionPopmenu | /显示转到测验或挑战页面的弹出选项 | private actionPopmenu(){
let options: ItemOption[] = []
///我要测验
options.push(
{text: getString($r('app.string.learn_detail_to_test_btn_test')),action: ()=>{
//我要测验
QuizManager.shared.questionMode = QuestionMode.Normal
this.openTestStart()
}})
///我要挑战
options.pu... | AST#method_declaration#Left private actionPopmenu AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left options : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ItemOption [ ] AST#array_type#R... | private actionPopmenu(){
let options: ItemOption[] = []
options.push(
{text: getString($r('app.string.learn_detail_to_test_btn_test')),action: ()=>{
QuizManager.shared.questionMode = QuestionMode.Normal
this.openTestStart()
}})
options.push(
{text: get... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/card/detail/DetailCardsView.ets#L348-L378 | 7792954c8261cf03577e40928ba3a2f2a5703c6d | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/structures/shared/resolvePermissions.ets | arkts | 应用约束60:使用export代替module.exports | export function resolvePermissions(overwrites: Collection<PermissionOverwrite> | PermissionOverwrite[], guild: any): ResolvedPermission[] {
// 应用约束14:使用数组类型代替索引签名
if (overwrites instanceof Collection || overwrites instanceof Array) {
// 应用约束23:显式标注map回调参数类型
return overwrites.map((overwrite: Perm... | AST#export_declaration#Left export AST#function_declaration#Left function resolvePermissions AST#parameter_list#Left ( AST#parameter#Left overwrites : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#generic_type#Left Collection AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#L... | export function resolvePermissions(overwrites: Collection<PermissionOverwrite> | PermissionOverwrite[], guild: any): ResolvedPermission[] {
if (overwrites instanceof Collection || overwrites instanceof Array) {
return overwrites.map((overwrite: PermissionOverwrite) => {
const role ... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/shared/resolvePermissions.ets#L23-L50 | d3e2f982426b5cc44c8ace8a21dab6c8af4bc944 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/EfRcp.ets | arkts | addSecurity | 设置证书
@param securityCfg 证书配置 - efRcpConfig.securityCfg
@returns | addSecurity(securityCfg: efRcpConfig.securityCfg): EfRcp {
if (this.cfg.requestConfiguration) {
if (this.cfg.requestConfiguration.security) {
this.cfg.requestConfiguration.security.remoteValidation = securityCfg.remoteValidation;
this.cfg.requestConfiguration.security.certificate = securityCfg... | AST#method_declaration#Left addSecurity AST#parameter_list#Left ( AST#parameter#Left securityCfg : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left efRcpConfig . securityCfg AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : A... | addSecurity(securityCfg: efRcpConfig.securityCfg): EfRcp {
if (this.cfg.requestConfiguration) {
if (this.cfg.requestConfiguration.security) {
this.cfg.requestConfiguration.security.remoteValidation = securityCfg.remoteValidation;
this.cfg.requestConfiguration.security.certificate = securityCfg... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfRcp.ets#L372-L383 | a787696945953916f94a8b2288fbc3ffbcaf899d | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/viewmodel/MainViewModel.ets | arkts | toggleTaskStatus | Toggle task completion status
@param taskId - ID of task to toggle | async toggleTaskStatus(taskId: number): Promise<void> {
try {
const task = this.tasks.find((t: Task) => t.id === taskId);
if (task) {
await this.rdbHelper.updateTaskStatus(taskId, !task.isDone);
await this.refreshData();
}
} catch (error) {
console.error(`[MainViewModel] ... | AST#method_declaration#Left async toggleTaskStatus AST#parameter_list#Left ( AST#parameter#Left taskId : 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 AST#generic_type... | async toggleTaskStatus(taskId: number): Promise<void> {
try {
const task = this.tasks.find((t: Task) => t.id === taskId);
if (task) {
await this.rdbHelper.updateTaskStatus(taskId, !task.isDone);
await this.refreshData();
}
} catch (error) {
console.error(`[MainViewModel] ... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/viewmodel/MainViewModel.ets#L479-L489 | 80573b974cdf83c457ded172a06800aaf9d755ad | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/map_lib_func_001_T.ets | arkts | Introduction 库函数-map_set | export function map_lib_func_001_T(taint_src : string) {
let map = new Map<string,string>();
map.set("t",taint_src);
taint.Sink(map);
} | AST#export_declaration#Left export AST#function_declaration#Left function map_lib_func_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#... | export function map_lib_func_001_T(taint_src : string) {
let map = new Map<string,string>();
map.set("t",taint_src);
taint.Sink(map);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/map_lib_func_001_T.ets#L7-L11 | 4dace59f7fb1ee833e92a04df0d5025f48dbb5ca | github | |
Duke_Bit/logan | 37ce340f90e508cbf3914162df2254aca76a525a | core/src/main/ets/Logan.ets | arkts | @param message 表示日志内容
@param tag 表示日志标识
@param type 表示日志类型
@brief Logan写入日志 | export function log(type: number, tag: string, message: string): void {
LoganControlCenter.instance().write(type, tag, message)
} | AST#export_declaration#Left export AST#function_declaration#Left function log AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left tag : AST#type_annotation#Left AST#primary_typ... | export function log(type: number, tag: string, message: string): void {
LoganControlCenter.instance().write(type, tag, message)
} | https://github.com/Duke_Bit/logan/blob/37ce340f90e508cbf3914162df2254aca76a525a/core/src/main/ets/Logan.ets#L23-L25 | 87e567ba2ce523a1b3d624db94f3abdb64273840 | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/data/src/main/ets/repository/DemoRepository.ets | arkts | deleteDemo | 删除指定 ID 的 Demo 记录
@param {number} id - 记录主键
@returns {Promise<void>} Promise<void> | async deleteDemo(id: number): Promise<void> {
return this.demoLocalDataSource.deleteById(id);
} | AST#method_declaration#Left async deleteDemo AST#parameter_list#Left ( AST#parameter#Left id : 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 AST#generic_type#Left Prom... | async deleteDemo(id: number): Promise<void> {
return this.demoLocalDataSource.deleteById(id);
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/data/src/main/ets/repository/DemoRepository.ets#L45-L47 | 9f07be120ddaf1ca55c92e722c0ec8c2ed3e2b75 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.InnerFullScreenLaunchComponent.d.ets | arkts | Callback for launch atomicservice.
@typedef { function } LaunchAtomicServiceCallback
@param { string } appId - appId of atomicservice.
@param { AtomicServiceOptions } [options] - options that could be empty.
@syscap SystemCapability.ArkUI.ArkUI.Full
@systemapi
@since 12 | export declare type LaunchAtomicServiceCallback = (appId: string, options?: AtomicServiceOptions) => void; | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#type_declaration#Left type LaunchAtomicServiceCallback = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left appId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#typ... | export declare type LaunchAtomicServiceCallback = (appId: string, options?: AtomicServiceOptions) => void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.InnerFullScreenLaunchComponent.d.ets#L90-L90 | 243429ef63f4d8cf8b77ba9012aa8f8fe52fdff0 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/social/CommunityService.ets | arkts | unfollowTopic | 取消关注话题 | async unfollowTopic(topicId: string): Promise<boolean> {
try {
if (!this.currentUser) return false;
// TODO: 取消关注话题
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Topic unfollowed: ${topicId}`);
return true;
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogCon... | AST#method_declaration#Left async unfollowTopic AST#parameter_list#Left ( AST#parameter#Left topicId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#L... | async unfollowTopic(topicId: string): Promise<boolean> {
try {
if (!this.currentUser) return false;
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Topic unfollowed: ${topicId}`);
return true;
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP,... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L531-L543 | 6b16c68d635e4abfadadb92f6093c97130f14caf | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/todo/TodoService.ets | arkts | completeTodo | 完成代办事项 | async completeTodo(id: string): Promise<Todo | null> {
const todo = await this.updateTodo({
id,
status: TodoStatus.COMPLETED
});
if (todo) {
this.recordOperation('complete', id, undefined, `完成代办事项: ${todo.title}`);
}
return todo;
} | AST#method_declaration#Left async completeTodo AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Pr... | async completeTodo(id: string): Promise<Todo | null> {
const todo = await this.updateTodo({
id,
status: TodoStatus.COMPLETED
});
if (todo) {
this.recordOperation('complete', id, undefined, `完成代办事项: ${todo.title}`);
}
return todo;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/todo/TodoService.ets#L289-L300 | 035768fdec0bc71fadf34a62ef05e27c839e0df4 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/PieChartModel.ets | arkts | setTransparentCircleAlpha | Sets the amount of transparency the transparent circle should have 0 = fully transparent,
255 = fully opaque.
Default value is 100.
@param alpha 0-255 | public setTransparentCircleAlpha(alpha: number): void {
if (!this.mRenderer) {
return;
}
( /*(PieChartRenderer)*/
this.mRenderer as PieChartRenderer).getPaintTransparentCircle().setGlobalAlpha(alpha / 255);
} | AST#method_declaration#Left public setTransparentCircleAlpha AST#parameter_list#Left ( AST#parameter#Left alpha : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AS... | public setTransparentCircleAlpha(alpha: number): void {
if (!this.mRenderer) {
return;
}
(
this.mRenderer as PieChartRenderer).getPaintTransparentCircle().setGlobalAlpha(alpha / 255);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L677-L683 | eec9588eae10d90de0e0cc0e6d6425c5c640c9e7 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_speech/src/main/ets/AudioCapturerHelper.ets | arkts | start | 开始音频采集 | static async start(): Promise<boolean> {
let blResult: boolean = false;
if (AudioCapturerHelper.audioCapturer !== undefined) {
const stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED];
const state = AudioCapturerHelper.audioCapturer.state.va... | AST#method_declaration#Left static async start 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 boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_... | static async start(): Promise<boolean> {
let blResult: boolean = false;
if (AudioCapturerHelper.audioCapturer !== undefined) {
const stateGroup = [audio.AudioState.STATE_PREPARED, audio.AudioState.STATE_PAUSED, audio.AudioState.STATE_STOPPED];
const state = AudioCapturerHelper.audioCapturer.state.va... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/AudioCapturerHelper.ets#L91-L107 | c021883b141b89eb1d755d52b3afa65c4355e060 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | HDRVivid/AVRecorder/entry/src/main/ets/utils/FileUtil.ets | arkts | createOrOpen | Create and open a file. | static createOrOpen(path: string): fileIo.File | null {
let file: fileIo.File | null = null;
try {
let isExist = fileIo.accessSync(path);
if (isExist) {
file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE);
} else {
file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | ... | AST#method_declaration#Left static createOrOpen AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left A... | static createOrOpen(path: string): fileIo.File | null {
let file: fileIo.File | null = null;
try {
let isExist = fileIo.accessSync(path);
if (isExist) {
file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE);
} else {
file = fileIo.openSync(path, fileIo.OpenMode.READ_WRITE | ... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVRecorder/entry/src/main/ets/utils/FileUtil.ets#L22-L36 | e738ae7560db64b45fa7c6eacb551590fae96a33 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/StatusBarUtils.ets | arkts | setStatusBar | 设置沉浸式状态栏
@param isLayoutFullScreen 窗口的布局是否为沉浸式布局(该沉浸式布局状态栏、导航栏仍然显示)。true表示沉浸式布局;false表示非沉浸式布局。
@param enable 设置窗口全屏模式时状态栏、导航栏或底部导航条是否显示,true表示显示 false表示隐藏。
@param color 设置窗口的背景颜色。
@param systemBarProperties 状态栏、导航栏的属性:
statusBarColor 状态栏背景颜色,为十六进制RGB或ARGB颜色,不区分大小写,例如#00FF00或#FF00FF00。默认值:#0x66000000。
statusBarContentCo... | public static setStatusBar(isLayoutFullScreen: boolean = true, enable: boolean = true, color: string = '#FFFFFF',
systemBarProperties?: window.SystemBarProperties) {
let windowClass = AppUtils.getMainWindow();
windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => {
windowClass.setWindow... | AST#method_declaration#Left public static setStatusBar AST#parameter_list#Left ( AST#parameter#Left isLayoutFullScreen : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left true AST#boolean_literal#Right AST#expression#Ri... | public static setStatusBar(isLayoutFullScreen: boolean = true, enable: boolean = true, color: string = '#FFFFFF',
systemBarProperties?: window.SystemBarProperties) {
let windowClass = AppUtils.getMainWindow();
windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => {
windowClass.setWindow... | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StatusBarUtils.ets#L74-L93 | b44beebb942f122a3056fae7ccd8f0d54945b72c | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/DateUtil.ets | arkts | isSameYear | 判断两个日期是否是同一年 | static isSameYear(date1: number | string | Date, date2: number | string | Date) {
date1 = DateUtil.getFormatDate(date1);
date2 = DateUtil.getFormatDate(date2);
let blSameYear = date1.getFullYear() === date2.getFullYear();
return blSameYear;
} | AST#method_declaration#Left static isSameYear AST#parameter_list#Left ( AST#parameter#Left date1 : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Date AST#primary_type#Right AST#union_type#Rig... | static isSameYear(date1: number | string | Date, date2: number | string | Date) {
date1 = DateUtil.getFormatDate(date1);
date2 = DateUtil.getFormatDate(date2);
let blSameYear = date1.getFullYear() === date2.getFullYear();
return blSameYear;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L181-L186 | d0c899abf3b715c95e2e7cade2cf63df4837bb25 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/OrderCacheStoreRepository.ets | arkts | saveSelectedGoodsList | 保存已选商品列表
@param {SelectedGoods[]} goodsList 已选商品列表
@returns {Promise<void>} Promise<void> | saveSelectedGoodsList(goodsList: SelectedGoods[]): Promise<void> {
return this.dataSource.setSelectedGoodsList(goodsList);
} | AST#method_declaration#Left saveSelectedGoodsList AST#parameter_list#Left ( AST#parameter#Left goodsList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left SelectedGoods [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_... | saveSelectedGoodsList(goodsList: SelectedGoods[]): Promise<void> {
return this.dataSource.setSelectedGoodsList(goodsList);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderCacheStoreRepository.ets#L48-L50 | c93439e45cf7f402dc3848d76e3e8fb5eeedd9ff | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Download/CDownloadable/CosService.ets | arkts | MARK: - 腾讯云服务类 | export class CosService {
// MARK: - 单例实例
private static instance: CosService = new CosService();
// MARK: - 私有属性
//private credentialFenceQueue: any; // 模拟QCloudCredentailFenceQueue
private cosService: CosXmlBaseService; // 模拟QCloudCOSXMLService
// MARK: - 构造函数
private constructor() {
this.initTenc... | AST#export_declaration#Left export AST#class_declaration#Left class CosService AST#class_body#Left { // MARK: - 单例实例 AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left CosService AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expressio... | export class CosService {
private static instance: CosService = new CosService();
private cosService: CosXmlBaseService;
private constructor() {
this.initTencentCos();
this.cosService = CosXmlBaseService.default()
}
public static get shared(): CosService {
return this.instance;... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Download/CDownloadable/CosService.ets#L21-L94 | fabee5c62433fc399260a9b3f26c131af3b9b19e | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/ImageProcessing-master/scenes/personal/src/main/ets/pages/QuickLoginPage.ets | arkts | showToast | Toast提示 | showToast(resource: string) {
try {
promptAction.showToast({
message: resource,
duration: 2000
});
} catch (error) {
let message = (error as BusinessError).message
let code = (error as BusinessError).code
hilog.error(this.domainId, this.logTag, `showToast args error... | AST#method_declaration#Left showToast AST#parameter_list#Left ( AST#parameter#Left resource : 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 try AST... | showToast(resource: string) {
try {
promptAction.showToast({
message: resource,
duration: 2000
});
} catch (error) {
let message = (error as BusinessError).message
let code = (error as BusinessError).code
hilog.error(this.domainId, this.logTag, `showToast args error... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/ImageProcessing-master/scenes/personal/src/main/ets/pages/QuickLoginPage.ets#L150-L162 | 1430cd445ff174ada148d53cd1d7839da52dfb79 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/SM2.ets | arkts | signSync | 对数据进行签名,同步
@param dataBlob 待签名数据
@param priKey 私钥
@param algName 指定签名算法(SM2_256|SM3、SM2|SM3)。
@returns | static signSync(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey,
algName: string = 'SM2_256|SM3'): cryptoFramework.DataBlob {
return CryptoUtil.signSync(dataBlob, priKey, algName);
} | AST#method_declaration#Left static signSync AST#parameter_list#Left ( AST#parameter#Left dataBlob : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey ... | static signSync(dataBlob: cryptoFramework.DataBlob, priKey: cryptoFramework.PriKey,
algName: string = 'SM2_256|SM3'): cryptoFramework.DataBlob {
return CryptoUtil.signSync(dataBlob, priKey, algName);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM2.ets#L222-L225 | 10f00965ecc48061e7edab84fbc696bc6f340f68 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/RSA.ets | arkts | decode2048PKCS1Segment | 2048位解密-分段
@param decodeStr 待解密的字符串
@param priKey 2048位RSA私钥 | static async decode2048PKCS1Segment(str: string, priKey: string): Promise<OutDTO<string>> {
return CryptoUtil.decodeAsymSegment(str, priKey, 'RSA2048', 'RSA2048|PKCS1', 2048);
} | AST#method_declaration#Left static async decode2048PKCS1Segment 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 strin... | static async decode2048PKCS1Segment(str: string, priKey: string): Promise<OutDTO<string>> {
return CryptoUtil.decodeAsymSegment(str, priKey, 'RSA2048', 'RSA2048|PKCS1', 2048);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSA.ets#L114-L116 | 7f49d2ad1ed0f09eef648577f1da966d3de20902 | gitee |
waylau/harmonyos-tutorial | 74e23dfa769317f8f057cc77c2d09f0b1f2e0773 | samples/ArkTSMultiPicture/commons/base/src/main/ets/constants/BaseConstants.ets | arkts | 基础常量 | export class BaseConstants {
/**
* Component size.
*/
static readonly FULL_HEIGHT: string = '100%';
static readonly FULL_WIDTH: string = '100%';
/**
* Text property.
*/
static readonly FONT_FAMILY_NORMAL: Resource = $r('app.float.font_family_normal');
static readonly FONT_FAMILY_MEDIUM: Resource... | AST#export_declaration#Left export AST#class_declaration#Left class BaseConstants AST#class_body#Left { /**
* Component size.
*/ AST#property_declaration#Left static readonly FULL_HEIGHT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left ... | export class BaseConstants {
static readonly FULL_HEIGHT: string = '100%';
static readonly FULL_WIDTH: string = '100%';
static readonly FONT_FAMILY_NORMAL: Resource = $r('app.float.font_family_normal');
static readonly FONT_FAMILY_MEDIUM: Resource = $r('app.float.font_family_medium');
static readonly FO... | https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSMultiPicture/commons/base/src/main/ets/constants/BaseConstants.ets#L4-L27 | 5f37c830c3d261e7c7d6b096c429383f30fbe666 | gitee | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Media/VideoPlay/entry/src/main/ets/videomanager/AvPlayManager.ets | arkts | setAVPlayerCallback | 注册avplayer回调函数 | async setAVPlayerCallback(callback: (avPlayer: media.AVPlayer) => void, videoSrc?: string): Promise<void> {
if (this.avPlayer === null) {
return;
}
// seek操作结果回调函数
this.avPlayer.on('seekDone', (seekDoneTime) => {
Logger.info(this.tag, 'setAVPlayerCallback AVPlayer seek succeeded, seek time i... | AST#method_declaration#Left async setAVPlayerCallback AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left avPlayer : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left media . AVPlayer AST#qualified_type... | async setAVPlayerCallback(callback: (avPlayer: media.AVPlayer) => void, videoSrc?: string): Promise<void> {
if (this.avPlayer === null) {
return;
}
this.avPlayer.on('seekDone', (seekDoneTime) => {
Logger.info(this.tag, 'setAVPlayerCallback AVPlayer seek succeeded, seek time is ${seekDoneTim... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/VideoPlay/entry/src/main/ets/videomanager/AvPlayManager.ets#L65-L99 | a72f5c22eeea59875b5b431de1b0496a1b7c6f0d | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | ETSUI/ListSample/entry/src/main/ets/common/bean/ListItemData.ets | arkts | List item data entity. | export class ListItemData {
/**
* Image of list item.
*/
image: Resource;
/**
* Title of list item.
*/
title: Resource;
/**
* Sub title of list item.
*/
subTitle: Resource;
/**
* Summary of list item.
*/
summary: Resource;
/**
* Arrow image on the right of list item.
... | AST#export_declaration#Left export AST#class_declaration#Left class ListItemData AST#class_body#Left { /**
* Image of list item.
*/ AST#property_declaration#Left image : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /**
... | export class ListItemData {
image: Resource;
title: Resource;
subTitle: Resource;
summary: Resource;
rightArrowImage: Resource;
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/ListSample/entry/src/main/ets/common/bean/ListItemData.ets#L4-L29 | adfabb0b6c83ff045d50c88c1970b4654583eecc | gitee | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/BookEditor/BookEditorPage.ets | arkts | BookIconSize | 设置书籍封面图片样式 | @Extend(Image) function BookIconSize(){
.width(90)
.height(120)
.borderRadius(5)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Image AST#expression#Right ) AST#decorator#Right function BookIconSize AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left 90 AST#ex... | @Extend(Image) function BookIconSize(){
.width(90)
.height(120)
.borderRadius(5)
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/pages/view/BookEditor/BookEditorPage.ets#L8-L12 | 85749dd4d54b88dff4150b95d8d04efef1e4e64a | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/CustomComponent.ets | arkts | Tab组件当前选中index值 | build() {
Row() {
ForEach(TabsInfo, (item: TabBarData) => {
this.TabItem(item.id);
}, (item: TabBarData) => item.id.toString())
}
.id('customTabBar')
.backgroundColor(Color.White)
.clip(false)
.width($r('app.string.multiple_screening_all_percentage'))
.expandSafeArea([Saf... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST#ui_control_flow#Left AST#for_each_statement#Left ForEach ( AST#expression#Left TabsInfo AST#expression#Right , AST#ui_builder_arrow_funct... | build() {
Row() {
ForEach(TabsInfo, (item: TabBarData) => {
this.TabItem(item.id);
}, (item: TabBarData) => item.id.toString())
}
.id('customTabBar')
.backgroundColor(Color.White)
.clip(false)
.width($r('app.string.multiple_screening_all_percentage'))
.expandSafeArea([Saf... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/CustomComponent.ets#L31-L42 | 2b31ec75d474c7cc1ed9180a73de0e58c7628a79 | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/base/src/main/ets/viewmodel/BaseViewModel.ets | arkts | onWillApplyTheme | 主题即将应用
@param {Theme} theme - 主题对象
@returns {void} 无返回值 | onWillApplyTheme(theme: Theme): void {
} | AST#method_declaration#Left onWillApplyTheme AST#parameter_list#Left ( AST#parameter#Left theme : AST#type_annotation#Left AST#primary_type#Left Theme AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Ri... | onWillApplyTheme(theme: Theme): void {
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/base/src/main/ets/viewmodel/BaseViewModel.ets#L40-L41 | a0f330e6c3bcdb79e9df4e90e5ec84148427beea | github |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/menu/VHInviteDialog.ets | arkts | getTimeStr | 获取当前时间的拼接字符串,用于图片命名 | private getTimeStr(): string {
const now: Date = new Date();
const year: number = now.getFullYear();
const month: number = now.getMonth() + 1;
const day: number = now.getDate();
const hours: number = now.getHours();
const minutes: number = now.getMinutes();
const seconds: number = now.getSec... | AST#method_declaration#Left private getTimeStr AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left now ... | private getTimeStr(): string {
const now: Date = new Date();
const year: number = now.getFullYear();
const month: number = now.getMonth() + 1;
const day: number = now.getDate();
const hours: number = now.getHours();
const minutes: number = now.getMinutes();
const seconds: number = now.getSec... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/menu/VHInviteDialog.ets#L180-L189 | 908c7d389069aa5d1c58d9aed549ffd42248967b | gitee |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/components/JhPickerTool.ets | arkts | isOneDimensionalArray | 是否是一维数组
@param arr
@returns | public static isOneDimensionalArray(arr: ESObject[]) {
// 检查是否为数组,并且数组内元素不是数组, 使用 some 方法检查是否有任何元素是数组,如果存在,则说明是非一维数组
return Array.isArray(arr) && !arr.some((item: ESObject) => Array.isArray(item))
} | AST#method_declaration#Left public static isOneDimensionalArray AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ESObject [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#bloc... | public static isOneDimensionalArray(arr: ESObject[]) {
return Array.isArray(arr) && !arr.some((item: ESObject) => Array.isArray(item))
} | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhPickerTool.ets#L232-L235 | 46680a3b03c95c668633bda32dc3c3f0085058d9 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | arkts/@arkts.utils.d.ets | arkts | queryAll | Query information about all locks.
@returns { AsyncLockState[] } Returns an array of AsyncLockState.
@static
@syscap SystemCapability.Utils.Lang
@atomicservice
@since 12
Query information about all locks.
@returns { AsyncLockState[] } Returns an array of AsyncLockState.
@static
@syscap SystemCapability.Utils.Lang
@... | static queryAll(): AsyncLockState[]; | AST#method_declaration#Left static queryAll AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left AsyncLockState [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | static queryAll(): AsyncLockState[]; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/arkts/@arkts.utils.d.ets#L174-L174 | 46b71503a7c476971056448bb9a04ab318ebcbc5 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.DialogV2.d.ets | arkts | Declare the callback when the checkbox of dialog is changed.
@typedef { function } AdvancedDialogV2OnCheckedChange
@param { boolean } checked - Checkbox status.
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 18 | export declare type AdvancedDialogV2OnCheckedChange = (checked: boolean) => void; | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#type_declaration#Left type AdvancedDialogV2OnCheckedChange = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left checked : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right ... | export declare type AdvancedDialogV2OnCheckedChange = (checked: boolean) => void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.DialogV2.d.ets#L253-L253 | 8ff68d4431c7779240fc46c895174bf46f355c96 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/utils/DialogUtils.ets | arkts | showDialog | 多个按钮的AlertDialog(AlertDialogParamWithOptions)
@param options | static showDialog(options: OptionDialogOptions) {
DialogUtils.initDialogDefault(options);
DialogUtils.initDialogButton(options);
AlertDialog.show(options as AlertDialogParamWithOptions);
} | AST#method_declaration#Left static showDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left OptionDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statemen... | static showDialog(options: OptionDialogOptions) {
DialogUtils.initDialogDefault(options);
DialogUtils.initDialogButton(options);
AlertDialog.show(options as AlertDialogParamWithOptions);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/DialogUtils.ets#L72-L76 | b17027db85e41cc9ee2b0f608cd4c296fb2f095c | gitee |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets | arkts | 获取相对时间描述
@param dateTime 目标日期时间
@returns 相对时间描述 | export function getRelativeTimeDesc(dateTime: Date): string {
const now = new Date();
const diffMs = now.getTime() - dateTime.getTime();
const diffSec = Math.floor(diffMs / 1000);
if (diffSec < 60) {
return '刚刚';
}
const diffMin = Math.floor(diffSec / 60);
if (diffMin < 60) {
return `${diffM... | AST#export_declaration#Left export AST#function_declaration#Left function getRelativeTimeDesc AST#parameter_list#Left ( AST#parameter#Left dateTime : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#... | export function getRelativeTimeDesc(dateTime: Date): string {
const now = new Date();
const diffMs = now.getTime() - dateTime.getTime();
const diffSec = Math.floor(diffMs / 1000);
if (diffSec < 60) {
return '刚刚';
}
const diffMin = Math.floor(diffSec / 60);
if (diffMin < 60) {
return `${diffM... | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets#L63-L94 | 39146bcdbc5466e32e844c6eea8def449941777f | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/Transformer.ets | arkts | rectValuesToPixel | transforms multiple rects with all matrices
@param rects | public rectValuesToPixel(rects: MyRect[]) {
var m: Matrix = this.getValueToPixelMatrix();
for (var i = 0; i < rects.length; i++) {
m.mapRect(rects[i]);
}
} | AST#method_declaration#Left public rectValuesToPixel AST#parameter_list#Left ( AST#parameter#Left rects : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left MyRect [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement... | public rectValuesToPixel(rects: MyRect[]) {
var m: Matrix = this.getValueToPixelMatrix();
for (var i = 0; i < rects.length; i++) {
m.mapRect(rects[i]);
}
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/Transformer.ets#L330-L336 | 3d4902ed8262a44c12382860477dda3099524111 | gitee |
jerryzhou2/ArkTS-news-app.git | 6dfa8631948f1def4269be5a48554b99ee64a18d | fluent-news-homepage-master/entry/src/main/ets/view/Home.ets | arkts | destroyLottie | [End lottie_controller] | destroyLottie() {
this.tabOption1.lottieItem?.removeEventListener('DOMLoaded');
this.tabOption2.lottieItem?.removeEventListener('DOMLoaded');
this.tabOption3.lottieItem?.removeEventListener('DOMLoaded');
lottie.destroy(this.tabOption1.name);
lottie.destroy(this.tabOption2.name);
lottie.destroy(t... | AST#method_declaration#Left destroyLottie AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST... | destroyLottie() {
this.tabOption1.lottieItem?.removeEventListener('DOMLoaded');
this.tabOption2.lottieItem?.removeEventListener('DOMLoaded');
this.tabOption3.lottieItem?.removeEventListener('DOMLoaded');
lottie.destroy(this.tabOption1.name);
lottie.destroy(this.tabOption2.name);
lottie.destroy(t... | https://github.com/jerryzhou2/ArkTS-news-app.git/blob/6dfa8631948f1def4269be5a48554b99ee64a18d/fluent-news-homepage-master/entry/src/main/ets/view/Home.ets#L165-L172 | 3ca7f86a0df6241f3183921189d30b82f240d557 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/media/MediaManager.ets | arkts | cacheMediaFile | 私有辅助方法 | private async cacheMediaFile(sourceUri: string, type: MediaType): Promise<string> {
const timestamp = Date.now();
const extension = this.getExtensionByType(type);
const cachedPath = `/data/storage/el2/base/cache/${type}_${timestamp}.${extension}`;
// TODO: 实现文件复制逻辑
// 这里需要将sourceUri的文件复制到cached... | AST#method_declaration#Left private async cacheMediaFile AST#parameter_list#Left ( AST#parameter#Left sourceUri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left MediaTyp... | private async cacheMediaFile(sourceUri: string, type: MediaType): Promise<string> {
const timestamp = Date.now();
const extension = this.getExtensionByType(type);
const cachedPath = `/data/storage/el2/base/cache/${type}_${timestamp}.${extension}`;
return cachedPath;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/MediaManager.ets#L621-L630 | 85a0a8620d66b669a907f758f5babc01ba8397a5 | github |
Zairgs/ArKTSMovie.git | 1586c977f12722333eee7d74a71f006ba0606ade | ets/pages/Goods.ets | arkts | getStatusText | 获取状态文本 | private getStatusText(status: OrderStatus): string {
const statusMap: Record<OrderStatus, string> = {
'pending': '待支付',
'paid': '待发货',
'shipped': '待收货',
'completed': '已完成',
'after_sale': '售后中'
};
return statusMap[status];
} | AST#method_declaration#Left private getStatusText AST#parameter_list#Left ( AST#parameter#Left status : AST#type_annotation#Left AST#primary_type#Left OrderStatus AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#p... | private getStatusText(status: OrderStatus): string {
const statusMap: Record<OrderStatus, string> = {
'pending': '待支付',
'paid': '待发货',
'shipped': '待收货',
'completed': '已完成',
'after_sale': '售后中'
};
return statusMap[status];
} | https://github.com/Zairgs/ArKTSMovie.git/blob/1586c977f12722333eee7d74a71f006ba0606ade/ets/pages/Goods.ets#L139-L148 | 91cc44bba78b31e018b07bdff46127e4b429d27a | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/network/src/main/ets/datasource/feedback/FeedbackNetworkDataSourceImpl.ets | arkts | @file 意见反馈数据源实现类
@author Joker.X | export class FeedbackNetworkDataSourceImpl implements FeedbackNetworkDataSource {
/**
* 提交反馈
* @param {FeedbackSubmitRequest} params - 反馈内容
* @returns {Promise<NetworkResponse<boolean>>} 是否提交成功
*/
async submitFeedback(params: FeedbackSubmitRequest): Promise<NetworkResponse<boolean>> {
const resp: Ax... | AST#export_declaration#Left export AST#class_declaration#Left class FeedbackNetworkDataSourceImpl AST#implements_clause#Left implements FeedbackNetworkDataSource AST#implements_clause#Right AST#class_body#Left { /**
* 提交反馈
* @param {FeedbackSubmitRequest} params - 反馈内容
* @returns {Promise<NetworkResponse<boole... | export class FeedbackNetworkDataSourceImpl implements FeedbackNetworkDataSource {
async submitFeedback(params: FeedbackSubmitRequest): Promise<NetworkResponse<boolean>> {
const resp: AxiosResponse<NetworkResponse<boolean>> =
await NetworkClient.http.post("app/feedback/submit", params);
return resp.da... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/feedback/FeedbackNetworkDataSourceImpl.ets#L10-L43 | 0a3602e36b7acaa7da16f31d6a6570cb0fdc576e | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/LineData.ets | arkts | Data object that encapsulates all data associated with a LineChart. | export default class LineData extends BarLineScatterCandleBubbleData<ILineDataSet> {
public constructor(dataSets?: JArrayList<ILineDataSet>) {
super(dataSets);
}
} | AST#export_declaration#Left export default AST#class_declaration#Left class LineData extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BarLineScatterCandleBubbleData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ILineDataSet AST#primary_type#Right AST#type_annotatio... | export default class LineData extends BarLineScatterCandleBubbleData<ILineDataSet> {
public constructor(dataSets?: JArrayList<ILineDataSet>) {
super(dataSets);
}
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/LineData.ets#L24-L28 | 074491bc958d8a98db312bb0bf9196764efd1b26 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/entity/OrderCount.ets | arkts | @file 用户订单统计
@author Joker.X | export class OrderCount {
/**
* 待付款订单数量
*/
pendingPayment: number = 0;
/**
* 待发货订单数量
*/
pendingShipment: number = 0;
/**
* 待收货订单数量
*/
pendingReceive: number = 0;
/**
* 待评价订单数量
*/
pendingReview: number = 0;
/**
* 退款中订单数量
*/
refunding: number = 0;
/**
* 已退款订单数量
*/... | AST#export_declaration#Left export AST#class_declaration#Left class OrderCount AST#class_body#Left { /**
* 待付款订单数量
*/ AST#property_declaration#Left pendingPayment : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ;... | export class OrderCount {
pendingPayment: number = 0;
pendingShipment: number = 0;
pendingReceive: number = 0;
pendingReview: number = 0;
refunding: number = 0;
refunded: number = 0;
constructor(init?: Partial<OrderCount>) {
if (!init) {
return;
}
this.pendingPayment =... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/OrderCount.ets#L5-L100 | 7cff73eaf2cf297ea9abcd40bc1bd3d9af9416ac | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/addressrecognize/src/main/ets/view/ImageEdit.ets | arkts | moveClipCanvas | 裁剪框位置和大小变化,初始位置为图片的初始坐标,移动的坐标
@param moveX
@param moveY | moveClipCanvas(moveX: number, moveY: number) {
let clipRect: RectPosition = {
x: this.clipRect.x,
y: this.clipRect.y,
width: this.clipRect.width,
height: this.clipRect.height
}
switch (this.actionType) {
case ActionType.move:
clipRect.x += moveX; | AST#method_declaration#Left moveClipCanvas AST#parameter_list#Left ( AST#parameter#Left moveX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left moveY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#R... | moveClipCanvas(moveX: number, moveY: number) {
let clipRect: RectPosition = {
x: this.clipRect.x,
y: this.clipRect.y,
width: this.clipRect.width,
height: this.clipRect.height
}
switch (this.actionType) {
case ActionType.move:
clipRect.x += moveX; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/addressrecognize/src/main/ets/view/ImageEdit.ets#L61-L70 | efb1a26a744e1360ea6565fac626290d0e06ec87 | gitee |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/pages/TaskReviewView.ets | arkts | confirmFlaw | 确认故障 | async confirmFlaw(flaw: FlawInfo) {
try {
console.log('[TaskReviewView] 🔧 开始确认故障,ID:', flaw.id);
const httpRequest = http.createHttp();
const response = await httpRequest.request(
`${AppConstants.API_BASE_URL}/agv/flaw`,
{
method: http.RequestMethod.PUT,
... | AST#method_declaration#Left async confirmFlaw AST#parameter_list#Left ( AST#parameter#Left flaw : AST#type_annotation#Left AST#primary_type#Left FlawInfo 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 t... | async confirmFlaw(flaw: FlawInfo) {
try {
console.log('[TaskReviewView] 🔧 开始确认故障,ID:', flaw.id);
const httpRequest = http.createHttp();
const response = await httpRequest.request(
`${AppConstants.API_BASE_URL}/agv/flaw`,
{
method: http.RequestMethod.PUT,
... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/pages/TaskReviewView.ets#L367-L449 | f30c2f683996c812d0e0c4230eb5d5cf54bc06e3 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | isUseAutoScaleMinRestriction | Returns true if autoscale restriction for axis min value is enabled
@Deprecated | public isUseAutoScaleMinRestriction(): boolean {
return this.mUseAutoScaleRestrictionMin;
} | AST#method_declaration#Left public isUseAutoScaleMinRestriction 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 isUseAutoScaleMinRestriction(): boolean {
return this.mUseAutoScaleRestrictionMin;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L402-L404 | 777c50022175517516505f2365939f5d2eb4b96c | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/RPC/entry/src/main/ets/common/TitleBar.ets | arkts | TitleBar | Copyright (c) 2021-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,... | @Component
export struct TitleBar {
build() {
Row() {
Text($r('app.string.entry_MainAbility'))
.fontSize(30)
.layoutWeight(1)
.fontColor(Color.White)
}
.width('100%')
.height('8%')
.padding({ left: 15 })
.backgroundColor($r('app.color.title_bar_bg'))
.constrai... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TitleBar AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Row ( ) AST#container_content_body#Left { AST... | @Component
export struct TitleBar {
build() {
Row() {
Text($r('app.string.entry_MainAbility'))
.fontSize(30)
.layoutWeight(1)
.fontColor(Color.White)
}
.width('100%')
.height('8%')
.padding({ left: 15 })
.backgroundColor($r('app.color.title_bar_bg'))
.constrai... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/RPC/entry/src/main/ets/common/TitleBar.ets#L16-L31 | 0a2b36caed13c4d4671c842489015f3511fa8728 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Plan.ets | arkts | delete | / 从db中删除 | async delete(): Promise<void> {
await PlanManager.delete(this);
} | AST#method_declaration#Left async delete 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_arguments... | async delete(): Promise<void> {
await PlanManager.delete(this);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L479-L481 | 8826e2d6fabba73377255e881ff2f6ac1f49ca37 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/ContactTypes.ets | arkts | 联系人创建参数接口 | export interface CreateContactParams extends Partial<ExtendedContactInfo> {
name: string;
relation: RelationType;
birthday: BirthdayInfo;
gender?: Gender;
phone?: string;
email?: string;
avatar?: string;
tags?: string[];
notes?: string;
intimacyLevel?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface CreateContactParams AST#extends_clause#Left extends AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ExtendedContactInfo AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments... | export interface CreateContactParams extends Partial<ExtendedContactInfo> {
name: string;
relation: RelationType;
birthday: BirthdayInfo;
gender?: Gender;
phone?: string;
email?: string;
avatar?: string;
tags?: string[];
notes?: string;
intimacyLevel?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L163-L174 | 20a2d2c8a65cef3ed448b81e80dbfa2de8143c36 | github | |
HunZiLei/ArtTs_PokeAccountBook.git | 3d91db931f5dd6cea3c6cd414fad7c28942a58ac | entry/src/main/ets/pages/toBuyPage.ets | arkts | detect | 网络请求相关 | detect(): boolean{
let res = Check_Access();
if(res){
return true;
}else{
return false;
}
} | AST#method_declaration#Left detect 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#variable_declaration#Left let AST#variable_declarator#Left res = AST#express... | detect(): boolean{
let res = Check_Access();
if(res){
return true;
}else{
return false;
}
} | https://github.com/HunZiLei/ArtTs_PokeAccountBook.git/blob/3d91db931f5dd6cea3c6cd414fad7c28942a58ac/entry/src/main/ets/pages/toBuyPage.ets#L80-L87 | 5b6da0d36810a0f90d73108baa4734a1454da923 | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Column.ets | arkts | 渲染布局
@returns {void} 无返回值
@example
ColumnStart() { Text("Hi"); } | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValu... | AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expressio... | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: HorizontalAlign.Start,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValu... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Column.ets#L284-L299 | 02ed15bb723dec416a3d8e37e6c11e6a25e5a172 | github | |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-dialog@1.1.7/oh_modules/@pura/harmony-dialog/src/main/ets/utils/Helper.ets | arkts | getResourceManager | 获取提供访问应用资源的能力
@returns | static getResourceManager(): resourceManager.ResourceManager {
return getContext().resourceManager;
} | AST#method_declaration#Left static getResourceManager AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left resourceManager . ResourceManager AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#s... | static getResourceManager(): resourceManager.ResourceManager {
return getContext().resourceManager;
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-dialog@1.1.7/oh_modules/@pura/harmony-dialog/src/main/ets/utils/Helper.ets#L104-L106 | eb51ced60560c9c834d28fcd1cfbb4e8453b2b63 | github |
openharmony/global_resource_management | abbbae9556ca674a754d58c65039a821b72357ae | interfaces/ets/ani/resourceManager/ets/global/rawFileDescriptor.ets | arkts | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface RawFileDescriptor {
fd: number;
offset: number;
length: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface RawFileDescriptor AST#object_type#Left { AST#type_member#Left fd : 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 offset : AST#type_annotation#... | export interface RawFileDescriptor {
fd: number;
offset: number;
length: number;
} | https://github.com/openharmony/global_resource_management/blob/abbbae9556ca674a754d58c65039a821b72357ae/interfaces/ets/ani/resourceManager/ets/global/rawFileDescriptor.ets#L16-L20 | 8b8f3f9c7c6764525bbeb90986c62db753ab5044 | gitee | |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/DialogBuilder.ets | arkts | SelectDialogBuilder | 【系统】SelectDialog弹窗
@param options | @Builder
export function SelectDialogBuilder(options: ISelectDialogOptions) {
SelectDialog(options as ESObject)
.height(options.style?.height)
.width(options.style?.width)
.constraintSize({ maxWidth: options.style?.maxWidth, maxHeight: options.style?.maxHeight })
.backgroundColor(options.style?.backgr... | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SelectDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ISelectDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST... | @Builder
export function SelectDialogBuilder(options: ISelectDialogOptions) {
SelectDialog(options as ESObject)
.height(options.style?.height)
.width(options.style?.width)
.constraintSize({ maxWidth: options.style?.maxWidth, maxHeight: options.style?.maxHeight })
.backgroundColor(options.style?.backgr... | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogBuilder.ets#L171-L185 | 90df906e2d3e4c2e1f7625f35f20a1ce05caf59b | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WantUtil.ets | arkts | toWifiSetting | 跳转WLAN设置页面 | static toWifiSetting(): Promise<void> {
return WantUtil.toSetting(WantUtil.URI_WIFI);
} | AST#method_declaration#Left static toWifiSetting 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_a... | static toWifiSetting(): Promise<void> {
return WantUtil.toSetting(WantUtil.URI_WIFI);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WantUtil.ets#L139-L141 | 4abafb67d889d9c63ff255992e1f8023f00bdc5c | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/dbUtils/DBAccessor.ets | arkts | encodedParamString | /安全编码字符串参数(带输入验证和类型守卫) | static encodedParamString(param: string | null): string | null {
if (!param?.trim()) return null; // 合并空值检查和trim
return StringEncoder.encodedToBase64(param) ?? null; // 空值合并操作符
} | AST#method_declaration#Left static encodedParamString AST#parameter_list#Left ( AST#parameter#Left param : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Rig... | static encodedParamString(param: string | null): string | null {
if (!param?.trim()) return null;
return StringEncoder.encodedToBase64(param) ?? null;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBAccessor.ets#L402-L405 | 4858091b8f85aac59e5db2328ea9f471a74c5531 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeScanConst.ets | arkts | 图片属性 | export interface ImageAttribute {
width: number;
height: number;
pixelMap: image.PixelMap;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ImageAttribute AST#object_type#Left { AST#type_member#Left width : 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 height : AST#type_annotation#... | export interface ImageAttribute {
width: number;
height: number;
pixelMap: image.PixelMap;
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/QRCodeScan/Feature/src/main/ets/qrcodescan/QRCodeScanConst.ets#L50-L54 | beb82fa4e8586ecca3f4c9a3b5c710b927a8ddf6 | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/SearchManager.ets | arkts | createPartFromWord | 从单词创建分类对象 | private createPartFromWord(word: WordUser): Part {
const part = new Part();
part.partId = word.partId || 0;
part.partName = word.partName || '';
part.units = [];
return part;
} | AST#method_declaration#Left private createPartFromWord AST#parameter_list#Left ( AST#parameter#Left word : AST#type_annotation#Left AST#primary_type#Left WordUser AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Part AST#pri... | private createPartFromWord(word: WordUser): Part {
const part = new Part();
part.partId = word.partId || 0;
part.partName = word.partName || '';
part.units = [];
return part;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L267-L273 | 4ce7d7f0c5c5fec991fa4be3067913805e175a9e | github |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/pages/MainPage.ets | arkts | 页面渲染函数 | build() {
Stack() {
Scroll(this.scroller) {
Column(){
Column() {
Text(" ").height($r('app.float.edge_size_M')).width('100%')
// .backgroundColor($r('app.color.blue'))
//最上部分组件
Row() { //标题
Text($r('app.string.MainAbility_label')... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Stack ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( AST#expression#Left AST#member_expression#Left ... | build() {
Stack() {
Scroll(this.scroller) {
Column(){
Column() {
Text(" ").height($r('app.float.edge_size_M')).width('100%')
Row() {
Text($r('app.string.MainAbility_label'))
.height($r('app.float.component_siz... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/pages/MainPage.ets#L93-L333 | 377ad07769ee88bf6e0ce997c1c426dd764f63bf | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/XAxisLabelPosition.ets | arkts | 标签绘制位置的枚举 | export enum XAxisLabelPosition {
Left,
Center,
Right
} | AST#export_declaration#Left export AST#enum_declaration#Left enum XAxisLabelPosition AST#enum_body#Left { AST#enum_member#Left Left AST#enum_member#Right , AST#enum_member#Left Center AST#enum_member#Right , AST#enum_member#Left Right AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_dec... | export enum XAxisLabelPosition {
Left,
Center,
Right
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/XAxisLabelPosition.ets#L19-L23 | 8cec93fdb33e14b746676c0b8f2d960ca0e51a68 | gitee | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.SubHeaderV2.d.ets | arkts | SubHeaderV2Title | Declare the SubHeaderV2Title
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 18 | @ObservedV2
export declare class SubHeaderV2Title {
/**
* The first line text of content area.
* @type { ?ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 18
*/
@Trace primaryTitle?: ResourceStr;
/**
* Text modifier for primary title.
... | AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right class SubHeaderV2Title AST#class_body#Left { /**
* The first line text of content area.
* @type { ?ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatfo... | @ObservedV2
export declare class SubHeaderV2Title {
@Trace primaryTitle?: ResourceStr;
@Trace primaryTitleModifier?: TextModifier;
@Trace secondaryTitle?: ResourceStr;
@Trace secondaryTitleModifier?: TextModifier;
constructor(options: SubHeaderV2TitleOptions);
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.SubHeaderV2.d.ets#L88-L136 | 18d8c1c6b23b0bbe15632b0a36bbdcc39c110247 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/etswrapper/src/main/ets/view/MockNativeCallPickerView.ets | arkts | emitter | 注意:仅供UI展示使用 | emitter.on({
eventId: EVENT_ID
}, (eventData: emitter.EventData): void => {
const data = eventData.data as Record<string, string>;
this.selectedContent = "";
this.selectedContent = data.content.replace(',', '\n');
})
} | AST#method_declaration#Left emitter AST#ERROR#Left . on AST#ERROR#Right AST#parameter_list#Left ( AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#arrow_function#Left eventId : AST#ERROR#Left EVENT_ID } , AST#parameter_list#Left ( AST#parameter#Left eventD... | emitter.on({
eventId: EVENT_ID
}, (eventData: emitter.EventData): void => {
const data = eventData.data as Record<string, string>;
this.selectedContent = "";
this.selectedContent = data.content.replace(',', '\n');
})
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/etswrapper/src/main/ets/view/MockNativeCallPickerView.ets#L65-L72 | 2a22dd88e98a517639750d7b27b1db37351f2db7 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | video net address | export const NET: string = '网络视频地址*****'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left NET : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '网络视频地址*****' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declarati... | export const NET: string = '网络视频地址*****'; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets#L29-L29 | 1c92d8e21b0f88bcac4dbb95eac9439d4f236a80 | gitee | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/map_lib_func_005_T.ets | arkts | Introduction 库函数-map_entries | export function map_lib_func_005_T(taint_src : string) {
let map = new Map<string,string>();
map.set("t",taint_src);
map.set("tt","a");
taint.Sink(map.entries());
} | AST#export_declaration#Left export AST#function_declaration#Left function map_lib_func_005_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#... | export function map_lib_func_005_T(taint_src : string) {
let map = new Map<string,string>();
map.set("t",taint_src);
map.set("tt","a");
taint.Sink(map.entries());
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/map_lib_func_005_T.ets#L7-L12 | c36dd15f73ca2e6ea4253ddbb9fcc518ce6611c8 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/setting/AdviceView.ets | arkts | buildTextEditor | / 构建文本编辑区域 | @Builder buildTextEditor() {
Stack({ alignContent: Alignment.BottomEnd }) {
// 文本输入框
TextArea({ text: this.content })
.height(180)
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(10)
.border({ width: 1, color: '#DDDDDD' })
.onChange((value: string... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildTextEditor 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 Stack ( AST#component_parameters#Left { AST#component_para... | @Builder buildTextEditor() {
Stack({ alignContent: Alignment.BottomEnd }) {
TextArea({ text: this.content })
.height(180)
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(10)
.border({ width: 1, color: '#DDDDDD' })
.onChange((value: string) => {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/setting/AdviceView.ets#L113-L133 | 88c92e3cc9c88d93cc2c6a5f23c918a733ea17ae | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/database/GreetingHistoryDAO.ets | arkts | getGreetingHistoryById | 根据ID查询祝福记录
@param id 祝福记录ID
@returns 祝福历史实体或null | async getGreetingHistoryById(id: number): Promise<GreetingHistoryEntity | null> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('greeting_history');
predicates.e... | AST#method_declaration#Left async getGreetingHistoryById AST#parameter_list#Left ( AST#parameter#Left id : 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 AST#generic_ty... | async getGreetingHistoryById(id: number): Promise<GreetingHistoryEntity | null> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('greeting_history');
predicates.e... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/GreetingHistoryDAO.ets#L93-L117 | 1ba77ca3b9b509fe024317c5b0bd13f46931531b | github |
openharmony-tpc/ImageKnife | bc55de9e2edd79ed4646ce37177ad94b432874f7 | library/src/main/ets/utils/ArrayBufferUtils.ets | arkts | Copyright (C) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export function combineArrayBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {
// 计算多个ArrayBuffer的总字节大小
let totalByteLength = 0;
for (const arrayBuffer of arrayBuffers) {
totalByteLength += arrayBuffer.byteLength;
}
// 创建一个新的ArrayBuffer
const combinedArrayBuffer = new ArrayBuffer(totalByteLength);
... | AST#export_declaration#Left export AST#function_declaration#Left function combineArrayBuffers AST#parameter_list#Left ( AST#parameter#Left arrayBuffers : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ArrayBuffer [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter... | export function combineArrayBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {
let totalByteLength = 0;
for (const arrayBuffer of arrayBuffers) {
totalByteLength += arrayBuffer.byteLength;
}
const combinedArrayBuffer = new ArrayBuffer(totalByteLength);
const combinedUint8Array = new Uint8Array... | https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/utils/ArrayBufferUtils.ets#L16-L38 | 2bd7833a0d5cac52f599429f73e2da5fa8bdbb83 | gitee | |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/src/main/ets/components/SwipeCardStack.ets | arkts | swipeLeft | 程序化向左滑动 | public swipeLeft(): void {
if (this.cardState !== CardState.IDLE || this.currentIndex >= this.cardDataList.length) {
return;
}
const data: object = this.cardDataList[this.currentIndex];
const deltaX: number = -this.finalConfig.swipeThreshold - 1;
const deltaY: number = 0;
this.performSwi... | AST#method_declaration#Left public swipeLeft 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#if_statement#Left if ( AST#expression#Left AST#member_expression#Left... | public swipeLeft(): void {
if (this.cardState !== CardState.IDLE || this.currentIndex >= this.cardDataList.length) {
return;
}
const data: object = this.cardDataList[this.currentIndex];
const deltaX: number = -this.finalConfig.swipeThreshold - 1;
const deltaY: number = 0;
this.performSwi... | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/components/SwipeCardStack.ets#L468-L478 | 7eb1e54468de21ebb0ec0412dc9cb1d42187eef3 | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | advanced_ui_component/dialogv2/source/dialogv2.ets | arkts | initTitleTextAlign | get tile TextAlign
@returns TextAlign | private initTitleTextAlign(): void {
let textAlign: number = ALERT_TITLE_ALIGNMENT;
if (textAlign === TextAlign.Start) {
this.titleTextAlign = TextAlign.Start;
} else if (textAlign === TextAlign.Center) {
this.titleTextAlign = TextAlign.Center;
} else if (textAlign === TextAlign.End) {
... | AST#method_declaration#Left private initTitleTextAlign 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 initTitleTextAlign(): void {
let textAlign: number = ALERT_TITLE_ALIGNMENT;
if (textAlign === TextAlign.Start) {
this.titleTextAlign = TextAlign.Start;
} else if (textAlign === TextAlign.Center) {
this.titleTextAlign = TextAlign.Center;
} else if (textAlign === TextAlign.End) {
... | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/dialogv2/source/dialogv2.ets#L1324-L1337 | ed9cbc3e48f8903d79727ab8200b45a8063e9825 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets | arkts | 继承自BasicDataSource的子类,重写了方法。
@class
@extends {BasicDataSource} | export class MyDataSource extends BasicDataSource {
private dataArray: CustomDataType[] = [];
/**
* 获取数组长度。
* @returns {number} 返回数组长度。
*/
public totalCount(): number {
return this.dataArray.length;
}
/**
* 获取指定索引数据。
* @param {number} index - 索引值。
* @returns {CustomDataType} 返回指定索引数据。
... | AST#export_declaration#Left export AST#class_declaration#Left class MyDataSource extends AST#type_annotation#Left AST#primary_type#Left BasicDataSource AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left private dataArray : AST#type_annotation#Left AST#primary_type#Left ... | export class MyDataSource extends BasicDataSource {
private dataArray: CustomDataType[] = [];
public totalCount(): number {
return this.dataArray.length;
}
public getData(index: number): CustomDataType {
return this.dataArray[index];
}
public addData(index: number, data: CustomDataType):... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/DataType.ets#L138-L180 | b318852bc0d92d4957f96c8d893357356457cf5f | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/models/ContactModel.ets | arkts | getContact | 获取联系人信息 | getContact(): Contact {
return {
id: this.contact.id,
name: this.contact.name,
avatar: this.contact.avatar,
phone: this.contact.phone,
email: this.contact.email,
relation: this.contact.relation,
gender: this.contact.gender,
tags: this.contact.tags.slice(),
notes... | AST#method_declaration#Left getContact AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#object_literal#Left... | getContact(): Contact {
return {
id: this.contact.id,
name: this.contact.name,
avatar: this.contact.avatar,
phone: this.contact.phone,
email: this.contact.email,
relation: this.contact.relation,
gender: this.contact.gender,
tags: this.contact.tags.slice(),
notes... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/models/ContactModel.ets#L122-L162 | b56de1b655237b4b395daaa2acbb69acd5591554 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/BuildProfile.ets | arkts | Use these variables when you tailor your ArkTS code. They must be of the const type. | export const HAR_VERSION = '1.0.1'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '1.0.1' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '1.0.1'; | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/BuildProfile.ets#L4-L4 | 7468a841e91226556dd445d3ea175e01b5ed6d84 | gitee | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | ComponentEncapsulation/entry/src/main/ets/pages/ControllerCallPage.ets | arkts | [Start ctrl] | export class Controller {
action = () => {
};
} | AST#export_declaration#Left export AST#class_declaration#Left class Controller AST#class_body#Left { AST#property_declaration#Left action = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expression#Left AST#object_literal#Left { } AST#object_literal#Right AST#exp... | export class Controller {
action = () => {
};
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ComponentEncapsulation/entry/src/main/ets/pages/ControllerCallPage.ets#L16-L19 | b50416f823b0bea4aaf8d9150d9840863e91fd6d | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/constants/AppConstants.ets | arkts | 事件常量 | export class EventConstants {
static readonly CONTACT_UPDATED: string = 'contact_updated';
static readonly CONTACT_DELETED: string = 'contact_deleted';
static readonly GREETING_SENT: string = 'greeting_sent';
static readonly SETTINGS_CHANGED: string = 'settings_changed';
static readonly THEME_CHANGED: string ... | AST#export_declaration#Left export AST#class_declaration#Left class EventConstants AST#class_body#Left { AST#property_declaration#Left static readonly CONTACT_UPDATED : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'contact_updated' AST#expr... | export class EventConstants {
static readonly CONTACT_UPDATED: string = 'contact_updated';
static readonly CONTACT_DELETED: string = 'contact_deleted';
static readonly GREETING_SENT: string = 'greeting_sent';
static readonly SETTINGS_CHANGED: string = 'settings_changed';
static readonly THEME_CHANGED: string ... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/constants/AppConstants.ets#L86-L92 | 9e50181b703c49261d9f2869db507d5b9921a027 | github | |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/service/DownloadService.ets | arkts | pauseDownload | 暂停下载 | async pauseDownload(episodeId: string): Promise<void> {
try {
const task = this.downloadTasks.get(episodeId);
if (task) {
await task.downloadTask.suspend();
task.isPaused = true;
}
} catch (error) {
console.error('Failed to pause download:', error);
}
} | AST#method_declaration#Left async pauseDownload AST#parameter_list#Left ( AST#parameter#Left episodeId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type... | async pauseDownload(episodeId: string): Promise<void> {
try {
const task = this.downloadTasks.get(episodeId);
if (task) {
await task.downloadTask.suspend();
task.isPaused = true;
}
} catch (error) {
console.error('Failed to pause download:', error);
}
} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/DownloadService.ets#L191-L201 | 41ff32de7890760f15f0fc08a35c30237c4a1652 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Data/SetAppFontSize/entry/src/main/ets/viewmodel/ChatData.ets | arkts | Chat list item info. | export default class ChatData {
/**
* Chat list item direction.
*/
itemDirection: ItemDirection = ItemDirection.LEFT;
/**
* Chat list item content.
*/
content: Resource = $r('app.string.empty');
} | AST#export_declaration#Left export default AST#class_declaration#Left class ChatData AST#class_body#Left { /**
* Chat list item direction.
*/ AST#property_declaration#Left itemDirection : AST#type_annotation#Left AST#primary_type#Left ItemDirection AST#primary_type#Right AST#type_annotation#Right = AST#expression... | export default class ChatData {
itemDirection: ItemDirection = ItemDirection.LEFT;
content: Resource = $r('app.string.empty');
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/SetAppFontSize/entry/src/main/ets/viewmodel/ChatData.ets#L21-L31 | 2cec484b74cb2770046132f01e37f6666104f30a | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/VerifyCode/casesfeature/verifycode/Index.ets | arkts | VerifyCodeViewComponent | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export { VerifyCodeViewComponent } from './src/main/ets/view/VerifyCodeView' | AST#export_declaration#Left export { VerifyCodeViewComponent } from './src/main/ets/view/VerifyCodeView' AST#export_declaration#Right | export { VerifyCodeViewComponent } from './src/main/ets/view/VerifyCodeView' | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/VerifyCode/casesfeature/verifycode/Index.ets#L16-L16 | 0acf1a712ba246c2b0d19e8c8bed98a68563c16b | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/services/ConfigService.ets | arkts | 配置服务 - 单例模式
安全存储和管理应用配置 | export class ConfigService {
private static instance: ConfigService | null = null;
private dataPreferences: preferences.Preferences | null = null;
private context: common.UIAbilityContext | null = null;
// 存储键名
private static readonly PREF_NAME = 'lumos_config';
private static readonly KEY_API_KEY = 'deeps... | AST#export_declaration#Left export AST#class_declaration#Left class ConfigService AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ConfigService AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#... | export class ConfigService {
private static instance: ConfigService | null = null;
private dataPreferences: preferences.Preferences | null = null;
private context: common.UIAbilityContext | null = null;
private static readonly PREF_NAME = 'lumos_config';
private static readonly KEY_API_KEY = 'deepseek_api... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/ConfigService.ets#L24-L287 | 0ef3d0514d8fce5a582c3ca84a7bb67a8cc737cd | github | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets | arkts | drawInnerCircle | Draw the inner disc. | drawInnerCircle() {
this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_CIRCLE_RATIOS, 0,
Math.PI * CommonConstants.TWO), ColorConstants.INNER_CIRCLE_COLOR);
this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_WHITE_CIRCLE_RATIOS, 0,
Math.PI * CommonCo... | AST#method_declaration#Left drawInnerCircle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . fillArc AST#member_e... | drawInnerCircle() {
this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_CIRCLE_RATIOS, 0,
Math.PI * CommonConstants.TWO), ColorConstants.INNER_CIRCLE_COLOR);
this.fillArc(new FillArcData(0, 0, this.screenWidth * CommonConstants.INNER_WHITE_CIRCLE_RATIOS, 0,
Math.PI * CommonCo... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/CanvasComponent/entry/src/main/ets/viewmodel/DrawModel.ets#L132-L137 | 04aa22bcc081ee1b7f328d5f42e34d9e6dd0baa3 | gitee |
wuyukobe24/HMApp_ArkTS.git | 6d09d9b07a4fdc4713e5a13b61b85bc1e7893956 | entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets | arkts | loadHomeRequestIconDataNew | 获取首页金刚区数据2【使用三方库Net进行网络请求,使用requestObject获取封装好的数据】 | loadHomeRequestIconDataNew(success:(model:QQBannerModel)=>void, fail:(error:NetError)=>void) {
let param:Record<string, string> = {
"game":"game_zone",
"priority":"5",
"favzone":"",
"subChannel":"1",
"slidetype":"0",
"next":"0",
}
let url:string = '/go/zone/icon_card'
... | AST#method_declaration#Left loadHomeRequestIconDataNew AST#parameter_list#Left ( AST#parameter#Left success : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left model : AST#type_annotation#Left AST#primary_type#Left QQBannerModel AST#primary_type#Right AST#type_annotation#Right... | loadHomeRequestIconDataNew(success:(model:QQBannerModel)=>void, fail:(error:NetError)=>void) {
let param:Record<string, string> = {
"game":"game_zone",
"priority":"5",
"favzone":"",
"subChannel":"1",
"slidetype":"0",
"next":"0",
}
let url:string = '/go/zone/icon_card'
... | https://github.com/wuyukobe24/HMApp_ArkTS.git/blob/6d09d9b07a4fdc4713e5a13b61b85bc1e7893956/entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets#L66-L81 | 23e0b1569b45d89a8aad658a0729f7dd81924385 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/managers/WaterFlowDataSource.ets | arkts | [Start encapsulate_waterfall_data_source] 实现IDataSource接口的对象,用于瀑布流组件加载数据 | export class WaterFlowDataSource implements IDataSource {
private dataArray: number[] = [];
private listeners: DataChangeListener[] = [];
constructor() {
for (let i = 0; i < 100; i++) {
this.dataArray.push(i);
}
}
// 获取索引对应的数据
public getData(index: number): number {
return this.dataArray... | AST#export_declaration#Left export AST#class_declaration#Left class WaterFlowDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private dataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#... | export class WaterFlowDataSource implements IDataSource {
private dataArray: number[] = [];
private listeners: DataChangeListener[] = [];
constructor() {
for (let i = 0; i < 100; i++) {
this.dataArray.push(i);
}
}
public getData(index: number): number {
return this.dataArray[index];
}... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/ApplicationMultithreadingDevelopment/PracticalCases/entry/src/main/ets/managers/WaterFlowDataSource.ets#L18-L143 | e5807a99ee631e8d1e2dbaae9d538215dff41785 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets | arkts | generateReport | 生成分析报告 | async generateReport(
type: MetricType,
timeRange: TimeRange,
customStartDate?: string,
customEndDate?: string
): Promise<AnalyticsReport> {
try {
const { startDate, endDate } = this.getDateRange(timeRange, customStartDate, customEndDate);
// 获取相关数据
const data = await this... | AST#method_declaration#Left async generateReport AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left MetricType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left timeRange : AST#type_annotation#Left AST#primary_type#Left TimeRange AS... | async generateReport(
type: MetricType,
timeRange: TimeRange,
customStartDate?: string,
customEndDate?: string
): Promise<AnalyticsReport> {
try {
const { startDate, endDate } = this.getDateRange(timeRange, customStartDate, customEndDate);
const data = await this.getMetri... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AdvancedAnalyticsService.ets#L375-L422 | 85dd27b2cf2e64aa07af6bffda5fbe1f51f8804e | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/web/WebSearchService.ets | arkts | Web搜索服务类 | export class WebSearchService {
private static instance: WebSearchService;
// 搜索API配置(这里使用模拟的搜索API)
private readonly searchConfigs: Record<string, SearchConfig>;
private constructor() {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[WebSearchService] Service initialized');
// 初始化搜索配置
... | AST#export_declaration#Left export AST#class_declaration#Left class WebSearchService AST#class_body#Left { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left WebSearchService AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right // 搜索API配置(... | export class WebSearchService {
private static instance: WebSearchService;
private readonly searchConfigs: Record<string, SearchConfig>;
private constructor() {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, '[WebSearchService] Service initialized');
const aggregateConfig: SearchConf... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/web/WebSearchService.ets#L64-L261 | e2337262f9f5f54b816a954f76a4f1d72791561b | github | |
conrad_sheeran/TickAuth | 8ef852e12999d15cf70394cdab82d08ac5843143 | features/settings/src/main/ets/common/Constants.ets | arkts | Copyright (c) 2024 Yang He
TickAuth is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be... | export class Constants {
static readonly DOMAIN: number = 0x00202;
static readonly SETTINGSITEM_LIST_SIZE: string = "100%";
static readonly SETTINGSITEM_LIST_SPACE: number = 12;
static readonly SETTINGSITEMVIEW_LISTITEM_MAXLINE: number = 1;
static readonly SETTINGSITEMVIEW_LISTITEM_TITLE_WIDTH: string = "... | AST#export_declaration#Left export AST#class_declaration#Left class Constants AST#class_body#Left { AST#property_declaration#Left static readonly DOMAIN : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0x00202 AST#expression#Right ; AST#prope... | export class Constants {
static readonly DOMAIN: number = 0x00202;
static readonly SETTINGSITEM_LIST_SIZE: string = "100%";
static readonly SETTINGSITEM_LIST_SPACE: number = 12;
static readonly SETTINGSITEMVIEW_LISTITEM_MAXLINE: number = 1;
static readonly SETTINGSITEMVIEW_LISTITEM_TITLE_WIDTH: string = "... | https://github.com/conrad_sheeran/TickAuth/blob/8ef852e12999d15cf70394cdab82d08ac5843143/features/settings/src/main/ets/common/Constants.ets#L18-L40 | 241cb1d42337235ec10145341457923acd165003 | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/DES.ets | arkts | decodeECB | 解密-ECB模式
@param str 加密的字符串
@param desKey 3DES密钥 | static async decodeECB(str: string, desKey: string): Promise<string> {
return CryptoUtil.decodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192);
} | AST#method_declaration#Left static async decodeECB AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left desKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | static async decodeECB(str: string, desKey: string): Promise<string> {
return CryptoUtil.decodeECB(str, desKey, '3DES192', '3DES192|ECB|PKCS7', 192);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/DES.ets#L63-L65 | a20900353ed0a6ca294fd4818536fd2549d20c29 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceRSA/entry/src/main/ets/pages/rsa_segmentation/RSASegmentationAsync.ets | arkts | rsaDecryptBySegment | 分段解密消息 | async function rsaDecryptBySegment(priKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('RSA1024|PKCS1');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, priKey, null);
let cipherTextSplitLen = 128; // RSA密钥每次加密生成的密文字节长度计算方式:密钥位数/8
let de... | AST#function_declaration#Left async function rsaDecryptBySegment AST#parameter_list#Left ( AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . PriKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#param... | async function rsaDecryptBySegment(priKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('RSA1024|PKCS1');
await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, priKey, null);
let cipherTextSplitLen = 128;
let decryptText = new Uint8Array();
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceRSA/entry/src/main/ets/pages/rsa_segmentation/RSASegmentationAsync.ets#L40-L57 | 106ecc9390c1190300d7ad899e6d287ca210bb5c | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/AudioPlayer/entry/src/main/ets/controller/AudioPlayerControllerl.ets | arkts | setEventCallBack | Registering the avplayer callback function.
@param context Context. | setEventCallBack() {
if (this.avPlayer === undefined) {
return;
}
// Callback function for state machine changes.
this.avPlayer.on('stateChange', async (state) => {
if (this.avPlayer === undefined) {
return;
}
switch (state) {
case StateEvent.IDLE: // This state m... | AST#method_declaration#Left setEventCallBack AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . avPlayer AST#memb... | setEventCallBack() {
if (this.avPlayer === undefined) {
return;
}
this.avPlayer.on('stateChange', async (state) => {
if (this.avPlayer === undefined) {
return;
}
switch (state) {
case StateEvent.IDLE:
Logger.info(TAG, 'state idle called'); | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/AudioPlayer/entry/src/main/ets/controller/AudioPlayerControllerl.ets#L64-L75 | 68a61d7a9c011edf46272c139db65418fcfdb438 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/home/Swiper.ets | arkts | getImgCoefficients | Get the image offset coefficients.
@param index
@returns offset coefficients | getImgCoefficients(index: number): number {
let coefficient: number = this.currentIndex - index;
let tempCoefficient: number = Math.abs(coefficient);
if (tempCoefficient <= 2) {
return coefficient;
}
let dataLength: number = INDEX_DATA.length;
let tempOffset: number = dataLength - tempCoef... | AST#method_declaration#Left getImgCoefficients AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_ty... | getImgCoefficients(index: number): number {
let coefficient: number = this.currentIndex - index;
let tempCoefficient: number = Math.abs(coefficient);
if (tempCoefficient <= 2) {
return coefficient;
}
let dataLength: number = INDEX_DATA.length;
let tempOffset: number = dataLength - tempCoef... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/home/Swiper.ets#L33-L48 | 556b383cb09c4e903b9e2739d25b9b2921834412 | gitee |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/FFmpegManager.ets | arkts | enqueueByPriority | ==================== 私有方法 ====================
按优先级插入任务队列 | private enqueueByPriority(task: Task): void {
const priorityValue = this.getPriorityValue(task.getPriority());
let inserted = false;
for (let i = 0; i < this.taskQueue.length; i++) {
if (priorityValue > this.getPriorityValue(this.taskQueue[i].getPriority())) {
this.taskQueue.splice(i, 0, ... | AST#method_declaration#Left private enqueueByPriority AST#parameter_list#Left ( AST#parameter#Left task : AST#type_annotation#Left AST#primary_type#Left Task AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_... | private enqueueByPriority(task: Task): void {
const priorityValue = this.getPriorityValue(task.getPriority());
let inserted = false;
for (let i = 0; i < this.taskQueue.length; i++) {
if (priorityValue > this.getPriorityValue(this.taskQueue[i].getPriority())) {
this.taskQueue.splice(i, 0, ... | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegManager.ets#L187-L202 | 04a00b6fa96ee3c2889c1b2da2a54c2337be1d54 | github |
yycy134679/FoodieHarmony.git | e6971f0a8f7574ae278d02eb5c057e57e667dab5 | entry/src/main/ets/pages/Index.ets | arkts | handleNavigateToDetail | 处理导航到详情页 | private handleNavigateToDetail(merchantId: number): void {
hilog.info(DOMAIN, TAG, 'Navigating to merchant detail: %{public}d', merchantId);
router.pushUrl({
url: 'pages/MerchantDetailPage',
params: {
merchantId: merchantId
}
}).catch((err: Error) => {
hilog.error(
D... | AST#method_declaration#Left private handleNavigateToDetail AST#parameter_list#Left ( AST#parameter#Left merchantId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void... | private handleNavigateToDetail(merchantId: number): void {
hilog.info(DOMAIN, TAG, 'Navigating to merchant detail: %{public}d', merchantId);
router.pushUrl({
url: 'pages/MerchantDetailPage',
params: {
merchantId: merchantId
}
}).catch((err: Error) => {
hilog.error(
D... | https://github.com/yycy134679/FoodieHarmony.git/blob/e6971f0a8f7574ae278d02eb5c057e57e667dab5/entry/src/main/ets/pages/Index.ets#L48-L64 | 72301e21cc0b05d6cf9c0848f89984623d7bfcc7 | github |
Zairgs/ArKTSMovie.git | 1586c977f12722333eee7d74a71f006ba0606ade | ets/pages/CouponPage.ets | arkts | sectionTitle | 区块标题 | @Builder
sectionTitle(title: string) {
Text(title)
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ left: 16, top: 16, bottom: 12 })
.width('100%')
.textAlign(TextAlign.Start)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right sectionTitle 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_list#Right AST#builder_function_body#L... | @Builder
sectionTitle(title: string) {
Text(title)
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ left: 16, top: 16, bottom: 12 })
.width('100%')
.textAlign(TextAlign.Start)
} | https://github.com/Zairgs/ArKTSMovie.git/blob/1586c977f12722333eee7d74a71f006ba0606ade/ets/pages/CouponPage.ets#L79-L87 | 635f4a9b8977602bf32bcf452d87d175c6bc8fa4 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/sidebaranimation/Index.ets | arkts | SideBarAnimationViewComponent | 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 { SideBarAnimationViewComponent } from './src/main/ets/view/SideBarAnimationView'; | AST#export_declaration#Left export { SideBarAnimationViewComponent } from './src/main/ets/view/SideBarAnimationView' ; AST#export_declaration#Right | export { SideBarAnimationViewComponent } from './src/main/ets/view/SideBarAnimationView'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/sidebaranimation/Index.ets#L17-L17 | 798bafb636d2e8919cd0525e2bbb7de3468e5e39 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets | arkts | addLastItem | 在数据尾部增加一个元素 | public addLastItem(): void {
this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length);
this.notifyDataAdd(this.dataArray.length - 1);
} | AST#method_declaration#Left public addLastItem AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expre... | public addLastItem(): void {
this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length);
this.notifyDataAdd(this.dataArray.length - 1);
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets#L94-L97 | 8ad482b36b42cdfaff16673600e54fa801d85d60 | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/storage_tools.ets | arkts | Converts a path to uri.
@param path The path.
@returns Its uri. | export function path_2_uri(path: string) {
return fileUri.getUriFromPath(path);
} | AST#export_declaration#Left export AST#function_declaration#Left function path_2_uri AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#st... | export function path_2_uri(path: string) {
return fileUri.getUriFromPath(path);
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L736-L738 | 7efd18fa2f9cea3eb1743b49b7b1c09292ac68f9 | gitee | |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/viewmodel/SimpleStatsManager.ets | arkts | calculateRealPomodoroSessions | 计算真实的番茄钟数据 | private calculateRealPomodoroSessions(tasks: TaskItem[]): PomodoroData {
const today = new Date();
today.setHours(0, 0, 0, 0);
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);
let todayPomodoros = 0;
let totalPomodoros = 0;
tasks.forEach(task => {
if (task.... | AST#method_declaration#Left private calculateRealPomodoroSessions AST#parameter_list#Left ( AST#parameter#Left tasks : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left TaskItem [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AS... | private calculateRealPomodoroSessions(tasks: TaskItem[]): PomodoroData {
const today = new Date();
today.setHours(0, 0, 0, 0);
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);
let todayPomodoros = 0;
let totalPomodoros = 0;
tasks.forEach(task => {
if (task.... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/SimpleStatsManager.ets#L148-L172 | 7d872e1000c47396c6a082c67a310863e100a307 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/highlyloadedcomponentrender/src/main/ets/pages/MonthDataSource.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface Month {
month: string; // 具体年月
num: number; // 月份
days: number[]; // 该月日期
lunarDays: string[];// 农历日期
year:number; // 年份
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Month AST#object_type#Left { AST#type_member#Left month : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; // 具体年月 AST#type_member#Left num : AST#type_annotation#Left... | export interface Month {
month: string;
num: number;
days: number[];
lunarDays: string[];
year:number;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/highlyloadedcomponentrender/src/main/ets/pages/MonthDataSource.ets#L16-L22 | e1dcb2ebd98315948b23fd4ecac8603da0c76e04 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.