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
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/path_sensitive/explicit_jump_control/return_002_F.ets
arkts
Introduction 显式跳转控制- return-路径敏感
export function return_002_F(taint_src : string) { process(taint_src,"some_condition") }
AST#export_declaration#Left export AST#function_declaration#Left function return_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left {...
export function return_002_F(taint_src : string) { process(taint_src,"some_condition") }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/explicit_jump_control/return_002_F.ets#L6-L8
f1a0fcc284bcfc289c476ac096512ba365099afe
github
ccccjiemo/egl.git
d18849c3da975ccf9373fd09874aa5637ccbe6bd
Index.d.ets
arkts
swapInterval
eglSwapInterval
swapInterval(interval: number): boolean;
AST#method_declaration#Left swapInterval AST#parameter_list#Left ( AST#parameter#Left interval : 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 boolean AST#primary_type...
swapInterval(interval: number): boolean;
https://github.com/ccccjiemo/egl.git/blob/d18849c3da975ccf9373fd09874aa5637ccbe6bd/Index.d.ets#L224-L224
85cef6a5d51219b5198df0467c5b3e1a827f4820
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets
arkts
getContent
获取tab项内容 @param name - tab项标题 @returns: tab项内容
public getContent(name: string): WrappedBuilder<[ESObject]> | undefined { return this.tabsInfo.get(name)?.contentbuilder; }
AST#method_declaration#Left public getContent AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST...
public getContent(name: string): WrappedBuilder<[ESObject]> | undefined { return this.tabsInfo.get(name)?.contentbuilder; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/ComponentFactory.ets#L50-L52
d585434c8b3cb76a820f9a99769eebf5a4fba3ba
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/CustomAnimationTab/customanimationtab/src/main/ets/model/IndicatorAniamtionInfo.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export interface IndicatorAnimationInfo { // 背景条左边距 left: number; // 页签条便宜 offset: number; // 背景条高度 height: number; // 背景条宽度 width: number; // 是否初始化(true: 已初始化, false: 未初始化) flag: boolean; }
AST#export_declaration#Left export AST#interface_declaration#Left interface IndicatorAnimationInfo AST#object_type#Left { // 背景条左边距 AST#type_member#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; // 页签条便宜 AST#type_member#Left off...
export interface IndicatorAnimationInfo { left: number; offset: number; height: number; width: number; flag: boolean; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CustomAnimationTab/customanimationtab/src/main/ets/model/IndicatorAniamtionInfo.ets#L16-L27
0a0ae93f4329efff4d48bc6405e24b340a6c8eb2
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/StorageConst.ets
arkts
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class StorageConst { static readonly GB_MAGNITUDE: number = 1024 * 1024 * 1024 static readonly MB_MAGNITUDE: number = 1024 * 1024 static readonly KB_MAGNITUDE: number = 1024 static readonly GB_SYMBOL: string = 'GB' static readonly MB_SYMBOL: string = 'MB' static readonly KB_SYMBOL: string = 'KB' st...
AST#export_declaration#Left export AST#class_declaration#Left class StorageConst AST#class_body#Left { AST#property_declaration#Left static readonly GB_MAGNITUDE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#binary_expression#Left AST#...
export class StorageConst { static readonly GB_MAGNITUDE: number = 1024 * 1024 * 1024 static readonly MB_MAGNITUDE: number = 1024 * 1024 static readonly KB_MAGNITUDE: number = 1024 static readonly GB_SYMBOL: string = 'GB' static readonly MB_SYMBOL: string = 'MB' static readonly KB_SYMBOL: string = 'KB' st...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/StorageStatistic/entry/src/main/ets/utils/StorageConst.ets#L16-L24
c6c4c5d83c425272d77b7d903aedad93a8f788c5
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/VPNControl_Case/entry/src/main/ets/notification/WantAgentUtil.ets
arkts
createWantAgentForStartAbility
create wantAgent for start ability @param bundleName @param abilityName @return return the created WantAgent object.
async createWantAgentForStartAbility(bundleName: string, abilityName: string) { let wantAgentInfo: wantAgent.WantAgentInfo = { wants: [ { bundleName: bundleName, abilityName: abilityName } ], actionType: wantAgent.OperationType.START_ABILITY, requestCode: ...
AST#method_declaration#Left async createWantAgentForStartAbility AST#parameter_list#Left ( AST#parameter#Left bundleName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left abilityName : AST#type_annotation#Left AST#primary_ty...
async createWantAgentForStartAbility(bundleName: string, abilityName: string) { let wantAgentInfo: wantAgent.WantAgentInfo = { wants: [ { bundleName: bundleName, abilityName: abilityName } ], actionType: wantAgent.OperationType.START_ABILITY, requestCode: ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_NetManager/VPNControl_Case/entry/src/main/ets/notification/WantAgentUtil.ets#L27-L39
b885308ef7e245cae68ceada601cda32b7d1500e
gitee
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/components/ProgressContent.ets
arkts
ProgressContent
下载进度组件 @since 2022-06-06
@Component export struct ProgressContent { @StorageProp('updateStatus') private updateStatus: number = AppStorage.Get('updateStatus'); @StorageProp('downloadProgress') private downloadProgress: number = AppStorage.Get('downloadProgress'); @Builder ProgressView() { Stack({ alignContent: Alignment.Center }...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ProgressContent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ StorageProp ( AST#expression#Left 'updateStatus' AST#expression#Right ) AST#decorator#Right private updateStatus : AST#type_...
@Component export struct ProgressContent { @StorageProp('updateStatus') private updateStatus: number = AppStorage.Get('updateStatus'); @StorageProp('downloadProgress') private downloadProgress: number = AppStorage.Get('downloadProgress'); @Builder ProgressView() { Stack({ alignContent: Alignment.Center }...
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/components/ProgressContent.ets#L37-L91
3d3df08a05f5af9058e7832473285387df80e086
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/listexchange/src/main/ets/model/MockData.ets
arkts
Mock数据
export const MEMO_DATA: ListInfo[] = [ new ListInfo($r("app.media.list_exchange_ic_public_cards_filled"), '账户余额'), new ListInfo($r("app.media.list_exchange_ic_public_cards_filled2"), 'xx银行储蓄卡(1234)'), new ListInfo($r("app.media.list_exchange_ic_public_cards_filled3"), 'xx银行储蓄卡(1238)'), new ListInfo($r("app.medi...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left MEMO_DATA : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ListInfo [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#express...
export const MEMO_DATA: ListInfo[] = [ new ListInfo($r("app.media.list_exchange_ic_public_cards_filled"), '账户余额'), new ListInfo($r("app.media.list_exchange_ic_public_cards_filled2"), 'xx银行储蓄卡(1234)'), new ListInfo($r("app.media.list_exchange_ic_public_cards_filled3"), 'xx银行储蓄卡(1238)'), new ListInfo($r("app.medi...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/listexchange/src/main/ets/model/MockData.ets#L19-L24
7af8172093982de097607ffb804ee1e634cf4ac6
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GreetingTypes.ets
arkts
祝福语推荐结果接口
export interface GreetingRecommendation { greetings: GreetingTemplate[]; reason: string; confidence: number; personalizedFactors: string[]; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GreetingRecommendation AST#object_type#Left { AST#type_member#Left greetings : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left GreetingTemplate [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#typ...
export interface GreetingRecommendation { greetings: GreetingTemplate[]; reason: string; confidence: number; personalizedFactors: string[]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L451-L456
f760a3797a318f47785e7554cb09a922f8c0a979
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/AppUtility.ets
arkts
getNameOfMistake
used for quiz select @param mistake 错误类型 @returns 错误类型名称
static getNameOfMistake(mistake: string): string { // 需要在实际使用时传入context // 这里返回空字符串,实际使用时应从资源文件获取 return ""; }
AST#method_declaration#Left static getNameOfMistake AST#parameter_list#Left ( AST#parameter#Left mistake : 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#pri...
static getNameOfMistake(mistake: string): string { return ""; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/AppUtility.ets#L159-L163
cf51110b202048b6eeafa2a647df293dd474a627
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets
arkts
connect
连接设备
connect(bluetoothDevice: BluetoothDevice): boolean { Log.showInfo(TAG, `connect: bluetoothDevice = ${JSON.stringify(bluetoothDevice)}`); if (this.mGattClientDevice && this.mConnectBluetoothDevice && this.mConnectBluetoothDevice.deviceId === bluetoothDevice.deviceId) { Log.showWarn(TAG, `Trying to u...
AST#method_declaration#Left connect AST#parameter_list#Left ( AST#parameter#Left bluetoothDevice : AST#type_annotation#Left AST#primary_type#Left BluetoothDevice 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#p...
connect(bluetoothDevice: BluetoothDevice): boolean { Log.showInfo(TAG, `connect: bluetoothDevice = ${JSON.stringify(bluetoothDevice)}`); if (this.mGattClientDevice && this.mConnectBluetoothDevice && this.mConnectBluetoothDevice.deviceId === bluetoothDevice.deviceId) { Log.showWarn(TAG, `Trying to u...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/viewmodel/BluetoothClientModel.ets#L115-L139
b10d862cdc4b7152a616300991643e3872224f5a
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/model/ChatLog.ets
arkts
Unix timestamp in milliseconds
constructor( id: number = 0, date: string = '', content: string = '', isUser: boolean = true, emotion: string = 'neutral', timestamp: number = Date.now() ) { this.id = id; this.date = date; this.content = content; this.isUser = isUser; this.emotion = emotion; this.times...
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right AST#parameter#Right , AST#parameter#Left date : AST#type_annotation#Left AST#...
constructor( id: number = 0, date: string = '', content: string = '', isUser: boolean = true, emotion: string = 'neutral', timestamp: number = Date.now() ) { this.id = id; this.date = date; this.content = content; this.isUser = isUser; this.emotion = emotion; this.times...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/model/ChatLog.ets#L37-L51
8c876921d0c5d12080c8f67606efc5a9d4b32f0d
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets
arkts
getListFile
[End copy_distributed_to_sand] 查看文件列表
function getListFile(pathDir: string): void { let listFileOption: ListFileOptions = { recursion: false, listNum: 0, // 0表示不限制列出的文件数量 filter: { suffix: ['.png', '.jpg', '.txt', '.jpeg'], displayName: ['*'], fileSizeOver: 0, // 文件大小必须大于 0 字节 lastModifiedAfter: new Date(0).getTime() ...
AST#function_declaration#Left function getListFile AST#parameter_list#Left ( AST#parameter#Left pathDir : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primar...
function getListFile(pathDir: string): void { let listFileOption: ListFileOptions = { recursion: false, listNum: 0, filter: { suffix: ['.png', '.jpg', '.txt', '.jpeg'], displayName: ['*'], fileSizeOver: 0, lastModifiedAfter: new Date(0).getTime() } }; let files = fs.listF...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/DistributedFileSample/entry/src/main/ets/pages/Index.ets#L227-L243
61402ea52bc05a9fcc2d473f73443bfea0a8b9b1
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/Rect.ets
arkts
contains
Returns true if (x,y) is inside the rectangle. The left and top are considered to be inside, while the right and bottom are not. This means that for a x,y to be contained: left <= x < right and top <= y < bottom. An empty rectangle never contains any point. @param x The X coordinate of the point being tested for conta...
public contains(x: number, y: number): boolean { return this.left < this.right && this.top < this.bottom // check for empty first && x >= this.left && x < this.right && y >= this.top && y < this.bottom; }
AST#method_declaration#Left public contains AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AS...
public contains(x: number, y: number): boolean { return this.left < this.right && this.top < this.bottom && x >= this.left && x < this.right && y >= this.top && y < this.bottom; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/Rect.ets#L217-L220
d67a4e46b070849ba486ae8c34e1e0e5609991fd
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/ibestui/src/main/ets/IBestUIInitializer.ets
arkts
setIBestUIBaseStyle
设置 IBest UI 组件库基础样式 @returns {void} 无返回值
static setIBestUIBaseStyle(): void { IBestSetUIBaseStyle({ primary: $r("app.color.primary"), success: $r("app.color.success"), warning: $r("app.color.warning"), danger: $r("app.color.danger"), }); }
AST#method_declaration#Left static setIBestUIBaseStyle 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_component_statement#Left IBestSetUIBaseStyle ( AST#component_p...
static setIBestUIBaseStyle(): void { IBestSetUIBaseStyle({ primary: $r("app.color.primary"), success: $r("app.color.success"), warning: $r("app.color.warning"), danger: $r("app.color.danger"), }); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/ibestui/src/main/ets/IBestUIInitializer.ets#L25-L32
302e34922aadbc40030f0ab0afae03e3690c32a8
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets
arkts
updateIsDefaultAddress
更新默认地址状态 @param {boolean} value - 是否默认 @returns {void} 无返回值
updateIsDefaultAddress(value: boolean): void { this.isDefaultAddress = value; }
AST#method_declaration#Left updateIsDefaultAddress AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary...
updateIsDefaultAddress(value: boolean): void { this.isDefaultAddress = value; }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/AddressDetailViewModel.ets#L268-L270
8b72b3bbaa041b5280e9fb21515b4aad6084bceb
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/common/BillData.ets
arkts
统计数据接口
export interface BillStats { monthExpense: string; monthIncome: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface BillStats AST#object_type#Left { AST#type_member#Left monthExpense : 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 monthIncome : AST#type_anno...
export interface BillStats { monthExpense: string; monthIncome: string; }
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/common/BillData.ets#L15-L18
d7341dc6d4f4cc7609bbefc47f2e49ac181ff3fa
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTsConcurrent/MultithreadedConcurrency/WorkerIntroduction/har/Index.ets
arkts
MainPage
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { MainPage } from './src/main/ets/components/MainPage';
AST#export_declaration#Left export { MainPage } from './src/main/ets/components/MainPage' ; AST#export_declaration#Right
export { MainPage } from './src/main/ets/components/MainPage';
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTsConcurrent/MultithreadedConcurrency/WorkerIntroduction/har/Index.ets#L16-L16
6d86c2754a2809ab0ccd0fc985e937fa5d818dbe
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/ImageUtil.ets
arkts
计算,当固定容器宽高,选择Contain模式后,图片的实际宽高 @param componentW 容器宽 @param componentH @param imageW 图片宽 @param imageH @returns
export function getContainSize(componentW: number, componentH: number, imageW: number, imageH: number): Size { const size: Size = new Size(); // 如果组件宽高比更小,那么宽度会最大 const isWidthMax: boolean = componentW / componentH - imageW / imageH <= 0; if (isWidthMax) { size.width = componentW; size.height = componen...
AST#export_declaration#Left export AST#function_declaration#Left function getContainSize AST#parameter_list#Left ( AST#parameter#Left componentW : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left componentH : AST#type_annotat...
export function getContainSize(componentW: number, componentH: number, imageW: number, imageH: number): Size { const size: Size = new Size(); const isWidthMax: boolean = componentW / componentH - imageW / imageH <= 0; if (isWidthMax) { size.width = componentW; size.height = componentW / imageW * imageH...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/ImageUtil.ets#L24-L37
92d81d0f9f65294e450ff7505dcdbb69a8a7e462
gitee
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
common/src/main/ets/component/CheckingDots.ets
arkts
onDotTextPlayChange
bind dotTextPlay change running play
private onDotTextPlayChange() { if (this.dotTextPlay) { this.cycleDisplay(); } else { this.clearCheckingTid(); } }
AST#method_declaration#Left private onDotTextPlayChange 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 . dotTextPlay AST#member_expre...
private onDotTextPlayChange() { if (this.dotTextPlay) { this.cycleDisplay(); } else { this.clearCheckingTid(); } }
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/common/src/main/ets/component/CheckingDots.ets#L41-L47
56101281f7cd0ddb3cb28984068c404b607e298b
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/sync/EncryptionService.ets
arkts
encrypt
加密数据
async encrypt(data: string, password?: string, config?: EncryptionConfig): Promise<EncryptedData> { try { const encConfig = { ...this.defaultConfig, ...config }; const encPassword = password || await this.getDefaultPassword(); hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `E...
AST#method_declaration#Left async encrypt AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left password ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_typ...
async encrypt(data: string, password?: string, config?: EncryptionConfig): Promise<EncryptedData> { try { const encConfig = { ...this.defaultConfig, ...config }; const encPassword = password || await this.getDefaultPassword(); hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `E...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/EncryptionService.ets#L31-L69
4bcd12c57acc38c74a86c705f589171bf7f79314
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets
arkts
yearMonthTitle
年月信息标题。月视图和周视图显示年月信息,年视图只显示年信息。周视图中如果选中了日期,则优先根据选中日期显示年月信息。
@Builder yearMonthTitle() { Row() { Text(`${this.currentShowYear}年 ${this.tabSelectedIndex === CalendarViewType.YEAR ? '' : MONTHS[this.currentShowMonth-1]}`) .fontSize(FONT_SIZE * TEXT_SCALING) .fontWeight(FONT_WEIGHT_FIVE_HUNDRED) // 自定义添加日程组件 // monthViewController: ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right yearMonthTitle 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_elem...
@Builder yearMonthTitle() { Row() { Text(`${this.currentShowYear}年 ${this.tabSelectedIndex === CalendarViewType.YEAR ? '' : MONTHS[this.currentShowMonth-1]}`) .fontSize(FONT_SIZE * TEXT_SCALING) .fontWeight(FONT_WEIGHT_FIVE_HUNDRED) SchedulePoint({ mo...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets#L170-L189
a51a14deb17404770ab9608f5ea2e29a436ff9fb
gitee
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets
arkts
changeOrientation
Changes the preferred orientation of the window. @param orientation - The preferred orientation to set. This should be a value from the `window.Orientation` enum. @returns void - This function does not return any value.
changeOrientation(orientation: window.Orientation) { this.windowClass?.setPreferredOrientation(orientation); }
AST#method_declaration#Left changeOrientation AST#parameter_list#Left ( AST#parameter#Left orientation : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Orientation AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AS...
changeOrientation(orientation: window.Orientation) { this.windowClass?.setPreferredOrientation(orientation); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/VideoProcessBaseWeb/entry/src/main/ets/pages/Index.ets#L122-L124
a2554e34890fa8d2f95ba13e8bac9b1c88e788ba
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/social/SearchPage.ets
arkts
搜索结果接口
export interface SearchResult { posts: CommunityPost[]; topics: CommunityTopic[]; users: UserProfile[]; total: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface SearchResult AST#object_type#Left { AST#type_member#Left posts : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CommunityPost [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; ...
export interface SearchResult { posts: CommunityPost[]; topics: CommunityTopic[]; users: UserProfile[]; total: number; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/social/SearchPage.ets#L29-L34
192b5e4c6e82bb4be50ec30406d725e444891afb
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/ChartHighlighter.ets
arkts
getHighlight
@Override
public getHighlight(x: number, y: number): Highlight { var pos: MPPointD = this.getValsForTouch(x, y); var xVal: number = pos.x; MPPointD.recycleInstance(pos); var high: Highlight = this.getHighlightForX(xVal, x, y); return high; }
AST#method_declaration#Left public getHighlight AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Righ...
public getHighlight(x: number, y: number): Highlight { var pos: MPPointD = this.getValsForTouch(x, y); var xVal: number = pos.x; MPPointD.recycleInstance(pos); var high: Highlight = this.getHighlightForX(xVal, x, y); return high; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/ChartHighlighter.ets#L44-L51
b28a91c4bc1b6c28a583507153311359dbd5fb2a
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Overlay/entry/src/main/ets/pages/components/popup/UIContextPopup.ets
arkts
popupDemo
全局气泡的wrapperBuilder
@Builder export function popupDemo() { Row() { // popup 自定义高级组件 Popup({ // PopupIconOptions类型设置图标内容 icon: { image: $r('app.media.app_icon'), width: 32, height: 32, fillColor: Color.White, borderRadius: 16 } as PopupIconOptions, // PopupTextOption...
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function popupDemo 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#Lef...
@Builder export function popupDemo() { Row() { Popup({ icon: { image: $r('app.media.app_icon'), width: 32, height: 32, fillColor: Color.White, borderRadius: 16 } as PopupIconOptions, title: { text: 'This is a popup with PopupOpti...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/popup/UIContextPopup.ets#L39-L88
ef4895cdbc1ae318e63d7952d1f9dfc5f466dda2
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SettingsPage.ets
arkts
loadSettings
加载设置数据
private async loadSettings(): Promise<void> { try { this.loading = true; // 加载应用设置 this.settings = await this.settingsService.getSettings(); // 加载统计数据 const contactStats = await this.contactService.getContactStatistics(); this.contactsCount = contactStats.total; ...
AST#method_declaration#Left private async loadSettings 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 loadSettings(): Promise<void> { try { this.loading = true; this.settings = await this.settingsService.getSettings(); const contactStats = await this.contactService.getContactStatistics(); this.contactsCount = contactStats.total; } catch (e...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SettingsPage.ets#L60-L76
a7620ee5d144876992c177280b82245f1238d3fa
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
entry/src/main/ets/common/component/TextMatchUtils.ets
arkts
抽象类
export abstract class TextMatchRegExp { getType(): number { return 0 } getRegExp(): RegExp { return new RegExp('') } /** 替换匹配到的字符串,不重写默认不替换 */ matchReplace(start: number, text: string): string { return text } }
AST#export_declaration#Left export AST#class_declaration#Left abstract class TextMatchRegExp AST#class_body#Left { AST#method_declaration#Left getType 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_s...
export abstract class TextMatchRegExp { getType(): number { return 0 } getRegExp(): RegExp { return new RegExp('') } matchReplace(start: number, text: string): string { return text } }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/common/component/TextMatchUtils.ets#L154-L168
a62015f673649c9b9c89999cc73518cadae4cf7c
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
calcNewLimit
When image changing, calc limit size again. @returns
private calcNewLimit(): RectF { let limit = new RectF(); limit.set(this.marginW, this.marginH, this.displayWidth - this.marginW, this.displayHeight - this.marginH); return limit; }
AST#method_declaration#Left private calcNewLimit AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RectF AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left limit...
private calcNewLimit(): RectF { let limit = new RectF(); limit.set(this.marginW, this.marginH, this.displayWidth - this.marginW, this.displayHeight - this.marginH); return limit; }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L386-L390
1a28fce7ddf5cce910065c001b55c8809d7f64f6
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.file.PhotoPickerComponent.d.ets
arkts
BadgeType. @enum { int } BadgeType @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core @atomicservice @since 21
export declare enum BadgeType { /** * BADGE_UPLOADED. Asset uploaded. * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 21 */ BADGE_UPLOADED = 0 }
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum BadgeType AST#enum_body#Left { /** * BADGE_UPLOADED. Asset uploaded. * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @atomicservice * @since 21 */ AST#enum_member#Left BADGE_UP...
export declare enum BadgeType { BADGE_UPLOADED = 0 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.PhotoPickerComponent.d.ets#L1196-L1205
f2a2a44090d4d8bf138b6711f04eca1f05fe840f
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.SubHeader.d.ets
arkts
Declare type SelectOption @syscap SystemCapability.ArkUI.ArkUI.Full @since 10 Declare type SelectOption @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 11 Declare type SelectOption @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 18
export declare class SelectOptions { /** * SubOption array of the select. * @type { Array<SelectSubOption> }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * SubOption array of the select. * @type { Array<SelectSubOption> }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class SelectOptions AST#class_body#Left { /** * SubOption array of the select. * @type { Array<SelectSubOption> }. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ /** * SubOption array of th...
export declare class SelectOptions { options: Array<SelectOption>; selected?: number; value?: ResourceStr; onSelect?: (index: number, value?: string) => void; defaultFocus?: boolean; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.SubHeader.d.ets#L249-L359
19abc3548a454ff0fcf3d078bc8bed0a0d3f206e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/SimpleBirthdayApp.ets
arkts
getCurrentWeekday
获取当前星期
private getCurrentWeekday(): string { const weekdays = ['日', '一', '二', '三', '四', '五', '六']; const today = new Date(); return weekdays[today.getDay()]; }
AST#method_declaration#Left private getCurrentWeekday AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Le...
private getCurrentWeekday(): string { const weekdays = ['日', '一', '二', '三', '四', '五', '六']; const today = new Date(); return weekdays[today.getDay()]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L765-L769
ae0de9cd17b2d81dfd48ea9f8e323f60acfbd1f4
github
queueit/harmony-sdk.git
ba7b4b38c03730bfbe305789acba6db0012d5f5c
entry/src/main/ets/pages/DemoPage.ets
arkts
createQueueListener
--- QueueListener Implementation ---
private createQueueListener(): QueueListener { return { onQueuePassed: (info: QueuePassedInfo) => { this.isLoadingSdk = false; this.sdkQueueToken = info.queueItToken; this.sdkQueueErrorMsg = ''; this.queueViewManager?.hideQueue(); ...
AST#method_declaration#Left private createQueueListener AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left QueueListener AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left ...
private createQueueListener(): QueueListener { return { onQueuePassed: (info: QueuePassedInfo) => { this.isLoadingSdk = false; this.sdkQueueToken = info.queueItToken; this.sdkQueueErrorMsg = ''; this.queueViewManager?.hideQueue(); ...
https://github.com/queueit/harmony-sdk.git/blob/ba7b4b38c03730bfbe305789acba6db0012d5f5c/entry/src/main/ets/pages/DemoPage.ets#L122-L175
d63c8232b2fcb0d669a62ab12d37dec7d374848d
github
njkndxz/learn-ArkTs.git
70fabab8ee28e3637329d53a4ec93afc72a001c2
entry/src/main/ets/pages/学习/10.背景图片.ets
arkts
@State message: string = 'Hello World123';
build() { // build里面只能有一个容器组件 // 使用space控制组件间的距离 Column({ space: 20 }) { Text('我是内容文本') .fontColor(Color.Transparent) .width(200) .height(100) .backgroundColor(Color.Pink) .backgroundImage($r('app.media.startIcon'), ImageRepeat.XY) // .backgroundImagePos...
AST#build_method#Left build ( ) AST#build_body#Left { // build里面只能有一个容器组件 // 使用space控制组件间的距离 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#Left space : AST#expression#Left 20 AST#expression#Right AST#component_paramete...
build() { Column({ space: 20 }) { Text('我是内容文本') .fontColor(Color.Transparent) .width(200) .height(100) .backgroundColor(Color.Pink) .backgroundImage($r('app.media.startIcon'), ImageRepeat.XY) .backgroundImagePosition({ x: vp2px(50),...
https://github.com/njkndxz/learn-ArkTs.git/blob/70fabab8ee28e3637329d53a4ec93afc72a001c2/entry/src/main/ets/pages/学习/10.背景图片.ets#L8-L37
36e85ed2e0327e248a6873fedd75e2f3e23609c2
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets
arkts
订单统计数据模型
export interface OrderCount { pendingPayment: number; pendingShipment: number; pendingReceive: number; pendingReview: number; refunding: number; refunded: number; }
AST#export_declaration#Left export AST#interface_declaration#Left interface OrderCount AST#object_type#Left { AST#type_member#Left pendingPayment : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left pendingShipment : AST#ty...
export interface OrderCount { pendingPayment: number; pendingShipment: number; pendingReceive: number; pendingReview: number; refunding: number; refunded: number; }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets#L99-L106
8ae315ceb11453e439f00b32d9ed8ede592569c3
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/VoiceService.ets
arkts
speakGreeting
朗读生日祝福语
async speakGreeting(greeting: Greeting, contact: Contact): Promise<void> { try { const greetingText = `为${contact.name}朗读生日祝福:${greeting.content}`; await this.speakText(greetingText, { rate: 0.8, // 稍慢的语速 pitch: 1.1 // 稍高的音调,更欢快 }); hilog.info(LogConstants.DOMAIN_APP, LogC...
AST#method_declaration#Left async speakGreeting AST#parameter_list#Left ( AST#parameter#Left greeting : AST#type_annotation#Left AST#primary_type#Left Greeting AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#p...
async speakGreeting(greeting: Greeting, contact: Contact): Promise<void> { try { const greetingText = `为${contact.name}朗读生日祝福:${greeting.content}`; await this.speakText(greetingText, { rate: 0.8, pitch: 1.1 }); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L217-L232
ba3a44334fc76c4baaf429da3071ce32cdbf5f39
github
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/dialog/DialogHelper.ets
arkts
onCancel
弹框辅助者 @since 2022-06-05
export namespace DialogHelper { /** * 弹框操作接口 * * @since 2022-06-05 */ export interface DialogOperator { /** * 取消 */ onCancel?: () => void; /** * 确认 */ onConfirm?: () => void; }
AST#export_declaration#Left export AST#ERROR#Left namespace DialogHelper { /** * 弹框操作接口 * * @since 2022-06-05 */ export in terface DialogOperator AST#ERROR#Right { /** * 取消 */ onCancel AST#ERROR#Left ? : ( ) => void ; /** * 确认 */ onConfirm ? : ( ) => void ; AST#ERROR#Right } AST#export_d...
export namespace DialogHelper { export interface DialogOperator { onCancel?: () => void; onConfirm?: () => void; }
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/dialog/DialogHelper.ets#L25-L41
69fa7677d80ce01c52e019a83b281e3d4bbcb2cc
gitee
openharmony/multimedia_camera_framework
9873dd191f59efda885bc06897acf9b0660de8f2
frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/views/SlideComponent.ets
arkts
SlideComponent
变焦组件
@Component export struct SlideComponent { // slide滑块 @StorageLink('zoomRatio') zoomRatio: number = 1; @StorageLink('sliderValue') sliderValue: SliderValue | undefined = undefined; private fractionDigits = 2; private xString = 'x'; aboutToDisappear(): void { } slideChange(value: number): void { Cam...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SlideComponent AST#component_body#Left { // slide滑块 AST#property_declaration#Left AST#decorator#Left @ StorageLink ( AST#expression#Left 'zoomRatio' AST#expression#Right ) AST#decorator#Right zoomRatio : AST#type_anno...
@Component export struct SlideComponent { @StorageLink('zoomRatio') zoomRatio: number = 1; @StorageLink('sliderValue') sliderValue: SliderValue | undefined = undefined; private fractionDigits = 2; private xString = 'x'; aboutToDisappear(): void { } slideChange(value: number): void { CameraService...
https://github.com/openharmony/multimedia_camera_framework/blob/9873dd191f59efda885bc06897acf9b0660de8f2/frameworks/js/camera_napi/cameraAnimSample/entry/src/main/ets/views/SlideComponent.ets#L23-L88
7d5ef6b426f449846f27502db02bfd2346f5055d
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/dbUtils/DBPrepare.ets
arkts
prepareDbIfNeeds
==================== 公有方法 ==================== 准备数据库文件(根据资源路径) @param protocol 数据库协议实现 @param context Ability上下文 @param resPath 资源路径对象 @param async 是否异步操作
static async prepareDbIfNeeds(protocol: DBPrepareProtocol, resPath: ResPath) { await DbPrepareUtils.prepareDbIfNeedsByPath(protocol, resPath.assetPath, resPath.filePath); }
AST#method_declaration#Left static async prepareDbIfNeeds AST#parameter_list#Left ( AST#parameter#Left protocol : AST#type_annotation#Left AST#primary_type#Left DBPrepareProtocol AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resPath : AST#type_annotation#Left AST#primary_type...
static async prepareDbIfNeeds(protocol: DBPrepareProtocol, resPath: ResPath) { await DbPrepareUtils.prepareDbIfNeedsByPath(protocol, resPath.assetPath, resPath.filePath); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBPrepare.ets#L36-L38
4b8e81e0e1a77eb358838407af2d83f9d96f833a
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/PieData.ets
arkts
A PieData object can only represent one DataSet. Unlike all other charts, the legend labels of the PieChart are created from the x-values array, and not from the DataSet labels. Each PieData object can only represent one PieDataSet (multiple PieDataSets inside a single PieChart are not possible).
export default class PieData extends ChartData<IPieDataSet> { constructor(dataSet?: IPieDataSet) { if (dataSet) { super([dataSet]); } else { super(); } } // public PieData(IPieDataSet dataSet) { // super(dataSet); // } /** * Sets the PieDataSet this data object should repres...
AST#export_declaration#Left export default AST#class_declaration#Left class PieData extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ChartData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left IPieDataSet AST#primary_type#Right AST#type_annotation#Right > AST#type_argu...
export default class PieData extends ChartData<IPieDataSet> { constructor(dataSet?: IPieDataSet) { if (dataSet) { super([dataSet]); } else { super(); } } public setDataSet(dataSet: IPieDataSet): void { if (this.mDataSets) { this.mDataSets.clear(); this.mDataSe...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/PieData.ets#L31-L119
cbc9f0f8f8e01e1cc00522d7fbb39ca6a3299b86
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/CommonTypes.ets
arkts
比较函数类型
export type Comparator<T> = (a: T, b: T) => number;
AST#export_declaration#Left export AST#type_declaration#Left type Comparator AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right = AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left a : AST#type_annotation#Left AST#primary_t...
export type Comparator<T> = (a: T, b: T) => number;
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L264-L264
c4be39855d37ca23682a1b9b4088e0802c5b7882
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
setGranularityEnabled
Enabled/disable granularity control on axis value intervals. If enabled, the axis interval is not allowed to go below a certain granularity. Default: false @param enabled
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
AST#method_declaration#Left public setGranularityEnabled AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST...
public setGranularityEnabled(enabled: boolean): void { this.mGranularityEnabled = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L409-L411
5930f8b7d2f549fa0f227668b0ba2c746b38dfcf
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/GridItem.ets
arkts
首页网格数据实体类
export default class GridItem { /** * 首页网格项的标题 */ title: Resource; /** * 首页网格项的图片 */ image: Resource = $r('app.media.ic_love'); /** * 首页网格项的其他资源 */ others?: Resource; constructor(title: Resource, image: Resource, others?: Resource) { this.title = title; this.image = image; t...
AST#export_declaration#Left export default AST#class_declaration#Left class GridItem AST#class_body#Left { /** * 首页网格项的标题 */ AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right /** * 首页网格...
export default class GridItem { title: Resource; image: Resource = $r('app.media.ic_love'); others?: Resource; constructor(title: Resource, image: Resource, others?: Resource) { this.title = title; this.image = image; this.others = others; } }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/GridItem.ets#L4-L23
0758cf30263fa6121c75a7a145896d56df3100bf
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
NEXT/XiaoXunAI/entry/src/main/ets/model/IChatDataSource.ets
arkts
聊天数据资源接口
export interface IChatDataSource extends IDataSource { /** * 添加数据函数 * * @param index * @param data */ addData(index: number, data: IChatMessage): void; /** * 插入数据函数 * * @param data */ pushData(data: ChatMessage): void; /** * 更新数据函数 * * @param index * @param data */...
AST#export_declaration#Left export AST#interface_declaration#Left interface IChatDataSource AST#extends_clause#Left extends IDataSource AST#extends_clause#Right AST#object_type#Left { /** * 添加数据函数 * * @param index * @param data */ AST#type_member#Left addData AST#parameter_list#Left ( AST#parameter#Left ...
export interface IChatDataSource extends IDataSource { addData(index: number, data: IChatMessage): void; pushData(data: ChatMessage): void; updateData(index: number, data: IChatMessage): void; removeData(index: number): void; clearData(): void; }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/XiaoXunAI/entry/src/main/ets/model/IChatDataSource.ets#L7-L43
fcb5c8f9af75c2dda34bebd173cce66cdd53c4c4
gitee
BohanSu/LumosAgent-HarmonyOS.git
9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76
entry/src/main/ets/view/ConfettiComponent.ets
arkts
initParticles
初始化粒子
private initParticles(): void { const colors = [ Constants.PRIMARY_COLOR, Constants.CYBER_CYAN, Constants.ACCENT_COLOR, Constants.EMOTION_HAPPY, Constants.EMOTION_EXCITED ]; for (let i = 0; i < this.particleCount; i++) { this.particles.push({ id: i, x: Ma...
AST#method_declaration#Left private initParticles AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left col...
private initParticles(): void { const colors = [ Constants.PRIMARY_COLOR, Constants.CYBER_CYAN, Constants.ACCENT_COLOR, Constants.EMOTION_HAPPY, Constants.EMOTION_EXCITED ]; for (let i = 0; i < this.particleCount; i++) { this.particles.push({ id: i, x: Ma...
https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/view/ConfettiComponent.ets#L41-L63
96f9525c1367ccf52e9c821b841626f284b461d4
github
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/exam/src/main/ets/components/SelectComponent.ets
arkts
getCheckBoxClickImage
多选-点击提交答案按钮时的图标展示 @param option 当前选项 @param selected 已选择 @param answer 答案 @returns 对应图标
function getCheckBoxClickImage(option: string, selected: Array<string>, answer: Array<string>): ResourceStr { if (selected.includes(option) && answer.includes(option)) { return $r('app.media.correct'); } if (selected.includes(option) && !answer.includes(option)) { return $r('app.media.error'); } if (!...
AST#function_declaration#Left function getCheckBoxClickImage AST#parameter_list#Left ( AST#parameter#Left option : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left selected : AST#type_annotation#Left AST#primary_type#Left AST...
function getCheckBoxClickImage(option: string, selected: Array<string>, answer: Array<string>): ResourceStr { if (selected.includes(option) && answer.includes(option)) { return $r('app.media.correct'); } if (selected.includes(option) && !answer.includes(option)) { return $r('app.media.error'); } if (!...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/components/exam/src/main/ets/components/SelectComponent.ets#L392-L403
888d70719c7bd4165d3c46ca993eed9ba2292c02
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Share transition id.
export const SHARE_TRANSITION_ID: string = 'shareId';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SHARE_TRANSITION_ID : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'shareId' AST#expression#Right AST#variable_declarator#Right ; AST#variab...
export const SHARE_TRANSITION_ID: string = 'shareId';
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets#L48-L48
fd7c396d1285a89c6e364e34247491da8158b2de
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/model/DatabaseModel.ets
arkts
query
Init when open the app @param date @param callback
query(date: string, callback: Function) { let result: TaskInfo[] = []; let self = this; GlobalInfoApi.query((globalResult: GlobalInfo) => { if (!globalResult.firstDate) { // if global information is not found, it is written let globalInfo: GlobalInfo = new GlobalInfo(date, date, 0, ''); ...
AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left date : 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#primary_type#Left Function AST#primary_type#Right ...
query(date: string, callback: Function) { let result: TaskInfo[] = []; let self = this; GlobalInfoApi.query((globalResult: GlobalInfo) => { if (!globalResult.firstDate) { let globalInfo: GlobalInfo = new GlobalInfo(date, date, 0, ''); GlobalInfoApi.insertData(globalInfo, (isDone: numb...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/model/DatabaseModel.ets#L32-L64
350399afd2dc7928fb7a98f823d46c207149d552
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/navigation/src/main/ets/goods/GoodsNavigator.ets
arkts
@file 商品模块导航封装 @author Joker.X
export class GoodsNavigator { /** * 跳转到商品详情 * @param {number} goodsId - 商品 ID * @returns {void} 无返回值 */ static toDetail(goodsId: number): void { const params: GoodsIdParam = { goodsId }; navigateTo(GoodsRoutes.Detail, params); } /** * 跳转到商品评价 * @param {number} goodsId - 商品 ID * @re...
AST#export_declaration#Left export AST#class_declaration#Left class GoodsNavigator AST#class_body#Left { /** * 跳转到商品详情 * @param {number} goodsId - 商品 ID * @returns {void} 无返回值 */ AST#method_declaration#Left static toDetail AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#p...
export class GoodsNavigator { static toDetail(goodsId: number): void { const params: GoodsIdParam = { goodsId }; navigateTo(GoodsRoutes.Detail, params); } static toComment(goodsId: number): void { const params: GoodsIdParam = { goodsId }; navigateTo(GoodsRoutes.Comment, params); } s...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/goods/GoodsNavigator.ets#L10-L51
ce596b4188c427b486d2f91a3f93e407349513e8
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
advanced_ui_component/dialogv2/source/dialogv2.ets
arkts
isDefaultFocus
is button set default focus @param singleButton button options @param isHasDefaultFocus is button list has default focus button @param isAllFocusFalse is all button in button list default focus false @returns boolean
function isDefaultFocus(singleButton?: AdvancedDialogV2Button, isHasDefaultFocus?: boolean, isAllFocusFalse?: boolean): boolean { try { // 当前按钮为默认按钮 if (singleButton?.defaultFocus) { return true; } let isDefaultFocus: boolean = false; if (isHasDefaultFocus || isAllFocusFalse) { isDef...
AST#function_declaration#Left function isDefaultFocus AST#parameter_list#Left ( AST#parameter#Left singleButton ? : AST#type_annotation#Left AST#primary_type#Left AdvancedDialogV2Button AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left isHasDefaultFocus ? : AST#type_annotation#Le...
function isDefaultFocus(singleButton?: AdvancedDialogV2Button, isHasDefaultFocus?: boolean, isAllFocusFalse?: boolean): boolean { try { if (singleButton?.defaultFocus) { return true; } let isDefaultFocus: boolean = false; if (isHasDefaultFocus || isAllFocusFalse) { isDefaultFocus = ...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/dialogv2/source/dialogv2.ets#L1588-L1608
52954cf8789add53abeeff8d16562bbcd451f0f2
gitee
yongoe1024/RdbPlus.git
4a3fc04ba5903bc1c1b194efbc557017976909dc
rdbplus/src/main/ets/core/MyWrapper.ets
arkts
getUpdateValue
获取更新的占位符参数
getUpdateValue() { return this.updateValueList }
AST#method_declaration#Left getUpdateValue AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . updateValueList AST#member_expression#Right AST#ex...
getUpdateValue() { return this.updateValueList }
https://github.com/yongoe1024/RdbPlus.git/blob/4a3fc04ba5903bc1c1b194efbc557017976909dc/rdbplus/src/main/ets/core/MyWrapper.ets#L81-L83
7ef320a82b7b421e3be422253f167cc57040ef26
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/theme/ThemeManager.ets
arkts
setFontConfig
设置字体配置
async setFontConfig(fontId: string): Promise<void> { try { const fontConfig = this.fontConfigs.find(f => f.id === fontId); if (!fontConfig || !this.currentTheme) { throw new Error('字体配置不存在'); } const oldFont = this.currentTheme.fontConfig; this.currentTheme.fontConfig = fontCo...
AST#method_declaration#Left async setFontConfig AST#parameter_list#Left ( AST#parameter#Left fontId : 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#Le...
async setFontConfig(fontId: string): Promise<void> { try { const fontConfig = this.fontConfigs.find(f => f.id === fontId); if (!fontConfig || !this.currentTheme) { throw new Error('字体配置不存在'); } const oldFont = this.currentTheme.fontConfig; this.currentTheme.fontConfig = fontCo...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/theme/ThemeManager.ets#L281-L304
774303900b9bb693805af6dd67085ab5b6ac0a7f
github
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api18/entry/src/main/ets/MainAbility/pages/MyDataSource.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export class BasicDataSource<T> implements IDataSource { private listeners: DataChangeListener[] = []; protected dataArray: T[] = []; public totalCount(): number { return this.dataArray.length; } public getData(index: number): T { return this.dataArray[index]; } registerDataChangeListener(liste...
AST#export_declaration#Left export AST#class_declaration#Left class BasicDataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left ...
export class BasicDataSource<T> implements IDataSource { private listeners: DataChangeListener[] = []; protected dataArray: T[] = []; public totalCount(): number { return this.dataArray.length; } public getData(index: number): T { return this.dataArray[index]; } registerDataChangeListener(liste...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api18/entry/src/main/ets/MainAbility/pages/MyDataSource.ets#L15-L77
99629e3ac686fe58d1ce3b02da2f30bb0aaa9df2
gitee
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets
arkts
Constructs the file name of history records in which history in [year, month] should be. @param year A number, the year, like 2024. @param month A number, the month, like 12. @returns A string, 'history_YYYY_MM.txt'
export function history_file_name_of_month(year: number, month: number) { let month_unified = month.toString(); if (month_unified.length == 1) { month_unified = '0' + month_unified; } return 'history_' + year.toString() + "_" + month_unified + '.txt'; }
AST#export_declaration#Left export AST#function_declaration#Left function history_file_name_of_month AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annota...
export function history_file_name_of_month(year: number, month: number) { let month_unified = month.toString(); if (month_unified.length == 1) { month_unified = '0' + month_unified; } return 'history_' + year.toString() + "_" + month_unified + '.txt'; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index_x_functions.ets#L279-L285
53917988397b4893efee25dcb8e9bfb8f234f331
gitee
Susuperli/ArkTsPlugin.git
d0a7d0cae1ef3bb3bd4a0af9a38cb353fa9da65f
examples/sample.ets
arkts
UserListComponent
Component with decorators
@Component export struct UserListComponent { @ObjectLink dataModel: DataModel; @State selectedUserId: number = -1; // Builder function @Builder UserItemBuilder(user: UserInfo) { Row() { Text(user.name) .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor(user.isActive ?...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct UserListComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ ObjectLink AST#decorator#Right dataModel : AST#type_annotation#Left AST#primary_type#Left DataModel AST#primary_type#Right...
@Component export struct UserListComponent { @ObjectLink dataModel: DataModel; @State selectedUserId: number = -1; @Builder UserItemBuilder(user: UserInfo) { Row() { Text(user.name) .fontSize(16) .fontWeight(FontWeight.Medium) .fontColor(user.isActive ? Color.Black : Colo...
https://github.com/Susuperli/ArkTsPlugin.git/blob/d0a7d0cae1ef3bb3bd4a0af9a38cb353fa9da65f/examples/sample.ets#L42-L144
0590c9ce8a85a101b1ce3f8cacd4f90916d50398
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/model/SearchManager.ets
arkts
refreshData
刷新数据(在数据修改后调用)
async refreshData(): Promise<void> { await this.loadWords(); }
AST#method_declaration#Left async refreshData 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_argu...
async refreshData(): Promise<void> { await this.loadWords(); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/SearchManager.ets#L92-L94
b7e498bf0ced38ff909cf2a104900f0e91cd9eb8
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/component/Row.ets
arkts
渲染布局 @returns {void} 无返回值 @example RowCenter() { Text("Hi"); }
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.Center, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginValue, ...
AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left RowBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expression#L...
build(): void { RowBase({ options: this.options, justifyContent: FlexAlign.Center, alignItems: VerticalAlign.Center, widthValue: this.widthValue, heightValue: this.heightValue, sizeValue: this.sizeValue, paddingValue: this.paddingValue, marginValue: this.marginValue, ...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L204-L219
300fbf6b553c3149c283cee311968c09c57522e5
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/utils/StrUtils.ets
arkts
notEqual
判断两个传入的数值或者是字符串是否不相等 @param source @param target @returns
static notEqual(source: string | number, target: string | number): boolean { return false === StrUtils.equal(source, target); }
AST#method_declaration#Left static notEqual AST#parameter_list#Left ( AST#parameter#Left source : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right , AS...
static notEqual(source: string | number, target: string | number): boolean { return false === StrUtils.equal(source, target); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/StrUtils.ets#L167-L169
99e5ff211ba79b7be83fa027c40f70abc6de8ba1
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/BatteryStatsUtil.ets
arkts
Binds battery data to components and provides interfaces.
export class BatteryStatsUtil { // 缓存应用 private applications: Array<bundleManager.ApplicationInfo> = []; private hardwareNames: Map<batteryStats.ConsumptionType, Resource> = new Map<batteryStats.ConsumptionType, Resource>(); private hardwareIcons: Map<batteryStats.ConsumptionType, Resource> = new Map<batterySta...
AST#export_declaration#Left export AST#class_declaration#Left class BatteryStatsUtil AST#class_body#Left { // 缓存应用 AST#property_declaration#Left private applications : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#...
export class BatteryStatsUtil { private applications: Array<bundleManager.ApplicationInfo> = []; private hardwareNames: Map<batteryStats.ConsumptionType, Resource> = new Map<batteryStats.ConsumptionType, Resource>(); private hardwareIcons: Map<batteryStats.ConsumptionType, Resource> = new Map<batteryStats.Cons...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/BatteryStatsUtil.ets#L31-L257
d2db1abdca26ee9f50648332173aa150c34786f0
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/database/src/main/ets/datasource/footprint/FootprintLocalDataSourceImpl.ets
arkts
removeFootprint
根据商品ID删除足迹记录 @param {number} goodsId 商品ID @returns {Promise<void>} Promise<void>
async removeFootprint(goodsId: number): Promise<void> { this.orm.deleteById(FootprintEntity, goodsId); }
AST#method_declaration#Left async removeFootprint AST#parameter_list#Left ( AST#parameter#Left goodsId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type...
async removeFootprint(goodsId: number): Promise<void> { this.orm.deleteById(FootprintEntity, goodsId); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/footprint/FootprintLocalDataSourceImpl.ets#L53-L55
09347b17ad2691161f103e6487c1830df00d0db0
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/CommonModel.ets
arkts
Group list of teletext titles.
export class TitleInfoList { title: ResourceStr; titleInfo: TitleInfo[]; constructor(title: ResourceStr, titleInfo: TitleInfo[]) { this.title = title; this.titleInfo = titleInfo; } }
AST#export_declaration#Left export AST#class_declaration#Left class TitleInfoList AST#class_body#Left { AST#property_declaration#Left title : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left titleIn...
export class TitleInfoList { title: ResourceStr; titleInfo: TitleInfo[]; constructor(title: ResourceStr, titleInfo: TitleInfo[]) { this.title = title; this.titleInfo = titleInfo; } }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/CommonModel.ets#L32-L40
2115838f91e7d8f648fcb8a5c7f9635b483bfd37
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/BaseDataSet.ets
arkts
setColorsByArr
Sets the colors that should be used fore this DataSet. Colors are reused as soon as the number of Entries the DataSet represents is higher than the size of the colors array. You can use "new int[] { R.color.red, R.color.green, ... }" to provide colors for this method. Internally, the colors are resolved using getResour...
public setColorsByArr(colors: number[]): void { if (this.mColors == null) { this.mColors = new JArrayList <Number>(); } this.mColors.clear(); for (let color of colors) { this.mColors.add(color); } }
AST#method_declaration#Left public setColorsByArr AST#parameter_list#Left ( AST#parameter#Left colors : 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...
public setColorsByArr(colors: number[]): void { if (this.mColors == null) { this.mColors = new JArrayList <Number>(); } this.mColors.clear(); for (let color of colors) { this.mColors.add(color); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BaseDataSet.ets#L174-L183
4fb3702845be69febd1ebe2e39c90de6732f242a
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_core/src/main/ets/core/util/Logger.ets
arkts
init
初始化Logger,只需传入应用名和域 @param prefix 应用名 @param domain 域
static init(prefix: string = 'efTool', ctx: common.Context, domain: number = 0xFF00) { Logger.prefix = prefix; Logger.domain = domain; //此处从1.1.6版本增加将日志写入文件 // let context = getContext() as common.UIAbilityContext; // let tempDir = context.tempDir; // 获取应用文件路径 if (ctx) { let logPath = ...
AST#method_declaration#Left static init 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 'efTool' AST#expression#Right AST#parameter#Right , AST#parameter#Left ctx : AST#type_annotation#Left...
static init(prefix: string = 'efTool', ctx: common.Context, domain: number = 0xFF00) { Logger.prefix = prefix; Logger.domain = domain; if (ctx) { let logPath = ctx.filesDir + '/logs'; } } fs.mkdirSync('./logs/'); let filePath = tempDir +...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/Logger.ets#L41-L62
6ba1e9612d6b63f1d4599165576dbe6af26dee38
gitee
zl3624/harmonyos_network_samples
b8664f8bf6ef5c5a60830fe616c6807e83c21f96
code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets
arkts
buf2String
ArrayBuffer转utf8字符串
function buf2String(buf: ArrayBuffer) { let msgArray = new Uint8Array(buf); let textDecoder = util.TextDecoder.create("utf-8"); return textDecoder.decodeWithStream(msgArray) }
AST#function_declaration#Left function buf2String AST#parameter_list#Left ( AST#parameter#Left buf : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_decla...
function buf2String(buf: ArrayBuffer) { let msgArray = new Uint8Array(buf); let textDecoder = util.TextDecoder.create("utf-8"); return textDecoder.decodeWithStream(msgArray) }
https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/tcp/SmtpClient/entry/src/main/ets/pages/Index.ets#L365-L369
7940f95920f66e5f37f581600bb99bcac4e4c7d2
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/data/LineDataSet.ets
arkts
setFillFormatter
Sets a custom IFillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. @param formatter
public setFillFormatter(formatter: IFillFormatter): void { if (!formatter) { this.mFillFormatter = new DefaultFillFormatter(); } else { this.mFillFormatter = formatter; } }
AST#method_declaration#Left public setFillFormatter AST#parameter_list#Left ( AST#parameter#Left formatter : AST#type_annotation#Left AST#primary_type#Left IFillFormatter AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void...
public setFillFormatter(formatter: IFillFormatter): void { if (!formatter) { this.mFillFormatter = new DefaultFillFormatter(); } else { this.mFillFormatter = formatter; } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineDataSet.ets#L359-L366
81e282812c0d6871ed66445917eab09846c8368a
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets
arkts
ImageText
自定义封装图文组件
@Component export struct ImageText { @State item: string | Resource = $r('app.string.dynamicattributes_text'); @State textOneContent: string | Resource = $r('app.string.dynamicattributes_text'); @State textTwoContent: string | Resource = $r('app.string.dynamicattributes_text'); @State textThreeContent: string |...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ImageText 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 string AST#primary_type#Right ...
@Component export struct ImageText { @State item: string | Resource = $r('app.string.dynamicattributes_text'); @State textOneContent: string | Resource = $r('app.string.dynamicattributes_text'); @State textTwoContent: string | Resource = $r('app.string.dynamicattributes_text'); @State textThreeContent: string |...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example3/common/CommonText.ets#L124-L157
a45b4696018a31a2bc30c04a2435a6bc747f7c76
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/util/src/main/ets/notification/NotificationUtil.ets
arkts
获取当前应用未删除的通知列表 @returns {Promise<Array<NotificationRequest>>} 返回当前应用的通知列表。
export async function getActiveList(): Promise<Array<notificationManager.NotificationRequest>> { return notificationManager.getActiveNotifications(); }
AST#export_declaration#Left export AST#function_declaration#Left async function getActiveList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left...
export async function getActiveList(): Promise<Array<notificationManager.NotificationRequest>> { return notificationManager.getActiveNotifications(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/notification/NotificationUtil.ets#L359-L361
95a3f07924bfae3c380687ca8e7ae539aea4e609
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Drawing/ArkTSGraphicsDraw/entry/src/main/ets/drawing/pages/CanvasGetResult.ets
arkts
2. 自定义NodeController
export class MyNodeControllerIndirectDisplay extends NodeController { private rootNode: FrameNode | null = null; private myRenderNode = new MyRenderNodeIndirectDisplay(); // 3. 在MyNodeController的aboutToAppear中创建PixeMap aboutToAppear(): void { let task = new taskpool.Task(createPixelMapAsync); taskpool....
AST#export_declaration#Left export AST#class_declaration#Left class MyNodeControllerIndirectDisplay extends AST#type_annotation#Left AST#primary_type#Left NodeController AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#property_declaration#Left private rootNode : AST#type_annotation#Left AST#u...
export class MyNodeControllerIndirectDisplay extends NodeController { private rootNode: FrameNode | null = null; private myRenderNode = new MyRenderNodeIndirectDisplay(); aboutToAppear(): void { let task = new taskpool.Task(createPixelMapAsync); taskpool.execute(task).then((pixel:Object)=>{ this...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Drawing/ArkTSGraphicsDraw/entry/src/main/ets/drawing/pages/CanvasGetResult.ets#L102-L132
c989d74e9d6c7ce1c608a06fd2fbd6d142ecc237
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/member/MemberManager.ets
arkts
get
会员过期时间(对应Swift中的expireDate计算属性)
get expireDate(): Date | null { // 调试模式返回当前日期 if (this.isDebug() && this.debugMember) { return new Date(); } // 获取订阅和礼品会员的过期时间,取较晚者 const subscribeDate = SubscribeManager.shared.currentItem?.expireDate ?? null; // const giftDate = GiftMemberManager.shared.expireDate; // return this.m...
AST#method_declaration#Left get AST#ERROR#Left expireDate AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Date AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Rig...
get expireDate(): Date | null { if (this.isDebug() && this.debugMember) { return new Date(); } const subscribeDate = SubscribeManager.shared.currentItem?.expireDate ?? null; return subscribeDate }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/member/MemberManager.ets#L124-L136
36e1dbb54106844b258b17d2a974210739a293ed
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/GreetingGenerationService.ets
arkts
getRelationText
辅助方法 - 获取关系文本
private getRelationText(relation: RelationType): string { switch (relation) { case RelationType.FAMILY: return '家人'; case RelationType.FRIEND: return '朋友'; case RelationType.COLLEAGUE: return '同事'; default: return '朋友'; } }
AST#method_declaration#Left private getRelationText AST#parameter_list#Left ( AST#parameter#Left relation : AST#type_annotation#Left AST#primary_type#Left RelationType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string ...
private getRelationText(relation: RelationType): string { switch (relation) { case RelationType.FAMILY: return '家人'; case RelationType.FRIEND: return '朋友'; case RelationType.COLLEAGUE: return '同事'; default: return '朋友'; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/GreetingGenerationService.ets#L537-L544
bbb98e4a78a7316095076dced121fa3248a08e7f
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.atomicservice.AtomicServiceSearch.d.ets
arkts
Defines the MenuAlign parameters. @typedef MenuAlignParams @syscap SystemCapability.ArkUI.ArkUI.Full @atomicservice @since 18
export interface MenuAlignParams { /** * Indicates the fontSize and fontColor of the search button. * * @type { MenuAlignType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ alignType: MenuAlignType; /** * Offset of the drop-down menu relative to the drop-down...
AST#export_declaration#Left export AST#interface_declaration#Left interface MenuAlignParams AST#object_type#Left { /** * Indicates the fontSize and fontColor of the search button. * * @type { MenuAlignType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 18 */ AST#type_member...
export interface MenuAlignParams { alignType: MenuAlignType; offset?: Offset; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.AtomicServiceSearch.d.ets#L128-L148
977e8875555c20387202da437affc5a1439cc04c
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/components/timer/CountDownTimerView.ets
arkts
updateCanvas
========== Canvas 更新 ==========
private updateCanvas() { try { if (this.ctx) { this.draw(this.ctx) } } catch(e) {} }
AST#method_declaration#Left private updateCanvas AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left this ...
private updateCanvas() { try { if (this.ctx) { this.draw(this.ctx) } } catch(e) {} }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/timer/CountDownTimerView.ets#L160-L162
939a30ea8ed8b23ab7891d841c2ed3b218ceb2b8
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Common constants for all features.
export default class CommonConstants { /** * Input length of the account. */ static readonly INPUT_ACCOUNT_LENGTH: number = 11; /** * Input length of the password. */ static readonly INPUT_PASSWORD_LENGTH: number = 8; /** * Common Spacing of Components. */ static readonly COMMON_SPACE: ...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Input length of the account. */ AST#property_declaration#Left static readonly INPUT_ACCOUNT_LENGTH : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotat...
export default class CommonConstants { static readonly INPUT_ACCOUNT_LENGTH: number = 11; static readonly INPUT_PASSWORD_LENGTH: number = 8; static readonly COMMON_SPACE: number = 12; static readonly LOGIN_WAIT_TIME: number = 2000; static readonly SUCCESS_PAGE_URL: string = 'pages/SuccessPa...
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/common/constants/CommonConstants.ets#L4-L125
debafd99b796b62d6c049ce4053355174b226df0
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/Router.ets
arkts
THEORY OF OPERATIONS Router is designed to navigate between multiple logical pages back and forth, with the following abilities: - keeping state when returning back - ability to modify navigation stack - ability to show several pages at once to allow cross-page animations We took the following approach in design: - r...
export enum RouterTransitionVisibility { Hidden = 0, Visible = 1, Showing = 2, Hiding = 3, }
AST#export_declaration#Left export AST#enum_declaration#Left enum RouterTransitionVisibility AST#enum_body#Left { AST#enum_member#Left Hidden = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left Visible = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_me...
export enum RouterTransitionVisibility { Hidden = 0, Visible = 1, Showing = 2, Hiding = 3, }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/handwritten/Router.ets#L58-L63
cc24d8cb4f21fa320f1b956157746cb8646573d7
gitee
IceYuanyyy/OxHornCampus.git
bb5686f77fa36db89687502e35898cda218d601f
entry/src/main/ets/viewmodel/PositionItem.ets
arkts
PixelCoordinates.
export class PixelCoordinates { coordinateX: number = 0; coordinateY: number = 0; }
AST#export_declaration#Left export AST#class_declaration#Left class PixelCoordinates AST#class_body#Left { AST#property_declaration#Left coordinateX : 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#property_declar...
export class PixelCoordinates { coordinateX: number = 0; coordinateY: number = 0; }
https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/viewmodel/PositionItem.ets#L45-L48
07516b5db3c77ad46aa73945c6c013fd6faa99be
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/app/constants/AppDefines.ets
arkts
👑
export const dFlashFlag = "\u26a1";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left dFlashFlag = AST#expression#Left "\u26a1" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right
export const dFlashFlag = "\u26a1";
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/constants/AppDefines.ets#L61-L61
b0161264f1d8d2a9c4506dd8ab26ba550a9d1da4
github
jerryzhou2/ArkTS-news-app.git
6dfa8631948f1def4269be5a48554b99ee64a18d
fluent-news-homepage-master/entry/src/main/ets/viewmodel/NewsDataSource.ets
arkts
notifyDataAdd
Notify the LazyForEach component that a subcomponent needs to be added to the index.
notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) }
AST#method_declaration#Left notifyDataAdd 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#Righ...
notifyDataAdd(index: number): void { this.listeners.forEach(listener => { listener.onDataAdd(index); }) }
https://github.com/jerryzhou2/ArkTS-news-app.git/blob/6dfa8631948f1def4269be5a48554b99ee64a18d/fluent-news-homepage-master/entry/src/main/ets/viewmodel/NewsDataSource.ets#L67-L71
ba892a0896e7a177e5c47f1cf24b5656eaac872c
github
kaina404/HarmonyStock.git
99233a46fb0dfb21e02294c730fd80e2fb404f9b
entry/src/main/ets/pages/component/FiveDayMinuteKLineComponent.ets
arkts
_reDrawAllCanvas
重新绘制
_reDrawAllCanvas() { this._clearCanvas() this.drawBackgroundLine() this.drawMinuteLine() }
AST#method_declaration#Left _reDrawAllCanvas AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . _clearCanvas AST#me...
_reDrawAllCanvas() { this._clearCanvas() this.drawBackgroundLine() this.drawMinuteLine() }
https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/FiveDayMinuteKLineComponent.ets#L47-L51
25cc29bac0edc3821e8a132199c6f015883421d1
github
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/StringUtils.ets
arkts
strToBase64
字符串转Base64字符串 @param src 字符串 @returns
static strToBase64(src: string): string { let uint8Array = StringUtils.strToUint8Array(src); let result = Base64Utils.encodeToStrSync(uint8Array); return result; }
AST#method_declaration#Left static strToBase64 AST#parameter_list#Left ( AST#parameter#Left 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#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static strToBase64(src: string): string { let uint8Array = StringUtils.strToUint8Array(src); let result = Base64Utils.encodeToStrSync(uint8Array); return result; }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/StringUtils.ets#L227-L231
95b8249bd3e5bf5b566d2ffdf7c241851e7d7d76
gitee
common-apps/ZRouter
5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6
RouterApi/src/main/ets/animation/NavAnimationMgr.ets
arkts
setIsAdaptImmersive
设置是否适配沉浸式,如果页面是沉浸式,则设置为true @param b
public setIsAdaptImmersive(b: boolean) { this._isAdaptImmersive = b return this }
AST#method_declaration#Left public setIsAdaptImmersive AST#parameter_list#Left ( AST#parameter#Left b : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_stat...
public setIsAdaptImmersive(b: boolean) { this._isAdaptImmersive = b return this }
https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L237-L240
4ccab0bfbc71537db1c381e94419eff74ef48f3b
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/mainpage/MainPage.ets
arkts
WebPageSnapshotComponent
功能说明:示例入口,通过Navigation跳转至Web页面和滚动组件页面 推荐场景:仅作为路由入口,不承载功能 核心组件: 1. WebPageSnapshotPage 2. ScrollableComponentSnapshotPage 实现步骤: 1. 主页面使用Navigation组件作为根容器,并绑定WebPageSnapshotPage和ScrollableComponentSnapshotPage子页面 2. 子页面使用NavDestination组件作为根容器,通过绑定路由栈到Navigation组件实现跳转
@Component export struct WebPageSnapshotComponent { // 注册路由返回函数,案例插件不触发 popRouter: () => void = () => { }; // Navigation路由栈 pageInfos: NavPathStack = new NavPathStack() aboutToAppear(): void { this.listenBackPress(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct WebPageSnapshotComponent AST#component_body#Left { // 注册路由返回函数,案例插件不触发 AST#property_declaration#Left popRouter : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => ...
@Component export struct WebPageSnapshotComponent { popRouter: () => void = () => { }; pageInfos: NavPathStack = new NavPathStack() aboutToAppear(): void { this.listenBackPress(); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/mainpage/MainPage.ets#L32-L42
b853e49df25a377fb11b3487f23083fa91a4fb61
gitee
xt1314520/IbestKnowTeach
61f0a7a3d328ad5a52de8fd699b9e1e94de0203b
entry/src/main/ets/utils/FileUtil.ets
arkts
copyUserFileToCache
将用户文件转换成缓存目录
static copyUserFileToCache(uri: string, fileData: FileData): Promise<boolean> { return new Promise<boolean>((resolve, reject) => { // 缓存目录 let cachePath = cacheDir + '/' + fileData.fileFullName try { let files = fs.openSync(uri, fs.OpenMode.READ_ONLY) fs.copyFileSync(files.fd, cach...
AST#method_declaration#Left static copyUserFileToCache AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fileData : AST#type_annotation#Left AST#primary_type#Left FileData AST...
static copyUserFileToCache(uri: string, fileData: FileData): Promise<boolean> { return new Promise<boolean>((resolve, reject) => { let cachePath = cacheDir + '/' + fileData.fileFullName try { let files = fs.openSync(uri, fs.OpenMode.READ_ONLY) fs.copyFileSync(files.fd, cachePath) ...
https://github.com/xt1314520/IbestKnowTeach/blob/61f0a7a3d328ad5a52de8fd699b9e1e94de0203b/entry/src/main/ets/utils/FileUtil.ets#L93-L107
6c7578a8592f94c00be4f82dcc7b4b48e05325aa
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamEditPage.ets
arkts
generateDateStrings
生成日期字符串选项,未来60天的日期
private generateDateStrings(): string[] { const options: string[] = []; for (let i = 0; i < 60; i++) { const date = CustomDate.afterDays(i); options.push(date.toString()); } return options; }
AST#method_declaration#Left private generateDateStrings 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_de...
private generateDateStrings(): string[] { const options: string[] = []; for (let i = 0; i < 60; i++) { const date = CustomDate.afterDays(i); options.push(date.toString()); } return options; }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamEditPage.ets#L609-L618
5141564cae38421869268cda5811ba69947b78d9
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/navigation/ScreenAdaptDemoNav.ets
arkts
ScreenAdaptDemoNav
@file 屏幕适配示例页导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function ScreenAdaptDemoNav(): void { ScreenAdaptDemoPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function ScreenAdaptDemoNav 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_cu...
@Builder export function ScreenAdaptDemoNav(): void { ScreenAdaptDemoPage(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/navigation/ScreenAdaptDemoNav.ets#L8-L11
fe05e9b35d7e39df08fd1da5acf150631d99efea
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/pages/common.ets
arkts
makeNode
必须要重写的方法,用于构建节点数、返回节点挂载在对应NodeContainer中 在对应NodeContainer创建的时候调用或者通过rebuild方法调用刷新
makeNode(uiContext: UIContext): FrameNode | null { // 该节点会被挂载在NodeContainer的父节点下 return this.rootNode; }
AST#method_declaration#Left makeNode AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext 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 Fram...
makeNode(uiContext: UIContext): FrameNode | null { return this.rootNode; }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/pages/common.ets#L61-L64
7bf32f7660d22034e121c6124ea7ca6fc2faeacd
gitee
xsdkhlgz/ATSOBJECT_OF_FIRST.git
8c14e875d7ec3f418bb7cdaae123a8fea87a7e76
entry/src/main/ets/view/welcome/UserPrivacyDialog.ets
arkts
UserPrivacyDialog
用户隐私协议对话框 预览 @Preview
@CustomDialog export default struct UserPrivacyDialog { controller:CustomDialogController confrim:()=> void concel:()=> void build() { Column({space:10}){ //1.标题 Text('欢迎使用实战项目') .fontSize(20) //字体加粗 .fontWeight(FontWeight.Bold) //2.内容 Text($r('app.string.us...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export default struct UserPrivacyDialog AST#component_body#Left { AST#property_declaration#Left controller : AST#ERROR#Left CustomDialogController confrim : AST#ERROR#Right AST#type_annotation#Left AST#function_type#Left AST#par...
@CustomDialog export default struct UserPrivacyDialog { controller:CustomDialogController confrim:()=> void concel:()=> void build() { Column({space:10}){ Text('欢迎使用实战项目') .fontSize(20) .fontWeight(FontWeight.Bold) Text($r('app.string.user_privacy_content...
https://github.com/xsdkhlgz/ATSOBJECT_OF_FIRST.git/blob/8c14e875d7ec3f418bb7cdaae123a8fea87a7e76/entry/src/main/ets/view/welcome/UserPrivacyDialog.ets#L7-L45
69c7511afbb97c97c920ed7eec0ab1086bd8f3ea
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/view/PrivacyPolicyPage.ets
arkts
构建隐私政策页面 @returns {void} 无返回值
build() { AppNavDestination({ title: "隐私政策", viewModel: this.vm }) { this.PrivacyPolicyContent(); } }
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left "隐私政策" AST#expression#Right AST#component_parameter#Right , AST#component_...
build() { AppNavDestination({ title: "隐私政策", viewModel: this.vm }) { this.PrivacyPolicyContent(); } }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/view/PrivacyPolicyPage.ets#L20-L27
4a6e20fe5eb387df5b6abbe88ff7ac0c6eacf274
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
advanced_ui_component/dialogv2/source/dialogv2.ets
arkts
getTitleAreaPadding
get title area padding @returns padding
private getTitleAreaPadding(): Padding { if (this.primaryTitle || this.secondaryTitle) { return { top: $r('sys.float.alert_title_padding_top'), right: $r('sys.float.alert_title_padding_right'), left: $r('sys.float.alert_title_padding_left'), bottom: $r('sys.float.alert_title_pa...
AST#method_declaration#Left private getTitleAreaPadding AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Padding 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_e...
private getTitleAreaPadding(): Padding { if (this.primaryTitle || this.secondaryTitle) { return { top: $r('sys.float.alert_title_padding_top'), right: $r('sys.float.alert_title_padding_right'), left: $r('sys.float.alert_title_padding_left'), bottom: $r('sys.float.alert_title_pa...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/dialogv2/source/dialogv2.ets#L1302-L1318
57269f567ab63bb0b6a7fe44735a335e34b1cd7b
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
addLimitLine
Adds a new LimitLine to this axis. @param l
public addLimitLine(l: LimitLine): void { this.mLimitLines.add(l); if (this.mLimitLines.size() > 6) { LogUtil.log("MPChart", "Warning! You have more than 6 LimitLines on your axis, do you really want " + "that?"); } }
AST#method_declaration#Left public addLimitLine AST#parameter_list#Left ( AST#parameter#Left l : AST#type_annotation#Left AST#primary_type#Left LimitLine 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 addLimitLine(l: LimitLine): void { this.mLimitLines.add(l); if (this.mLimitLines.size() > 6) { LogUtil.log("MPChart", "Warning! You have more than 6 LimitLines on your axis, do you really want " + "that?"); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L437-L445
44b1953b42e3fde03639bb9cd816e73b8b46818c
gitee
OHPG/FinVideo.git
2b288396af5b2a20a24575faa317b46214965391
entry/src/main/ets/data/Repository.ets
arkts
onPlaybackStopped
播放停止 @param id @param position @returns
public onPlaybackStopped(id: string, position: number): Promise<void> { return this.requireApi().onPlaybackStopped(id, position) }
AST#method_declaration#Left public onPlaybackStopped 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#Left position : AST#type_annotation#Left AST#primary_type#Left number AST#prim...
public onPlaybackStopped(id: string, position: number): Promise<void> { return this.requireApi().onPlaybackStopped(id, position) }
https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/data/Repository.ets#L191-L193
fe00ae90a966a9bf9bbcc562cbf434884480cb0f
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/proxy/BaseCustomBuilderProxy.ets
arkts
backgroundImage
设置弹窗背景图片 @param backgroundImage 图片 @param backgroundImageSize @returns
backgroundImage(backgroundImage: ResourceStr, backgroundImageSize: ImageSize = ImageSize.FILL) { this.builderOptions.backgroundImage = backgroundImage; this.builderOptions.backgroundImageSize = backgroundImageSize; return this; }
AST#method_declaration#Left backgroundImage AST#parameter_list#Left ( AST#parameter#Left backgroundImage : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left backgroundImageSize : AST#type_annotation#Left AST#primary_type#...
backgroundImage(backgroundImage: ResourceStr, backgroundImageSize: ImageSize = ImageSize.FILL) { this.builderOptions.backgroundImage = backgroundImage; this.builderOptions.backgroundImageSize = backgroundImageSize; return this; }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/BaseCustomBuilderProxy.ets#L47-L51
221234379fe823d8cf994ceb08f39336c0e9f6f9
github
Classaspen/ArkTS_PasswordManagement.git
66aea6e4f8ee3a78e5029c63186dba70707ca2d9
entry/src/main/ets/pages/MainPage.ets
arkts
BuildCard
统一卡片构建方法
@Builder BuildCard(text: Resource, color: Resource, borderColor: Resource, onClick: () => void) { Button() { Text(text) .fontSize(22) // 增大字体 .fontColor(Color.White) .fontWeight(FontWeight.Bold) .textAlign(TextAlign.Center) } .backgroundColor(color) .border({ widt...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right BuildCard AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left color : AST#type_annotation#Left AS...
@Builder BuildCard(text: Resource, color: Resource, borderColor: Resource, onClick: () => void) { Button() { Text(text) .fontSize(22) .fontColor(Color.White) .fontWeight(FontWeight.Bold) .textAlign(TextAlign.Center) } .backgroundColor(color) .border({ width: 4, c...
https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/pages/MainPage.ets#L116-L131
4a40a1758782b45dbcd9480f1bf6c38e35af8829
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/view/WorldClock/ClockArea.ets
arkts
startDrawTask
启动绘画任务
private startDrawTask() { this.renderContext.translate( this.canvasSize / CommonConstants.DEFAULT_DOUBLE, this.canvasSize / CommonConstants.DEFAULT_DOUBLE); }
AST#method_declaration#Left private startDrawTask AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#...
private startDrawTask() { this.renderContext.translate( this.canvasSize / CommonConstants.DEFAULT_DOUBLE, this.canvasSize / CommonConstants.DEFAULT_DOUBLE); }
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/WorldClock/ClockArea.ets#L25-L29
ac995cc088686a77abe6eec7d6eb38e5c33c594b
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/CryptoUtil.ets
arkts
digestSync
摘要,同步 @param data 待摘要的数据 @param algName 摘要算法名(SHA1、SHA224、SHA256、SHA384、SHA512、MD5、SM3)。 @param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。 @returns
static digestSync(data: string, algName: string, resultCoding: crypto.BhCoding = 'hex'): string { let md = cryptoFramework.createMd(algName); //数据量较少时,可以只做一次update,将数据全部传入,接口未对入参长度做限制 md.updateSync({ data: CryptoHelper.strToUint8Array(data, 'utf-8') }); let dataBlob = md.digestSync(); let result = C...
AST#method_declaration#Left static digestSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left algName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty...
static digestSync(data: string, algName: string, resultCoding: crypto.BhCoding = 'hex'): string { let md = cryptoFramework.createMd(algName); md.updateSync({ data: CryptoHelper.strToUint8Array(data, 'utf-8') }); let dataBlob = md.digestSync(); let result = CryptoHelper.uint8ArrayToStr(dataBlob.data...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L511-L518
03e6f2f43e49f402a78152d0bdd2734ac4abeea0
gitee
JinnyWang-Space/guanlanwenjuan.git
601c4aa6c427e643d7bf42bc21945f658738e38c
entry/src/main/ets/entryability/EntryAbility.ets
arkts
onWindowStageCreate
正常启动
onWindowStageCreate(windowStage: window.WindowStage): void { // Main window is created, set main page for this ability Logger.info('[EntryAbility.onWindowStageCreate]', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err) => { if (err.code) { Logger.error('[EntryAbilit...
AST#method_declaration#Left onWindowStageCreate AST#parameter_list#Left ( AST#parameter#Left windowStage : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . WindowStage AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right ...
onWindowStageCreate(windowStage: window.WindowStage): void { Logger.info('[EntryAbility.onWindowStageCreate]', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err) => { if (err.code) { Logger.error('[EntryAbility.onWindowStageCreate]', 'Failed to load the content. Cau...
https://github.com/JinnyWang-Space/guanlanwenjuan.git/blob/601c4aa6c427e643d7bf42bc21945f658738e38c/entry/src/main/ets/entryability/EntryAbility.ets#L56-L70
3846df5d1bc81a349061ed2edbcf49ddaaf4b828
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/field_sensitive/container/map_field_sensitive_001_T.ets
arkts
Introduction Map域敏感
export function map_field_sensitive_001_T(taint_src : string) { let map = new Map<string,string>(); map.set("key1", taint_src) map.set("key2", "clean") taint.Sink(map.get("key1")!); }
AST#export_declaration#Left export AST#function_declaration#Left function map_field_sensitive_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_sta...
export function map_field_sensitive_001_T(taint_src : string) { let map = new Map<string,string>(); map.set("key1", taint_src) map.set("key2", "clean") taint.Sink(map.get("key1")!); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/field_sensitive/container/map_field_sensitive_001_T.ets#L6-L11
1c72e74351b4650d8c21f24ffefb34d66e7184c8
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_bookmarks.ets
arkts
move_folder
Moves a folder to another directory @param folder_path directory of folder to be moved @param to_path directory of destination @returns 0 if success @returns 1 if no folder selected @returns 2 if name crash @returns 3 if moving a folder to its sub folder
move_folder(folder_path: string, to_path: string) { if (folder_path == "") { console.log("[ERROR][Meow][bunch_of_bookmarks] Empty folder_path!") return 1; } if (to_path.indexOf(folder_path) == 0) { console.log("[ERROR][bunch_of_bookmarks] Cannot move myself to my sub folder!") return...
AST#method_declaration#Left move_folder AST#parameter_list#Left ( AST#parameter#Left folder_path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left to_path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t...
move_folder(folder_path: string, to_path: string) { if (folder_path == "") { console.log("[ERROR][Meow][bunch_of_bookmarks] Empty folder_path!") return 1; } if (to_path.indexOf(folder_path) == 0) { console.log("[ERROR][bunch_of_bookmarks] Cannot move myself to my sub folder!") return...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_bookmarks.ets#L307-L346
f6a5a587ab2954fa7bf9d05d54caadd884f0bdad
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/perfermance/customreusablepool/src/main/ets/view/SwiperView.ets
arkts
SwiperNode
自定义组件复用池瀑布流子组件
@Component export struct SwiperNode { @State type: string = ''; @State images:Resource[]=[]; @State builder: WrappedBuilder<ESObject> | null = null; private nodeItem: NodeItem = new NodeItem(); aboutToAppear(): void { this.nodeItem = NodePool.getInstance().getNode(this.type, this.images, 0, this.builder!...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SwiperNode AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation...
@Component export struct SwiperNode { @State type: string = ''; @State images:Resource[]=[]; @State builder: WrappedBuilder<ESObject> | null = null; private nodeItem: NodeItem = new NodeItem(); aboutToAppear(): void { this.nodeItem = NodePool.getInstance().getNode(this.type, this.images, 0, this.builder!...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/customreusablepool/src/main/ets/view/SwiperView.ets#L26-L48
d42dd441ac243cef2cb08f8ddd475ca8f4733640
gitee
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
common/src/main/ets/component/TitleBar.ets
arkts
TitleBar
titleBar @since 2022-06-06
@Component export struct TitleBar { private static readonly TAG = 'TitleBar'; private title: string | Resource; private onBack?: () => boolean; build() { Flex({ justifyContent: FlexAlign.SpaceBetween }) { Row() { Row() { Image($r('app.media.back')) .width($r('app.float.t...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TitleBar AST#component_body#Left { AST#property_declaration#Left private static readonly TAG = AST#expression#Left 'TitleBar' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left private...
@Component export struct TitleBar { private static readonly TAG = 'TitleBar'; private title: string | Resource; private onBack?: () => boolean; build() { Flex({ justifyContent: FlexAlign.SpaceBetween }) { Row() { Row() { Image($r('app.media.back')) .width($r('app.float.t...
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/common/src/main/ets/component/TitleBar.ets#L24-L59
00495b3444a9c0e66106fb1f793adbede4667a33
gitee
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/AppState.ets
arkts
notifyLoginStateChange
通知登录状态变更
private notifyLoginStateChange() { this.loginStateListeners.forEach(listener => listener(this._isLoggedIn)); }
AST#method_declaration#Left private notifyLoginStateChange AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#ex...
private notifyLoginStateChange() { this.loginStateListeners.forEach(listener => listener(this._isLoggedIn)); }
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/AppState.ets#L191-L193
ec58d28b704a87ea773112cad61eddf838a5faa3
github