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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/social/SearchPage.ets | arkts | buildSearchingView | 构建搜索中视图 | @Builder
buildSearchingView() {
Column({ space: 16 }) {
LoadingProgress()
.width('40vp')
.height('40vp')
.color($r('app.color.primary'))
Text('搜索中...')
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
}
.layoutWeight(1)
.width('100%')
.j... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSearchingView AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_... | @Builder
buildSearchingView() {
Column({ space: 16 }) {
LoadingProgress()
.width('40vp')
.height('40vp')
.color($r('app.color.primary'))
Text('搜索中...')
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
}
.layoutWeight(1)
.width('100%')
.j... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/social/SearchPage.ets#L359-L375 | ae8e5cd6d583fda540ce2697c8680118dd49fc1c | github |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/components/ReviewPage.ets | arkts | handleAddTestTask | 添加测试任务 | handleAddTestTask() {
console.info('Adding test task with 1 hour duration');
const testTask: TaskItem = {
id: 'test_' + Date.now(),
name: '测试任务(45分钟/1小时)',
estimatedTime: 3600,
actualTime: 2700,
completedTime: Date.now(),
status: 'completed'
};
AppState.completedTasks... | AST#method_declaration#Left handleAddTestTask AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left console AST#expression#Right . in... | handleAddTestTask() {
console.info('Adding test task with 1 hour duration');
const testTask: TaskItem = {
id: 'test_' + Date.now(),
name: '测试任务(45分钟/1小时)',
estimatedTime: 3600,
actualTime: 2700,
completedTime: Date.now(),
status: 'completed'
};
AppState.completedTasks... | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/ReviewPage.ets#L428-L441 | 44d3e5050f87a77245e55ba52c9c02ca170be538 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/imagegridlayout/src/main/ets/utils/MultiGrid.ets | arkts | MultiImageGrid | 九宫格图片布局实现 | @Component
export struct MultiImageGrid {
// -------------------对外暴露变量-----------------------
// 图片扩展属性(图片公用属性)
@Prop modifier: AttributeModifier<ImageAttribute>;
// 图片数据资源
imageSource: ResourceStr[] = [];
// 图片排列列数
col: number = 0;
// 图片点击处理逻辑
clickImageHandle: (image: ResourceStr, imageIndex: number... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct MultiImageGrid AST#component_body#Left { // -------------------对外暴露变量----------------------- // 图片扩展属性(图片公用属性) AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right modifier : AST#type_annotation... | @Component
export struct MultiImageGrid {
@Prop modifier: AttributeModifier<ImageAttribute>;
imageSource: ResourceStr[] = [];
col: number = 0;
clickImageHandle: (image: ResourceStr, imageIndex: number) => void = (image: ResourceStr, imageIndex: number) => {
};
private flexWidth: string ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagegridlayout/src/main/ets/utils/MultiGrid.ets#L47-L127 | 291d06f4b35d529639c28935c90ee7f814a104d4 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/selecttextmenu/src/main/ets/component/RichEditorComponent.ets | arkts | RichEditorComponent | 富文本ID | @Component
export struct RichEditorComponent {
controller: RichEditorController = new RichEditorController(); // 富文本控制器
@Link selectMenu: string;
@Link selectText: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
menuItemsContent: Array<TextMenuItem> = []; // 传入菜单数组
private onCreatMenu?: CreateMen... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct RichEditorComponent AST#component_body#Left { AST#property_declaration#Left controller : AST#type_annotation#Left AST#primary_type#Left RichEditorController AST#primary_type#Right AST#type_annotation#Right = AST#expre... | @Component
export struct RichEditorComponent {
controller: RichEditorController = new RichEditorController();
@Link selectMenu: string;
@Link selectText: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
menuItemsContent: Array<TextMenuItem> = [];
private onCreatMenu?: CreateMenuCallback;
priva... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/selecttextmenu/src/main/ets/component/RichEditorComponent.ets#L52-L126 | 8f522b6932f486d942354221fe94978a8cd45416 | gitee |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets | arkts | subscribeCollectEvent | 订阅收藏event
@param callback | subscribeCollectEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_COLLECT, key, callback)
} | AST#method_declaration#Left subscribeCollectEvent AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_li... | subscribeCollectEvent(key: string, callback: (eventData: emitter.EventData) => void) {
EventBus.getInstance().regist(WanEventId.EVENT_COLLECT, key, callback)
} | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets#L169-L171 | 2ab263100a29238ec033314ef9532701e55f7908 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Notification/CustomEmitter/feature/emitter/src/main/ets/components/feature/CustomEmitter.ets | arkts | closeEventsDialog | 单次订阅回调(eventId为string类型) | public closeEventsDialog(callback: Base.Callback<emitter.EventData>) {
let dialogCloseEventsData: emitter.EventData = {
data: {
id: EmitterConst.CLOSE_DIALOG_EVENT_ID
}
};
// 单次订阅事件--关闭广告
emitter.once(EmitterConst.CLOSE_DIALOG_EVENT_ID, callback);
// 事件发布
emitter.emit(Emitter... | AST#method_declaration#Left public closeEventsDialog AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left AST#qualified_type#Left Base . Callback AST#qualified_type#Right AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#... | public closeEventsDialog(callback: Base.Callback<emitter.EventData>) {
let dialogCloseEventsData: emitter.EventData = {
data: {
id: EmitterConst.CLOSE_DIALOG_EVENT_ID
}
};
emitter.once(EmitterConst.CLOSE_DIALOG_EVENT_ID, callback);
emitter.emit(EmitterConst.CLOSE_DIALOG_EVE... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Notification/CustomEmitter/feature/emitter/src/main/ets/components/feature/CustomEmitter.ets#L50-L60 | 0d0537ed1707163d2730edca86cdc584ff7bed8a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/utils/DateUtils.ets | arkts | formatDate | 格式化日期
@param date 日期字符串或Date对象
@param format 格式化字符串
@returns 格式化后的日期字符串 | static formatDate(date: string | Date, format: string = DateFormatConstants.DATE_FORMAT_YYYY_MM_DD): string {
let dateObj: Date;
if (typeof date === 'string') {
dateObj = new Date(date);
} else {
dateObj = date;
}
if (isNaN(dateObj.getTime())) {
return '';
}
... | AST#method_declaration#Left static formatDate AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Date AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AST#... | static formatDate(date: string | Date, format: string = DateFormatConstants.DATE_FORMAT_YYYY_MM_DD): string {
let dateObj: Date;
if (typeof date === 'string') {
dateObj = new Date(date);
} else {
dateObj = date;
}
if (isNaN(dateObj.getTime())) {
return '';
}
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/utils/DateUtils.ets#L29-L73 | 665d0f6d729280f8becf3ec76c03c64761803ffa | github |
J-Design/ArkUI_Component | d7ecc33451ec5ebdb01da02616e1b83ecc3bfc66 | entry/src/main/ets/component/controller/CustomButton.ets | arkts | CustomButton | @author 鼓捣JIA
@date 2023/12/03 23:35 | @Component
export default struct CustomButton {
@Prop name: string
build() {
Column() {
Row() {
Text(this.name)
.fontColor($r('app.color.font_main'))
Blank()
Button(this.name)
.backgroundColor($r('app.color.brand'))
}
.width('100%')
.height(50... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct CustomButton AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_a... | @Component
export default struct CustomButton {
@Prop name: string
build() {
Column() {
Row() {
Text(this.name)
.fontColor($r('app.color.font_main'))
Blank()
Button(this.name)
.backgroundColor($r('app.color.brand'))
}
.width('100%')
.height(50... | https://github.com/J-Design/ArkUI_Component/blob/d7ecc33451ec5ebdb01da02616e1b83ecc3bfc66/entry/src/main/ets/component/controller/CustomButton.ets#L6-L24 | e85aad5f792347e74b85c7b5abdade3351b8b6b4 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/data/FestivalData2025.ets | arkts | getFestivalById | 根据ID获取节日信息 | public static getFestivalById(id: string): FestivalInfo | null {
return FestivalData2025.getAllFestivals().find(festival => festival.id === id) || null;
} | AST#method_declaration#Left public static getFestivalById 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#union_type#Left AST#primary_typ... | public static getFestivalById(id: string): FestivalInfo | null {
return FestivalData2025.getAllFestivals().find(festival => festival.id === id) || null;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/data/FestivalData2025.ets#L320-L322 | ec695cdd88a3641ecb55af24ca105dfc68e5ea79 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets | arkts | updateTotalTime | 更新播放歌曲总时间
@returns {void} | updateTotalTime(): void {
if (!this.curMusicModelRaw) {
return;
}
const totalTime = this.curMusicModelRaw.totalTime;
this.totalTimeStrRaw = this.genTimeStr(totalTime);
} | AST#method_declaration#Left updateTotalTime 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 ... | updateTotalTime(): void {
if (!this.curMusicModelRaw) {
return;
}
const totalTime = this.curMusicModelRaw.totalTime;
this.totalTimeStrRaw = this.genTimeStr(totalTime);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets#L315-L322 | 5c708f0762aff44763b2907c3d20517bcbc8f431 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogBuilder.ets | arkts | ConfirmDialogBuilder | ConfirmDialog | @Builder
export function ConfirmDialogBuilder(options: DialogOptions) {
ConfirmDialog(options)
.height(options.height)
.width(options.width)
.constraintSize({ maxWidth: options.maxWidth, maxHeight: options.maxHeight })
.backgroundColor(options.backgroundColor)
.backgroundBlurStyle(options.backgrou... | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function ConfirmDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left DialogOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#param... | @Builder
export function ConfirmDialogBuilder(options: DialogOptions) {
ConfirmDialog(options)
.height(options.height)
.width(options.width)
.constraintSize({ maxWidth: options.maxWidth, maxHeight: options.maxHeight })
.backgroundColor(options.backgroundColor)
.backgroundBlurStyle(options.backgrou... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogBuilder.ets#L60-L73 | 39e995010ce081b93b8d5dcfd929a5044e6c45f1 | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/arkts/@arkts.collections.d.ets | arkts | has | Check if bit vector contains a particular bit element.
@param { number } element - Element to be contained (0 means 0, else means 1).
@param { number } fromIndex - The starting position of the index, containing the value at that index position.
@param { number } toIndex - The end of the index, containing the value at ... | has(element: number, fromIndex: number, toIndex: number): boolean; | AST#method_declaration#Left has AST#parameter_list#Left ( AST#parameter#Left element : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fromIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right ... | has(element: number, fromIndex: number, toIndex: number): boolean; | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.collections.d.ets#L5496-L5496 | f3af51eb53c1a7fecc30969fae7eace43fe2f7c5 | github |
JinnyWang-Space/guanlanwenjuan.git | 601c4aa6c427e643d7bf42bc21945f658738e38c | entry/src/main/ets/views/ContentView.ets | arkts | sideBarMainIndexChange | 监听侧边栏索引值变化 | @Monitor('sideBarMainIndex')
async sideBarMainIndexChange() {
if (this.sideBarMainIndex === 5 && this.appTmpData.isNetwork) {
this.initMarket();
}
} | AST#method_declaration#Left AST#decorator#Left @ Monitor ( AST#expression#Left 'sideBarMainIndex' AST#expression#Right ) AST#decorator#Right async sideBarMainIndexChange 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#expre... | @Monitor('sideBarMainIndex')
async sideBarMainIndexChange() {
if (this.sideBarMainIndex === 5 && this.appTmpData.isNetwork) {
this.initMarket();
}
} | https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/entry/src/main/ets/views/ContentView.ets#L124-L129 | 2ee957977e03a19443f609bc0e24c2c266c6dc40 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/TaskManagement/Flybird/entry/src/main/ets/component/OperateView.ets | arkts | OperateView | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct OperateView {
@Link before: string
@Link after: string
build() {
Column() {
TextArea({ placeholder: $r('app.string.input_placeholder') })
.fontSize(22)
.width('94%')
.constraintSize({ minHeight: 50 })
.margin({ top: 10 })
.key('textArea')... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct OperateView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right before : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotati... | @Component
export struct OperateView {
@Link before: string
@Link after: string
build() {
Column() {
TextArea({ placeholder: $r('app.string.input_placeholder') })
.fontSize(22)
.width('94%')
.constraintSize({ minHeight: 50 })
.margin({ top: 10 })
.key('textArea')... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/TaskManagement/Flybird/entry/src/main/ets/component/OperateView.ets#L16-L42 | c5fe43022350af7b33a36f626c596010c8be247f | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/MineTabsItem.ets | arkts | Interface of mine tab item. | export interface MineTabsItem {
icon: Resource;
title: Resource;
more: Resource;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface MineTabsItem AST#object_type#Left { AST#type_member#Left icon : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left title : AST#type_annotation#Le... | export interface MineTabsItem {
icon: Resource;
title: Resource;
more: Resource;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/MineTabsItem.ets#L19-L23 | 6dbd559287fc891b45affdb3615ce74e9ca063d1 | gitee | |
huangwei021230/HarmonyFlow.git | 427f918873b0c9efdc975ff4889726b1bfccc546 | entry/src/main/ets/lib/FlowLocale.ets | arkts | buildLocaleString | Builds a locale or language tag for this locale by using delimiter.
@param delimiter The delimiter to use between the components.
@return The generated tag for this locale. May be an empty string if
language, country, and variant are not specified. | private buildLocaleString(delimiter: string): string {
const language: string = this.base.language;
const country: string = this.base.country;
const variant: string = this.base.variant;
let result: string = language;
if (language !== '' && country !== '') {
result += delimiter;
}
resul... | AST#method_declaration#Left private buildLocaleString AST#parameter_list#Left ( AST#parameter#Left delimiter : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST... | private buildLocaleString(delimiter: string): string {
const language: string = this.base.language;
const country: string = this.base.country;
const variant: string = this.base.variant;
let result: string = language;
if (language !== '' && country !== '') {
result += delimiter;
}
resul... | https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/FlowLocale.ets#L137-L151 | b8ba6cda9a6a0daec01889ed7c947d9591652634 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/SettingsTypes.ets | arkts | 通知重要性枚举 | export enum NotificationImportance {
LOW = 'low',
DEFAULT = 'default',
HIGH = 'high',
MAX = 'max'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum NotificationImportance AST#enum_body#Left { AST#enum_member#Left LOW = AST#expression#Left 'low' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left DEFAULT = AST#expression#Left 'default' AST#expression#Right AST#enum_member#Right , AST#en... | export enum NotificationImportance {
LOW = 'low',
DEFAULT = 'default',
HIGH = 'high',
MAX = 'max'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L335-L340 | 141a00120e93c1df9920b4ffc046041d609873b7 | github | |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/ai-form-recognizer/99.10.9/package/index.ets | arkts | gethttpips | 添加返回类型(约束45) | function gethttpips(): string[] {
let str: string[] = [];
let networkInterfaces = os.networkInterfaces();
for (let item in networkInterfaces) {
if (item != "lo") {
let addresses = networkInterfaces[item];
if (addresses) {
for (let i = 0; i < addresses.length; ... | AST#function_declaration#Left function gethttpips AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declarat... | function gethttpips(): string[] {
let str: string[] = [];
let networkInterfaces = os.networkInterfaces();
for (let item in networkInterfaces) {
if (item != "lo") {
let addresses = networkInterfaces[item];
if (addresses) {
for (let i = 0; i < addresses.length; ... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/ai-form-recognizer/99.10.9/package/index.ets#L42-L56 | de20b0cced6d6439b9eb7d9824a53605c561e82d | github |
kico0909/crazy_miner.git | 13eae3ac4d8ca11ecf2c97b375f82f24ab7919b9 | entry/src/main/ets/common/game/core/index.ets | arkts | initWorldData | 方法 | export {
initWorldData, initDB, initWorld,
getWorldData, saveWorldData, handlerEvents, playerActionOnce,
getDB,
actionPlayerMeditation, meditationPointsMaxByLevel
} | AST#export_declaration#Left export { initWorldData , initDB , initWorld , getWorldData , saveWorldData , handlerEvents , playerActionOnce , getDB , actionPlayerMeditation , meditationPointsMaxByLevel } AST#export_declaration#Right | export {
initWorldData, initDB, initWorld,
getWorldData, saveWorldData, handlerEvents, playerActionOnce,
getDB,
actionPlayerMeditation, meditationPointsMaxByLevel
} | https://github.com/kico0909/crazy_miner.git/blob/13eae3ac4d8ca11ecf2c97b375f82f24ab7919b9/entry/src/main/ets/common/game/core/index.ets#L7-L12 | d39e5347a733793e9a59ea12304e51ac458dd041 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | setSpaceBottom | Sets the bottom axis space in percent of the full range. Default 10f
@param percent | public setSpaceBottom(percent: number): void {
this.mSpacePercentBottom = percent;
} | AST#method_declaration#Left public setSpaceBottom AST#parameter_list#Left ( AST#parameter#Left percent : 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... | public setSpaceBottom(percent: number): void {
this.mSpacePercentBottom = percent;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L290-L292 | 9fd3113bb86118bef9d4ee2a6c5bc196872c5996 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/Screenshot/Feature/src/main/ets/components/utils/WindowPrivacy.ets | arkts | 判断隐私窗口 | export function hasPrivate(): ResponseData {
let currentDisplay = null
try {
currentDisplay = display.getDefaultDisplaySync()
} catch (exception) {
return { status: 'failed', errorMessage: JSON.stringify(exception) }
}
if (currentDisplay === null) {
return { status: 'failed', errorMessage: 'get cu... | AST#export_declaration#Left export AST#function_declaration#Left function hasPrivate AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ResponseData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#... | export function hasPrivate(): ResponseData {
let currentDisplay = null
try {
currentDisplay = display.getDefaultDisplaySync()
} catch (exception) {
return { status: 'failed', errorMessage: JSON.stringify(exception) }
}
if (currentDisplay === null) {
return { status: 'failed', errorMessage: 'get cu... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/Screenshot/Feature/src/main/ets/components/utils/WindowPrivacy.ets#L27-L48 | 0646e23ce7264817b420763db7e1dde4594f7a90 | gitee | |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | feature/ota/src/main/ets/notify/NotificationHelper.ets | arkts | showUpgradeFailed | 弹安装失败通知
@param context 实上下文 | async showUpgradeFailed(versionName: string, context: common.Context): Promise<void> {
let request = {
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: await context.resourceManager.getString($r('app.string.install_fail_message').id),... | AST#method_declaration#Left async showUpgradeFailed AST#parameter_list#Left ( AST#parameter#Left versionName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qual... | async showUpgradeFailed(versionName: string, context: common.Context): Promise<void> {
let request = {
content: {
contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
normal: {
title: await context.resourceManager.getString($r('app.string.install_fail_message').id),... | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/notify/NotificationHelper.ets#L154-L172 | 85b04a8bbb00b107fd8e26b9073207b40b4ffcf6 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customanimationtab/src/main/ets/view/CustomAnimationTabConfigure.ets | arkts | 自定义属性 | export class CustomAnimationTabConfigure {
// 背景条最大偏移距离(单位: px)
static readonly INDICATOR_MAX_LEFT = 90;
// 背景条宽度扩展比例
static readonly DEFAULT_INDICATOR_EXPAND = 1;
// 页签宽度
static readonly LIST_ITEM_WIDTH = 100;
// 背景条高度
static readonly TABBAR_HEIGHT = 70;
// 背景条宽度
static readonly INDICATOR_WIDTH = 1... | AST#export_declaration#Left export AST#class_declaration#Left class CustomAnimationTabConfigure AST#class_body#Left { // 背景条最大偏移距离(单位: px) AST#property_declaration#Left static readonly INDICATOR_MAX_LEFT = AST#expression#Left 90 AST#expression#Right ; AST#property_declaration#Right // 背景条宽度扩展比例 AST#property_declaration... | export class CustomAnimationTabConfigure {
static readonly INDICATOR_MAX_LEFT = 90;
static readonly DEFAULT_INDICATOR_EXPAND = 1;
static readonly LIST_ITEM_WIDTH = 100;
static readonly TABBAR_HEIGHT = 70;
static readonly INDICATOR_WIDTH = 100;
static readonly DEFAULT_BASE_TAB = "全部";
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/view/CustomAnimationTabConfigure.ets#L19-L42 | 35bf18cc0382e244da64a3ac2de830ba8527d00c | gitee | |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/itemview/ItemCallRdView.ets | arkts | ItemCallRdView | 对讲-呼叫列表的Item | @ComponentV2
export struct ItemCallRdView {
@Require @Param itemData: callRdBoardItemData
build() {
if (this.itemData.type == CALL_KEY_BOARD_COMMON) {
Column() {
Text(this.itemData.valueName)
.fontColor('#ffffff')
.fontSize(36)
}
.width('100%')
.height('100%'... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct ItemCallRdView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Require AST#decorator#Right AST#decorator#Left @ Param AST#decorator#Right itemData : AST#type_annotation#Left AST#primary_... | @ComponentV2
export struct ItemCallRdView {
@Require @Param itemData: callRdBoardItemData
build() {
if (this.itemData.type == CALL_KEY_BOARD_COMMON) {
Column() {
Text(this.itemData.valueName)
.fontColor('#ffffff')
.fontSize(36)
}
.width('100%')
.height('100%'... | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/itemview/ItemCallRdView.ets#L12-L54 | 355ebaa409179b98d5348b8c48f7558e3500510b | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | GlobalCustomComponentReuse/ComponentPrebuildByOnIdle/customreusablepool/src/main/ets/utils/BuilderNodePool.ets | arkts | recycleNode | [Start builder_node_pool] Recycle sub components into the reuse pool | public recycleNode(type: string, node: NodeItem) {
let nodeArray: Array<NodeItem> = this.nodePool.get(type);
if (!nodeArray) {
nodeArray = new Array<NodeItem>();
this.nodePool.set(type, nodeArray);
}
nodeArray.push(node);
} | AST#method_declaration#Left public recycleNode AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left node : AST#type_annotation#Left AST#primary_type#Left NodeItem AST#primary_ty... | public recycleNode(type: string, node: NodeItem) {
let nodeArray: Array<NodeItem> = this.nodePool.get(type);
if (!nodeArray) {
nodeArray = new Array<NodeItem>();
this.nodePool.set(type, nodeArray);
}
nodeArray.push(node);
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/GlobalCustomComponentReuse/ComponentPrebuildByOnIdle/customreusablepool/src/main/ets/utils/BuilderNodePool.ets#L111-L118 | a0d8176a5bd1894f9369070a66be1ece839507cf | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/imageviewer/src/main/ets/utils/Constrain.ets | arkts | constrainOffset | 约束图片偏移,确保不超出视口边界
@param offset -- 当前偏移量
@param winSize -- 视口大小
@param imageSize -- 图片大小
@param scale -- 缩放 | function constrainOffset(offset: number, winSize: number, imageSize: number, scale: number): number {
let maxAllowedOffset = getMaxAllowedOffset(winSize, imageSize, scale);
return Math.min(Math.max(offset, -maxAllowedOffset), maxAllowedOffset);
} | AST#function_declaration#Left function constrainOffset AST#parameter_list#Left ( AST#parameter#Left offset : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left winSize : AST#type_annotation#Left AST#primary_type#Left number AST... | function constrainOffset(offset: number, winSize: number, imageSize: number, scale: number): number {
let maxAllowedOffset = getMaxAllowedOffset(winSize, imageSize, scale);
return Math.min(Math.max(offset, -maxAllowedOffset), maxAllowedOffset);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageviewer/src/main/ets/utils/Constrain.ets#L79-L82 | d9287b6f214ffca9040411e8f75f6d864672330e | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/interface_class/simple_class/simple_class_002_F.ets | arkts | Introduction 简单类对象 | export function simple_class_002_F(taint_src : A) : void {
let _t = taint_src;
let _clean = new A("clean");
taint.Sink(_clean)
} | AST#export_declaration#Left export AST#function_declaration#Left function simple_class_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left A AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Lef... | export function simple_class_002_F(taint_src : A) : void {
let _t = taint_src;
let _clean = new A("clean");
taint.Sink(_clean)
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/interface_class/simple_class/simple_class_002_F.ets#L5-L9 | c961b45f3ff30739455b014e41b7746c1742a4a9 | github | |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/model/DailySummary.ets | arkts | fromRow | Create DailySummary from database row | static fromRow(row: DailySummaryRow): DailySummary {
let keyTopics: string[] = [];
try {
keyTopics = JSON.parse(row.key_topics) as string[];
} catch (e) {
keyTopics = [];
}
return new DailySummary(
row.id,
row.date,
row.summary,
keyTopics,
row.tasks_created... | AST#method_declaration#Left static fromRow AST#parameter_list#Left ( AST#parameter#Left row : AST#type_annotation#Left AST#primary_type#Left DailySummaryRow AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left DailySummary AST#p... | static fromRow(row: DailySummaryRow): DailySummary {
let keyTopics: string[] = [];
try {
keyTopics = JSON.parse(row.key_topics) as string[];
} catch (e) {
keyTopics = [];
}
return new DailySummary(
row.id,
row.date,
row.summary,
keyTopics,
row.tasks_created... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/DailySummary.ets#L68-L86 | dc9aa5a035aa0e02e44bd78f02b7c8e8e7c12df7 | github |
shubai-xixi/DistributeNewsArkts.git | 7a527c5f4121612c8070d809824b0f2615d1b238 | entry/src/main/ets/model/NewsData.ets | arkts | 接收接口对象,既减少参数,又保留平铺字段 | constructor(data: NewData) {
// 加默认值(类的核心价值)
this.newsId = data.newsId || '0';
this.title = data.title || '默认标题';
this.newsType = data.newsType || '未知类型';
this.imgUrl = data.imgUrl || $rawfile('news_image1.jpg') as Resource;
this.reads = data.reads || '0';
this.likes = data.likes || '0';
... | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left NewData AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { // 加默认值(类的核心价值) AST#statement#Left AST#expres... | constructor(data: NewData) {
this.newsId = data.newsId || '0';
this.title = data.title || '默认标题';
this.newsType = data.newsType || '未知类型';
this.imgUrl = data.imgUrl || $rawfile('news_image1.jpg') as Resource;
this.reads = data.reads || '0';
this.likes = data.likes || '0';
this.content =... | https://github.com/shubai-xixi/DistributeNewsArkts.git/blob/7a527c5f4121612c8070d809824b0f2615d1b238/entry/src/main/ets/model/NewsData.ets#L25-L34 | 1036432ddf1511062fa97cef896ba08847fd5a64 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.Dialog.d.ets | arkts | PopoverDialog | Declare struct PopoverDialog
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 14 | @Component
export declare struct PopoverDialog {
/**
* Sets the PopoverDialog Visible Status.
*
* @type { boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 14
*/
@Link
visible: boolean;
/**
* Sets the PopoverDialog options.
*
* @t... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct PopoverDialog AST#component_body#Left { /**
* Sets the PopoverDialog Visible Status.
*
* @type { boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crosspla... | @Component
export declare struct PopoverDialog {
@Link
visible: boolean;
@Require @Prop
popover: PopoverOptions;
@Require @BuilderParam
targetBuilder: Callback<void>;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.Dialog.d.ets#L1181-L1216 | 3af3d20adc1033fa9a49ae7cbc597e2ba43e037a | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogHelper.ets | arkts | closeBindSheet | 关闭半模态
@param dialogId 目前半模态id | static closeBindSheet(dialogId: string) {
ActionBaseCore.getInstance().closeBindSheet(dialogId);
} | AST#method_declaration#Left static closeBindSheet AST#parameter_list#Left ( AST#parameter#Left dialogId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left A... | static closeBindSheet(dialogId: string) {
ActionBaseCore.getInstance().closeBindSheet(dialogId);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L384-L386 | daf5859e58cabe85a6b906f2027a3f4638a06574 | gitee |
WinWang/HarmoneyOpenEye.git | 57f0542795336009aa0d46fd9fa5b07facc2ae87 | entry/src/main/ets/http/apiService.ets | arkts | 获取分类数据
@returns | export function getCategories() {
return axiosClient.get<CategoryModel>({
url: baseUrl + "api/v4/categories",
showLoading: true,
checkLoginState: true,
needJumpToLogin: true
})
} | AST#export_declaration#Left export AST#function_declaration#Left function getCategories AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expr... | export function getCategories() {
return axiosClient.get<CategoryModel>({
url: baseUrl + "api/v4/categories",
showLoading: true,
checkLoginState: true,
needJumpToLogin: true
})
} | https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/http/apiService.ets#L56-L63 | 0180e74803d41b6a7b27580842af3d094a416bbe | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customanimationtab/src/main/ets/utils/CustomAnimationTab.ets | arkts | checkNotLegal | 检查输入参数合法性 | private checkNotLegal(): void {
if (this.tabsInfo === undefined || this.tabsInfo.length <= 0) {
this.tabsInfo = [
new TabInfo(CommonConstants.DEFAULT_TITLE1_TAB, wrapBuilder(baseBuilder), wrapBuilder(tabBar)),
new TabInfo(CommonConstants.DEFAULT_TITLE2_TAB, wrapBuilder(baseBuilder), wrapBuilde... | AST#method_declaration#Left private checkNotLegal AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#bi... | private checkNotLegal(): void {
if (this.tabsInfo === undefined || this.tabsInfo.length <= 0) {
this.tabsInfo = [
new TabInfo(CommonConstants.DEFAULT_TITLE1_TAB, wrapBuilder(baseBuilder), wrapBuilder(tabBar)),
new TabInfo(CommonConstants.DEFAULT_TITLE2_TAB, wrapBuilder(baseBuilder), wrapBuilde... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/utils/CustomAnimationTab.ets#L240-L269 | ddaa52faf83cac93842baed86bb887eeeba3a2d9 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/UserGuildSettingsUpdate.ets | arkts | Emitted whenever the client user's settings update.
@event Client#clientUserGuildSettingsUpdate
@param {ClientUserGuildSettings} clientUserGuildSettings The new client user guild settings
应用约束61: 使用export default代替module.exports | export default UserGuildSettingsUpdateHandler; | AST#export_declaration#Left export default AST#expression#Left UserGuildSettingsUpdateHandler AST#expression#Right ; AST#export_declaration#Right | export default UserGuildSettingsUpdateHandler; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/websocket/packets/handlers/UserGuildSettingsUpdate.ets#L45-L45 | 5520034873d7a4fa34bb3e4b56c5ca829cca13d2 | github | |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/interceptions/IInterceptor.ets | arkts | @deprecated 建议使用IGlobalNavigateInterceptor | export interface IInterceptor {
/**
* 处理push和replace拦截器逻辑,返回null或undefined则表示拦截器处理完成,否则继续执行下一个拦截器
* @param context
* @returns
*/
process: (context: InterceptorInfo) => InterceptorInfoOrNull;
/**
* 拦截器优先级,数值越大则优先执行
*/
priority: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface IInterceptor AST#object_type#Left { /**
* 处理push和replace拦截器逻辑,返回null或undefined则表示拦截器处理完成,否则继续执行下一个拦截器
* @param context
* @returns
*/ AST#type_member#Left process : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#L... | export interface IInterceptor {
process: (context: InterceptorInfo) => InterceptorInfoOrNull;
priority: number;
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/interceptions/IInterceptor.ets#L63-L74 | 361b8eba428056b46b6f0d4ee682c890ba6ab865 | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarDataSet.ets | arkts | setFills | Sets the fills for the bars in this dataset.
@param fills | public setFills(fills: JArrayList<Fill>): void {
this.mFills = fills;
} | AST#method_declaration#Left public setFills AST#parameter_list#Left ( AST#parameter#Left fills : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left Fill AST#primary_type#Right AST#type_annotation#Right > AST#type_argum... | public setFills(fills: JArrayList<Fill>): void {
this.mFills = fills;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L135-L137 | c4f39c733758b26402e8cc96ca31509edabda6ed | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/SliderExample/entry/src/main/ets/common/Constants.ets | arkts | The constants of the application. | export class Constants {
/*
* The font size of app.
*/
static readonly FONT_SIZE = 14;
/*
* The layout weight of slider.
*/
static readonly LAYOUT_WEIGHT = 1;
/**
* The percentage of 100.
*/
static readonly PERCENTAGE_100 = '100%';
/**
* The delay time of interval to slider speed.... | AST#export_declaration#Left export AST#class_declaration#Left class Constants AST#class_body#Left { /*
* The font size of app.
*/ AST#property_declaration#Left static readonly FONT_SIZE = AST#expression#Left 14 AST#expression#Right ; AST#property_declaration#Right /*
* The layout weight of slider.
*/ AST#pr... | export class Constants {
static readonly FONT_SIZE = 14;
static readonly LAYOUT_WEIGHT = 1;
static readonly PERCENTAGE_100 = '100%';
static readonly DELAY_TIME = 15;
static readonly SLIDER_SKIN = $r('app.color.slider_color');
static readonly INTERVAL = 0;
static readonly SPEED ... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SliderExample/entry/src/main/ets/common/Constants.ets#L54-L205 | d2aba2748cf0a3e83f0f003dd9bced086c5f81d9 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/address/AddressCard.ets | arkts | buildAddressBottomBar | 构建地址底部栏
@param {Address} address - 地址数据
@returns {void} 无返回值 | @Builder
private buildAddressBottomBar(address: Address): void {
RowSpaceBetweenCenter({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_large"),
right: $r("app.float.space_horizontal_large"),
top: $r("app.float.space_vertical_medium"),
bottom: $r... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private buildAddressBottomBar AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left Address AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#t... | @Builder
private buildAddressBottomBar(address: Address): void {
RowSpaceBetweenCenter({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_large"),
right: $r("app.float.space_horizontal_large"),
top: $r("app.float.space_vertical_medium"),
bottom: $r... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/address/AddressCard.ets#L123-L159 | 15fefcfe13fdfea6cf917f272d4fe575e0c717ad | github |
njkndxz/learn-ArkTs.git | 70fabab8ee28e3637329d53a4ec93afc72a001c2 | entry/src/main/ets/pages/学习/22.@Styles抽取通用属性和事件.ets | arkts | textFn | @Extend(组件名)
function 函数名() {} | @Extend(Text)
function textFn() {
.width('100%')
.textAlign(TextAlign.Center)
.fontSize(20)
.fontWeight(FontWeight.Bold)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left Text AST#expression#Right ) AST#decorator#Right function textFn AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expre... | @Extend(Text)
function textFn() {
.width('100%')
.textAlign(TextAlign.Center)
.fontSize(20)
.fontWeight(FontWeight.Bold)
} | https://github.com/njkndxz/learn-ArkTs.git/blob/70fabab8ee28e3637329d53a4ec93afc72a001c2/entry/src/main/ets/pages/学习/22.@Styles抽取通用属性和事件.ets#L8-L14 | 01a6b825726eb73674d9f1f570a8f0aef86d3da8 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/DateUtil.ets | arkts | getTodayTime | 获取今天的时间戳
@returns | static getTodayTime(): number {
return new Date().getTime();
} | AST#method_declaration#Left static getTodayTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expres... | static getTodayTime(): number {
return new Date().getTime();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DateUtil.ets#L91-L93 | 522aed39aa61b862a383738615a58fd3bf239442 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/ZipTool.ets | arkts | unzipTo | /解压文件 到指定 目录 | static async unzipTo(zipFile: string, unZipFolder: string): Promise<string | null> {
// 删除已存在的解压目录
FileUtility.deleteFileAt(unZipFolder)
if (await ZipTool.decompress(zipFile, unZipFolder)) {
return unZipFolder
} else {
return null
}
} | AST#method_declaration#Left static async unzipTo AST#parameter_list#Left ( AST#parameter#Left zipFile : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left unZipFolder : AST#type_annotation#Left AST#primary_type#Left string AST#... | static async unzipTo(zipFile: string, unZipFolder: string): Promise<string | null> {
FileUtility.deleteFileAt(unZipFolder)
if (await ZipTool.decompress(zipFile, unZipFolder)) {
return unZipFolder
} else {
return null
}
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/ZipTool.ets#L116-L126 | f99ba599a16a7c002a9ead54c8cf327d5e0fe6f9 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/PhoneUtil.ets | arkts | isMobile | 验证是否为手机号码(中国)
@param content 手机号码 | static isMobile(content: string): OutDTO<string> {
if (content == null || content == '') {
// 提供null的字符串为不匹配
return OutDTO.Error("验证手机号不能为空");
}
if (new RegExp(Const.MOBILE).test(content)) {
return OutDTO.OK("手机号为中国号码")
} else {
return OutDTO.Error("手机号非中国号码,请检查")
}
} | AST#method_declaration#Left static isMobile AST#parameter_list#Left ( AST#parameter#Left content : 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 ... | static isMobile(content: string): OutDTO<string> {
if (content == null || content == '') {
return OutDTO.Error("验证手机号不能为空");
}
if (new RegExp(Const.MOBILE).test(content)) {
return OutDTO.OK("手机号为中国号码")
} else {
return OutDTO.Error("手机号非中国号码,请检查")
}
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/PhoneUtil.ets#L32-L42 | e6d5f10931774618c05add1dbe14ac43475741a9 | gitee |
openharmony-tpc/ImageKnife | bc55de9e2edd79ed4646ce37177ad94b432874f7 | library/src/main/ets/transform/PixelMapTransformation.ets | arkts | PixelMapTransformation | 基于PixelMap的图片变换 | @Sendable
export abstract class PixelMapTransformation implements BaseTransformation<PixelMap>{
transform(context: Context, toTransform: PixelMap, width: number, height: number): Promise<PixelMap> {
throw new Error('Method not implemented.');
}
getName(): string {
return this.constructor.name
}
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export abstract class PixelMapTransformation AST#implements_clause#Left implements AST#generic_type#Left BaseTransformation AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST... | @Sendable
export abstract class PixelMapTransformation implements BaseTransformation<PixelMap>{
transform(context: Context, toTransform: PixelMap, width: number, height: number): Promise<PixelMap> {
throw new Error('Method not implemented.');
}
getName(): string {
return this.constructor.name
}
} | https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/transform/PixelMapTransformation.ets#L20-L29 | ea9e22a668c7fcdf6d114f89594cd7e9f85ed7be | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/PieChartModel.ets | arkts | getCircleBox | returns the circlebox, the boundingbox of the pie-chart slices
@return | public getCircleBox(): MyRect {
return this.mCircleBox;
} | AST#method_declaration#Left public getCircleBox AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left MyRect 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_expr... | public getCircleBox(): MyRect {
return this.mCircleBox;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L543-L545 | 7734a33852bb78c53661bc56e45550ffbd44cf42 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/notification/NotificationManager.ets | arkts | scheduleDailyReminder | 安排每日提醒 | private scheduleDailyReminder(): void {
const now = new Date();
const tomorrow = new Date(now);
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(9, 0, 0, 0);
const msUntilTomorrow = tomorrow.getTime() - now.getTime();
setTimeout(async () => {
await this.sendBatchBirthdayNotifi... | AST#method_declaration#Left private scheduleDailyReminder AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#... | private scheduleDailyReminder(): void {
const now = new Date();
const tomorrow = new Date(now);
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(9, 0, 0, 0);
const msUntilTomorrow = tomorrow.getTime() - now.getTime();
setTimeout(async () => {
await this.sendBatchBirthdayNotifi... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationManager.ets#L495-L514 | 9d110bdd6ddfbbb4db1ad92779a93baeaaa2eddd | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/JSONUtil.ets | arkts | jsonToArray | JSON字符串转Array(嵌套类需要添加装饰器NestedClassV6)
@param cls 类名
@param jsonStr JSON字符串
@returns | static jsonToArray<T extends Object>(jsonStr: string, clazz?: Constructor<T>): Array<T> {
try {
const array = JSON.parse(jsonStr) as Array<T>;
if (clazz) {
return ObjectUtil.plainToClassArray(clazz, array);
}
return array;
} catch (err) {
LogUtil.error(err);
return []... | AST#method_declaration#Left static jsonToArray AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left jsonStr : A... | static jsonToArray<T extends Object>(jsonStr: string, clazz?: Constructor<T>): Array<T> {
try {
const array = JSON.parse(jsonStr) as Array<T>;
if (clazz) {
return ObjectUtil.plainToClassArray(clazz, array);
}
return array;
} catch (err) {
LogUtil.error(err);
return []... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/JSONUtil.ets#L81-L92 | c78eb29f6fdd96ca97f5539ed316d14e8c33e5dc | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/listener/OnChartGestureListener.ets | arkts | Listener for callbacks when doing gestures on the chart.
@author Philipp Jahoda | export default interface | AST#export_declaration#Left export default AST#expression#Left interface AST#expression#Right AST#export_declaration#Right | export default interface | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/listener/OnChartGestureListener.ets#L22-L22 | 0ffcc2aaede72a356e814dfba398d16655107fd3 | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/MD5.ets | arkts | digest | MD5摘要
@param str 带摘要的字符串
@param resultCoding 返回结果编码方式(hex/base64)-不传默认为base64
@returns 摘要后的字符串 | static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'MD5', resultCoding);
} | AST#method_declaration#Left static digest 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 resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Le... | static digest(str: string, resultCoding: buffer.BufferEncoding = 'base64'): string {
return CryptoSyncUtil.digest(str, 'MD5', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/MD5.ets#L37-L39 | e9f282f8aff1a4d1695420dbdbbfa069b2dd4761 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/utils/WindowModel.ets | arkts | getStatusBarHeight | 获取主窗口顶部导航栏高度
@returns {callback((statusBarHeight: number) => void))} | getStatusBarHeight(callback: ((statusBarHeight: number) => void)): void {
if (this.windowStage === undefined) {
logger.error('windowStage is undefined.');
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
logger.error(`Failed to obtain ... | AST#method_declaration#Left getStatusBarHeight AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#parenthesized_type#Left ( AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left statusBarHeight : AST#type_annotation#Left AST#... | getStatusBarHeight(callback: ((statusBarHeight: number) => void)): void {
if (this.windowStage === undefined) {
logger.error('windowStage is undefined.');
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
logger.error(`Failed to obtain ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bottomdrawerslidecase/src/main/ets/utils/WindowModel.ets#L92-L114 | 17dc3a017b1f0935f95a36a540c523a27fddef0d | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets | arkts | encode2048PKCS1 | 2048位加密
@param str 待加密的字符串
@param pubKey 2048位RSA公钥
@param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@param isPem 秘钥是否为pem格式 - 默认为false | static encode2048PKCS1(str: string, pubKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> {
return CryptoSyncUtil.encodeAsym(str, pubKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, resultCoding, isPem);
} | AST#method_declaration#Left static encode2048PKCS1 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 pubKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | static encode2048PKCS1(str: string, pubKey: string, keyCoding: buffer.BufferEncoding,
resultCoding: buffer.BufferEncoding = 'base64', isPem: boolean = false): OutDTO<string> {
return CryptoSyncUtil.encodeAsym(str, pubKey, 'RSA2048', 'RSA2048|PKCS1', 2048, keyCoding, resultCoding, isPem);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/RSASync.ets#L83-L86 | 8752b6ba6055230eecc6d12a42ad53fcd4400f0c | gitee |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets | arkts | hasFlashFn | 闪关灯 | hasFlashFn(flashMode: camera.FlashMode): void {
// 检测是否有闪关灯
let hasFlash = this.session?.hasFlash();
Logger.debug(TAG, `hasFlash success, hasFlash: ${hasFlash}`);
// 检测闪光灯模式是否支持
let isFlashModeSupported = this.session?.isFlashModeSupported(flashMode);
Logger.debug(TAG, `isFlashModeSupported succ... | AST#method_declaration#Left hasFlashFn AST#parameter_list#Left ( AST#parameter#Left flashMode : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . FlashMode AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_an... | hasFlashFn(flashMode: camera.FlashMode): void {
let hasFlash = this.session?.hasFlash();
Logger.debug(TAG, `hasFlash success, hasFlash: ${hasFlash}`);
let isFlashModeSupported = this.session?.isFlashModeSupported(flashMode);
Logger.debug(TAG, `isFlashModeSupported success, isFlashModeSupported... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/mode/CameraService.ets#L790-L799 | d4fa3c38aaafbbb98edcb5b1dd5b40ad8faeeb90 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/web/WebSearchService.ets | arkts | 搜索结果接口 | export interface SearchResult {
title: string;
description: string;
url: string;
price?: string;
imageUrl?: string;
shopName?: string;
rating?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SearchResult AST#object_type#Left { AST#type_member#Left title : 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 description : AST#type_annotati... | export interface SearchResult {
title: string;
description: string;
url: string;
price?: string;
imageUrl?: string;
shopName?: string;
rating?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/web/WebSearchService.ets#L26-L34 | f2ee070bd3412dff3edc6a483e26138030822d52 | github | |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/model/NavItemModel.ets | arkts | 底部导航栏信息模块 | export interface NavItem {
icon: Resource;
icon_selected: Resource;
text: Resource;
id: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface NavItem AST#object_type#Left { AST#type_member#Left icon : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left icon_selected : AST#type_annotation... | export interface NavItem {
icon: Resource;
icon_selected: Resource;
text: Resource;
id: number;
} | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/model/NavItemModel.ets#L2-L7 | c36a6dbc90bc4ebc0b1c1336a9d6beaa60d5078e | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/component/FlashSaleItem.ets | arkts | 构建限时精选卡片项
@returns {void} 无返回值 | build(): void {
ColumnStart({
widthValue: 120,
paddingValue: {
left: $r("app.float.space_horizontal_small"),
right: $r("app.float.space_horizontal_small"),
},
onTap: (): void => this.onItemClick(this.goods.id)
}) {
NetWorkImage({
model: this.goods.mainPic,
... | 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#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left ColumnStart ( AST#component_parameters#Left { AST#component_parameter#Left width... | build(): void {
ColumnStart({
widthValue: 120,
paddingValue: {
left: $r("app.float.space_horizontal_small"),
right: $r("app.float.space_horizontal_small"),
},
onTap: (): void => this.onItemClick(this.goods.id)
}) {
NetWorkImage({
model: this.goods.mainPic,
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/component/FlashSaleItem.ets#L28-L57 | 9bc35250cfa3cb8d0b928d697a47687071d67789 | github | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | getMinWidth | @return the minimum width that the axis should take (in dp). | public getMinWidth(): number {
return this.mMinWidth;
} | AST#method_declaration#Left public getMinWidth AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expre... | public getMinWidth(): number {
return this.mMinWidth;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L142-L144 | adb00945adf65be575a286408ea8f8635ff66ff8 | gitee |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/model/WindowModel.ets | arkts | getBottomAvoidHeight | 获取主窗口底部导航条高度
@returns {callback: ((bottomAvoidHeight: number) => void)} | getBottomAvoidHeight(callback: ((bottomAvoidHeight: number) => void)): void {
if (this.windowStage === undefined) {
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
return;
}
try {
const type = window.AvoidAreaType.TYPE... | AST#method_declaration#Left getBottomAvoidHeight AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left AST#parenthesized_type#Left ( AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left bottomAvoidHeight : AST#type_annotation#Left ... | getBottomAvoidHeight(callback: ((bottomAvoidHeight: number) => void)): void {
if (this.windowStage === undefined) {
return;
}
this.windowStage.getMainWindow((err, windowClass: window.Window) => {
if (err.code) {
return;
}
try {
const type = window.AvoidAreaType.TYPE... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/WindowModel.ets#L85-L106 | c0a79e363dbb68734f1d07abd295cfa587957e15 | gitee |
Active-hue/ArkTS-Accounting.git | c432916d305b407557f08e35017c3fd70668e441 | entry/src/main/ets/pages/Main.ets | arkts | PieSliceIncome | Draw income pie slice | @Builder
PieSliceIncome(item: CategoryStats, index: number) {
Path()
.width(180)
.height(180)
.commands(this.getPieSlicePath(item.percentage, this.getPieStartAngleIncome(index)))
.fill(item.color)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right PieSliceIncome AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left CategoryStats AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotati... | @Builder
PieSliceIncome(item: CategoryStats, index: number) {
Path()
.width(180)
.height(180)
.commands(this.getPieSlicePath(item.percentage, this.getPieStartAngleIncome(index)))
.fill(item.color)
} | https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/Main.ets#L249-L256 | 9b76f586a919390907d89e49cbecfac63aeaf3d9 | github |
JHB11Hinson/mineMointorAPP.git | b6b853cf534021ac39e66c9b3a35113896a272b2 | entry/src/main/ets/pages/DeviceMapDialog.ets | arkts | updateMapLocation | 调用 H5 方法 | updateMapLocation() {
if (!this.device) return;
// 获取模拟坐标,默认坐标设为重大
const coords = LocationMap[this.device.location] || [106.464673, 29.569537];
const lng = coords[0];
const lat = coords[1];
// 构建 JS 调用字符串
// setDeviceLocation(lng, lat, name, status)
const script = `setDeviceLocation(${... | AST#method_declaration#Left updateMapLocation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#una... | updateMapLocation() {
if (!this.device) return;
const coords = LocationMap[this.device.location] || [106.464673, 29.569537];
const lng = coords[0];
const lat = coords[1];
const script = `setDeviceLocation(${lng}, ${lat}, '${this.device.name}', ${this.device.status})`;
try ... | https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/pages/DeviceMapDialog.ets#L109-L127 | 5692a1f2ab6d583b7f41f786e44bade7c11b5a17 | github |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | ‘8%’ | export const THOUSANDTH_120: string = '12%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_120 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '12%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar... | export const THOUSANDTH_120: string = '12%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L52-L52 | 7a399a9158d80eb9f9c6942a80abd0d732d51bce | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/InputDeviceManager.ets | arkts | InputDeviceManager | 输入设备 | @Preview
@Component
export struct InputDeviceManager {
@State mInputDevices: InputDeviceInfo[] = []
@State mCurDevice: InputDeviceInfo | null = null;
@State mInputDeviceList: InputDeviceInfo[] = []
@State mIsListener: boolean = false
@State mIsRefreshing: boolean = false
dialogController: CustomDialogContro... | AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct InputDeviceManager AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right mInputDevices : AST#type_annotation#Left AST#p... | @Preview
@Component
export struct InputDeviceManager {
@State mInputDevices: InputDeviceInfo[] = []
@State mCurDevice: InputDeviceInfo | null = null;
@State mInputDeviceList: InputDeviceInfo[] = []
@State mIsListener: boolean = false
@State mIsRefreshing: boolean = false
dialogController: CustomDialogContro... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/capabilities/InputDeviceManager.ets#L109-L133 | 460ebb7be288eb4957f1ca4eab0c8b94de71596c | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/TypeUtil.ets | arkts | isMap | 检查是否为Map类型。
@param value
@returns | static isMap(value: Object): boolean {
return new util.types().isMap(value);
} | AST#method_declaration#Left static isMap AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Ri... | static isMap(value: Object): boolean {
return new util.types().isMap(value);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/TypeUtil.ets#L97-L99 | de82a8f815ea6ef29f044235e83345503b08a78e | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/array_lib_func_002_F.ets | arkts | Introduction 库函数-array_toString | export function array_lib_func_002_F(taint_src : string) {
let arr : string[] = ["_","a","b"];
let t = arr.toString();
taint.Sink(t);
} | AST#export_declaration#Left export AST#function_declaration#Left function array_lib_func_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statemen... | export function array_lib_func_002_F(taint_src : string) {
let arr : string[] = ["_","a","b"];
let t = arr.toString();
taint.Sink(t);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/array_lib_func_002_F.ets#L6-L10 | 6fa2e06b1791ba06c340d932a9bb4de8c0b2b67f | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/CalendarPage.ets | arkts | loadTodosData | 加载代办事项数据 | private async loadTodosData(): Promise<void> {
try {
// 获取当前月份的代办事项
const year = this.currentDate.getFullYear();
const month = this.currentDate.getMonth();
const startDate = `${year}-${(month + 1).toString().padStart(2, '0')}-01`;
const endDate = `${year}-${(month + 1).toString().padSt... | AST#method_declaration#Left private async loadTodosData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST... | private async loadTodosData(): Promise<void> {
try {
const year = this.currentDate.getFullYear();
const month = this.currentDate.getMonth();
const startDate = `${year}-${(month + 1).toString().padStart(2, '0')}-01`;
const endDate = `${year}-${(month + 1).toString().padStart(2, '0')}-3... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/CalendarPage.ets#L114-L134 | 145858334a2a60faee2d9623ad887a73ec313d32 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/StatusBarUtils.ets | arkts | setImmersiveStatusBar | 设置沉浸式状态栏[3,4](@ref)
@param context 上下文对象 | static async setImmersiveStatusBar(): Promise<void> {
try {
const context = getContext(StatusBarUtil)
const currentWindow = await window.getLastWindow(context)
// 设置窗口布局为全屏[3,4](@ref)
await currentWindow.setWindowLayoutFullScreen(true);
await currentWindow.setWindowSystemBarEnable(['st... | AST#method_declaration#Left static async setImmersiveStatusBar 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#Righ... | static async setImmersiveStatusBar(): Promise<void> {
try {
const context = getContext(StatusBarUtil)
const currentWindow = await window.getLastWindow(context)
await currentWindow.setWindowLayoutFullScreen(true);
await currentWindow.setWindowSystemBarEnable(['status']);
await cu... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/StatusBarUtils.ets#L76-L91 | 996b4292497cd2e75cdcec0916745f82463d89f5 | github |
openharmony/xts_tools | 784a2e99d894e6bc2aba8c38f6bb68032442b1c8 | sample/AppSampleD/entry/src/main/ets/pages/Index.ets | arkts | loginVerification | 底部选择索引
登录验证 | loginVerification(): boolean {
// 验证是否登录
if (AppStorage.get("userInfo") == null || AppStorage.get("userInfo") == undefined) {
return false;
}
return true;
} | AST#method_declaration#Left loginVerification 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#if_statement#Left if ( AST#expression#Left AST#binary_e... | loginVerification(): boolean {
if (AppStorage.get("userInfo") == null || AppStorage.get("userInfo") == undefined) {
return false;
}
return true;
} | https://github.com/openharmony/xts_tools/blob/784a2e99d894e6bc2aba8c38f6bb68032442b1c8/sample/AppSampleD/entry/src/main/ets/pages/Index.ets#L32-L38 | f0253932732dd88b1a58956b0d0c3ec1724c502d | gitee |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/api/Router.ets | arkts | templateMgr | 获取NavDestination页面模板管理器
@returns | public static templateMgr() {
return TemplateMgr.getInstance()
} | AST#method_declaration#Left public static templateMgr AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left TemplateMgr AST#expres... | public static templateMgr() {
return TemplateMgr.getInstance()
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L338-L340 | dc5c068ad8328beb661b6b9092183ed37840b399 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/feature/EmitterClass.ets | arkts | setShoppingCartGoodsList | 持久化订阅的事件回调 | public setShoppingCartGoodsList(callback): void {
let addGoodDataId: EventsId = new EventsId(EmitterConst.ADD_EVENT_ID);
// 以持久化方式订阅购物车添加事件并接收事件回调
emitter.off(EmitterConst.ADD_EVENT_ID);
emitter.on(addGoodDataId, (eventData: EventsData) => {
callback(eventData);
});
} | AST#method_declaration#Left public setShoppingCartGoodsList AST#parameter_list#Left ( AST#parameter#Left callback AST#parameter#Right ) 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#variab... | public setShoppingCartGoodsList(callback): void {
let addGoodDataId: EventsId = new EventsId(EmitterConst.ADD_EVENT_ID);
emitter.off(EmitterConst.ADD_EVENT_ID);
emitter.on(addGoodDataId, (eventData: EventsData) => {
callback(eventData);
});
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/feature/EmitterClass.ets#L57-L64 | 050e776a5b6e41ae632f91aca35415001d2c0e8a | gitee |
Neptune-EX/OS_System_Design.git | c728a82d48079ae0c52d50c4a2e2586b69f4ce55 | entry/src/main/ets/view/PublicFilesTab.ets | arkts | openFileActionPanel | 打开文件操作面板 | private openFileActionPanel(filename: string) {
this.selectedFileForPanel = filename;
this.showFileActionPanel = true;
} | AST#method_declaration#Left private openFileActionPanel AST#parameter_list#Left ( AST#parameter#Left filename : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#... | private openFileActionPanel(filename: string) {
this.selectedFileForPanel = filename;
this.showFileActionPanel = true;
} | https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/src/main/ets/view/PublicFilesTab.ets#L279-L282 | 26db17d443d3cb31765e22bc48ec551f85e3d8fb | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogHelper.ets | arkts | showTextAreaDialog | 显示多行文本输入弹框
@param options
@returns | static showTextAreaDialog(options: TextAreaOptions): string {
ActionParameter.initBaseDefault(options);
ActionParameter.initDialogDefault(options);
ActionParameter.initAlertTitle(options);
ActionParameter.initButtons(options, true);
const dialogId = ActionBaseCore.getInstance().openCustomDialog(wrap... | AST#method_declaration#Left static showTextAreaDialog AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left TextAreaOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left str... | static showTextAreaDialog(options: TextAreaOptions): string {
ActionParameter.initBaseDefault(options);
ActionParameter.initDialogDefault(options);
ActionParameter.initAlertTitle(options);
ActionParameter.initButtons(options, true);
const dialogId = ActionBaseCore.getInstance().openCustomDialog(wrap... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L208-L215 | 6b8f656caf248df607f1be29390b87c54007ad47 | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | get | Called when data is obtained.
@since 10 | static get<T>(propName: string): T | undefined {
return StorageMap.shared.get<T>(propName)
} | AST#method_declaration#Left static get AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri... | static get<T>(propName: string): T | undefined {
return StorageMap.shared.get<T>(propName)
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L140-L142 | 3317c3ac2c35578955f2d8d2d19dc45b71191d47 | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/library_function/set_lib_func_002_F.ets | arkts | Introduction 库函数-set_add | export function set_lib_func_002_F(taint_src : string) {
let s = new Set<string>();
s.add("_");
taint.Sink(s);
} | AST#export_declaration#Left export AST#function_declaration#Left function set_lib_func_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#... | export function set_lib_func_002_F(taint_src : string) {
let s = new Set<string>();
s.add("_");
taint.Sink(s);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/set_lib_func_002_F.ets#L6-L10 | d8d14f771da5537bb74cbdde3d1e3b527bd77094 | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/state/src/main/ets/BreakpointState.ets | arkts | 获取全局断点状态实例;若不存在则创建
@returns {BreakpointState} 全局断点状态
@example
const state = getBreakpointState(); | export function getBreakpointState(): BreakpointState {
return AppStorageV2.connect<BreakpointState>(
BreakpointState,
BREAKPOINT_STATE_KEY,
() => new BreakpointState()
)!;
} | AST#export_declaration#Left export AST#function_declaration#Left function getBreakpointState AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left BreakpointState AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_sta... | export function getBreakpointState(): BreakpointState {
return AppStorageV2.connect<BreakpointState>(
BreakpointState,
BREAKPOINT_STATE_KEY,
() => new BreakpointState()
)!;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/state/src/main/ets/BreakpointState.ets#L192-L198 | 29fdb5b730685f02a00dc00d0500adc0e4bb12f1 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | PerformanceAnalysis/BptaDelayAnalysis/entry/src/main/ets/pages/page2.ets | arkts | ... | build() {
Column() {
// ...
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
// ...
}
.barHeight(0)
.layoutWeight(1)
.animationDuration(1000)
.scrollable(false)
}
.width('100%')
} | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // ... AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Tabs ( AST#component_parameters#Left { AST#compo... | build() {
Column() {
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
}
.barHeight(0)
.layoutWeight(1)
.animationDuration(1000)
.scrollable(false)
}
.width('100%')
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/PerformanceAnalysis/BptaDelayAnalysis/entry/src/main/ets/pages/page2.ets#L23-L35 | 10e390539cbabbfc50cfaa52c908ce08b511e98e | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/plan/plancurve/Plan.ets | arkts | asyncDelete | / (异步)从db中删除wordIds | asyncDelete(wordIds: number[]): void {
setTimeout(async () => {
await this.deleteWordIds(wordIds);
}, 0);
} | AST#method_declaration#Left asyncDelete AST#parameter_list#Left ( AST#parameter#Left wordIds : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST... | asyncDelete(wordIds: number[]): void {
setTimeout(async () => {
await this.deleteWordIds(wordIds);
}, 0);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L501-L505 | 42233a705ef2c7cd37588db16efc4e69e5f4dd5b | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/analytics/AnalyticsService.ets | arkts | getBirthdayStats | 获取生日统计 | async getBirthdayStats(): Promise<BirthdayStats> {
const contacts = await this.contactService.searchContacts({ pageSize: 10000 });
const validContacts = contacts.filter(c => c.birthday.date);
// 月份分布
const monthlyDistribution = this.calculateMonthlyDistribution(validContacts);
// 年龄分布
cons... | AST#method_declaration#Left async getBirthdayStats 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 BirthdayStats AST#primary_type#Right AST#type_annotation#Right >... | async getBirthdayStats(): Promise<BirthdayStats> {
const contacts = await this.contactService.searchContacts({ pageSize: 10000 });
const validContacts = contacts.filter(c => c.birthday.date);
const monthlyDistribution = this.calculateMonthlyDistribution(validContacts);
const ageDistribut... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/analytics/AnalyticsService.ets#L243-L273 | 8df60d186b32241f38953dd4e10c7720f553947a | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildContactUs | 联系我们 | @Builder
buildContactUs() {
Column({ space: 16 }) {
Text('📞 联系我们')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.alignSelf(ItemAlign.Start)
Column({ space: 12 }) {
this.buildContactItem('👨💻', '开发者', '雄仔很忙工作室', '')
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactUs AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_para... | @Builder
buildContactUs() {
Column({ space: 16 }) {
Text('📞 联系我们')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor(this.COLORS.textPrimary)
.alignSelf(ItemAlign.Start)
Column({ space: 12 }) {
this.buildContactItem('👨💻', '开发者', '雄仔很忙工作室', '')
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L3613-L3644 | 52e6c5a88ff039b04772e439afe150266744a5dc | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PasteboardUtil.ets | arkts | getDataUriSync | 读取系统剪贴板URI内容。
@returns | static getDataUriSync(): string {
return PasteboardUtil.getDataSync().getPrimaryUri();
} | AST#method_declaration#Left static getDataUriSync AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expr... | static getDataUriSync(): string {
return PasteboardUtil.getDataSync().getPrimaryUri();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L211-L213 | 372e808b62b401cdf48bafe4c76773651f1a1789 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | getGridDashPathEffect | returns the DashPathEffect that is set for grid line
@return | public getGridDashPathEffect(): DashPathEffect | null {
return this.mGridDashPathEffect;
} | AST#method_declaration#Left public getGridDashPathEffect AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DashPathEffect AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#... | public getGridDashPathEffect(): DashPathEffect | null {
return this.mGridDashPathEffect;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L622-L624 | e6d0e5fc5cb1414ca42e293e77d6c3ab7c8efbdf | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/model/modifier/TextAreaInputFilterModifier.ets | arkts | 给TextArea 设置InputFilter过滤器 | export class TextAreaInputFilterModifier implements AttributeModifier<TextAreaAttribute> {
inputFilter?: InputFilter;
applyNormalAttribute(instance: TextAreaAttribute): void {
if (this.inputFilter) {
instance.inputFilter(this.inputFilter.value, this.inputFilter.error);
}
}
} | AST#export_declaration#Left export AST#class_declaration#Left class TextAreaInputFilterModifier AST#implements_clause#Left implements AST#generic_type#Left AttributeModifier AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left TextAreaAttribute AST#primary_type#Right AST#type_annotation#Right > AST#... | export class TextAreaInputFilterModifier implements AttributeModifier<TextAreaAttribute> {
inputFilter?: InputFilter;
applyNormalAttribute(instance: TextAreaAttribute): void {
if (this.inputFilter) {
instance.inputFilter(this.inputFilter.value, this.inputFilter.error);
}
}
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/modifier/TextAreaInputFilterModifier.ets#L6-L14 | 0aff9f244db4fe40bed613c1ee4ac0c206f74b5c | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/database/entities/rule/TocRule.ets | arkts | 目录规则 | export class TocRule {
preUpdateJs?: string
chapterList?: string
chapterName?: string
chapterUrl?: string
formatJs?: string
isVolume?: string
isVip?: string
isPay?: string
updateTime?: string
nextTocUrl?: string
} | AST#export_declaration#Left export AST#class_declaration#Left class TocRule AST#class_body#Left { AST#property_declaration#Left preUpdateJs AST#ERROR#Left ? : AST#ERROR#Left string chapter List ? : string chapterName ? : string chapterUrl ? : AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left string AST#pri... | export class TocRule {
preUpdateJs?: string
chapterList?: string
chapterName?: string
chapterUrl?: string
formatJs?: string
isVolume?: string
isVip?: string
isPay?: string
updateTime?: string
nextTocUrl?: string
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/database/entities/rule/TocRule.ets#L4-L15 | 8231b619dfdca773ab750c441b84576d47e56c68 | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/common/addBookTypeDialog.ets | arkts | addBookTypeDialog | 添加分类类型弹窗 | @CustomDialog
export default struct addBookTypeDialog {
@Link bookType:string
controller?: CustomDialogController
// 若尝试在CustomDialog中传入多个其他的Controller,以实现在CustomDialog中打开另一个或另一些CustomDialog,那么此处需要将指向自己的controller放在所有controller的后面
cancel: () => void = () => {
}
confirm: () => void = () => {
}
@State ... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export default struct addBookTypeDialog AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right bookType AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#pr... | @CustomDialog
export default struct addBookTypeDialog {
@Link bookType:string
controller?: CustomDialogController
cancel: () => void = () => {
}
confirm: () => void = () => {
}
@State BookTypeValueLength:number = 0
@StorageProp(ThemeStorageKey.THEME) theme: ThemeItem = {} as ThemeItem
build(... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/common/addBookTypeDialog.ets#L7-L91 | c633319aba7f584a6ce8b475e6702f72e2571f67 | github |
ark-ui/MiniCanvas | 2a9a12127ed5ea5b6b87da252d258c8ad5700f56 | mini_canvas/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.7'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left HAR_VERSION = AST#expression#Left '1.0.7' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const HAR_VERSION = '1.0.7'; | https://github.com/ark-ui/MiniCanvas/blob/2a9a12127ed5ea5b6b87da252d258c8ad5700f56/mini_canvas/BuildProfile.ets#L4-L4 | 403f423c4bf091d89ecbec306a591e08a07c8ea1 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/DES.ets | arkts | encryptCBC | 加密(CBC模式),异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@param params 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。
@param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(3DES192|ECB|PKCS7、3DES192|CBC|PKCS7、等)。
@returns | static async encryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
params: cryptoFramework.ParamsSpec | null, transformation: string = '3DES192|CBC|PKCS7'): Promise<cryptoFramework.DataBlob> {
return DES.encrypt(data, symKey, params, transformation);
} | AST#method_declaration#Left static async encryptCBC AST#parameter_list#Left ( AST#parameter#Left data : 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 sym... | static async encryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
params: cryptoFramework.ParamsSpec | null, transformation: string = '3DES192|CBC|PKCS7'): Promise<cryptoFramework.DataBlob> {
return DES.encrypt(data, symKey, params, transformation);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/DES.ets#L88-L91 | 816457ff14cd4ad84da7317cb34621b519022f14 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | VideoProcessBaseWeb/entry/src/main/ets/common/Constants.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class Constants {
/**
* Webview controller name.
*/
public static readonly INDEX_WEB_CONTROLLER = 'index_web_controller';
/**
* Hilog tag.
*/
public static readonly TAG = 'web video process sample';
/**
* System language.
*/
public static readonly SYSTEM_LANGUAGE_KEY = 'system_langu... | AST#export_declaration#Left export AST#class_declaration#Left class Constants AST#class_body#Left { /**
* Webview controller name.
*/ AST#property_declaration#Left public static readonly INDEX_WEB_CONTROLLER = AST#expression#Left 'index_web_controller' AST#expression#Right ; AST#property_declaration#Right /**
... | export class Constants {
public static readonly INDEX_WEB_CONTROLLER = 'index_web_controller';
public static readonly TAG = 'web video process sample';
public static readonly SYSTEM_LANGUAGE_KEY = 'system_language';
public static readonly CHINESE_LANGUAGE: string = 'zh-Hans';
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoProcessBaseWeb/entry/src/main/ets/common/Constants.ets#L16-L33 | fb1f41740976f37b847dd201b5c60182f50e8c3a | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WantUtil.ets | arkts | toBatterySetting | 跳转电池设置页面 | static toBatterySetting(): Promise<void> {
return WantUtil.toSetting(WantUtil.URI_BATTERY);
} | AST#method_declaration#Left static toBatterySetting 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#typ... | static toBatterySetting(): Promise<void> {
return WantUtil.toSetting(WantUtil.URI_BATTERY);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WantUtil.ets#L179-L181 | 8bde0d1aa4e0cea1738d8f2b6d5071eff233846a | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/TabsSample/entry/src/main/ets/pages/collapsemenu/CollapseMenuSection.ets | arkts | CollapseMenuSection | 功能描述:
1. 进入页面,呈现面板列表,点击普通面板,跳转到对应文章的网页。
2. 点击折叠面板,面板展开,再次点击,面板收起。
实现原理:
1. 使用List组件遍历折叠面板数据,如果数据含有children数据,使用ListGroup进行二次遍历渲染。(当前场景只支持嵌套层次为两级,多层级待扩展)
2. 点击ListGroup的header组件以及visibility来控制子列表的显示和隐藏。
@param {ArticleNode[]} articleNodes - 折叠面板列表数据
@param {(articleNode: ArticleNode)=>void} articleItemBuilder - 列表项视图
... | @Entry
@Component
export struct CollapseMenuSection {
// 折叠面板列表数据
articleNodes: TreeNode[] = ARTICLE_DATA1;
// 懒加载数据
articleSource: ArticleSource<TreeNode> = new ArticleSource<TreeNode>(this.articleNodes);
build() {
Column() {
Row() {
Text($r('app.string.custom_return'))
}
.marg... | AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct CollapseMenuSection AST#component_body#Left { // 折叠面板列表数据 AST#property_declaration#Left articleNodes : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ... | @Entry
@Component
export struct CollapseMenuSection {
articleNodes: TreeNode[] = ARTICLE_DATA1;
articleSource: ArticleSource<TreeNode> = new ArticleSource<TreeNode>(this.articleNodes);
build() {
Column() {
Row() {
Text($r('app.string.custom_return'))
}
.margin(3)
.width(... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/TabsSample/entry/src/main/ets/pages/collapsemenu/CollapseMenuSection.ets#L45-L177 | 6b2409326e23d190877da453d20dce8fd4d3cd0e | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/PreferencesUtils.ets | arkts | get | 获取缓存值
@param key
@param defValue
@param preferenceName
@returns | static async get(key: string, defValue: preferences.ValueType, preferenceName: string = defaultPreferenceName) {
let preferences = await PreferencesUtils.getPreferences(preferenceName) //获取实例
return preferences.get(key, defValue)
} | AST#method_declaration#Left static async get AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defValue : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Lef... | static async get(key: string, defValue: preferences.ValueType, preferenceName: string = defaultPreferenceName) {
let preferences = await PreferencesUtils.getPreferences(preferenceName)
return preferences.get(key, defValue)
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PreferencesUtils.ets#L65-L68 | 8ca729354dbe150098b5d06bf1ed599029fe17d9 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets | arkts | clearWrongQuestion | 清空所有错题 | public clearWrongQuestion(): void {
this.examDetails.forEach((item: ExamDetail) => item.isCorrect = undefined);
} | AST#method_declaration#Left public clearWrongQuestion 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 AS... | public clearWrongQuestion(): void {
this.examDetails.forEach((item: ExamDetail) => item.isCorrect = undefined);
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets#L275-L277 | 79e7f4f11486b4f8653f73e4f5b8fd995f1508aa | github |
iotjin/JhHarmonyDemo.git | 819e6c3b1db9984c042a181967784550e171b2e8 | JhCommon/src/main/ets/JhCommon/components/JhToast.ets | arkts | showError | / 失败弹框 | public static showError(loadingText: ResourceStr) {
JhToast._showToast(loadingText, _ToastType.error)
} | AST#method_declaration#Left public static showError AST#parameter_list#Left ( AST#parameter#Left loadingText : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statem... | public static showError(loadingText: ResourceStr) {
JhToast._showToast(loadingText, _ToastType.error)
} | https://github.com/iotjin/JhHarmonyDemo.git/blob/819e6c3b1db9984c042a181967784550e171b2e8/JhCommon/src/main/ets/JhCommon/components/JhToast.ets#L54-L56 | e38a6d527f6368c8103b53bc5ccd9da89a0dc34a | github |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/IMClientManager.ets | arkts | getLog | 返回日志对象。
@returns Logger对象 | getLog() :Logger {
return ClientCoreSDK.Log;
} | AST#method_declaration#Left getLog AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Logger 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_expression#Left A... | getLog() :Logger {
return ClientCoreSDK.Log;
} | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/IMClientManager.ets#L296-L298 | 9b8d0a2d3954d3b93262b78f942fd582c282b1d4 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets | arkts | Crop 1:1.
@param pixelMap.
@param width.
@param height. | export async function square(pixelMap: PixelMap, width: number, height: number) {
if (width < height) {
pixelMap.crop({
size: {
width: width,
height: width
},
x: 0,
y: Math.round((height - width) / CommonConstants.AVERAGE_WEIGHT_WIDTH)
});
} else {
pixelMap.crop({... | AST#export_declaration#Left export AST#function_declaration#Left async function square AST#parameter_list#Left ( AST#parameter#Left pixelMap : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left width : AST#type_annotation#Lef... | export async function square(pixelMap: PixelMap, width: number, height: number) {
if (width < height) {
pixelMap.crop({
size: {
width: width,
height: width
},
x: 0,
y: Math.round((height - width) / CommonConstants.AVERAGE_WEIGHT_WIDTH)
});
} else {
pixelMap.crop({... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/utils/CropUtil.ets#L26-L46 | e67adcb4556da410a4944cb97ece35f6f1fbb0a4 | gitee | |
openharmony/multimedia_camera_framework | 9873dd191f59efda885bc06897acf9b0660de8f2 | frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/pages/Index.ets | arkts | blurSecondAnim | 向内翻转90°同时 | blurSecondAnim() {
Logger.info(TAG, 'blurSecondAnim E');
animateToImmediately(
{
duration: BlurAnimateUtil.ROTATION_DURATION,
curve: Curve.Sharp,
onFinish: () => {
Logger.info(TAG, 'blurSecondAnim X');
}
},
() => {
this.shotImgScale = { x: 1, y... | AST#method_declaration#Left blurSecondAnim AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left Logger AST#expression#Right . info A... | blurSecondAnim() {
Logger.info(TAG, 'blurSecondAnim E');
animateToImmediately(
{
duration: BlurAnimateUtil.ROTATION_DURATION,
curve: Curve.Sharp,
onFinish: () => {
Logger.info(TAG, 'blurSecondAnim X');
}
},
() => {
this.shotImgScale = { x: 1, y... | https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/pages/Index.ets#L266-L280 | 30aa4e690808f564aff17d4bdc069eeeb069951c | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/GreetingTypes.ets | arkts | AI祝福语生成响应接口 | export interface AIGreetingResponse {
success: boolean;
candidates: string[];
content: string;
alternativeContents?: string[];
confidence: number;
processingTime: number;
tokensUsed?: number;
model?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface AIGreetingResponse AST#object_type#Left { AST#type_member#Left success : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left candidates : AST#type_... | export interface AIGreetingResponse {
success: boolean;
candidates: string[];
content: string;
alternativeContents?: string[];
confidence: number;
processingTime: number;
tokensUsed?: number;
model?: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L174-L183 | 543e9166f93c88a01ef90a9998c4b0313aeac159 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | NdkDrawing/entry/src/main/ets/view/GlassCoverView.ets | arkts | GlassCoverView | Glass cladding effect | @Preview
@Component
export default struct GlassCoverView {
@Prop @Watch('onDraw') pointsToDraw: number[][] = [];
private settings = new RenderingContextSettings(true);
private renderContext = new CanvasRenderingContext2D(this.settings);
private viewWidth: number = 0;
private viewHeight: number = 0;
build()... | AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export default struct GlassCoverView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right AST#decorator#Left @ Watch ( AST#expression... | @Preview
@Component
export default struct GlassCoverView {
@Prop @Watch('onDraw') pointsToDraw: number[][] = [];
private settings = new RenderingContextSettings(true);
private renderContext = new CanvasRenderingContext2D(this.settings);
private viewWidth: number = 0;
private viewHeight: number = 0;
build()... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NdkDrawing/entry/src/main/ets/view/GlassCoverView.ets#L26-L91 | c9de96baa06c0fc24a31298f41bb0597bfe975ce | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | WaterFlowSample/entry/src/main/ets/pages/DataUpdateAndAnimationPage.ets | arkts | getSize | [StartExclude quick_start] | getSize(): number {
let ret: number = Math.floor(Math.random() * this.maxSize);
return (ret > this.minSize ? ret : this.minSize);
}
setItemSizeArray(): void {
for (let i: number = 0; i < 100; i++) {
this.itemHeightArray.push(this.getSize());
}
}
initSections(): void {
let sectionOpti... | AST#method_declaration#Left getSize AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left ret : AST#type_an... | getSize(): number {
let ret: number = Math.floor(Math.random() * this.maxSize);
return (ret > this.minSize ? ret : this.minSize);
}
setItemSizeArray(): void {
for (let i: number = 0; i < 100; i++) {
this.itemHeightArray.push(this.getSize());
}
}
initSections(): void {
let sectionOpti... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WaterFlowSample/entry/src/main/ets/pages/DataUpdateAndAnimationPage.ets#L182-L213 | 6bed99716fbf7d059807c483bef05c397515a7a7 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/OfficeAttendance-master/commons/common_lib/Index.ets | arkts | FormatUtil | 格式化工具 | export { FormatUtil } from './src/main/ets/utils/FormatUtil'; | AST#export_declaration#Left export { FormatUtil } from './src/main/ets/utils/FormatUtil' ; AST#export_declaration#Right | export { FormatUtil } from './src/main/ets/utils/FormatUtil'; | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/OfficeAttendance-master/commons/common_lib/Index.ets#L14-L14 | ce1282b7da1b16c8ca825b63b061e6f90da46b9f | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/arkts/@arkts.collections.d.ets | arkts | from | Creates an ArkTS Array from an iterable object.
@param { Iterable<T> } iterable - An iterable object to convert to an ArkTS Array.
@returns { Array<T> } A new Array instance
@throws { BusinessError } 401 - Parameter error.
@throws { BusinessError } 10200011 - The from method cannot be bound.
@static
@syscap SystemCapa... | static from<T>(iterable: Iterable<T>): Array<T>; | AST#method_declaration#Left static from AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left iterable : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Iterable AST#type_arguments#Left < AST#type_annot... | static from<T>(iterable: Iterable<T>): Array<T>; | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/arkts/@arkts.collections.d.ets#L246-L246 | eea15f4aab933b5c0b1dde1a540f3979b89551e9 | github |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/objects/WebNode.ets | arkts | dispose | 解除当前builderNode与后端实体的引用关系 | dispose() {
if (this.builderNode) {
this.builderNode.dispose();
console.log(`[WebNode][dispose] OK!`);
} else {
console.warn(`[WebNode][dispose] Failed!`);
}
} | AST#method_declaration#Left dispose 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 . builderNode AST#member_expression#Right AST#expr... | dispose() {
if (this.builderNode) {
this.builderNode.dispose();
console.log(`[WebNode][dispose] OK!`);
} else {
console.warn(`[WebNode][dispose] Failed!`);
}
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/objects/WebNode.ets#L165-L172 | 31d5b58cdf1be5c1dc295eb3c314695f9d5a8a7c | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/StringUtils.ets | arkts | bufferToStr | ArrayBuffer转字符串
@param str
@returns | static bufferToStr(src: ArrayBuffer, encoding: buffer.BufferEncoding = 'utf-8'): string {
let buf = buffer.from(src);
let result = buf.toString(encoding);
return result;
} | AST#method_declaration#Left static bufferToStr AST#parameter_list#Left ( AST#parameter#Left src : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left encoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_t... | static bufferToStr(src: ArrayBuffer, encoding: buffer.BufferEncoding = 'utf-8'): string {
let buf = buffer.from(src);
let result = buf.toString(encoding);
return result;
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StringUtils.ets#L261-L265 | 966e1b096b8a134d42e7ab4b5c6731f2655ed60e | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/immersive/src/main/ets/view/GoodsDetails.ets | arkts | GoodsDetails | column间隙 | @Component
export struct GoodsDetails {
@State item: ProductDataModel | undefined = undefined;
@Consume navPathStack: NavPathStack;
@StorageLink('avoidAreaBottomToModule') avoidAreaBottomToModule: number = 0;
@StorageLink('avoidAreaTopToModule') avoidAreaTopToModule: number = 0;
aboutToAppear(): void {
t... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct GoodsDetails AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right item : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left ProductDataModel AST#primar... | @Component
export struct GoodsDetails {
@State item: ProductDataModel | undefined = undefined;
@Consume navPathStack: NavPathStack;
@StorageLink('avoidAreaBottomToModule') avoidAreaBottomToModule: number = 0;
@StorageLink('avoidAreaTopToModule') avoidAreaTopToModule: number = 0;
aboutToAppear(): void {
t... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/immersive/src/main/ets/view/GoodsDetails.ets#L22-L113 | a9de71d2a541772641a97cb1e32dde354356b12b | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.