nwo
stringclasses
304 values
sha
stringclasses
304 values
path
stringlengths
9
214
language
stringclasses
1 value
identifier
stringlengths
0
49
docstring
stringlengths
1
34.2k
function
stringlengths
8
59.4k
ast_function
stringlengths
71
497k
obf_function
stringlengths
8
39.4k
url
stringlengths
102
324
function_sha
stringlengths
40
40
source
stringclasses
2 values
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_speech/src/main/ets/TextReaderHelper.ets
arkts
off
注销监听事件
static off(type: 'stateChange' | 'stop' | 'release' | 'showPanel' | 'hidePanel' | 'setArticle' | 'clickArticle' | 'clickAuthor' | 'clickNotification' | 'requestMore' | 'eventPanel' | 'eventNotification' | 'eventReadList', callback: Callback<void> | Callback<string> | Callback<TextReader.ReadState> | Callbac...
AST#method_declaration#Left static off AST#parameter_list#Left ( AST#parameter#Left type AST#parameter#Right AST#ERROR#Left : 'stateChange' | 'stop' | 'release' | 'showPanel' | 'hidePanel' | 'setArticle' | 'clickArticle' | 'clickAuthor' | 'clickNotification' | 'requestMore' | 'eventPanel' | 'eventNotification' | 'event...
static off(type: 'stateChange' | 'stop' | 'release' | 'showPanel' | 'hidePanel' | 'setArticle' | 'clickArticle' | 'clickAuthor' | 'clickNotification' | 'requestMore' | 'eventPanel' | 'eventNotification' | 'eventReadList', callback: Callback<void> | Callback<string> | Callback<TextReader.ReadState> | Callbac...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/TextReaderHelper.ets#L376-L412
471262688a480e3de0fa08a52899a3d18ec118ba
gitee
huaweicloud/huaweicloud-iot-device-sdk-arkts.git
72954bea19e7e7f93567487b036c0664457bdaf3
huaweicloud_iot_device_library/src/main/ets/service/AbstractDevice.ets
arkts
onPropertiesSet
属性设置回调,,由SDK自动调用 @param requestId 请求id @param propsSet 属性设置请求
public onPropertiesSet(requestId: string, propsSet: PropsSet): void { let ret = IotResult.SUCCESS; propsSet.services.every((serviceProp) => { const deviceService = this.getService(serviceProp.service_id); if (deviceService !== null && deviceService !== undefined) { // 如果部分失败直接返回 con...
AST#method_declaration#Left public onPropertiesSet AST#parameter_list#Left ( AST#parameter#Left requestId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left propsSet : AST#type_annotation#Left AST#primary_type#Left PropsSet A...
public onPropertiesSet(requestId: string, propsSet: PropsSet): void { let ret = IotResult.SUCCESS; propsSet.services.every((serviceProp) => { const deviceService = this.getService(serviceProp.service_id); if (deviceService !== null && deviceService !== undefined) { const result = d...
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/huaweicloud_iot_device_library/src/main/ets/service/AbstractDevice.ets#L134-L152
52bd80b6cd91bbde1e3e3ead9cd9fecd579ad419
github
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/tcp/StickyDemo/entry/src/main/ets/pages/Index.ets
arkts
bind2Port
绑定本地端口
async bind2Port(tcpSocket: socket.TCPSocket) { //本地地址 let localAddress = { address: "0.0.0.0", family: 1 } await tcpSocket.bind(localAddress) .then(() => { this.msgHistory = 'bind success' + "\r\n"; }) .catch((e) => { this.msgHistory = 'bind fail ' + e.message + "\r\n"; ...
AST#method_declaration#Left async bind2Port AST#parameter_list#Left ( AST#parameter#Left tcpSocket : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left socket . TCPSocket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#bloc...
async bind2Port(tcpSocket: socket.TCPSocket) { let localAddress = { address: "0.0.0.0", family: 1 } await tcpSocket.bind(localAddress) .then(() => { this.msgHistory = 'bind success' + "\r\n"; }) .catch((e) => { this.msgHistory = 'bind fail ' + e.message + "\r\n"; })...
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tcp/StickyDemo/entry/src/main/ets/pages/Index.ets#L119-L137
47ef5054425835d4792c84a5e696df7aeecbc2ad
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/storage_tools.ets
arkts
Save (Copy) any file from a path to a selected position, pulling up a DocumentViewPicker. @param from the path.
export async function document_save_from_path(from: string, file_name_overwrite?: string) { await document_save_from_uri(fileUri.getUriFromPath(from), file_name_overwrite); }
AST#export_declaration#Left export AST#function_declaration#Left async function document_save_from_path AST#parameter_list#Left ( AST#parameter#Left from : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left file_name_overwrite ...
export async function document_save_from_path(from: string, file_name_overwrite?: string) { await document_save_from_uri(fileUri.getUriFromPath(from), file_name_overwrite); }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L124-L126
10ec76c2c3da4ef6cbe597a8d38a45fd79d9f63b
gitee
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/common/database/Tables/AccountingInfoApi.ets
arkts
updateData
更新数据
updateData(accountingInfo: AccountingInfo, callback: Function): void { const valueBucket = generateBucket(accountingInfo); let predicates = new dataRdb.RdbPredicates(Const.ACCOUNTING_INFO.tableName); predicates.equalTo('id', accountingInfo.id); RdbUtils.update(valueBucket, predicates).then(result => { ...
AST#method_declaration#Left updateData AST#parameter_list#Left ( AST#parameter#Left accountingInfo : AST#type_annotation#Left AST#primary_type#Left AccountingInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function ...
updateData(accountingInfo: AccountingInfo, callback: Function): void { const valueBucket = generateBucket(accountingInfo); let predicates = new dataRdb.RdbPredicates(Const.ACCOUNTING_INFO.tableName); predicates.equalTo('id', accountingInfo.id); RdbUtils.update(valueBucket, predicates).then(result => { ...
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Tables/AccountingInfoApi.ets#L27-L34
45c9b72883d543446500e26518691df5fb011962
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/chat/VoiceManage/SpeechManager.ets
arkts
writeAudio
写音频流
private async writeAudio(filePath:string) { let ctx = getContext(this) let filenames: string[] = fileIo.listFileSync(ctx.filesDir) if (filenames.length <= 0) { return } // 根据路径地址把录音阶段的存入的音频文件取到 let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE) try { let buf: ArrayB...
AST#method_declaration#Left private async writeAudio AST#parameter_list#Left ( AST#parameter#Left filePath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_de...
private async writeAudio(filePath:string) { let ctx = getContext(this) let filenames: string[] = fileIo.listFileSync(ctx.filesDir) if (filenames.length <= 0) { return } let file = fileIo.openSync(filePath, fileIo.OpenMode.READ_WRITE) try { let buf: ArrayBuffer = new ArrayBuffer(...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/chat/VoiceManage/SpeechManager.ets#L92-L118
dab76947b6342e399ce60ed731123cee99965052
github
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/api/Router.ets
arkts
animateMgr
获取动画管理类 @returns
public static animateMgr(): NavAnimationMgr { return ZRouter.getRouterMgr().animateMgr }
AST#method_declaration#Left public static animateMgr AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left NavAnimationMgr AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left A...
public static animateMgr(): NavAnimationMgr { return ZRouter.getRouterMgr().animateMgr }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/api/Router.ets#L218-L220
74e35c14f372d6d56ca8b9e705e09772de88a06a
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/viewmodel/OrderListViewModel.ets
arkts
toPay
跳转订单支付 @param {Order} order - 订单信息 @returns {void} 无返回值
toPay(order: Order): void { const payPrice: number = order.price - order.discountPrice; OrderNavigator.toPay(order.id, payPrice); }
AST#method_declaration#Left toPay AST#parameter_list#Left ( AST#parameter#Left order : AST#type_annotation#Left AST#primary_type#Left Order AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#typ...
toPay(order: Order): void { const payPrice: number = order.price - order.discountPrice; OrderNavigator.toPay(order.id, payPrice); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderListViewModel.ets#L63-L66
d43918bf7b2a2716afff7929e4a723730704e230
github
SeaEpoch/SepWeather.git
e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c
entry/src/main/ets/common/database/Rdb.ets
arkts
关系型数据库
export default class Rdb { private rdbStore: relationalStore.RdbStore | null = null; private tableName: string; private sqlCreateTable: string; private columns: Array<string>; constructor(tableName: string, sqlCreateTable: string, columns: Array<string>) { this.tableName = tableName; this.sqlCreateTa...
AST#export_declaration#Left export default AST#class_declaration#Left class Rdb AST#class_body#Left { AST#property_declaration#Left private rdbStore : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . RdbStore AST#qualified_type#Right AST#primary_type#Right | A...
export default class Rdb { private rdbStore: relationalStore.RdbStore | null = null; private tableName: string; private sqlCreateTable: string; private columns: Array<string>; constructor(tableName: string, sqlCreateTable: string, columns: Array<string>) { this.tableName = tableName; this.sqlCreateTa...
https://github.com/SeaEpoch/SepWeather.git/blob/e7b92b462f721fa7d1cc8ebbcda3ecf86f2cca8c/entry/src/main/ets/common/database/Rdb.ets#L6-L127
6033bfb8cb4dddff9b5ea2c9f4e70acd1e2532a3
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/navigation/OrderPayNav.ets
arkts
OrderPayNav
@file 订单支付页面导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function OrderPayNav(): void { OrderPayPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function OrderPayNav 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_custom_co...
@Builder export function OrderPayNav(): void { OrderPayPage(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/navigation/OrderPayNav.ets#L8-L11
848957dae9e28f37e16af6d463ed6ed142498bf3
github
sedlei/Smart-park-system.git
253228f73e419e92fd83777f564889d202f7c699
@huaweicloud/iot-device-sdk/src/main/ets/client/listener/ConnectionListener.d.ets
arkts
连接监听器
export interface ConnectListener { /** * 连接丢失通知 * */ connectionLost: () => void; /** * 连接成功通知 */ connectComplete: () => void; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ConnectListener AST#object_type#Left { /** * 连接丢失通知 * */ AST#type_member#Left connectionLost : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#type_annotation#Left AST#p...
export interface ConnectListener { connectionLost: () => void; connectComplete: () => void; }
https://github.com/sedlei/Smart-park-system.git/blob/253228f73e419e92fd83777f564889d202f7c699/@huaweicloud/iot-device-sdk/src/main/ets/client/listener/ConnectionListener.d.ets#L4-L14
056fd0a53c0e8c1a1bf3cd9b3f526b1b31be78d0
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/community/PostDetailPage.ets
arkts
fetchPostDetail
获取帖子详情
async fetchPostDetail(): Promise<void> { try { this.loading = true; try { this.post = await ApiService.getPostById(this.postId); // 添加详细日志 console.info(`获取到帖子详情数据: ${JSON.stringify({ id: this.post?.id, title: this.post?.title, // 输出作者信息 ...
AST#method_declaration#Left async fetchPostDetail AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_...
async fetchPostDetail(): Promise<void> { try { this.loading = true; try { this.post = await ApiService.getPostById(this.postId); console.info(`获取到帖子详情数据: ${JSON.stringify({ id: this.post?.id, title: this.post?.title, author: t...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/community/PostDetailPage.ets#L47-L122
d27d1640491339348ef08242379165531ef103c8
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets
arkts
getRecentSearchHistory
获取指定数量的最新搜索历史记录 @param {number} limit 限制数量 @returns {Promise<SearchHistory[]>} 搜索历史列表
async getRecentSearchHistory(limit: number): Promise<SearchHistory[]> { const all: SearchHistory[] = await this.getAllSearchHistory(); return all.slice(0, limit); }
AST#method_declaration#Left async getRecentSearchHistory AST#parameter_list#Left ( AST#parameter#Left limit : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic...
async getRecentSearchHistory(limit: number): Promise<SearchHistory[]> { const all: SearchHistory[] = await this.getAllSearchHistory(); return all.slice(0, limit); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/searchhistory/SearchHistoryLocalDataSourceImpl.ets#L89-L92
059fdc10321d4b04f32cc916730cc234e33c96e8
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/action/DialogUtil.ets
arkts
TODO 弹窗工具类(AlertDialog) author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class DialogUtil { private static defaultConfig: DialogConfig = new DialogConfig(); //默认样式 /** * 设置默认统一样式 * @param configs */ static setDefaultConfig(configs: (config: DialogConfig) => void): void { configs(DialogUtil.defaultConfig); } /** * 显示弹框(一个按钮的) * @param options */ ...
AST#export_declaration#Left export AST#class_declaration#Left class DialogUtil AST#class_body#Left { AST#property_declaration#Left private static defaultConfig : AST#type_annotation#Left AST#primary_type#Left DialogConfig AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AS...
export class DialogUtil { private static defaultConfig: DialogConfig = new DialogConfig(); static setDefaultConfig(configs: (config: DialogConfig) => void): void { configs(DialogUtil.defaultConfig); } static showConfirmDialog(options: ConfirmDialogOptions) { DialogUtil.initDialogDefault(opti...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/action/DialogUtil.ets#L35-L483
d40dbab6a0160e2cdd8ef10416a8714f53937903
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/LogUtil.ets
arkts
info
打印INFO级别日志 @param args
static info(...args: string[]): void { if (LogUtil.showLog) { hilog.info(LogUtil.domain, LogUtil.tag, LogUtil.format.repeat(args.length), args) } }
AST#method_declaration#Left static info AST#parameter_list#Left ( AST#parameter#Left ... args : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AS...
static info(...args: string[]): void { if (LogUtil.showLog) { hilog.info(LogUtil.domain, LogUtil.tag, LogUtil.format.repeat(args.length), args) } }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/LogUtil.ets#L64-L68
503b4c031f7fa57c521077579fb5d78d9b343a80
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/view/SkeletonLoader.ets
arkts
startDotAnimation
启动打字点动画
private startDotAnimation(): void { this.dotTimer = setInterval(() => { this.dotIndex = (this.dotIndex + 1) % 4; }, 400); }
AST#method_declaration#Left private startDotAnimation 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#assignment_expression#L...
private startDotAnimation(): void { this.dotTimer = setInterval(() => { this.dotIndex = (this.dotIndex + 1) % 4; }, 400); }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/view/SkeletonLoader.ets#L27-L31
09a9d41e48b69b43bb4e6deaf713bc930c329a93
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/AppUtil.ets
arkts
setWindowKeepScreenOn
设置屏幕是否为常亮状态。该方法已过时,推荐使用:WindowUtil.setWindowKeepScreenOn()
static async setWindowKeepScreenOn(isKeepScreenOn: boolean, windowClass: window.Window = AppUtil.getMainWindow()): Promise<void> { return WindowUtil.setWindowKeepScreenOn(isKeepScreenOn, windowClass); }
AST#method_declaration#Left static async setWindowKeepScreenOn AST#parameter_list#Left ( AST#parameter#Left isKeepScreenOn : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary...
static async setWindowKeepScreenOn(isKeepScreenOn: boolean, windowClass: window.Window = AppUtil.getMainWindow()): Promise<void> { return WindowUtil.setWindowKeepScreenOn(isKeepScreenOn, windowClass); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/AppUtil.ets#L592-L594
b03767d91ffe604634a3e372ef1689109228bc8d
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/settings/ThemeCustomizationPage.ets
arkts
buildCustomizationSection
构建个性化设置
@Builder buildCustomizationSection() { Card() { Column({ space: UIConstants.DEFAULT_PADDING }) { Text('个性化设置') .fontSize(UIConstants.FONT_SIZE_HEADING) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.text_primary')) // 视觉效果开关 Column({ space: UIC...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildCustomizationSection 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 Card ( ) AST#container_content_body#Left { AST#a...
@Builder buildCustomizationSection() { Card() { Column({ space: UIConstants.DEFAULT_PADDING }) { Text('个性化设置') .fontSize(UIConstants.FONT_SIZE_HEADING) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.text_primary')) Column({ space: UIConstants....
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L508-L623
f24b31aca388a7eb61993aaa1ac248457cc89548
github
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/actions/MessageReactionRemoveAll.ets
arkts
handle
应用ArkTS约束:方法参数需要明确类型(约束1)
handle(data: Object): Object | boolean { // 应用ArkTS约束:使用get方法需要确保类型安全(约束21) const channel = this.client.channels.get(data['channel_id']); if (!channel || channel.type === 'voice') return false; const message = channel.messages.get(data['message_id']); if (!message) return false; message._clear...
AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : 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#union_type#Left AST#primary_type#Left Object AST#pri...
handle(data: Object): Object | boolean { const channel = this.client.channels.get(data['channel_id']); if (!channel || channel.type === 'voice') return false; const message = channel.messages.get(data['message_id']); if (!message) return false; message._clearReactions(); this.client....
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/MessageReactionRemoveAll.ets#L8-L21
fe39f3e75db1612d2339b34534bbdc1f6784eea0
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
UseSendable/entry/src/main/ets/pages/ConcurrentTaskManagement1.ets
arkts
ConcurrentTaskManagement1
[End seq_runner]
@Component export struct ConcurrentTaskManagement1 { @Styles buttonStyles() { .width('100%') .height(40) } build() { NavDestination() { Column() { Button($r('app.string.multitasking_title')) .buttonStyles() .margin({ bottom: 16 }) .o...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ConcurrentTaskManagement1 AST#component_body#Left { AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right buttonStyles AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_bod...
@Component export struct ConcurrentTaskManagement1 { @Styles buttonStyles() { .width('100%') .height(40) } build() { NavDestination() { Column() { Button($r('app.string.multitasking_title')) .buttonStyles() .margin({ bottom: 16 }) .o...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/UseSendable/entry/src/main/ets/pages/ConcurrentTaskManagement1.ets#L74-L105
96912be04858d61673822846e047d422a90b6462
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/SecondaryLinkExample.ets
arkts
onIndexChange
监听一级列表获焦索引变化
onIndexChange() { const start = this.tagIndexPosition.start; const end = this.tagIndexPosition.end; if ((this.currentTagIndex === end || this.currentTagIndex === end - 1)) { let leftScrollCount: number = this.currentTagIndex + 1; leftScrollCount = leftScrollCount >= this.tagLists.length - 1 ? th...
AST#method_declaration#Left onIndexChange AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left start = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expressi...
onIndexChange() { const start = this.tagIndexPosition.start; const end = this.tagIndexPosition.end; if ((this.currentTagIndex === end || this.currentTagIndex === end - 1)) { let leftScrollCount: number = this.currentTagIndex + 1; leftScrollCount = leftScrollCount >= this.tagLists.length - 1 ? th...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/secondarylinkage/src/main/ets/pages/SecondaryLinkExample.ets#L245-L262
72afb69aced87c2045cc2635586021829e8823fe
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets
arkts
pushData
添加数据 @param data
public pushData(data: Comment): void { this.commentArray.push(data); this.notifyDataAdd(this.commentArray.length - 1); }
AST#method_declaration#Left public pushData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Comment AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Ri...
public pushData(data: Comment): void { this.commentArray.push(data); this.notifyDataAdd(this.commentArray.length - 1); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets#L65-L68
fd87068f9a2dd8f3a88c7a9a881d32b578655fcc
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/BarChartModel.ets
arkts
isDrawBarShadowEnabled
returns true if drawing shadows (maxvalue) for each bar is enabled, false if not @return
public isDrawBarShadowEnabled(): boolean { return this.mDrawBarShadow; }
AST#method_declaration#Left public isDrawBarShadowEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#...
public isDrawBarShadowEnabled(): boolean { return this.mDrawBarShadow; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/BarChartModel.ets#L231-L233
8c4c990dae85be417fac532ae48efe7e2a1ea181
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/OneWayTls.ets
arkts
selectCA
选择 CA 文件,并通过 worker 加载 CA 证书
selectCA() { let documentPicker = new picker.DocumentViewPicker(); documentPicker.select().then((result) => { if (result.length > 0) { caFileUri = result[0]; this.msgHistory += 'select file: ' + caFileUri + '\r\n'; this.canLoad = true; } }).catch((e: Error) => { thi...
AST#method_declaration#Left selectCA AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left documentPicker = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expressi...
selectCA() { let documentPicker = new picker.DocumentViewPicker(); documentPicker.select().then((result) => { if (result.length > 0) { caFileUri = result[0]; this.msgHistory += 'select file: ' + caFileUri + '\r\n'; this.canLoad = true; } }).catch((e: Error) => { thi...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/OneWayTls.ets#L210-L221
3408fed5f1af03dff16497606f42e253cc5bde9b
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Scroll.ets
arkts
VerticalScroll
@file 滚动布局组件 @author Joker.X 垂直滚动布局
@ComponentV2 export struct VerticalScroll { /** * 滚动控制器 */ @Param scroller: Scroller = new Scroller(); /** * 内容内边距 */ @Param paddingValue: Padding | Length | LocalizedPadding | undefined = undefined; /** * 外边距 */ @Param marginValue: Margin | Length | LocalizedMargin | undefined = und...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct VerticalScroll AST#component_body#Left { /** * 滚动控制器 */ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right scroller : AST#type_annotation#Left AST#primary_type#Left Scroller AST#prima...
@ComponentV2 export struct VerticalScroll { @Param scroller: Scroller = new Scroller(); @Param paddingValue: Padding | Length | LocalizedPadding | undefined = undefined; @Param marginValue: Margin | Length | LocalizedMargin | undefined = undefined; @Param fillMaxSize: boolean = false; @...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L11-L110
bf7a8c45d87f49d69c1b028fa649e3a862ee89a5
github
langwudong/browser.git
f44fff759c50c162739c1585149018e6f0277471
entry/src/main/ets/view/SettingDialog.ets
arkts
EngineBuilder
设置搜索引擎
@Builder EngineBuilder() { Row() { Text("搜索引擎") .margin({left: 15}) .fontSize(17) Select(this.searchEngine) .margin({right: 15}) .fontColor("#45A5FF") .selected(this.currentEngineIndex) .value(this.currentEngineName) .onSelect((index: number, value...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right EngineBuilder 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 Row ( ) AST#container_content_body#Left { AST#arkts_ui_eleme...
@Builder EngineBuilder() { Row() { Text("搜索引擎") .margin({left: 15}) .fontSize(17) Select(this.searchEngine) .margin({right: 15}) .fontColor("#45A5FF") .selected(this.currentEngineIndex) .value(this.currentEngineName) .onSelect((index: number, value...
https://github.com/langwudong/browser.git/blob/f44fff759c50c162739c1585149018e6f0277471/entry/src/main/ets/view/SettingDialog.ets#L47-L65
85132919736f60c43b52ebc07aa37d5f1e94c6dd
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/net/src/main/ets/rcp/BaseResponse.ets
arkts
@author open_9527 @date 2025/5/15 @desc 描述信息
export interface BaseResponse<T> { /** * 请求成功返回的数据 */ data?: T; /** *系统错误信息 */ error?: Error; }
AST#export_declaration#Left export AST#interface_declaration#Left interface BaseResponse AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#object_type#Left { /** * 请求成功返回的数据 */ AST#type_member#Left data ? : AST#type_annotation#Left AST#primary_type#Left ...
export interface BaseResponse<T> { data?: T; error?: Error; }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/net/src/main/ets/rcp/BaseResponse.ets#L7-L17
4f218d2bd6641f098b129e833d3632a3cde75b48
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/ability/NaturalLanguageExtract.ets
arkts
findPackageNearby
在位置附近查找包名(文本形式的)
private static findPackageNearby(fullText: string, position: number): string | null { const radius = 30; const start = Math.max(0, position - radius); const end = Math.min(fullText.length, position + radius); const context = fullText.substring(start, end); // 包名通常的格式 con...
AST#method_declaration#Left private static findPackageNearby AST#parameter_list#Left ( AST#parameter#Left fullText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left position : AST#type_annotation#Left AST#primary_type#Left n...
private static findPackageNearby(fullText: string, position: number): string | null { const radius = 30; const start = Math.max(0, position - radius); const end = Math.min(fullText.length, position + radius); const context = fullText.substring(start, end); const package...
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/ability/NaturalLanguageExtract.ets#L279-L290
99283e8521edca1569504a29f7db085af845ee78
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets
arkts
isNotNull
判断字符串是否为非空。true为非空空,否则false @param str @returns
static isNotNull(str: string | undefined | null): boolean { return false === StringUtil.isNull(str); }
AST#method_declaration#Left static isNotNull AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Rig...
static isNotNull(str: string | undefined | null): boolean { return false === StringUtil.isNull(str); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/commonLib/src/main/ets/utils/StringUtil.ets#L18-L20
286ab5efd53845a6068eafba88a88955c3247cfd
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.deviceInfo.d.ets
arkts
get
Obtains the first API version number. @syscap SystemCapability.Startup.SystemInfo @crossplatform @since 20 @arkts 1.2
static get firstApiVersion(): int;
AST#method_declaration#Left static get AST#ERROR#Left firstApiVersion AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left int AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right
static get firstApiVersion(): int;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.deviceInfo.d.ets#L305-L305
9e7b7cec50aac69fdf61898627f23db72355a38a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/analytics/AnalyticsService.ets
arkts
生日统计
export interface BirthdayStats { monthlyDistribution: MonthlyDistribution[]; ageDistribution: AgeDistribution[]; relationDistribution: RelationDistribution[]; zodiacDistribution: ZodiacDistribution[]; upcomingList: UpcomingBirthday[]; missedBirthdays: MissedBirthday[]; }
AST#export_declaration#Left export AST#interface_declaration#Left interface BirthdayStats AST#object_type#Left { AST#type_member#Left monthlyDistribution : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left MonthlyDistribution [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST...
export interface BirthdayStats { monthlyDistribution: MonthlyDistribution[]; ageDistribution: AgeDistribution[]; relationDistribution: RelationDistribution[]; zodiacDistribution: ZodiacDistribution[]; upcomingList: UpcomingBirthday[]; missedBirthdays: MissedBirthday[]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/analytics/AnalyticsService.ets#L145-L152
73cca7296e9a3e0a565e726db452fc4e4f9e1f9e
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/SavePhotoUtils.ets
arkts
saveFileToAlbum
保存指定路径的图片文件到系统相册 @param context 上下文对象 @param srcPath 图片源路径
static async saveFileToAlbum(srcPath: string) { try { const context = getAppContext() const helper = photoAccessHelper.getPhotoAccessHelper(context); const uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'jpeg'); const src = await fileIo.open(srcPath, fileIo.OpenMo...
AST#method_declaration#Left static async saveFileToAlbum AST#parameter_list#Left ( AST#parameter#Left srcPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_stat...
static async saveFileToAlbum(srcPath: string) { try { const context = getAppContext() const helper = photoAccessHelper.getPhotoAccessHelper(context); const uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'jpeg'); const src = await fileIo.open(srcPath, fileIo.OpenMo...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/SavePhotoUtils.ets#L53-L74
d696f89ba2e32cf8ebfda2ee532948fa25ca9d0e
github
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/services/ConfigService.ets
arkts
API配置接口
export interface ApiConfig { apiKey: string; baseUrl: string; model: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ApiConfig AST#object_type#Left { AST#type_member#Left apiKey : 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 baseUrl : AST#type_annotation#Lef...
export interface ApiConfig { apiKey: string; baseUrl: string; model: string; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/ConfigService.ets#L14-L18
b7a4549a71b5f470d717281a9a9506321e9c18de
github
fmtjava/Ohs_ArkTs_Eyepetizer.git
79578f394ccb926da1455e63b7fe0722df9b9a22
entry/src/main/ets/viewmodel/CategoryDetailViewModel.ets
arkts
hasMoreData
检查是否还有更多数据
hasMoreData(): boolean { return this.nextPageUrl !== null && this.nextPageUrl !== ''; }
AST#method_declaration#Left hasMoreData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#...
hasMoreData(): boolean { return this.nextPageUrl !== null && this.nextPageUrl !== ''; }
https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/viewmodel/CategoryDetailViewModel.ets#L11-L13
409e9c88db5d6f55d81e70472b32629d5b2e2735
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/LLMConfigPage.ets
arkts
hasProviderModels
检查是否有提供商模型
private hasProviderModels(): boolean { const providerInfo = this.getCurrentProviderInfo(); return providerInfo !== null && providerInfo.models.length > 0; }
AST#method_declaration#Left private hasProviderModels AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#L...
private hasProviderModels(): boolean { const providerInfo = this.getCurrentProviderInfo(); return providerInfo !== null && providerInfo.models.length > 0; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LLMConfigPage.ets#L72-L75
8315df44d65c04f17914d242af0b589996973d5f
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets
arkts
buildActionButtons
构建操作按钮
@Builder buildActionButtons() { Row({ space: UIConstants.DEFAULT_PADDING }) { Button('重置默认') .type(ButtonType.Normal) .backgroundColor($r('app.color.divider')) .fontColor($r('app.color.text_primary')) .layoutWeight(1) .onClick(() => this.resetToDefault()) Butto...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildActionButtons 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 Row ( AST#component_parameters#Left { AST#component_par...
@Builder buildActionButtons() { Row({ space: UIConstants.DEFAULT_PADDING }) { Button('重置默认') .type(ButtonType.Normal) .backgroundColor($r('app.color.divider')) .fontColor($r('app.color.text_primary')) .layoutWeight(1) .onClick(() => this.resetToDefault()) Butto...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L679-L700
c7ef5cad1c383fad844e82559fb226fd01b60dfb
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/AddressPopUpComponent.ets
arkts
AddressPopUpComponent
地址弹窗组件 @param addressDescription 弹框中需要显示的地址文本;设置为null时弹框不显示。 @param addressTip 弹框中需要显示的当前地址的一些提示,设置为null弹框左上角提示区域不展示。 @param tipBackgroundColor 提示文本的背景色。 @param addrImage 弹窗中需要展示的地址实景图,设置为null,弹窗中不展示实景图区域。 @param onImageClickCallback 实景图被点击时回调。 @param onAddrClickCallback 地址被点击时回调。 @param thumbTackWidth 用于设置大头针的宽度。 @par...
@AppRouter({ name: "mapthumbtack/AddressPopUpComponent" }) @Component export struct AddressPopUpComponent { @Link @Watch('onAddrChanged') addressDescription: string | null; @Link addressTip: string | null; @Link addressTipBackgroundColor: Color; @Link addrImage: PixelMap | ResourceStr | DrawableDescriptor | Ima...
AST#decorated_export_declaration#Left AST#decorator#Left @ AppRouter ( AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left name AST#property_name#Right : AST#expression#Left "mapthumbtack/AddressPopUpComponent" AST#expression#Right AST#property_assignment#Right } AST#object...
@AppRouter({ name: "mapthumbtack/AddressPopUpComponent" }) @Component export struct AddressPopUpComponent { @Link @Watch('onAddrChanged') addressDescription: string | null; @Link addressTip: string | null; @Link addressTipBackgroundColor: Color; @Link addrImage: PixelMap | ResourceStr | DrawableDescriptor | Ima...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/AddressPopUpComponent.ets#L30-L168
374329a670e9f4d6846b8534da413f31db883cf4
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/model/SearchManager.ets
arkts
getAllPart
获取所有分类
getAllPart(): Part[] { return [...this.parts]; }
AST#method_declaration#Left getAllPart AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Part [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return A...
getAllPart(): Part[] { return [...this.parts]; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L312-L314
9fde205e9cd5d9e19e15f2cc84e4053db21d7c66
github
openharmony-tpc-incubate/photo-deal-demo
01382ce30b1785f8fc8bc14f6b94f0a670a5b50b
library/src/main/ets/components/widget/SizePickerComponent.ets
arkts
SizePickerComponent
尺寸选择组件
@ComponentV2 export struct SizePickerComponent { @Local brushSizeArray: Array<number> = [BrushSize.tiny, BrushSize.small, BrushSize.big, BrushSize.large, BrushSize.huge] @Local selectedSize: number = BrushSize.large @Param @Require onPickSize: (size: number) => void build() { Row() { ForEach(this...
AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct SizePickerComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right brushSizeArray : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array ...
@ComponentV2 export struct SizePickerComponent { @Local brushSizeArray: Array<number> = [BrushSize.tiny, BrushSize.small, BrushSize.big, BrushSize.large, BrushSize.huge] @Local selectedSize: number = BrushSize.large @Param @Require onPickSize: (size: number) => void build() { Row() { ForEach(this...
https://github.com/openharmony-tpc-incubate/photo-deal-demo/blob/01382ce30b1785f8fc8bc14f6b94f0a670a5b50b/library/src/main/ets/components/widget/SizePickerComponent.ets#L21-L46
4c141d4a5a1305f950c2fd12d9faa755d17bc265
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/universal/events/dragEventSample/component/VideoDrag.ets
arkts
VideoDrag
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Component export struct VideoDrag { @State visible: boolean = true // 自定义拖拽过程中显示的内容 @Builder pixelMapBuilder() { Video({}) .width(400) .height(200) } build() { Video({}) .id('video') .width(400) .height(200) .visibility(this.visible ? Visibility.Visible : Visibil...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VideoDrag AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right visible : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotat...
@Component export struct VideoDrag { @State visible: boolean = true @Builder pixelMapBuilder() { Video({}) .width(400) .height(200) } build() { Video({}) .id('video') .width(400) .height(200) .visibility(this.visible ? Visibility.Visible : Visibility.Hidden) ...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/universal/events/dragEventSample/component/VideoDrag.ets#L16-L41
983ebd49c53b6e4ba0fa58a77b1bd403743f123d
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/common/types/SettingsTypes.ets
arkts
同步配置接口
export interface SyncConfig { enabled: boolean; provider: SyncProvider; lastSyncTime?: string; autoSync: boolean; syncInterval: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SyncConfig AST#object_type#Left { AST#type_member#Left enabled : 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 provider : AST#type_annotation...
export interface SyncConfig { enabled: boolean; provider: SyncProvider; lastSyncTime?: string; autoSync: boolean; syncInterval: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L655-L661
69fca65c760b7d3aca475a4a2032cff8f7e7e5b7
github
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Utils/DMPWindowUtils.ets
arkts
getTopSafeArea
系统返回的单位应该是px @param _windowStage @returns
public static getTopSafeArea(_windowStage: window.WindowStage): number { let windowClass: window.Window = _windowStage.getMainWindowSync(); // 获取应用主窗口 // 2. 获取布局避让遮挡的区域 let type = window.AvoidAreaType.TYPE_SYSTEM; // 以导航条避让为例 let avoidAreaTop = windowClass.getWindowAvoidArea(type); const heightTop ...
AST#method_declaration#Left public static getTopSafeArea AST#parameter_list#Left ( AST#parameter#Left _windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_l...
public static getTopSafeArea(_windowStage: window.WindowStage): number { let windowClass: window.Window = _windowStage.getMainWindowSync(); let type = window.AvoidAreaType.TYPE_SYSTEM; let avoidAreaTop = windowClass.getWindowAvoidArea(type); const heightTop = avoidAreaTop.topRect.height; DM...
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Utils/DMPWindowUtils.ets#L74-L84
bacf42a0cde78422e99a1c42f3260ded0b8f4c26
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/VideoPlayer/entry/src/main/ets/viewmodel/VideoSpeed.ets
arkts
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class VideoSpeed { text: string; value: number; constructor(text: string, value: number) { this.text = text; this.value = value; } }
AST#export_declaration#Left export AST#class_declaration#Left class VideoSpeed AST#class_body#Left { AST#property_declaration#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left value : AST#type...
export class VideoSpeed { text: string; value: number; constructor(text: string, value: number) { this.text = text; this.value = value; } }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/VideoPlayer/entry/src/main/ets/viewmodel/VideoSpeed.ets#L16-L24
bcd9cb9f3a54bef11050abf023c440dccda0f219
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/demo/entry/src/main/ets/views/ModeSwitchPage.ets
arkts
onChangeIsModeBol
暂停后点击停止 需要将暂停回复默认
onChangeIsModeBol(): void { this.isRecording = false; }
AST#method_declaration#Left onChangeIsModeBol 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#assignment_expression#Left AST#...
onChangeIsModeBol(): void { this.isRecording = false; }
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/demo/entry/src/main/ets/views/ModeSwitchPage.ets#L82-L84
eef36b35f0ef2af285cb546e0f2147afea3f2c6c
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/DriveTabsItem.ets
arkts
Interface of drive tab item.
export interface DriveTabsItem { img: Resource; title: Resource; intro: Resource; }
AST#export_declaration#Left export AST#interface_declaration#Left interface DriveTabsItem AST#object_type#Left { AST#type_member#Left img : 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 DriveTabsItem { img: Resource; title: Resource; intro: Resource; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Multi_device_V2/common/src/main/ets/viewmodel/DriveTabsItem.ets#L19-L23
81b261bcd3e68d8223df4bc1e872bb180da86421
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/userdata/UserDataManager.ets
arkts
MARK: - 用户数据管理器
export class UserDataManager { // MARK: - 用户数据加载 /** * 加载用户数据记录 * @param completion 完成回调(是否成功、错误信息、用户数据数组) */ static loadUserData(completion:(succeed: boolean, msg: string | null, userDataJsons: UserDataJson[] | null) => void) { const userId = UserManager.shared.userId; if (!UserManager.shared....
AST#export_declaration#Left export AST#class_declaration#Left class UserDataManager AST#class_body#Left { // MARK: - 用户数据加载 /** * 加载用户数据记录 * @param completion 完成回调(是否成功、错误信息、用户数据数组) */ AST#property_declaration#Left static loadUserData AST#ERROR#Left AST#parameter_list#Left ( AST#parameter#Left completion : AST...
export class UserDataManager { static loadUserData(completion:(succeed: boolean, msg: string | null, userDataJsons: UserDataJson[] | null) => void) { const userId = UserManager.shared.userId; if (!UserManager.shared.isLogin()) { completion(false, "User not logged in", null); return; } ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/userdata/UserDataManager.ets#L18-L45
b03ae76792b670884ef917c272e47bbbe85f8a59
github
wcmzllx/axis-render
34a330085691968cf1c132095e5ce078aa7ee933
AxisRenderLibrary/src/main/ets/common/AxisRender.ets
arkts
setIndicatorPosition
设置指示器位置 @param position
setIndicatorPosition(position: IndicatorPosition): void { this.getInstance().setIndicatorPosition(position.valueOf()) this.invalidate() }
AST#method_declaration#Left setIndicatorPosition AST#parameter_list#Left ( AST#parameter#Left position : AST#type_annotation#Left AST#primary_type#Left IndicatorPosition AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void ...
setIndicatorPosition(position: IndicatorPosition): void { this.getInstance().setIndicatorPosition(position.valueOf()) this.invalidate() }
https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L447-L450
bfcb03c37ee1adea2f38b5b46ad19314ef0b0345
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/chat/AIAssistantPage.ets
arkts
buildBirthdayCard
构建生日卡片
@Builder buildBirthdayCard(metadata: Map<string, string | number | boolean>) { Column({ space: 8 }) { Row({ space: 12 }) { Image($r('app.media.ic_cake')) .width('24vp') .height('24vp') .fillColor('#FF5722') Text(`${metadata.name}的生日`) .fontSize(16) ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBirthdayCard AST#parameter_list#Left ( AST#parameter#Left metadata : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Map AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
@Builder buildBirthdayCard(metadata: Map<string, string | number | boolean>) { Column({ space: 8 }) { Row({ space: 12 }) { Image($r('app.media.ic_cake')) .width('24vp') .height('24vp') .fillColor('#FF5722') Text(`${metadata.name}的生日`) .fontSize(16) ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/chat/AIAssistantPage.ets#L291-L327
e5497db039fd5fd6c3e48b273522ea657d6abca6
github
FantasyWind/fwrouter
eea785a7bf728862de1f88de487ef3857dee3364
libraryHar/Index.ets
arkts
BusinessScenePage
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 { BusinessScenePage } from './src/main/ets/pages/BusinessScenePage';
AST#export_declaration#Left export { BusinessScenePage } from './src/main/ets/pages/BusinessScenePage' ; AST#export_declaration#Right
export { BusinessScenePage } from './src/main/ets/pages/BusinessScenePage';
https://github.com/FantasyWind/fwrouter/blob/eea785a7bf728862de1f88de487ef3857dee3364/libraryHar/Index.ets#L15-L15
008fd3e73c727fd2bbcb0e6c455fdb5161283971
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/databaseupgrade/src/main/ets/utils/DBUtils.ets
arkts
restore
恢复数据库 @param callback 版本升级方法 @param version 版本
async restore(version: number): Promise<void> { if (store === undefined) { return; } await store.restore(version + Constants.DB_FILE_NAME_SUFFIX); }
AST#method_declaration#Left async restore AST#parameter_list#Left ( AST#parameter#Left version : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Pr...
async restore(version: number): Promise<void> { if (store === undefined) { return; } await store.restore(version + Constants.DB_FILE_NAME_SUFFIX); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/databaseupgrade/src/main/ets/utils/DBUtils.ets#L203-L208
385d81d2781753aca0aa57cdc7b4b56f1909d0fa
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
eftool/src/main/ets/core/media/AudioUtil.ets
arkts
release
销毁释放音频采集器
static async release() { // 采集器状态不是STATE_RELEASED或STATE_NEW状态,才能release if ((AudioUtil.audioCapturer as audio.AudioCapturer).state.valueOf() === audio.AudioState.STATE_RELEASED || (AudioUtil.audioCapturer as audio.AudioCapturer).state.valueOf() === audio.AudioState.STATE_NEW) { return; } //释...
AST#method_declaration#Left static async release AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 采集器状态不是STATE_RELEASED或STATE_NEW状态,才能release AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#...
static async release() { if ((AudioUtil.audioCapturer as audio.AudioCapturer).state.valueOf() === audio.AudioState.STATE_RELEASED || (AudioUtil.audioCapturer as audio.AudioCapturer).state.valueOf() === audio.AudioState.STATE_NEW) { return; } await (AudioUtil.audioCapturer as audio.Audi...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/core/media/AudioUtil.ets#L113-L121
6bc1a4da258803221490a40181aaa8d107d3760d
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/ChatLog.ets
arkts
ChatLog insert data
export interface ChatLogData { date: string; content: string; is_user: number; emotion: string; timestamp: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ChatLogData AST#object_type#Left { AST#type_member#Left date : 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 content : AST#type_annotation#Lef...
export interface ChatLogData { date: string; content: string; is_user: number; emotion: string; timestamp: number; }
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/ChatLog.ets#L21-L27
29b637fe60518a36a89af18e6bea1ef9fe588739
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/web/WebSearchService.ets
arkts
getInstance
获取单例实例
public static getInstance(): WebSearchService { if (!WebSearchService.instance) { WebSearchService.instance = new WebSearchService(); } return WebSearchService.instance; }
AST#method_declaration#Left public static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left WebSearchService 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#expres...
public static getInstance(): WebSearchService { if (!WebSearchService.instance) { WebSearchService.instance = new WebSearchService(); } return WebSearchService.instance; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/web/WebSearchService.ets#L91-L96
71c0ca6590df511ccdc57595086e5dd54841fc28
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/LazyForEach.ets
arkts
Prepare
@param parent @param itemCount @param offset of LazyForEach in parent's children
static Prepare(parent: PeerNode, itemCount: int32, offset: int32): void { // if (!LazyForEachManager.isDummy) // LazyForEachOps.Prepare(parent.peer.ptr, itemCount, offset) }
AST#method_declaration#Left static Prepare AST#parameter_list#Left ( AST#parameter#Left parent : AST#type_annotation#Left AST#primary_type#Left PeerNode AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left itemCount : AST#type_annotation#Left AST#primary_type#Left int32 AST#primary_...
static Prepare(parent: PeerNode, itemCount: int32, offset: int32): void { }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/LazyForEach.ets#L86-L89
c42166eacb59a5fde8e26523db3bbb5d5cca766a
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Select/entry/src/main/ets/pages/components/form.ets
arkts
resetForm
重置表单
private resetForm() { this.formData = { username: '', password: '', confirmPassword: '', gender: 0, age: 18, hobbies: [false, false, false, false], province: '', city: '', address: '', agree: false, deliveryTime: '09:00-12:00', paymentMethod: '...
AST#method_declaration#Left private resetForm AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . formData AST#member_expression#R...
private resetForm() { this.formData = { username: '', password: '', confirmPassword: '', gender: 0, age: 18, hobbies: [false, false, false, false], province: '', city: '', address: '', agree: false, deliveryTime: '09:00-12:00', paymentMethod: '...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/form.ets#L221-L239
e90328917ffbf523fc01ec5b64ff923d5bfb1855
gitee
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/TaskViewModel.ets
arkts
getTasksByPriority
根据优先级获取任务
getTasksByPriority(priority: string): TaskItem[] { return this.tasks.filter(task => task.priority === priority); }
AST#method_declaration#Left getTasksByPriority AST#parameter_list#Left ( AST#parameter#Left priority : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Lef...
getTasksByPriority(priority: string): TaskItem[] { return this.tasks.filter(task => task.priority === priority); }
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/TaskViewModel.ets#L442-L444
5da115e1c5f3e53252238060e03b5ceab3681193
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/component/LoadingView.ets
arkts
LoadingView
TODO Loading组件 author: 桃花镇童长老ᥫ᭡ since: 2024/08/01
@Component export struct LoadingView { @Prop options: LoadingOptions; @State content: string = ''; aboutToAppear(): void { if (this.options.content) { this.content = Helper.getResourceStr(this.options.content) ?? ""; } } build() { Column() { SpinKit({ spinType: this.options.l...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct LoadingView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right options : AST#type_annotation#Left AST#primary_type#Left LoadingOptions AST#primary_type#Right AST#type...
@Component export struct LoadingView { @Prop options: LoadingOptions; @State content: string = ''; aboutToAppear(): void { if (this.options.content) { this.content = Helper.getResourceStr(this.options.content) ?? ""; } } build() { Column() { SpinKit({ spinType: this.options.l...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/component/LoadingView.ets#L25-L63
53c798f7f01e46bf18e881b9492486ecee39a668
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/AudioPlayer/entry/src/main/ets/common/utils/Logger.ets
arkts
Constructor. @param Prefix Identifies the log tag. @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF.
constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { this.prefix = prefix; this.domain = domain; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left prefix : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'MyApp' AST#expression#Right AST#parameter#Right , AST#parameter#Left domain : AST#type_annotati...
constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { this.prefix = prefix; this.domain = domain; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/AudioPlayer/entry/src/main/ets/common/utils/Logger.ets#L31-L34
2f93f0732c41a87b4e41374041515abc086e462b
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/TabsData.ets
arkts
首页tabBar信息
export class TabDataModel { // tabId用户切换tabContent id: number = 0; // tab类别 navData: string | undefined = undefined; constructor(id: number, navData: string) { this.navData = navData; this.id = id; } }
AST#export_declaration#Left export AST#class_declaration#Left class TabDataModel AST#class_body#Left { // tabId用户切换tabContent AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#prope...
export class TabDataModel { id: number = 0; navData: string | undefined = undefined; constructor(id: number, navData: string) { this.navData = navData; this.id = id; } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/functionalscenes/src/main/ets/model/TabsData.ets#L19-L29
666c0cf6e3de107f35b56bc0fef5cb003f35ac22
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/NotificationCenterService.ets
arkts
markAllAsRead
标记所有通知为已读
public markAllAsRead(): number { let count = 0; this.notifications.forEach(notification => { if (notification.status === NotificationStatus.UNREAD) { notification.status = NotificationStatus.READ; count++; } }); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, ...
AST#method_declaration#Left public markAllAsRead 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 coun...
public markAllAsRead(): number { let count = 0; this.notifications.forEach(notification => { if (notification.status === NotificationStatus.UNREAD) { notification.status = NotificationStatus.READ; count++; } }); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationCenterService.ets#L286-L298
57134d0b5246b2b60bfc00d560f3b4096dcec089
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets
arkts
deleteItem
Deletes an element at the specified index location
public deleteItem(index: number): void { this.dataArray.splice(index, 1); this.notifyDataDelete(index); }
AST#method_declaration#Left public deleteItem AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#...
public deleteItem(index: number): void { this.dataArray.splice(index, 1); this.notifyDataDelete(index); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets#L130-L133
3b7c35c2b9d1f3a9955db6272832cbef42888821
gitee