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
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videolistautoplay/src/main/ets/view/XComponentVideo.ets
arkts
init
初始化AVPlayer
async init(): Promise<void> { await this.release(); // 创建avPlayer实例对象 this.avPlayer = await media.createAVPlayer(); this.isCreate = true // 创建状态机变化回调函数 await this.setSourceInfo(); // 视频信息上报函数 await this.setStateChangeCallback(); // 状态机上报回调函数 this.avPlayer.url = this.videoSrc; // 播放hls网络直...
AST#method_declaration#Left async init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#R...
async init(): Promise<void> { await this.release(); this.avPlayer = await media.createAVPlayer(); this.isCreate = true await this.setSourceInfo(); await this.setStateChangeCallback(); this.avPlayer.url = this.videoSrc; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videolistautoplay/src/main/ets/view/XComponentVideo.ets#L88-L97
730405d29fe3a96828297461d2e97896d86941d2
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_ui/src/main/ets/ui/prompt/ToastUtil.ets
arkts
showToast
弹出文本消息提示框,默认时长为2s,距离底部默认为20vp @param msg 提示消息 @param options: {duration:'',bottom:'',showMode:0} 提示参数duration为显示时长,bottom为距离底部位置,showMode设置弹窗是否显示在应用之上0内,1上
static showToast(msg: ResourceStr, options?: toastOptions): void { if (!options) { options = new toastOptions(); } promptAction.showToast({ message: msg, duration: options.duration ? options.duration : Const.ANIMATION_DURATION, bottom: options.bottom ? options.bottom : '20vp', ...
AST#method_declaration#Left static showToast AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left toastOptions AST...
static showToast(msg: ResourceStr, options?: toastOptions): void { if (!options) { options = new toastOptions(); } promptAction.showToast({ message: msg, duration: options.duration ? options.duration : Const.ANIMATION_DURATION, bottom: options.bottom ? options.bottom : '20vp', ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/prompt/ToastUtil.ets#L32-L43
640b5d7d06a8929d2fbcea6409dc1787426db18d
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11/entry/src/main/ets/MainAbility/pages/TextInput/TextinputIndex.ets
arkts
asNumber
import testsuite from '../../test/List.test'
function asNumber(value: number | string | Resource) { return value as number; }
AST#function_declaration#Left function asNumber AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_ty...
function asNumber(value: number | string | Resource) { return value as number; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_imageText/ace_ets_module_imageText_api11/entry/src/main/ets/MainAbility/pages/TextInput/TextinputIndex.ets#L21-L23
d38b167941d2fd8710868988c82b9e55a7ad10ff
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/GlobalInfo.ets
arkts
GlobalInfo @param firstDate @param lastDate @param checkInDays @param achievements
export default class GlobalInfo { firstDate: string; lastDate: string; checkInDays: number; achievements: string; constructor(firstDate: string, lastDate: string, checkInDays: number, achievements: string) { this.firstDate = firstDate; this.lastDate = lastDate; this.checkInD...
AST#export_declaration#Left export default AST#class_declaration#Left class GlobalInfo AST#class_body#Left { AST#property_declaration#Left firstDate : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left las...
export default class GlobalInfo { firstDate: string; lastDate: string; checkInDays: number; achievements: string; constructor(firstDate: string, lastDate: string, checkInDays: number, achievements: string) { this.firstDate = firstDate; this.lastDate = lastDate; this.checkInD...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ExcellentCase/Healthy_life/entry/src/main/ets/viewmodel/GlobalInfo.ets#L24-L36
2b049d88c9e8c7a9507f38864aed8fcda3c182ee
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/DynamicImport/harlibrary/src/main/ets/utils/Calc.ets
arkts
[Start dynamic_call_add]
export class Calc { public static staticAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in staticAdd, %d + %d = %d', a, b, c); return c; } public instanceAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibra...
AST#export_declaration#Left export AST#class_declaration#Left class Calc AST#class_body#Left { AST#method_declaration#Left public static staticAdd AST#parameter_list#Left ( AST#parameter#Left a : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ,...
export class Calc { public static staticAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibrary in staticAdd, %d + %d = %d', a, b, c); return c; } public instanceAdd(a: number, b: number): number { let c = a + b; console.info('DynamicImport I am harlibra...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/DynamicImport/harlibrary/src/main/ets/utils/Calc.ets#L17-L29
75c6a5788c9974cd184235b10aa332572cadf9de
gitee
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/completeness/function_call/library_function/string_lib_func_011_T.ets
arkts
Introduction 库函数-string_substring
export function string_lib_func_011_T(taint_src : string) { let t = taint_src.substring(1,3); taint.Sink(t); }
AST#export_declaration#Left export AST#function_declaration#Left function string_lib_func_011_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_stateme...
export function string_lib_func_011_T(taint_src : string) { let t = taint_src.substring(1,3); taint.Sink(t); }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/library_function/string_lib_func_011_T.ets#L7-L10
ec6cb1f66b50dc40ed093663bcc6ba536d85caae
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets
arkts
getTextStyle
Returns the color of the value-text that is drawn next to the LimitLine. @return
public getTextStyle(): Style { return this.mTextStyle; }
AST#method_declaration#Left public getTextStyle AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Style AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expre...
public getTextStyle(): Style { return this.mTextStyle; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets#L159-L161
6073b0a52c518423434a1ef4f87086acab326398
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/arkui/component/builder.d.ets
arkts
Defines the PageMapBuilder Type. @typedef { @Builder ((name: string, param: Object | null | undefined) => void) } PageMapBuilder @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @form @atomicservice @since 20
export type PageMapBuilder = @Builder ((name: string, param: Object | null | undefined) => void) /** * Defining wrapBuilder function. * @param { function } builder * @returns { WrappedBuilder<T> } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */
AST#export_declaration#Left export AST#type_declaration#Left type PageMapBuilder = AST#ERROR#Left @ Builder AST#ERROR#Right AST#type_annotation#Left AST#primary_type#Left AST#parenthesized_type#Left ( AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation...
export type PageMapBuilder = @Builder ((name: string, param: Object | null | undefined) => void)
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/builder.d.ets#L81-L89
a53edc9364ddf08ce5fd70da6219b4a91439f2eb
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets
arkts
VideoCreateGifComponent
功能描述: 本示例介绍了如何截取视频的一段内容制作gif图片,使用FFmpeg命令对视频进行截取gif图 推荐场景: 长视频播放场景 核心组件: 1. SelectGifTimeFrameView 实现步骤: 1. 打开视频播放页面,根据视频是本地视频还是线上视频选择设置avPlayer的url。如果是线上视频,使用边缓存边播放的方式,需要记录缓存文件的本地路径。 2. 根据视频播放页面上"gif"按钮的时间点,按一定规则确定截取的时间范围,进入选取生成gif时间片段页面,通过MP4Parser获取每秒的视频帧图片,展示在时间轴上。 3. 时间轴选择框框取截取的范围。 4. 点击"下一步"按钮,会出现gif生成页面,根据起始时...
@Component export struct VideoCreateGifComponent { private bannerInfoArray: BannerInfo[] = [{ image: $r("app.media.video_create_gif_preview1"), title: "鹅鹅鹅" }, { image: $r("app.media.video_create_gif_preview2"), title: "曲项向天歌" }, { image: $r("app.media.video_create_gif_preview3"), title: "白毛浮绿水" }, { imag...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VideoCreateGifComponent AST#component_body#Left { AST#property_declaration#Left private bannerInfoArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left BannerInfo [ ] AST#array_type#Right AST#prim...
@Component export struct VideoCreateGifComponent { private bannerInfoArray: BannerInfo[] = [{ image: $r("app.media.video_create_gif_preview1"), title: "鹅鹅鹅" }, { image: $r("app.media.video_create_gif_preview2"), title: "曲项向天歌" }, { image: $r("app.media.video_create_gif_preview3"), title: "白毛浮绿水" }, { imag...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/view/VideoCreateGif.ets#L37-L242
5d6a8f05b6389bc1c3a713f1dde5c01498f2c0e5
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
setUsePercentValues
If this is enabled, values inside the PieChart are drawn in percent and not with their original value. Values provided for the IValueFormatter to format are then provided in percent. @param enabled
public setUsePercentValues(enabled: boolean): void { this.mUsePercentValues = enabled; }
AST#method_declaration#Left public setUsePercentValues 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#p...
public setUsePercentValues(enabled: boolean): void { this.mUsePercentValues = enabled; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L772-L774
25e01a6a2cad414dbedc7084f0bc695b1bce8999
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/UserFile/DevelopingFileManagerApplication/entry/src/main/ets/filemanager/pages/FileManagerApplication.ets
arkts
creatFile
[End file_info_dir] [Start create_file_promise]
async creatFile(): Promise<void> { try { // fileAccessHelperAllServer 参考 fileAccess.createFileAccessHelper 示例代码获取 fileUri = await fileAccessHelperAllServer.createFile(sourceUri, displayName); if (!fileUri) { Logger.error('createFile return undefined object'); } Logger.info('cre...
AST#method_declaration#Left async creatFile 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_argume...
async creatFile(): Promise<void> { try { fileUri = await fileAccessHelperAllServer.createFile(sourceUri, displayName); if (!fileUri) { Logger.error('createFile return undefined object'); } Logger.info('createFile sucess, fileUri: ' + JSON.stringify(fileUri)); this.uriMes...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/UserFile/DevelopingFileManagerApplication/entry/src/main/ets/filemanager/pages/FileManagerApplication.ets#L158-L172
35a3acde8f10f6e1a5d307a3d6bb7d516826a3a9
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets
arkts
getPlans
/从DB加载所有的plans / 从DB加载所有的plans
public static async getPlans(): Promise<Plan[] | null> { const dbPlans: DBPlan[] | null = await PlanDbAccess.shared.getPlans(); if (!dbPlans) return null; // 使用 Promise.all 并行处理异步函数 const plans: Plan[] = await Promise.all( dbPlans.map(async (dbPlan: DBPlan): Promise<Plan> => { const dbPla...
AST#method_declaration#Left public static async getPlans 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#union_type#Left AST#primary_type#Left AST#array_type#Left Plan [ ] AST#array...
public static async getPlans(): Promise<Plan[] | null> { const dbPlans: DBPlan[] | null = await PlanDbAccess.shared.getPlans(); if (!dbPlans) return null; const plans: Plan[] = await Promise.all( dbPlans.map(async (dbPlan: DBPlan): Promise<Plan> => { const dbPlanHelper: DBPlanHelper = ne...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets#L133-L165
382ede14162e21816ec6f6e10c419899fe55efc6
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets
arkts
determineMaxScaleFactor
Calc max scale factor.
private determineMaxScaleFactor(): void { if (this.input == undefined) { return; } let scaleFactorW = this.input.width / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); let scaleFactorH = this.input.height / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); this.cropShow.setMaxScaleFac...
AST#method_declaration#Left private determineMaxScaleFactor AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_...
private determineMaxScaleFactor(): void { if (this.input == undefined) { return; } let scaleFactorW = this.input.width / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); let scaleFactorH = this.input.height / px2vp(CommonConstants.DEFAULT_MIN_SIDE_LENGTH_EDIT); this.cropShow.setMaxScaleFac...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/ImageEditCrop.ets#L395-L402
3ce907ef076984a92f2a9c90fbb1dfbfae6f655f
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/pages/complex_share.ets
arkts
handleAutoExtract
处理提取信息
private async handleAutoExtract() { // 1. 增加检查:如果输入为空,或正在处理,直接返回 if (this.isProcessing || !this.inputText.trim()) { console.log("跳过提取:状态为处理中或输入为空"); return; } // 2. 设置处理状态,清空旧结果 this.isProcessing = true; this.extractedApps = []; try { ...
AST#method_declaration#Left private async handleAutoExtract AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 1. 增加检查:如果输入为空,或正在处理,直接返回 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expressio...
private async handleAutoExtract() { if (this.isProcessing || !this.inputText.trim()) { console.log("跳过提取:状态为处理中或输入为空"); return; } this.isProcessing = true; this.extractedApps = []; try { console.log("开始自动提取,文本长度:", this.inpu...
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/pages/complex_share.ets#L432-L500
f28e91f89b9f6de60692f82689fd8b4ed13a05f7
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/hosts/bunch_of_tabs.ets
arkts
save_web_state_to_sandbox
Saves my web state to the storage.
save_web_state_to_sandbox(dir: string) { try { if (this.web_state_array) { let file_name = dir + "/continue_tabs_web_state_array_" + this.index.toString(); sandbox_save(file_name, this.web_state_array.buffer); return true; } } catch (e) { console.error('[tab_info_packed...
AST#method_declaration#Left save_web_state_to_sandbox AST#parameter_list#Left ( AST#parameter#Left dir : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#L...
save_web_state_to_sandbox(dir: string) { try { if (this.web_state_array) { let file_name = dir + "/continue_tabs_web_state_array_" + this.index.toString(); sandbox_save(file_name, this.web_state_array.buffer); return true; } } catch (e) { console.error('[tab_info_packed...
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_tabs.ets#L1019-L1030
a975afb773754ed44ad1edfac7a649d5ee279439
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/profiler/base/BaseProfilerUtils.ets
arkts
lastIndex
返回字符结尾符坐标 @param str
function lastIndex(str) { var index = -1; for (var i = 0; i < str.length; i++) { var temp = str.charCodeAt(i).toString(16); if (temp == 'a') { return i; } } return index; }
AST#function_declaration#Left function lastIndex AST#parameter_list#Left ( AST#parameter#Left str AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left var AST#variable_declarator#Left index = AST#expression#Left AST#unary_expression#Left - AST#expres...
function lastIndex(str) { var index = -1; for (var i = 0; i < str.length; i++) { var temp = str.charCodeAt(i).toString(16); if (temp == 'a') { return i; } } return index; }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/profiler/base/BaseProfilerUtils.ets#L110-L119
339ddccca3e462ca8cdb2c674efa7e0d9bcd73aa
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/encryption/AESSync.ets
arkts
decodeCBC192
解密-CBC模式-192位 @param str 加密的字符串 @param aesKey AES密钥 @param iv iv偏移量字符串 @param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式 @param dataCoding 入参字符串编码方式(hex/base64) - 不传默认为base64 @returns
static decodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.decodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, dataCoding); }
AST#method_declaration#Left static decodeCBC192 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left aesKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty...
static decodeCBC192(str: string, aesKey: string, iv: string, keyCoding: buffer.BufferEncoding, dataCoding: buffer.BufferEncoding = 'base64'): string { return CryptoSyncUtil.decodeCBC(str, aesKey, iv, 'AES192', 'AES192|CBC|PKCS7', 192, keyCoding, dataCoding); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/AESSync.ets#L258-L261
f3ed62a1a3489c361f7695770b3fa1b50ab727e1
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
addVoiceMessage
添加语音留言
async addVoiceMessage(cardId: string, voiceMessagePath: string): Promise<void> { try { const cardData = await this.loadARCard(cardId); if (!cardData) { throw new Error('AR card not found'); } cardData.voiceMessage = voiceMessagePath; await this.saveCardData(cardData); ...
AST#method_declaration#Left async addVoiceMessage AST#parameter_list#Left ( AST#parameter#Left cardId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left voiceMessagePath : AST#type_annotation#Left AST#primary_type#Left string...
async addVoiceMessage(cardId: string, voiceMessagePath: string): Promise<void> { try { const cardData = await this.loadARCard(cardId); if (!cardData) { throw new Error('AR card not found'); } cardData.voiceMessage = voiceMessagePath; await this.saveCardData(cardData); ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L543-L563
498f5b786b48b4a53a85d704caf6246e46560687
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
video net address
export const ZERO_STR: string = '0';
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left ZERO_STR : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '0' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Ri...
export const ZERO_STR: string = '0';
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets#L44-L44
ca0a3c223cd352cc9a6b4730d97934a43a5ae411
gitee
iichen-bycode/ArkTsWanandroid.git
ad128756a6c703d9a72cf7f6da128c27fc63bd00
entry/src/main/ets/http/api.ets
arkts
title
新增收藏 @param date @returns
export function addCollect(params: { title:string,author:string,link:string }
AST#export_declaration#Left export AST#ERROR#Left function addCollect ( params : AST#ERROR#Right { title AST#ERROR#Left : string AST#ERROR#Right , author AST#ERROR#Left : string AST#ERROR#Right , link AST#ERROR#Left : string AST#ERROR#Right } AST#export_declaration#Right
export function addCollect(params: { title:string,author:string,link:string }
https://github.com/iichen-bycode/ArkTsWanandroid.git/blob/ad128756a6c703d9a72cf7f6da128c27fc63bd00/entry/src/main/ets/http/api.ets#L325-L327
47123a51d79f062e872a5af7dfd7c09a4c5735a9
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ChipGroup.d.ets
arkts
Defines chip group space. @interface ChipGroupSpaceOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface ChipGroupSpaceOptions { /** * Space between items. * * @type { ?(string | number) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ itemSpace?: string | number; /** * Start space. * * @type...
AST#export_declaration#Left export AST#interface_declaration#Left interface ChipGroupSpaceOptions AST#object_type#Left { /** * Space between items. * * @type { ?(string | number) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#ty...
export interface ChipGroupSpaceOptions { itemSpace?: string | number; startSpace?: Length; endSpace?: Length; }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ChipGroup.d.ets#L351-L385
8f02ba2051286b5effc0c24f59ae101f1584bd9f
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/common/src/main/ets/navigation/WebNav.ets
arkts
WebNav
@file 网页页面导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function WebNav(): void { WebPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function WebNav 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_compone...
@Builder export function WebNav(): void { WebPage(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/common/src/main/ets/navigation/WebNav.ets#L8-L11
c55cd77aafbd29fe45950e45480095c2e357b16b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/accessibility/AccessibilityService.ets
arkts
字体大小级别
export enum FontSizeLevel { SMALL = 'small', NORMAL = 'normal', LARGE = 'large', EXTRA_LARGE = 'extra_large', HUGE = 'huge' }
AST#export_declaration#Left export AST#enum_declaration#Left enum FontSizeLevel AST#enum_body#Left { AST#enum_member#Left SMALL = AST#expression#Left 'small' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left NORMAL = AST#expression#Left 'normal' AST#expression#Right AST#enum_member#Right , AST#enum_memb...
export enum FontSizeLevel { SMALL = 'small', NORMAL = 'normal', LARGE = 'large', EXTRA_LARGE = 'extra_large', HUGE = 'huge' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/accessibility/AccessibilityService.ets#L28-L34
46fb63b7ae855d4519730ba31ce10f3180a2c46f
github
xixi-cquer/BiJiDaiBan.git
206dc33a837acbe6fc837feff848427e83946534
entry/src/main/ets/viewmodel/AccountData.ets
arkts
Copyright (c) 2023 Huawei Device Co., Ltd. Licensed under the Apache License,Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
export default class AccountData { id: number = -1; title: string =''; txt: string = ''; url: string =''; }
AST#export_declaration#Left export default AST#class_declaration#Left class AccountData AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#unary_expression#Left - AST#expression#Left 1 ...
export default class AccountData { id: number = -1; title: string =''; txt: string = ''; url: string =''; }
https://github.com/xixi-cquer/BiJiDaiBan.git/blob/206dc33a837acbe6fc837feff848427e83946534/entry/src/main/ets/viewmodel/AccountData.ets#L16-L21
64cf463e01ca2091f5ee872bc4774411f3497959
github
Application-Security-Automation/Arktan.git
3ad9cb05235e38b00cd5828476aa59a345afa1c0
dataset/accuracy/path_sensitive/loop_stmt/for_body_001_T.ets
arkts
Introduction 循环结构-body语句
export function for_body_001_T(taint_src : string) { let res = "" for (let i = 0; i < 2; i++) { res = taint_src } taint.Sink(res) }
AST#export_declaration#Left export AST#function_declaration#Left function for_body_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left...
export function for_body_001_T(taint_src : string) { let res = "" for (let i = 0; i < 2; i++) { res = taint_src } taint.Sink(res) }
https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/loop_stmt/for_body_001_T.ets#L7-L13
46ec495d49d1dc97f1105fa565faabd88030c4d5
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/SM4.ets
arkts
encryptGCM
加密(GCM模式),异步 @param data 加密或者解密的数据。data不能为null。 @param symKey 指定加密或解密的密钥。 @param gcmParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。 @param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(SM4_128|GCM|PKCS7、SM4_128|GCM|PKCS5、等) @returns
static async encryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7'): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await cipher.init(cryptoFramework.Cr...
AST#method_declaration#Left static async encryptGCM AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sym...
static async encryptGCM(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey, gcmParams: cryptoFramework.GcmParamsSpec, transformation: string = 'SM4_128|GCM|PKCS7'): Promise<cryptoFramework.DataBlob> { let cipher = cryptoFramework.createCipher(transformation); await cipher.init(cryptoFramework.Cr...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SM4.ets#L36-L44
4860b6bec53580be93f78bb8f9894c6156c970ed
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/swipersmoothvariation/Index.ets
arkts
SwiperSmoothVariationComponent
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage';
AST#export_declaration#Left export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage' ; AST#export_declaration#Right
export { SwiperSmoothVariationComponent } from './src/main/ets/pages/MainPage';
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/swipersmoothvariation/Index.ets#L16-L16
f1040a2f2fc2b72b17cb35df28399371ff34d568
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets
arkts
deleteData
删除指定index的数据
public deleteData(index: number): void { if (index < 0 || index >= this.originDataArray.length) { throw new Error("Index out of bounds"); } this.originDataArray.splice(index, 1); this.notifyDataDelete(index); }
AST#method_declaration#Left public deleteData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#...
public deleteData(index: number): void { if (index < 0 || index >= this.originDataArray.length) { throw new Error("Index out of bounds"); } this.originDataArray.splice(index, 1); this.notifyDataDelete(index); }
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets#L53-L59
5662dc8cca98366fe8cb909bc52e789503a011f5
github
buqiuz/Account.git
b843a38c24a833a9a4386f63cffec5fa5dadc674
oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/renderer/RadarChartRenderer.ets
arkts
drawDataSet
Draws the RadarDataSet @param c @param dataSet @param mostEntries the entry count of the dataset with the most entries
protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void { if (!this.mAnimator) { return; } let phaseX: number = this.mAnimator.getPhaseX(); let phaseY: number = this.mAnimator.getPhaseY(); let sliceangle: number = this.mChart.getSliceAngle(); ...
AST#method_declaration#Left protected drawDataSet AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataSet : AST#type_annotation#Left AST#primary_type#Left IR...
protected drawDataSet(c: CanvasRenderingContext2D, dataSet: IRadarDataSet, mostEntries: number): void { if (!this.mAnimator) { return; } let phaseX: number = this.mAnimator.getPhaseX(); let phaseY: number = this.mAnimator.getPhaseY(); let sliceangle: number = this.mChart.getSliceAngle(); ...
https://github.com/buqiuz/Account.git/blob/b843a38c24a833a9a4386f63cffec5fa5dadc674/oh_modules/.ohpm/@ohos+mpchart@3.0.15/oh_modules/@ohos/mpchart/src/main/ets/components/renderer/RadarChartRenderer.ets#L93-L164
ce9821a3d57b92b7f304aacb8b8c5041ed0a469f
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/designsystem/src/main/ets/constants/LayoutPercent.ets
arkts
15% 百分比
export const P15: string = "15%";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left P15 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "15%" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right...
export const P15: string = "15%";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/constants/LayoutPercent.ets#L24-L24
2f3a88552d77b5be813c5619619f06a512991b42
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/JsonListData.ets
arkts
样例数据
export interface samplesData { name: string, uri: string, drm_scheme: string, drm_license_url: string, }
AST#export_declaration#Left export AST#interface_declaration#Left interface samplesData AST#object_type#Left { AST#type_member#Left name : 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 uri : AST#type_annotation#Left AS...
export interface samplesData { name: string, uri: string, drm_scheme: string, drm_license_url: string, }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/FileManagement/MediaCollections/entry/src/main/ets/model/JsonListData.ets#L19-L24
d9f3ec049707184e91808dfed28616aac562227f
gitee
jxdiaodeyi/YX_Sports.git
af5346bd3d5003c33c306ff77b4b5e9184219893
YX_Sports/entry/src/main/ets/pages/NormalQuestionPage.ets
arkts
renderDropdown
渲染单个下拉框组件
@Builder renderDropdown(title: string, options: Array<string>, index: number) { Column({ space: 3 }) { Row() { Text(title) .fontSize(16) .padding(12) //.width('100%') .height(40) //.backgroundColor('#F5F5F5') .borderRadius(8); Imag...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right renderDropdown AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options : AST#type_annotation#L...
@Builder renderDropdown(title: string, options: Array<string>, index: number) { Column({ space: 3 }) { Row() { Text(title) .fontSize(16) .padding(12) .height(40) .borderRadius(8); Image(this.expandedIndex === index ? $r('app.medi...
https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/NormalQuestionPage.ets#L73-L133
ff29cc04476036564550369890bd2cbc5d6ae5cb
github
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
头像上传返回数据
export interface AvatarResponse { compressUrl: string; url: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface AvatarResponse AST#object_type#Left { AST#type_member#Left compressUrl : 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 url : AST#type_annotati...
export interface AvatarResponse { compressUrl: string; url: string; }
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L78-L81
b0db7cefb591cc14e50e92078d9efe0b5e074a76
github
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/model/InterviewRecordModel.ets
arkts
getOfferStatusText
获取Offer状态显示文本
getOfferStatusText(): string { switch (this.offerStatus) { case OfferStatus.NO_OFFER: return '无offer'; case OfferStatus.PENDING: return 'offer待定'; case OfferStatus.RECEIVED: return '已收到offer'; case OfferStatus.ACCEPTED: return '已接受offer'; case OfferStatu...
AST#method_declaration#Left getOfferStatusText 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#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left...
getOfferStatusText(): string { switch (this.offerStatus) { case OfferStatus.NO_OFFER: return '无offer'; case OfferStatus.PENDING: return 'offer待定'; case OfferStatus.RECEIVED: return '已收到offer'; case OfferStatus.ACCEPTED: return '已接受offer'; case OfferStatu...
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/model/InterviewRecordModel.ets#L141-L156
9b2ee92084e444d24c2fef15bbbd484de4c088a7
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/component/TextInputDialogView.ets
arkts
TextInputDialogView
TODO TextInputDialog组件 author: 桃花镇童长老ᥫ᭡ since: 2024/08/01
@Component export struct TextInputDialogView { private controller: TextInputController = new TextInputController(); @Prop options: TextInputOptions; @State customOptions: BaseContentOptions | undefined = undefined; @State modifier: TextInputModifier = new TextInputModifier(); @State text: string = ''; @Stat...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TextInputDialogView AST#component_body#Left { AST#property_declaration#Left private controller : AST#type_annotation#Left AST#primary_type#Left TextInputController AST#primary_type#Right AST#type_annotation#Right = AS...
@Component export struct TextInputDialogView { private controller: TextInputController = new TextInputController(); @Prop options: TextInputOptions; @State customOptions: BaseContentOptions | undefined = undefined; @State modifier: TextInputModifier = new TextInputModifier(); @State text: string = ''; @Stat...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/component/TextInputDialogView.ets#L29-L136
accdd20b7fa60b9454c21e86e5b9da1bf5e63ba1
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
harmonyos/src/main/ets/pages/Index.ets
arkts
loadThemeSettings
加载主题设置
private async loadThemeSettings(): Promise<void> { try { this.themeSettings = await this.settingsService.getThemeSettings(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to load theme settings: ${error}`); } }
AST#method_declaration#Left private async loadThemeSettings 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 >...
private async loadThemeSettings(): Promise<void> { try { this.themeSettings = await this.settingsService.getThemeSettings(); } catch (error) { hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Failed to load theme settings: ${error}`); } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/Index.ets#L59-L65
6e4ca3edca317306f7243e42039f24784e80293a
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
captureARScreenshot
截取AR截图
async captureARScreenshot(): Promise<string> { try { const outputPath = `/data/storage/el2/base/cache/ar_screenshot_${Date.now()}.png`; await this.captureFrame(outputPath); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AR screenshot captured: ${outputPath}`); ...
AST#method_declaration#Left async captureARScreenshot 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 string AST#primary_type#Right AST#type_annotation#Right > AST...
async captureARScreenshot(): Promise<string> { try { const outputPath = `/data/storage/el2/base/cache/ar_screenshot_${Date.now()}.png`; await this.captureFrame(outputPath); hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `AR screenshot captured: ${outputPath}`); ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L523-L538
eb8e8b5d7075be3e33216ef151ba8dfafc1f2cb8
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/FavoritesService.ets
arkts
saveData
保存数据
private async saveData(): Promise<void> { // 这里可以实现数据持久化 hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Data saved to storage'); }
AST#method_declaration#Left private async saveData 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...
private async saveData(): Promise<void> { hilog.debug(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Data saved to storage'); }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/FavoritesService.ets#L476-L479
0e13f0c802a75a6d49135c3231110605e2ba1c93
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/storage/PreferencesService.ets
arkts
putBatch
批量设置值 @param data 键值对对象
async putBatch(data: Record<string, preferences.ValueType>): Promise<void> { try { this.checkInitialized(); const promises: Promise<void>[] = []; const dataEntries: [string, preferences.ValueType][] = Object.entries(data); for (let i = 0; i < dataEntries.length; i++) { const k...
AST#method_declaration#Left async putBatch AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_annotatio...
async putBatch(data: Record<string, preferences.ValueType>): Promise<void> { try { this.checkInitialized(); const promises: Promise<void>[] = []; const dataEntries: [string, preferences.ValueType][] = Object.entries(data); for (let i = 0; i < dataEntries.length; i++) { const k...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/storage/PreferencesService.ets#L300-L319
0ac91cb69bbdce13c6f40411977d6e0b4d94be92
github
openharmony/update_update_app
0157b7917e2f48e914b5585991e8b2f4bc25108a
feature/ota/src/main/ets/manager/OtaUpdateManager.ets
arkts
getOtaStatus
取升级状态 @return resolve 状态/reject 错误信息
async getOtaStatus(): Promise<UpgradeData<OtaStatus>> { return new Promise((resolve, reject) => { this.updateManager.getOtaStatus().then((result: UpgradeData<OtaStatus>) => { if (result?.callResult === UpgradeCallResult.OK) { this.refreshState(result?.data); } resolve(result)...
AST#method_declaration#Left async getOtaStatus 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 UpgradeData AST#type_arguments#Left < AST#type...
async getOtaStatus(): Promise<UpgradeData<OtaStatus>> { return new Promise((resolve, reject) => { this.updateManager.getOtaStatus().then((result: UpgradeData<OtaStatus>) => { if (result?.callResult === UpgradeCallResult.OK) { this.refreshState(result?.data); } resolve(result)...
https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/feature/ota/src/main/ets/manager/OtaUpdateManager.ets#L76-L85
b303fced6ed9a4d04cac512c64807275a34b91ab
gitee
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
Binds data to components and provides interfaces.
export class MainViewModel { /** * Get swiper image data. * * @return {Array<Resource>} swiperImages. */ getSwiperImages(): Array<Resource> { let swiperImages: Resource[] = [ $r('app.media.fig1'), $r('app.media.fig2'), $r('app.media.fig3'), $r('app.media.fig4') ]; re...
AST#export_declaration#Left export AST#class_declaration#Left class MainViewModel AST#class_body#Left { /** * Get swiper image data. * * @return {Array<Resource>} swiperImages. */ AST#method_declaration#Left getSwiperImages AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#...
export class MainViewModel { getSwiperImages(): Array<Resource> { let swiperImages: Resource[] = [ $r('app.media.fig1'), $r('app.media.fig2'), $r('app.media.fig3'), $r('app.media.fig4') ]; return swiperImages; } getFirstGridData(): Array<ItemData> { let firstGridDat...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets#L21-L90
b000a994ad541e2d12cd96258dd29b4a5aebb998
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/VoiceService.ets
arkts
parseVoiceCommand
解析语音命令
parseVoiceCommand(recognizedText: string): VoiceCommand[] { const commands: VoiceCommand[] = []; const text = recognizedText.toLowerCase(); // 添加联系人命令 if (text.includes('添加联系人') || text.includes('新增联系人')) { // 提取姓名 const nameMatch = text.match(/添加联系人\s*(.+)|新增联系人\s*(.+)/); const name ...
AST#method_declaration#Left parseVoiceCommand AST#parameter_list#Left ( AST#parameter#Left recognizedText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_typ...
parseVoiceCommand(recognizedText: string): VoiceCommand[] { const commands: VoiceCommand[] = []; const text = recognizedText.toLowerCase(); if (text.includes('添加联系人') || text.includes('新增联系人')) { const nameMatch = text.match(/添加联系人\s*(.+)|新增联系人\s*(.+)/); const name = nameMatch ? (na...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L378-L436
cf7f4f1a95c12d9fc259859f8fa7f77fcd4f3a86
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/calendar/CalendarApiService.ets
arkts
getHolidayInfo
获取节假日信息
private async getHolidayInfo(date: Date): Promise<HolidayInfo> { try { const dateStr = this.formatDate(date); const url = `${this.APIs.holiday}${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, header...
AST#method_declaration#Left private async getHolidayInfo AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_ty...
private async getHolidayInfo(date: Date): Promise<HolidayInfo> { try { const dateStr = this.formatDate(date); const url = `${this.APIs.holiday}${dateStr}`; const request = http.createHttp(); const response = await request.request(url, { method: http.RequestMethod.GET, header...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/calendar/CalendarApiService.ets#L175-L209
eba811193f97649242fd5986339041d39b00dd84
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/notification/ReminderScheduler.ets
arkts
initializeScheduler
初始化调度器
private async initializeScheduler(): Promise<void> { try { // 请求提醒代理权限 await this.requestReminderPermissions(); // 启动后台任务 await this.startBackgroundTask(); // 加载已有的提醒 await this.loadExistingReminders(); // 开始定期调度 this.startPeriodicScheduling(); ...
AST#method_declaration#Left private async initializeScheduler 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...
private async initializeScheduler(): Promise<void> { try { await this.requestReminderPermissions(); await this.startBackgroundTask(); await this.loadExistingReminders(); this.startPeriodicScheduling(); hilog.info(LogConstants.DOMA...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/ReminderScheduler.ets#L64-L82
3fee6a97737cec4cc84d74deb6df8ef6f735c01e
github
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.arkui.advanced.ArcSlider.d.ets
arkts
@file @kit ArkUI Enum for ArcSliderPosition @enum { string } @syscap SystemCapability.ArkUI.ArkUI.Circle @crossplatform @atomicservice @since 18
export declare enum ArcSliderPosition { /** * The position is on the left * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ LEFT = 0, /** * The position is on the right. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatfo...
AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ArcSliderPosition AST#enum_body#Left { /** * The position is on the left * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ AST#enum_member#Left LEF...
export declare enum ArcSliderPosition { LEFT = 0, RIGHT = 1 }
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ArcSlider.d.ets#L31-L52
02e847adf37985982156f917b42f1ac1baba3876
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/ChartModel.ets
arkts
clearValues
Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the chart by calling invalidate().
public clearValues() { if (this.mData) { this.mData.clearValues(); } this.invalidate(); }
AST#method_declaration#Left public clearValues 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 . mData AST#member_expression#Right AST...
public clearValues() { if (this.mData) { this.mData.clearValues(); } this.invalidate(); }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/ChartModel.ets#L263-L268
6567c8aa043105ba20da2271eacdec3b9dbd0872
gitee
ChangweiZhang/chardet-arkts.git
3a214882ec6a2753c0fed84162952aa659341c19
src/main/ets/components/encoding/mbcs.ets
arkts
Shift_JIS charset recognizer.
export class sjis extends mbcs { name() { return 'Shift_JIS'; } language() { return 'ja'; } // TODO: This set of data comes from the character frequency- // of-occurrence analysis tool. The data needs to be moved // into a resource and loaded from there. commonChars = [ 0x81...
AST#export_declaration#Left export AST#class_declaration#Left class sjis extends AST#type_annotation#Left AST#primary_type#Left mbcs AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left name AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST...
export class sjis extends mbcs { name() { return 'Shift_JIS'; } language() { return 'ja'; } commonChars = [ 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0, 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5, 0x82b7, 0x82...
https://github.com/ChangweiZhang/chardet-arkts.git/blob/3a214882ec6a2753c0fed84162952aa659341c19/src/main/ets/components/encoding/mbcs.ets#L199-L245
270b46b384d30c47962f6fe9e0f75f00be96a3f8
github
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/DialogCoreHandler.ets
arkts
openBaseCustomDialog
创建并弹出dialogContent对应的自定义弹窗 @param uiContext UIContext。 @param wrappedBuilder 自定义弹窗中显示的组件内容。 @param options 弹窗样式。
private openBaseCustomDialog<T extends IBaseDialogOptions>(uiContext: UIContext, wrappedBuilder: WrappedBuilder<[T]>, options: T) { if (this.exist(options.dialogId ?? "")) { //判断dialogId是否存在 // LogUtil.error(`该弹框已存在,dialogId:${options.dialogId}`); return } const newOptions: IBaseDialogOptio...
AST#method_declaration#Left private openBaseCustomDialog AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left IBaseDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#para...
private openBaseCustomDialog<T extends IBaseDialogOptions>(uiContext: UIContext, wrappedBuilder: WrappedBuilder<[T]>, options: T) { if (this.exist(options.dialogId ?? "")) { return } const newOptions: IBaseDialogOptions = {} as IBaseDialogOptions ObjectUtil.assign(newOptions, options)...
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogCoreHandler.ets#L60-L90
4c5d4fce8883349eb15426726c1c1e78fb583bad
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/utils/ui_tools.ets
arkts
Infers the index of window. @param w The windowClass (window.Window).
export function window_index_of_windowClass(w: window.Window) { let windowClasses = AppStorage.get('windows') as window.Window[]; let window_idx = windowClasses.indexOf(w); return window_idx; }
AST#export_declaration#Left export AST#function_declaration#Left function window_index_of_windowClass AST#parameter_list#Left ( AST#parameter#Left w : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#para...
export function window_index_of_windowClass(w: window.Window) { let windowClasses = AppStorage.get('windows') as window.Window[]; let window_idx = windowClasses.indexOf(w); return window_idx; }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L429-L433
f23672203c894f348258533904ed5cae7d8c6c5a
gitee
Vinson0709/arkdemo.git
793491fe04b387f55dadfef86b30e28d0535d994
entry/src/main/ets/pages/Progresses.ets
arkts
aboutToAppear
生命周期函数,创建组件实例后,执行build渲染函数之前
aboutToAppear() {}
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
aboutToAppear() {}
https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Progresses.ets#L21-L21
7c60d2f2ffd22cef5cb6b37617ad15e4db28fb2a
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/BubbleChartRenderer.ets
arkts
initBuffers
@Override
public initBuffers(): void { }
AST#method_declaration#Left public initBuffers 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#builder_function_body#Right AST#method_declaration#Right
public initBuffers(): void { }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/BubbleChartRenderer.ets#L48-L50
306604af9dde408ee2a2720dedc6e573246f2e14
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets
arkts
initPreferences
MARK: - Preference 初始化
private async initPreferences() { this.prefs = await preferences.getPreferences(this.context, Prefs.Name); await this.loadPreference(); }
AST#method_declaration#Left private async initPreferences AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . prefs AST#member_exp...
private async initPreferences() { this.prefs = await preferences.getPreferences(this.context, Prefs.Name); await this.loadPreference(); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/PlanManager.ets#L102-L105
92f74e89846bf81f19bef623a09556be8314da65
github
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets
arkts
聊天数据资源类
export class ChatDataSource implements IChatDataSource { // 聊天信息数组 private originDataArray: IChatMessage[] = []; // 消息监听数组 private listeners: DataChangeListener[] = []; // 添加数据函数 public addData(index: number, data: IChatMessage): void { this.originDataArray.splice(index, 0, data); this.notifyDataAd...
AST#export_declaration#Left export AST#class_declaration#Left class ChatDataSource AST#implements_clause#Left implements IChatDataSource AST#implements_clause#Right AST#class_body#Left { // 聊天信息数组 AST#property_declaration#Left private originDataArray : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ...
export class ChatDataSource implements IChatDataSource { private originDataArray: IChatMessage[] = []; private listeners: DataChangeListener[] = []; public addData(index: number, data: IChatMessage): void { this.originDataArray.splice(index, 0, data); this.notifyDataAdd(index); } public ...
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets#L8-L97
d7e7d743cbd9309ed33d21a87f4910980eeb67e5
gitee
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/手机浏览器/hap源码/laval-browser_v104/entry/src/main/ets/common/TitleBar.ets
arkts
webview
启动预连接,连接地址为即将打开的网址。
webview.WebviewController.prepareForPageLoad(this.src, true, 2);
AST#method_declaration#Left webview AST#ERROR#Left . WebviewController . prepareForPageLoad AST#ERROR#Right AST#parameter_list#Left ( AST#parameter#Left this AST#parameter#Right AST#ERROR#Left . src AST#ERROR#Right , AST#parameter#Left true AST#parameter#Right AST#ERROR#Left , 2 AST#ERROR#Right ) AST#parameter_list#Rig...
webview.WebviewController.prepareForPageLoad(this.src, true, 2);
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/手机浏览器/hap源码/laval-browser_v104/entry/src/main/ets/common/TitleBar.ets#L248-L248
a1f4bf1446fdcdd2f080bc8da3d9fc48301bbbe5
gitee
openharmony-tpc/ImageKnife
bc55de9e2edd79ed4646ce37177ad94b432874f7
library/src/main/ets/cache/FileCache.ets
arkts
initFileCache
遍历缓存文件目录,初始化缓存
public async initFileCache(path: string = FileCache.CACHE_FOLDER) { if (this.isInited) { return } let startTime = Date.now() if (this.context && path.startsWith(this.context.cacheDir) === true) { this.path = path } else { FileCache.CACHE_FOLDER = path this.path = this.context...
AST#method_declaration#Left public async initFileCache AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left FileCache AST#expression#Right . CACHE_FO...
public async initFileCache(path: string = FileCache.CACHE_FOLDER) { if (this.isInited) { return } let startTime = Date.now() if (this.context && path.startsWith(this.context.cacheDir) === true) { this.path = path } else { FileCache.CACHE_FOLDER = path this.path = this.context...
https://github.com/openharmony-tpc/ImageKnife/blob/bc55de9e2edd79ed4646ce37177ad94b432874f7/library/src/main/ets/cache/FileCache.ets#L55-L74
466f3c57615772803c8df57a7fb6b7a2cf34a555
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
buildContactsContent
构建联系人页面内容
@Builder buildContactsContent() { Column({ space: 16 }) { // 搜索和筛选工具栏 this.buildContactsToolbar() // 联系人统计信息 this.buildContactsStats() // 联系人列表 this.buildContactsList() } .width('100%') .alignItems(HorizontalAlign.Start) }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactsContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen...
@Builder buildContactsContent() { Column({ space: 16 }) { this.buildContactsToolbar() this.buildContactsStats() this.buildContactsList() } .width('100%') .alignItems(HorizontalAlign.Start) }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L1757-L1771
8ebd76c0be43b353439375099424a63878a0a68c
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
ref
Returns an alias to the AppStorage property with given name. @param propName - a property name @returns an AbstractProperty by the given name, or `undefined` if it does not exist
static ref<T>(propName: string): AbstractProperty<T> | undefined { return StorageMap.shared.entry<T>(propName) }
AST#method_declaration#Left static ref AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri...
static ref<T>(propName: string): AbstractProperty<T> | undefined { return StorageMap.shared.entry<T>(propName) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L33-L35
bddea33c926a36f1edfa6c07903a930966af1a65
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/data/DataImportExportService.ets
arkts
importFromOtherApps
从其他应用导入联系人
async importFromOtherApps(onProgress?: ImportProgressCallback): Promise<ImportResult> { try { hilog.info(0x0000, 'DataImportExportService', 'Starting other apps import...'); if (onProgress) { onProgress({ totalRecords: 0, processedRecords: 0, currentOperation: '检测其...
AST#method_declaration#Left async importFromOtherApps AST#parameter_list#Left ( AST#parameter#Left onProgress ? : AST#type_annotation#Left AST#primary_type#Left ImportProgressCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_t...
async importFromOtherApps(onProgress?: ImportProgressCallback): Promise<ImportResult> { try { hilog.info(0x0000, 'DataImportExportService', 'Starting other apps import...'); if (onProgress) { onProgress({ totalRecords: 0, processedRecords: 0, currentOperation: '检测其...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/data/DataImportExportService.ets#L270-L310
b729e69be9532d1c32859049581924fb9ed5632d
github
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/DataModel.ets
arkts
pushData
Add data.
public pushData(data: string): void { this.tabContent.push(data); this.notifyDataAdd(this.tabContent.length - 1); }
AST#method_declaration#Left public pushData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Rig...
public pushData(data: string): void { this.tabContent.push(data); this.notifyDataAdd(this.tabContent.length - 1); }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/DataModel.ets#L71-L74
f2c9aed94850134de3242e61575981b6e33ee563
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GreetingTypes.ets
arkts
祝福语发送结果接口
export interface GreetingSendResult { success: boolean; message?: string; sentAt?: string; historyId?: string; error?: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface GreetingSendResult AST#object_type#Left { AST#type_member#Left success : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left message ? : AST#type_a...
export interface GreetingSendResult { success: boolean; message?: string; sentAt?: string; historyId?: string; error?: string; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GreetingTypes.ets#L196-L202
a1c76d2e3ae95453cd9b47cfbc6daf13fc618566
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/media/VoiceService.ets
arkts
executeVoiceCommand
执行语音命令
async executeVoiceCommand(command: VoiceCommand): Promise<any> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Executing voice command: ${command.action}`); switch (command.action) { case 'addContact': return await this.handleAddContactCommand(command.param...
AST#method_declaration#Left async executeVoiceCommand AST#parameter_list#Left ( AST#parameter#Left command : AST#type_annotation#Left AST#primary_type#Left VoiceCommand AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#ge...
async executeVoiceCommand(command: VoiceCommand): Promise<any> { try { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `Executing voice command: ${command.action}`); switch (command.action) { case 'addContact': return await this.handleAddContactCommand(command.param...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/media/VoiceService.ets#L441-L460
773f1f0dd3c429373cba4a1ea7df2739ea1b97b2
github
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets
arkts
sign
签名 @param str 需要签名的字符串 @param priKey 给定秘钥规格私钥 @param symAlgName 秘钥规格 @param symEncryptName 加密规格 @returns string> 签名对象
static async sign(str: string, priKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<string> { //将私钥转换 let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName); //创建签名器 let signer = crypto.createSign(symEncryptName); //初始化签名器 await sign...
AST#method_declaration#Left static async sign AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
static async sign(str: string, priKey: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<string> { let priPair = await CryptoUtil.convertPriKeyFromStr(priKey, symAlgName, keyName); let signer = crypto.createSign(symEncryptName); await signer.init(priPair.priKey...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/CryptoUtil.ets#L341-L355
95a923664861643f1a5731c751c302719af8054c
gitee
vhall/VHLive_SDK_Harmony
29c820e5301e17ae01bc6bdcc393a4437b518e7c
watchKit/src/main/ets/utils/NumberUtil.ets
arkts
TODO number工具类 author: 桃花镇童长老ᥫ᭡ since: 2024/05/01
export class NumberUtil { /** * 检查值是否为NaN * @param value * @returns */ static isNaN(value: Any): boolean { return Number.isNaN(value); } /** * 检查值是否为有限数字 * @param value * @returns */ static isFinite(value: Any): boolean { return Number.isFinite(value); } /** * 检查值是否为...
AST#export_declaration#Left export AST#class_declaration#Left class NumberUtil AST#class_body#Left { /** * 检查值是否为NaN * @param value * @returns */ AST#method_declaration#Left static isNaN AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Any AST#primary_type#...
export class NumberUtil { static isNaN(value: Any): boolean { return Number.isNaN(value); } static isFinite(value: Any): boolean { return Number.isFinite(value); } static isInteger(value: Any): boolean { return Number.isInteger(value); } static isSafeInteger(value: Any): boole...
https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/utils/NumberUtil.ets#L27-L226
8a0c1303af8c678d9ab3224fcdc27ff15e1841dc
gitee
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets
arkts
navigateToCreateDream
点击创建新梦想
navigateToCreateDream() { router.pushUrl({ url: 'pages/dream/DreamEditPage' }); }
AST#method_declaration#Left navigateToCreateDream 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 router AST#expression#Right . pushUrl AST#...
navigateToCreateDream() { router.pushUrl({ url: 'pages/dream/DreamEditPage' }); }
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/dream/DreamPage.ets#L103-L107
98f9f64abf1fbd519d4d2eaeb2a50462ee5eb1b5
github
Classaspen/ArkTS_PasswordManagement.git
66aea6e4f8ee3a78e5029c63186dba70707ca2d9
entry/src/main/ets/components/database/Database.ets
arkts
initialize
添加初始化状态标识
async initialize(tablename: string, context: Context): Promise<void> { if (this.isInitialized) return; try { // 创建新数据库 this.store = await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG); hilog.info(0x0000, 'DB', 'RdbStore instance created'); // 先执行建表语句 const cre...
AST#method_declaration#Left async initialize AST#parameter_list#Left ( AST#parameter#Left tablename : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#prima...
async initialize(tablename: string, context: Context): Promise<void> { if (this.isInitialized) return; try { this.store = await relationalStore.getRdbStore(context, CommonConstants.STORE_CONFIG); hilog.info(0x0000, 'DB', 'RdbStore instance created'); const createTableSQL = `CREA...
https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/database/Database.ets#L43-L71
3c72044e6e4da23a3952b59cf15c08466a3878a1
github
from-north-to-north/OpenHarmony_p7885
f6ea526c039db535a7c958fa154ccfcb3668b37c
hap/easy_demo/audio-native-master/entry/src/main/ets/constants/CommonConstants.ets
arkts
Copyright (c) 2024 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export default class CommonConstants { /** * Hundred percent. */ static readonly FULL_PERCENT: string = '100%'; /** * Default column space. */ static readonly COLUMN_DEFAULT_SPACE: string = '12vp'; /** * Pause position x. */ static readonly PAUSE_POSITION_X: string = '80%'; /** * R...
AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /** * Hundred percent. */ AST#property_declaration#Left static readonly FULL_PERCENT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expr...
export default class CommonConstants { static readonly FULL_PERCENT: string = '100%'; static readonly COLUMN_DEFAULT_SPACE: string = '12vp'; static readonly PAUSE_POSITION_X: string = '80%'; static readonly RECORD_POSITION_Y: string = '82%'; static readonly PLAY_INIT: string = 'init'; ...
https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/easy_demo/audio-native-master/entry/src/main/ets/constants/CommonConstants.ets#L16-L95
ed122cc2b44d409579e1aff60b785c8cbe7f5df3
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/scrollingCharts/data/Sine.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 default class Sine { public data: number[] = [ 0.0, //#0 0.019998666246387648, //#1 0.039989333293279646, //#2 0.059964005140753354, //#3 0.07991469218675235, //#4 0.0998334181294999, //#5 0.11971221202299985, //#6 0.1395431152344512, //#7 0.15931820308364608, //#8 0.179...
AST#export_declaration#Left export default AST#class_declaration#Left class Sine AST#class_body#Left { AST#property_declaration#Left public data : 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#expression#Left AST...
export default class Sine { public data: number[] = [ 0.0, 0.019998666246387648, 0.039989333293279646, 0.059964005140753354, 0.07991469218675235, 0.0998334181294999, 0.11971221202299985, 0.1395431152344512, 0.15931820308364608, 0.17902956580240917, 0.1986693191117...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/scrollingCharts/data/Sine.ets#L16-L769
8a4da31c5bebd47833c44c7a054a2fc53319bd4f
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/CommentItemView.ets
arkts
CommentView
单个评论组件,用于显示评论
@Component export struct CommentView { // 评论 private comment: Comment = new Comment('', '', '', [], ''); build() { Column() { Row() { Image(this.comment.avatar) .width($r('app.integer.image_comment_image_avatar_width')) .height($r('app.integer.image_comment_image_avatar_heig...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommentView AST#component_body#Left { // 评论 AST#property_declaration#Left private comment : AST#type_annotation#Left AST#primary_type#Left Comment AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left...
@Component export struct CommentView { private comment: Comment = new Comment('', '', '', [], ''); build() { Column() { Row() { Image(this.comment.avatar) .width($r('app.integer.image_comment_image_avatar_width')) .height($r('app.integer.image_comment_image_avatar_height'))...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imagecomment/src/main/ets/components/view/CommentItemView.ets#L20-L59
c3ae8fde0e2a8cec621c742822f4596e49824144
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets
arkts
closeWebSocket
关闭WebSocket连接
closeWebSocket() { if (!this.ws) { this.closeConnectionResult = 'WebSocket not connected'; Logger.error(`${LOG_TAG} WebSocket not connected`); return; } this.ws.close((err: BusinessError) => { if (!err) { this.closeConnectionResult = 'Connection closed successfully'; ...
AST#method_declaration#Left closeWebSocket 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 AST#unary_expression#Left ! AST#expression#Left this AST#expression#R...
closeWebSocket() { if (!this.ws) { this.closeConnectionResult = 'WebSocket not connected'; Logger.error(`${LOG_TAG} WebSocket not connected`); return; } this.ws.close((err: BusinessError) => { if (!err) { this.closeConnectionResult = 'Connection closed successfully'; ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/WebSocket_case/entry/src/main/ets/pages/Index.ets#L196-L217
91d2e66efcbfb70a2b43578def2302b667343426
gitee
wangjinyuan/JS-TS-ArkTS-database.git
a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26
npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildBanRemove.ets
arkts
handle
应用约束10:显式声明参数类型(使用Object代替any)
handle(data: Object): void { const client = this.client; // 应用约束21:使用Map的get方法进行属性访问 const guild = client.guilds.get(data['guild_id']); // 应用约束21:使用Map的get方法进行属性访问 const user = client.dataManager.newUser(data['user']); if (guild && user) { // 应用约束21:使用字符串常量访问属性 client.emit(Constants....
AST#method_declaration#Left handle AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#ty...
handle(data: Object): void { const client = this.client; const guild = client.guilds.get(data['guild_id']); const user = client.dataManager.newUser(data['user']); if (guild && user) { client.emit(Constants.Events.GUILD_BAN_REMOVE, guild, user); } }
https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildBanRemove.ets#L7-L17
72561e5c729bf204217bfc2762244cf35bda90f6
github
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/common/url.ets
arkts
forEach
values(): IterableIterator<string> { const params = this._params; let index = 0; const iterator: IterableIterator<string> = { next(): IteratorResult<string> { if (index < params.length) { const value = params[index].value; index++; return { value: value, done: false }; } return { value: '', done: true }; }, [Symbol.it...
forEach(callback: (value: string, key: string, parent: URLSearchParams) => void): void { for (let i = 0; i < this._params.length; i++) { const param = this._params[i]; callback(param.value, param.key, this); } }
AST#method_declaration#Left forEach AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AS...
forEach(callback: (value: string, key: string, parent: URLSearchParams) => void): void { for (let i = 0; i < this._params.length; i++) { const param = this._params[i]; callback(param.value, param.key, this); } }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/url.ets#L252-L257
5c7590cdc620717ab6034d913be410cdce7423ce
github
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/addDevice/pages/index.ets
arkts
getCurrentSsid
获取当前连接的wifi名称 @return name
private async getCurrentSsid() { let wifiSsid = '' // 调用WLAN连接状态接口,判断当前设备是否已连接到WLAN if (wifi.isConnected ) { // 获取wifi连接信息 let data = await wifi.getLinkedInfo() wifiSsid = data.ssid; }else{ wifiSsid = "" } return wifiSsid }
AST#method_declaration#Left private async getCurrentSsid AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left wifiSsid = AST#expression#Left '' AST#expression#Right AST#variable_declarator#Right // 调用WLAN连接状态接口,...
private async getCurrentSsid() { let wifiSsid = '' if (wifi.isConnected ) { let data = await wifi.getLinkedInfo() wifiSsid = data.ssid; }else{ wifiSsid = "" } return wifiSsid }
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/addDevice/pages/index.ets#L116-L127
26f45ea525d21fa77944754e76601b5ef93901cc
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/model/NotificationOperations.ets
arkts
在初始化函数初始化基本通知类型的参数
constructor(context: Context) { this.context = context; let notificationTitle = ''; let notificationText = '通知内容'; let notificationAdditional = '通知次要内容'; this.basicContent = { title: notificationTitle, text: notificationText, additionalText: notificationAdditional }; }
AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statemen...
constructor(context: Context) { this.context = context; let notificationTitle = ''; let notificationText = '通知内容'; let notificationAdditional = '通知次要内容'; this.basicContent = { title: notificationTitle, text: notificationText, additionalText: notificationAdditional }; }
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/validator/acts_validator/entry/src/main/ets/pages/Notification/CustomNotification/model/NotificationOperations.ets#L62-L72
fc24280609069ce5b0efa0f5af016734443a3e08
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/casesfeature/advertisingpage/src/main/ets/components/AdvertisingPage.ets
arkts
timerInterval
控制页面显示倒计时
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { router.pushUrl({url:"pages/home"}) this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
AST#method_declaration#Left timerInterval AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . timer AST#member_expression#Right = ...
timerInterval() { this.timer = setInterval(() => { this.pageCountDown--; if (this.pageCountDown === 0) { router.pushUrl({url:"pages/home"}) this.changeFullScreen(false); clearInterval(this.timer); this.isShow = false; } }, 1000) }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/casesfeature/advertisingpage/src/main/ets/components/AdvertisingPage.ets#L59-L69
d97bceb72896f7560e0cb08ebe823aa5b7f1359e
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/database/GreetingHistoryDAO.ets
arkts
insertGreetingHistory
插入新祝福记录 @param greetingHistory 祝福历史实体 @returns 插入的记录ID
async insertGreetingHistory(greetingHistory: GreetingHistoryEntity): Promise<number> { const rdbStore = this.dbManager.getRdbStore(); if (!rdbStore) { throw new Error('Database not initialized'); } try { const currentTime = new Date().toISOString(); const valueBucket: relationalStore....
AST#method_declaration#Left async insertGreetingHistory AST#parameter_list#Left ( AST#parameter#Left greetingHistory : AST#type_annotation#Left AST#primary_type#Left GreetingHistoryEntity AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#prima...
async insertGreetingHistory(greetingHistory: GreetingHistoryEntity): Promise<number> { const rdbStore = this.dbManager.getRdbStore(); if (!rdbStore) { throw new Error('Database not initialized'); } try { const currentTime = new Date().toISOString(); const valueBucket: relationalStore....
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/GreetingHistoryDAO.ets#L63-L86
9f8c36f4665cd03b7aa393212071a32e6594f2b6
github
awa_Liny/LinysBrowser_NEXT
a5cd96a9aa8114cae4972937f94a8967e55d4a10
home/src/main/ets/blocks/modules/meowScratchingBoard.ets
arkts
copy_text
Copies a text into system pasteboard. @param text the text
copy_text(text: string) { copy(text); this.copied = true; clearTimeout(this.copied_timeout_id); this.copied_timeout_id = setTimeout(() => { this.copied = false; }, animation_popup_duration()) }
AST#method_declaration#Left copy_text AST#parameter_list#Left ( AST#parameter#Left text : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_custom_component_statement#Left copy ( A...
copy_text(text: string) { copy(text); this.copied = true; clearTimeout(this.copied_timeout_id); this.copied_timeout_id = setTimeout(() => { this.copied = false; }, animation_popup_duration()) }
https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/modules/meowScratchingBoard.ets#L380-L387
d2dcae28fc6b4e4ac7544e6cb0885f2f79bede95
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/main/sub/report/RadarView.ets
arkts
clone
深拷贝方法
clone(): ChartPart { return new ChartPart(this.partName, this.allCount, this.curCount, this.color); }
AST#method_declaration#Left clone AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ChartPart AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left A...
clone(): ChartPart { return new ChartPart(this.partName, this.allCount, this.curCount, this.color); }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L398-L400
12eb4a1c34cadacc05f3bd1b9c1a850685bd9c2f
github
wuyuanwuhui999/harmony-arkts-chat-app-ui.git
128861bc002adae9c34c6ce8fbf12686c26e51ec
entry/src/main/ets/utils/PreferenceModel.ets
arkts
getToken
获取 token
async getToken() { return this.getPreference('token'); }
AST#method_declaration#Left async getToken AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . getPr...
async getToken() { return this.getPreference('token'); }
https://github.com/wuyuanwuhui999/harmony-arkts-chat-app-ui.git/blob/128861bc002adae9c34c6ce8fbf12686c26e51ec/entry/src/main/ets/utils/PreferenceModel.ets#L85-L87
c17d38f35e1556b4a395f0119370cdecd2901b89
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/CommonRepository.ets
arkts
getDictData
获取字典数据 @param request 字典数据请求参数 @returns 字典数据结果
async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> { return this.networkDataSource.getDictData(request); }
AST#method_declaration#Left async getDictData AST#parameter_list#Left ( AST#parameter#Left request : AST#type_annotation#Left AST#primary_type#Left DictDataRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic...
async getDictData(request: DictDataRequest): Promise<NetworkResponse<DictDataResponse>> { return this.networkDataSource.getDictData(request); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/CommonRepository.ets#L44-L46
5006c57494dbd3a3d0efcfb4391a1a715e295c51
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imageviewer/Index.ets
arkts
CommonLazyDataSourceModel
model
export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel'
AST#export_declaration#Left export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel' AST#export_declaration#Right
export { CommonLazyDataSourceModel } from './src/main/ets/model/CommonLazyDataSourceModel'
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageviewer/Index.ets#L27-L27
a40aa26ab3969224dbbdddee0143d70811abbf06
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/charts/PieChartModel.ets
arkts
getCenterText
returns the text that is drawn in the center of the pie-chart @return
public getCenterText(): string /*CharSequence*/ { return this.mCenterText; }
AST#method_declaration#Left public getCenterText 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 /*CharSequence*/ AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Le...
public getCenterText(): string { return this.mCenterText; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L492-L495
46ad58d784c9275b376a777f8ea3f06336f71cb3
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderCommentPage.ets
arkts
ImagePickerSection
图片选择区域 @returns {void} 无返回值
@Builder private ImagePickerSection(): void { IBestUploader({ fileList: this.vm.imageList!!, max: 9, previewSize: 90, cornerRadius: 8, uploaderBgColor: $r("app.color.bg_content"), onChange: (list: IBestUploaderFile[], _allList: IBestUploaderFile[]): void => this.vm.updateImageL...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private ImagePickerSection 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_sta...
@Builder private ImagePickerSection(): void { IBestUploader({ fileList: this.vm.imageList!!, max: 9, previewSize: 90, cornerRadius: 8, uploaderBgColor: $r("app.color.bg_content"), onChange: (list: IBestUploaderFile[], _allList: IBestUploaderFile[]): void => this.vm.updateImageL...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderCommentPage.ets#L148-L158
10b5409f978d811d95bf0673be11433e2d808da2
github
Neptune-EX/OS_System_Design.git
c728a82d48079ae0c52d50c4a2e2586b69f4ce55
entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets
arkts
readUserFile. Reads the contents of a user directory file. @return Promise<string>.
export async function readUserFile(): Promise<string> { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); let documentPicker = new picker.DocumentViewPicker(); await documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult: Array<string>) => { Logger.info('Document...
AST#export_declaration#Left export AST#function_declaration#Left async function readUserFile 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 string AST#primary_typ...
export async function readUserFile(): Promise<string> { try { let DocumentSelectOptions = new picker.DocumentSelectOptions(); let documentPicker = new picker.DocumentViewPicker(); await documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult: Array<string>) => { Logger.info('Document...
https://github.com/Neptune-EX/OS_System_Design.git/blob/c728a82d48079ae0c52d50c4a2e2586b69f4ce55/entry/src/main/ets/common/utils/SavingAndSelectUserFile.ets#L56-L80
2447039233b7ad15b5df4821034464dd4054e0c6
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/YAxis.ets
arkts
isDrawTopYLabelEntryEnabled
returns true if drawing the top y-axis label entry is enabled @return
public isDrawTopYLabelEntryEnabled(): boolean { return this.mDrawTopYLabelEntry; }
AST#method_declaration#Left public isDrawTopYLabelEntryEnabled AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left...
public isDrawTopYLabelEntryEnabled(): boolean { return this.mDrawTopYLabelEntry; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L261-L263
8bd25805f66fe4e6839b558844b0cafc443424b9
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/services/CartService.ets
arkts
addListener
添加监听器
addListener(listener: (count: number) => void): void { this.listeners.push(listener); }
AST#method_declaration#Left addListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ...
addListener(listener: (count: number) => void): void { this.listeners.push(listener); }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/services/CartService.ets#L33-L35
264d0b56ccb1722117907b77932c6d3793237a26
github
Active-hue/ArkTS-Accounting.git
c432916d305b407557f08e35017c3fd70668e441
entry/src/main/ets/pages/AboutUs.ets
arkts
FeatureItem
功能项组件
@Builder FeatureItem(icon: string, title: string, description: string) { Row() { Text(icon) .fontSize(32) .width(48) .height(48) .textAlign(TextAlign.Center) .borderRadius(12) .backgroundColor('#F5F7FF') .margin({ right: 16 }) Column() { ...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right FeatureItem AST#parameter_list#Left ( AST#parameter#Left icon : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left title : AST#type_annotation#Left AS...
@Builder FeatureItem(icon: string, title: string, description: string) { Row() { Text(icon) .fontSize(32) .width(48) .height(48) .textAlign(TextAlign.Center) .borderRadius(12) .backgroundColor('#F5F7FF') .margin({ right: 16 }) Column() { ...
https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/AboutUs.ets#L216-L245
6c68de890ef6f195b5eb888b3a640a6ff034e097
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets
arkts
setAndRef
Returns an alias to the AppStorage property with given name. If property does not exist in AppStorage, create it with the given value. @param propName - a property name @param defaultValue - a value used to create property if it does not exist @returns an AbstractProperty for the given name
static setAndRef<T>(propName: string, defaultValue: T): AbstractProperty<T> { return StorageMap.shared.entryOrCreate(propName, defaultValue) }
AST#method_declaration#Left static setAndRef AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parame...
static setAndRef<T>(propName: string, defaultValue: T): AbstractProperty<T> { return StorageMap.shared.entryOrCreate(propName, defaultValue) }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L44-L46
cb5f867904bcae9a6a585669a690bd63b178145f
gitee
sithvothykiv/dialog_hub.git
b676c102ef2d05f8994d170abe48dcc40cd39005
custom_dialog/src/main/ets/core/DialogHub.ets
arkts
getToast
【系统】显示吐司(该方法可设置样式) @param options @returns
static getToast(message: ResourceStr): ToastDialog { return new ToastDialog(message) }
AST#method_declaration#Left static getToast AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ToastDialog AST#p...
static getToast(message: ResourceStr): ToastDialog { return new ToastDialog(message) }
https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/DialogHub.ets#L85-L87
28f89d87bd2f270d0ceeb6c4cc0131e75087559e
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
entry/src/main/ets/pages/lineCharts/MultiplePage.ets
arkts
menuCallback
标题栏菜单回调
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index === -1) { return } let data = this.model.getData(); let sets...
AST#method_declaration#Left AST#decorator#Left @ Monitor ( AST#expression#Left "titleModel.index" AST#expression#Right ) AST#decorator#Right menuCallback AST#parameter_list#Left ( ) AST#parameter_list#Right AST#ERROR#Left { AST#ERROR#Left AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expr...
@Monitor("titleModel.index") menuCallback() { if (this.titleModel === null || this.titleModel === undefined) { return } let index: number = this.titleModel.getIndex() if (index === undefined || index === null || index === -1) { return } let data = this.model.getData(); let sets...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/entry/src/main/ets/pages/lineCharts/MultiplePage.ets#L176-L193
c590afc8687da44918af6b045fb4a18a05c0945e
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/plan/plancurve/Plan.ets
arkts
dayOfFor
/ 获取指定日期的dayOf
dayOfFor(date: Date): DayOf | null { if (this.startDate !== null) { let num = this.daysTo(this.startDate, date); return this.dayOfs.find((d) => d.num === num) ?? null; } return null; }
AST#method_declaration#Left dayOfFor AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left DayOf AST#prim...
dayOfFor(date: Date): DayOf | null { if (this.startDate !== null) { let num = this.daysTo(this.startDate, date); return this.dayOfs.find((d) => d.num === num) ?? null; } return null; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/plan/plancurve/Plan.ets#L145-L151
3c26a9a274c1d7b27bf981e5e67bcd302af51e37
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets
arkts
addLastItem
Add an element to the tail of the data
public addLastItem(): void { this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); }
AST#method_declaration#Left public addLastItem AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expre...
public addLastItem(): void { this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length); this.notifyDataAdd(this.dataArray.length - 1); }
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AvoidTimeComsume/entry/src/main/ets/views/WaterFlowDataSource.ets#L100-L103
044f35a3992a8c7fb31ecc3fc627d6da433d4721
gitee
huangwei021230/HarmonyFlow.git
427f918873b0c9efdc975ff4889726b1bfccc546
entry/src/main/ets/lib/io/FsFile.ets
arkts
subDir
Helper function to get a subdirectory of a directory. @param relPath The relative path of the subdirectory. @returns The subdirectory.
function subDir(dir: FsDir, relPath: string): FsDir { return fs.dir(dir, relPath); }
AST#function_declaration#Left function subDir AST#parameter_list#Left ( AST#parameter#Left dir : AST#type_annotation#Left AST#primary_type#Left FsDir AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left relPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type...
function subDir(dir: FsDir, relPath: string): FsDir { return fs.dir(dir, relPath); }
https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/io/FsFile.ets#L18-L20
c3be503ea226a0fa8cd2922b789cfc97a3cfae15
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/ThumbTackComponent.ets
arkts
createRingAnimation
创建帧帽波纹动画
createRingAnimation() { // 创建帽檐宽度变化动画 this.hatBrimWidthAnimator = animator.create({ // 400, 大头针帽檐动画持续400ms duration: 400, easing: 'linear', delay: 0, fill: 'forwards', direction: 'normal', iterations: -1, begin: 0, end: this.thumbTackWidth * ThumbTackCommonC...
AST#method_declaration#Left createRingAnimation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 创建帽檐宽度变化动画 AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . hatBrimWidthAnim...
createRingAnimation() { this.hatBrimWidthAnimator = animator.create({ duration: 400, easing: 'linear', delay: 0, fill: 'forwards', direction: 'normal', iterations: -1, begin: 0, end: this.thumbTackWidth * ThumbTackCommonConstants.TACK_HAT_BRIM_WIDTH_RATIO ...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/mapthumbtack/src/main/ets/components/ThumbTackComponent.ets#L114-L151
6799a843a54788e3ad2f81fe1c08375ebc48a7b1
gitee
Rayawa/dashboard.git
9107efe7fb69a58d799a378b79ea8ffa4041cec8
entry/src/main/ets/common/SettingsStorage.ets
arkts
主题设置(如果需要存储主题)
export async function getThemeColor(): Promise<string> { const settings = getSettingsInstance(); return (await settings.get("themeColor", "blue")) as string; }
AST#export_declaration#Left export AST#function_declaration#Left async function getThemeColor 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 string AST#primary_ty...
export async function getThemeColor(): Promise<string> { const settings = getSettingsInstance(); return (await settings.get("themeColor", "blue")) as string; }
https://github.com/Rayawa/dashboard.git/blob/9107efe7fb69a58d799a378b79ea8ffa4041cec8/entry/src/main/ets/common/SettingsStorage.ets#L71-L74
3aa10e2c53501dcf711691de8a31fd26667d6cf6
github
L1rics06/arkTS-.git
991fd131bfdb11e2933152133c97453d86092ac0
entry/src/main/ets/pages/NetworkUtil.ets
arkts
getNoticeList
获取通知列表
static async getNoticeList(userId: string): Promise<ResponseDao<NoticeListResponse>> { try { const params: NoticeListParams = { id: userId }; const response: AxiosResponse<ResponseDao<NoticeListResponse>> = await axios.post( `${BASE_URL}/ddchat/notice/getList`, params, { ...
AST#method_declaration#Left static async getNoticeList AST#parameter_list#Left ( AST#parameter#Left userId : 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_...
static async getNoticeList(userId: string): Promise<ResponseDao<NoticeListResponse>> { try { const params: NoticeListParams = { id: userId }; const response: AxiosResponse<ResponseDao<NoticeListResponse>> = await axios.post( `${BASE_URL}/ddchat/notice/getList`, params, { ...
https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L475-L491
9b43b5d5bb469390320735a208e407e707c1973f
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/etswrapper/src/main/cpp/types/libetswrapper/index.d.ets
arkts
注册封装后的select与save方法,全局仅需调用一次
export const registryDocumentViewPickerFn: ( select: ( uiContext: UIContext, options: picker.DocumentSelectOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void, save: ( uiContext: UIContext, options: picker.DocumentSaveOptions, thenWrapper: StringArrayCbWr...
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left registryDocumentViewPickerFn : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left select : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter...
export const registryDocumentViewPickerFn: ( select: ( uiContext: UIContext, options: picker.DocumentSelectOptions, thenWrapper: StringArrayCbWrapper, catchWrapper: CatchCbWrapper ) => void, save: ( uiContext: UIContext, options: picker.DocumentSaveOptions, thenWrapper: StringArrayCbWr...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/etswrapper/src/main/cpp/types/libetswrapper/index.d.ets#L8-L21
7f1fb19987c129ffff01a34d58f6dbf9241bef0e
gitee
open9527/OpenHarmony
fdea69ed722d426bf04e817ec05bff4002e81a4e
libs/core/src/main/ets/utils/PreferencesUtils.ets
arkts
getAllSync
static init(preferenceName: string = defaultPreferenceName) { PreferencesUtils.preferenceName = preferenceName } 获取所有 数据缓存 @param preferenceName @returns
static getAllSync(preferenceName: string = defaultPreferenceName) { let preferences = PreferencesUtils.getPreferencesSync(preferenceName); //获取实例 return preferences.getAllSync() }
AST#method_declaration#Left static getAllSync AST#parameter_list#Left ( AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left defaultPreferenceName AST#expression#Right AST#parameter#Right ) AST#parameter_list#Rig...
static getAllSync(preferenceName: string = defaultPreferenceName) { let preferences = PreferencesUtils.getPreferencesSync(preferenceName); return preferences.getAllSync() }
https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/PreferencesUtils.ets#L27-L30
d43d65e095eb7eddf962144b3c2797e36bf8bf50
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/managers/servercfg/AppCfgManager.ets
arkts
get
获取单例实例
static get shared(): AppCfgManager { if (!AppCfgManager.instance) { AppCfgManager.instance = new AppCfgManager(); } return AppCfgManager.instance; }
AST#method_declaration#Left static get AST#ERROR#Left shared AST#ERROR#Right AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AppCfgManager AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#...
static get shared(): AppCfgManager { if (!AppCfgManager.instance) { AppCfgManager.instance = new AppCfgManager(); } return AppCfgManager.instance; }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/servercfg/AppCfgManager.ets#L87-L92
1682b36a398eb6bd9b13e9337edf0da939796c4a
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
ArkUI/orientationDevelopment/entry/src/main/ets/pages/Index.ets
arkts
[StartExclude enable_nfc]
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container__'...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left RelativeContainer ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#member_expres...
build() { RelativeContainer() { Text(this.message) .id('HelloWorld') .fontSize($r('app.float.page_text_font_size')) .fontWeight(FontWeight.Bold) .alignRules({ center: { anchor: '__container__', align: VerticalAlign.Center }, middle: { anchor: '__container__'...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/ArkUI/orientationDevelopment/entry/src/main/ets/pages/Index.ets#L52-L68
5b6469a6a934a1bd1a6ea1f153616697d19cce38
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets
arkts
rowStyles
订单与互动栏的通用样式
@Styles rowStyles() { .width($r('app.string.slidetohideanddisplace_size_full')) .padding($r('app.integer.slidetohideanddisplace_padding_small')) .margin({ top: $r('app.integer.slidetohideanddisplace_margin_small') }) .backgroundColor($r('app.color.slidetohideanddisplace_color_transparent_aa')) .bo...
AST#method_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right rowStyles AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left 'app.string.slidetohideanddisp...
@Styles rowStyles() { .width($r('app.string.slidetohideanddisplace_size_full')) .padding($r('app.integer.slidetohideanddisplace_padding_small')) .margin({ top: $r('app.integer.slidetohideanddisplace_margin_small') }) .backgroundColor($r('app.color.slidetohideanddisplace_color_transparent_aa')) .bo...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/slidetohideanddisplace/src/main/ets/view/SlideToHideAndDisplace.ets#L114-L121
ba37fe3c55edd2d5dd9f44fb6cffa60821b60a80
gitee