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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/RcpLogInterceptor.ets | arkts | @Author csx
@DateTime 2024/7/24 00:02
@TODO RcpInterceptor rcp日志拦截器配置
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_rcp | export class RcpLogInterceptor implements rcp.Interceptor {
/**
* 拦截核心
* @param context
* @param next
* @returns
*/
async intercept(context: rcp.RequestContext, next: rcp.RequestHandler): Promise<rcp.Response> {
Logger.init('efRcp', getContext(), 0xFF00);
try {
//获取当前请求url
const u... | AST#export_declaration#Left export AST#class_declaration#Left class RcpLogInterceptor AST#implements_clause#Left implements AST#implements_clause#Right AST#ERROR#Left AST#qualified_type#Left rcp . Interceptor AST#qualified_type#Right AST#ERROR#Right AST#class_body#Left { /**
* 拦截核心
* @param context
* @param ne... | export class RcpLogInterceptor implements rcp.Interceptor {
async intercept(context: rcp.RequestContext, next: rcp.RequestHandler): Promise<rcp.Response> {
Logger.init('efRcp', getContext(), 0xFF00);
try {
const url = context.request.url.href;
const requestFromCache = CacheUtil.ge... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/RcpLogInterceptor.ets#L29-L75 | ac096276d83fb5dbe87563a05beb6efc8ab01313 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Data/NotePadOpenHarmony/entry/src/main/ets/common/constants/StyleConstants.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export default class StyleConstants {
/**
* Full height.
*/
static readonly FULL_HEIGHT: string = '100%';
/**
* Full width.
*/
static readonly FULL_WIDTH: string = '100%';
/**
* Content width.
*/
static readonly CONTENT_WIDTH: string = '87%';
/**
* TextInput width.
*/
static r... | AST#export_declaration#Left export default AST#class_declaration#Left class StyleConstants AST#class_body#Left { /**
* Full height.
*/ AST#property_declaration#Left static readonly FULL_HEIGHT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression... | export default class StyleConstants {
static readonly FULL_HEIGHT: string = '100%';
static readonly FULL_WIDTH: string = '100%';
static readonly CONTENT_WIDTH: string = '87%';
static readonly TEXT_INPUT_WIDTH: string = '93%';
static readonly MEMO_LIST_SPACE: string = '12';
static read... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/NotePadOpenHarmony/entry/src/main/ets/common/constants/StyleConstants.ets#L16-L51 | ec720b2d0368b18a98c21e37299deb4ffae182f3 | gitee | |
RicardoWesleyli/HarmonyNEXT_Examples.git | 6a9cc1a06e3c7b126faa61ccf1b91ac6cea47670 | Chapter6/entry/src/main/ets/pages/Index.ets | arkts | textView | 文字组件代码块 | @Builder
textView(text:string,size:number,weight:number,color:Color){
Text(text)
.fontSize(size)
.fontWeight(weight)
.fontColor(color)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right textView 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#Left size : AST#type_annotation#Left AST#pr... | @Builder
textView(text:string,size:number,weight:number,color:Color){
Text(text)
.fontSize(size)
.fontWeight(weight)
.fontColor(color)
} | https://github.com/RicardoWesleyli/HarmonyNEXT_Examples.git/blob/6a9cc1a06e3c7b126faa61ccf1b91ac6cea47670/Chapter6/entry/src/main/ets/pages/Index.ets#L93-L99 | 422de6cb03ef86a7ed7dcd5ad21b9dbea8452f6f | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/Camera/entry/src/main/ets/views/ModeSwitchPage.ets | arkts | onChangeIsModeBol | After pausing, click 'stop' to reset the pause to default | onChangeIsModeBol() {
} | AST#method_declaration#Left onChangeIsModeBol AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | onChangeIsModeBol() {
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Camera/entry/src/main/ets/views/ModeSwitchPage.ets#L139-L140 | 565c51507495218e1cc5dd4581680292cde5a2c0 | gitee |
jjjjjjava/ffmpeg_tools.git | 6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161 | src/main/ets/ffmpeg/FFMpegUtils.ets | arkts | convertVideo | 便捷方法:视频格式转换
@param inputPath 输入文件路径或URL
@param outputPath 输出文件路径
@param onProgress 进度回调
@returns Promise | static convertVideo(
inputPath: string,
outputPath: string,
onProgress?: (progress: number) => void
): Promise<number> {
return FFMpegUtils.executeFFmpegCommand({
cmds: ['-i', inputPath, '-c:v', 'libx264', '-c:a', 'aac', outputPath],
onFFmpegProgress: onProgress || ((progress) => {
... | AST#method_declaration#Left static convertVideo AST#parameter_list#Left ( AST#parameter#Left inputPath : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left outputPath : AST#type_annotation#Left AST#primary_type#Left string AST#... | static convertVideo(
inputPath: string,
outputPath: string,
onProgress?: (progress: number) => void
): Promise<number> {
return FFMpegUtils.executeFFmpegCommand({
cmds: ['-i', inputPath, '-c:v', 'libx264', '-c:a', 'aac', outputPath],
onFFmpegProgress: onProgress || ((progress) => {
... | https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFMpegUtils.ets#L146-L163 | a86e21ceb042dbbb497e631b6c8d8a3d5ec11c09 | github |
Classaspen/ArkTS_PasswordManagement.git | 66aea6e4f8ee3a78e5029c63186dba70707ca2d9 | entry/src/main/ets/components/pswmanagement/CommonConstants.ets | arkts | Common constants for all features. | export default class CommonConstants {
/**
* Search font weight.
*/
static readonly SEARCH_FONT_WEIGHT: number = 10;
/**
* The font family of search component.
*/
static readonly SEARCH_FONT_FAMILY: string = 'serif';
/**
* The layout weight of the list title.
*/
static readonly TITLE_LAYOU... | AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /**
* Search font weight.
*/ AST#property_declaration#Left static readonly SEARCH_FONT_WEIGHT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right =... | export default class CommonConstants {
static readonly SEARCH_FONT_WEIGHT: number = 10;
static readonly SEARCH_FONT_FAMILY: string = 'serif';
static readonly TITLE_LAYOUT_WEIGHT: number = 1;
static readonly TITLE_MAX_LINES: number = 1;
static readonly WEIGHT: number = 1;
static readonly PA... | https://github.com/Classaspen/ArkTS_PasswordManagement.git/blob/66aea6e4f8ee3a78e5029c63186dba70707ca2d9/entry/src/main/ets/components/pswmanagement/CommonConstants.ets#L22-L340 | ed878f723ecda29fe2d627bda8236c300914197b | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/DialogBuilder.ets | arkts | TextPickerDialogBuilder | TextPickerDialog
@param options | @Builder
export function TextPickerDialogBuilder(options: TextPickerOptions) {
TextPickerDialogView({ options: options })
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function TextPickerDialogBuilder AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left TextPickerOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AS... | @Builder
export function TextPickerDialogBuilder(options: TextPickerOptions) {
TextPickerDialogView({ options: options })
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogBuilder.ets#L177-L180 | 29be78c8280d80938ac91cc5b9d9265b3a7f9bf4 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/containernestedslide/src/main/ets/model/NewsCommentModel.ets | arkts | pushData | 存储数据到懒加载数据源中 | pushData(data: NewsCommentModel): void {
this.comments.push(data);
// 在数组头部添加数据
this.notifyDataAdd(this.comments.length - 1);
} | AST#method_declaration#Left pushData AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left NewsCommentModel 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#... | pushData(data: NewsCommentModel): void {
this.comments.push(data);
this.notifyDataAdd(this.comments.length - 1);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/model/NewsCommentModel.ets#L140-L144 | 3862b907ce7eccc19eadf40639eba84873bda468 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/videotrimmer/src/main/ets/utils/UrlUtils.ets | arkts | saveUrl | 设置保存上传下载地址 | async saveUrl(context: common.UIAbilityContext, url: string) {
let preference = await preferences.getPreferences(context, STORE_NAME);
await preference.put(URL_KEY, url);
await preference.flush();
logger.info(TAG, `saveUrl,url= ${url}`);
} | AST#method_declaration#Left async saveUrl AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left url : AST#t... | async saveUrl(context: common.UIAbilityContext, url: string) {
let preference = await preferences.getPreferences(context, STORE_NAME);
await preference.put(URL_KEY, url);
await preference.flush();
logger.info(TAG, `saveUrl,url= ${url}`);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/src/main/ets/utils/UrlUtils.ets#L41-L46 | 3ce65710f68731655fb343d37c74e884da32b188 | gitee |
0dot618/my_PCB_detection_harmony_app.git | 58217366ac936b5f4c246191701b333f4d3c5513 | MyApplication2/entry/src/main/ets/pages/Detect.ets | arkts | savePixmap2SysHelper | 保存到系统相册 | async savePixmap2SysHelper(pixmap:image.PixelMap) {
if (!pixmap) {
return;
}
const imgBuffer = await this.transferPixelMap2Buffer(pixmap);
// 获取相册管理模块的实例,用于访问和修改相册中的媒体文件。
let helper = photoAccessHelper.getPhotoAccessHelper(getContext(this));
// 指定待创建的文件类型和后缀,创建图片或视频资源,使用callback方式返回结果。
... | AST#method_declaration#Left async savePixmap2SysHelper AST#parameter_list#Left ( AST#parameter#Left pixmap : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AS... | async savePixmap2SysHelper(pixmap:image.PixelMap) {
if (!pixmap) {
return;
}
const imgBuffer = await this.transferPixelMap2Buffer(pixmap);
let helper = photoAccessHelper.getPhotoAccessHelper(getContext(this));
const uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'p... | https://github.com/0dot618/my_PCB_detection_harmony_app.git/blob/58217366ac936b5f4c246191701b333f4d3c5513/MyApplication2/entry/src/main/ets/pages/Detect.ets#L194-L206 | 087cf0c4d017f725f62fd17c82919b96da676762 | github |
851432669/Smart-Home-ArkTs-Hi3861.git | 0451f85f072ed3281cc23d9cdc2843d79f60f975 | entry/src/main/ets/view/AIComponent.ets | arkts | saveConversation | 新增:保存对话记录到MongoDB | private saveConversation(prompt: string, reply: string, environmentData: EnvironmentViewModel): void {
const httpRequest = http.createHttp()
console.info('准备保存AI对话记录到MongoDB...')
console.info('服务器地址:', this.SAVE_CONVERSATION_URL)
// 创建符合接口定义的请求数据对象
const requestData: ConversationRequest = ... | AST#method_declaration#Left private saveConversation AST#parameter_list#Left ( AST#parameter#Left prompt : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left reply : AST#type_annotation#Left AST#primary_type#Left string AST#pri... | private saveConversation(prompt: string, reply: string, environmentData: EnvironmentViewModel): void {
const httpRequest = http.createHttp()
console.info('准备保存AI对话记录到MongoDB...')
console.info('服务器地址:', this.SAVE_CONVERSATION_URL)
const requestData: ConversationRequest = {
username: ... | https://github.com/851432669/Smart-Home-ArkTs-Hi3861.git/blob/0451f85f072ed3281cc23d9cdc2843d79f60f975/entry/src/main/ets/view/AIComponent.ets#L120-L166 | 1982ca1f42cac1d6968dac8d12961750185049db | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets | arkts | Copyright (C) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class RouterModule {
static builderMap: Map<string, WrappedBuilder<[object]>> = new Map<string, WrappedBuilder<[object]>>();
static routerMap: Map<string, NavPathStack> = new Map<string, NavPathStack>();
// 通过名称注册builder
public static registerBuilder(builderName: string, builder: WrappedBuilder<[object]... | AST#export_declaration#Left export AST#class_declaration#Left class RouterModule AST#class_body#Left { AST#property_declaration#Left static builderMap : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Map AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty... | export class RouterModule {
static builderMap: Map<string, WrappedBuilder<[object]>> = new Map<string, WrappedBuilder<[object]>>();
static routerMap: Map<string, NavPathStack> = new Map<string, NavPathStack>();
public static registerBuilder(builderName: string, builder: WrappedBuilder<[object]>): void{
Ro... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L15-L72 | fb8019fd0dd34f65639a552116484ad623ebbef2 | gitee | |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets | arkts | decryptCBCSync | 解密(CBC模式),同步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@param ivParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。
@param transformation 待生成Cipher的算法名称(含密钥长度)、加密模式以及填充方法的组合(AES256|CBC|PKCS7、AES192|CBC|PKCS7、AES128|CBC|PKCS7)。
@returns | static decryptCBCSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
ivParams: cryptoFramework.IvParamsSpec): cryptoFramework.DataBlob {
return SM4.decryptSync(data, symKey, ivParams, 'SM4_128|CBC|PKCS7');
} | AST#method_declaration#Left static decryptCBCSync 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 symKe... | static decryptCBCSync(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
ivParams: cryptoFramework.IvParamsSpec): cryptoFramework.DataBlob {
return SM4.decryptSync(data, symKey, ivParams, 'SM4_128|CBC|PKCS7');
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets#L143-L146 | 93b4fbfeb13849aa5e97b8bdc788aa086273d937 | github |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/animation/NavAnimationMgr.ets | arkts | registerAnimParam | 注册路由转场动画,设置相关参数
@param modifier
@param ctx
@param param | public registerAnimParam(component: object, ctx: NavDestinationContext): AnimateCallback | undefined {
if (ctx.navDestinationId) {
const pageInfo = this.navContextMap.get(this.getKey(component))
if (pageInfo) {
pageInfo.pageId = ctx.navDestinationId
const name = ctx.navDestinationId;
... | AST#method_declaration#Left public registerAnimParam AST#parameter_list#Left ( AST#parameter#Left component : AST#type_annotation#Left AST#primary_type#Left object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ctx : AST#type_annotation#Left AST#primary_type#Left NavDestinatio... | public registerAnimParam(component: object, ctx: NavDestinationContext): AnimateCallback | undefined {
if (ctx.navDestinationId) {
const pageInfo = this.navContextMap.get(this.getKey(component))
if (pageInfo) {
pageInfo.pageId = ctx.navDestinationId
const name = ctx.navDestinationId;
... | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/NavAnimationMgr.ets#L302-L319 | a6ee652b0b07b6411fe9858d6f40038c10ed623f | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_user_agents.ets | arkts | export_string | Export user agents in a specific plain text format.
@returns '\n' connected string of user agents in the format of:
@example 'Firefox Windows 132\nMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0' | static export_string() {
let export_list: string[] = []
for (let index = 0; index < bunch_of_user_agents.list_of_user_agents.length; index++) {
let ua: user_agent = bunch_of_user_agents.list_of_user_agents[index];
export_list.push(ua.label);
export_list.push(ua.user_agent_content);
}
r... | AST#method_declaration#Left static export_string AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left export_list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Ri... | static export_string() {
let export_list: string[] = []
for (let index = 0; index < bunch_of_user_agents.list_of_user_agents.length; index++) {
let ua: user_agent = bunch_of_user_agents.list_of_user_agents[index];
export_list.push(ua.label);
export_list.push(ua.user_agent_content);
}
r... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_user_agents.ets#L57-L65 | 7147e2f8e15b99e2aee32ac50af18aa29fad8c27 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_ccm_encryption_decryption/aes_ccm_encryption_decryption_synchronous.ets | arkts | encryptMessage | 加密消息 | function encryptMessage(symKey: cryptoFramework.SymKey, plainText: cryptoFramework.DataBlob) {
let cipher = cryptoFramework.createCipher('AES128|CCM');
cipher.initSync(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, ccmParams);
let encryptUpdate = cipher.updateSync(plainText);
// ccm模式加密doFinal时传入空,获得tag数据,并更新... | AST#function_declaration#Left function encryptMessage AST#parameter_list#Left ( AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left p... | function encryptMessage(symKey: cryptoFramework.SymKey, plainText: cryptoFramework.DataBlob) {
let cipher = cryptoFramework.createCipher('AES128|CCM');
cipher.initSync(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, ccmParams);
let encryptUpdate = cipher.updateSync(plainText);
ccmParams.authTag = cipher.doF... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_ccm_encryption_decryption/aes_ccm_encryption_decryption_synchronous.ets#L42-L49 | dc057a23518e6dea34cacb71596e872c1dc8e62f | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkWeb/UseSameLayerRender/entry/src/main/ets/pages/RenderTxtBoxSameLayer_two.ets | arkts | makeNode | 必须要重写的方法,用于构建节点数、返回节点数挂载在对应NodeContainer中。 在对应NodeContainer创建的时候调用、或者通过rebuild方法调用刷新。 | makeNode(uiContext: UIContext): FrameNode | null {
if (this.isDestroy_) { // rootNode为null
return null;
}
if (!this.rootNode) {// rootNode 为undefined时
this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ });
if(this.rootNode) {
this.rootNo... | AST#method_declaration#Left makeNode AST#parameter_list#Left ( AST#parameter#Left uiContext : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Fram... | makeNode(uiContext: UIContext): FrameNode | null {
if (this.isDestroy_) {
return null;
}
if (!this.rootNode) {
this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId_, type: this.renderType_ });
if(this.rootNode) {
this.rootNode.build(
wrapBuilder(textInp... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/UseSameLayerRender/entry/src/main/ets/pages/RenderTxtBoxSameLayer_two.ets#L62-L78 | 6dd4444084820439486d94cc1aa093929ece9e2c | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets | arkts | setYOffset | Sets the used y-axis offset for the labels on this axis. For the legend,
higher offset means the legend as a whole will be placed further away
from the top.
@param yOffset | public setYOffset(yOffset: number): void {
this.mYOffset = Utils.convertDpToPixel(yOffset);
} | AST#method_declaration#Left public setYOffset AST#parameter_list#Left ( AST#parameter#Left yOffset : 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_typ... | public setYOffset(yOffset: number): void {
this.mYOffset = Utils.convertDpToPixel(yOffset);
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets#L91-L93 | f58cb124ca4209cda810df66443c8cf070d55e40 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | setLabelXOffset | sets the horizontal offset of the y-label
@param xOffset | public setLabelXOffset(xOffset: number): void {
this.mXLabelOffset = xOffset;
} | AST#method_declaration#Left public setLabelXOffset AST#parameter_list#Left ( AST#parameter#Left xOffset : 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#primar... | public setLabelXOffset(xOffset: number): void {
this.mXLabelOffset = xOffset;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L199-L201 | cd0a4b306b0dffe1f686aeb40aacdb6361837ac4 | gitee |
asasugar/HarmoneyNote.git | 2a7f0eeac701ffc41ed09c3c95244fab1bed7489 | entry/src/main/ets/view/DetailListComponent.ets | arkts | DetailListComponent | Detail page list component. | @Component
export struct DetailListComponent {
build() {
Column() {
List() {
ForEach(BusinessViewModel.getDetailPageListItems(), (item: ListItemData) => {
ListItem() {
Row() {
Text(item.title)
.fontSize($r('app.float.detail_title_size'))
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct DetailListComponent AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_b... | @Component
export struct DetailListComponent {
build() {
Column() {
List() {
ForEach(BusinessViewModel.getDetailPageListItems(), (item: ListItemData) => {
ListItem() {
Row() {
Text(item.title)
.fontSize($r('app.float.detail_title_size'))
... | https://github.com/asasugar/HarmoneyNote.git/blob/2a7f0eeac701ffc41ed09c3c95244fab1bed7489/entry/src/main/ets/view/DetailListComponent.ets#L8-L45 | a2bbade1ddf61103616158c8e06fec1189c85e69 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/GreetingsPage.ets | arkts | getOccasionLabel | 获取场合标签 | private getOccasionLabel(occasion: GreetingOccasion): string {
const labels: Record<GreetingOccasion, string> = {
[GreetingOccasion.BIRTHDAY]: '生日',
[GreetingOccasion.HOLIDAY]: '节日',
[GreetingOccasion.ANNIVERSARY]: '纪念日',
[GreetingOccasion.GRADUATION]: '毕业',
[GreetingOccasion.OTHER]: '... | AST#method_declaration#Left private getOccasionLabel AST#parameter_list#Left ( AST#parameter#Left occasion : AST#type_annotation#Left AST#primary_type#Left GreetingOccasion AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left st... | private getOccasionLabel(occasion: GreetingOccasion): string {
const labels: Record<GreetingOccasion, string> = {
[GreetingOccasion.BIRTHDAY]: '生日',
[GreetingOccasion.HOLIDAY]: '节日',
[GreetingOccasion.ANNIVERSARY]: '纪念日',
[GreetingOccasion.GRADUATION]: '毕业',
[GreetingOccasion.OTHER]: '... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/GreetingsPage.ets#L652-L661 | bef69351d66297918d369421737e2ca61d9b69f6 | github |
htliang128/arkts_oss.git | 9da4a87c36272873c649f556854bd793ac337a18 | htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets | arkts | getClientCert | Getter and setter for clientCert | getClientCert(): http.ClientCert | undefined {
return this.clientCert;
} | AST#method_declaration#Left getClientCert AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left AST#qualified_type#Left http . ClientCert AST#qualified_type#Right AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right AST#union... | getClientCert(): http.ClientCert | undefined {
return this.clientCert;
} | https://github.com/htliang128/arkts_oss.git/blob/9da4a87c36272873c649f556854bd793ac337a18/htliang_oss/src/main/ets/common/comm/CustomHttpRequestOptions.ets#L146-L148 | 378cfef6081c3ff03e0a4484f2cd4f56c67f8704 | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets | arkts | totalCount | 获取聊天信息数组长度函数 | public totalCount(): number {
return this.originDataArray.length;
} | AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expres... | public totalCount(): number {
return this.originDataArray.length;
} | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/model/ChatDataSource.ets#L63-L65 | 3a6ae5a1f3258de8f4fdebe7b9cd8528a647f602 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets | arkts | getSizeValue | 获取尺寸适配值
@returns {string} 尺寸值 | private getSizeValue(): string {
return bp({ sm: "80vp", md: "96vp", lg: "120vp" });
} | AST#method_declaration#Left private getSizeValue AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expre... | private getSizeValue(): string {
return bp({ sm: "80vp", md: "96vp", lg: "120vp" });
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets#L268-L270 | 23df3ba2b1529d44df7599ef71287198f5e98a66 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets | arkts | buildSwitchItem | 构建开关项 | @Builder
buildSwitchItem(label: string, value: boolean, onChange: (value: boolean) => void) {
Row() {
Text(label)
.fontSize(UIConstants.FONT_SIZE_BODY)
.fontColor($r('app.color.text_primary'))
.layoutWeight(1)
Toggle({ type: ToggleType.Switch, isOn: value })
.onChange(... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSwitchItem AST#parameter_list#Left ( AST#parameter#Left label : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Le... | @Builder
buildSwitchItem(label: string, value: boolean, onChange: (value: boolean) => void) {
Row() {
Text(label)
.fontSize(UIConstants.FONT_SIZE_BODY)
.fontColor($r('app.color.text_primary'))
.layoutWeight(1)
Toggle({ type: ToggleType.Switch, isOn: value })
.onChange(... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L705-L719 | 72797284c3545871335a11571bce4f271be11259 | github |
zhangyuhang0914/ArkTs-HarmonyOs.git | c9773cad7ebeee413f98ee1a57cc8fba91fecf7d | entry/src/main/ets/components/CommonComponents.ets | arkts | BackHeader | 通用返回Header组件 | @Component
export struct BackHeader {
@Prop title: string
@Prop alpha: number
@State statusBarHeight: number = 0
private titleAlignment: TextAlign = TextAlign.Center
private backButton: boolean = true
private onBackClick?: () => void
aboutToAppear() {
this.setSystemStatusBar()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct BackHeader AST#ERROR#Left { AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right A... | @Component
export struct BackHeader {
@Prop title: string
@Prop alpha: number
@State statusBarHeight: number = 0
private titleAlignment: TextAlign = TextAlign.Center
private backButton: boolean = true
private onBackClick?: () => void
aboutToAppear() {
this.setSystemStatusBar()
} | https://github.com/zhangyuhang0914/ArkTs-HarmonyOs.git/blob/c9773cad7ebeee413f98ee1a57cc8fba91fecf7d/entry/src/main/ets/components/CommonComponents.ets#L83-L94 | d418c039915e1ac5edb7a5606420e02cc3dc4ba2 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/TcpServer.ets | arkts | sendMessage | 发送消息到服务端 | sendMessage() {
if (!this.message) {
Logger.error('Some required fields are missing.');
this.msgHistory += 'Some required fields are missing.' + '\r\n';
return;
}
let tcpMessage: TcpMessage = {
type: 'sendMessage',
message: this.message,
};
workerPort.postMessage(
... | AST#method_declaration#Left sendMessage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right AST#unary_exp... | sendMessage() {
if (!this.message) {
Logger.error('Some required fields are missing.');
this.msgHistory += 'Some required fields are missing.' + '\r\n';
return;
}
let tcpMessage: TcpMessage = {
type: 'sendMessage',
message: this.message,
};
workerPort.postMessage(
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/NetWork_Kit/NetWorkKit_Datatransmission/Socket/entry/src/main/ets/connect/TcpServer.ets#L223-L251 | dbf6882b5a4c952362d4451334bcb12a2eb116dc | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_history_index_lite.ets | arkts | log_head_worker | The head of logging information for workers.
@returns "[Meow][bunch_of_history_index]" | static log_head_worker() {
return '[Meow][bunch_of_history_index_add_only][Worker]';
} | AST#method_declaration#Left static log_head_worker AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left '[Meow][bunch_of_history_index_add_only][Worker]' AST#expression#Right ; AST#return_statement#Right AST#statement#Rig... | static log_head_worker() {
return '[Meow][bunch_of_history_index_add_only][Worker]';
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_history_index_lite.ets#L190-L192 | eed8bb407adb243b5fc51ba5ccbee95822fabac8 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/doc/VHDocPageComponent.ets | arkts | onDocSwitchStatus | @description 是否显示文档
@param switchStatus 状态 | onDocSwitchStatus(switchStatus: boolean) {
this.showDoc = switchStatus;
} | AST#method_declaration#Left onDocSwitchStatus AST#parameter_list#Left ( AST#parameter#Left switchStatus : 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#builder_function_body#Left { AST#expression_statement#Left ... | onDocSwitchStatus(switchStatus: boolean) {
this.showDoc = switchStatus;
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/doc/VHDocPageComponent.ets#L105-L107 | 76c10bdd58a7ff98a94286420ae2d23764584dc6 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/cigen/CigenWordHelper.ets | arkts | getRefWords | ============================================================ 同 CID 的所有单词(wordsOfSameCigen / wordsOfSameCid) ============================================================ | static async getRefWords(cigen: CigenWord): Promise<Array<WordUser> | null> {
const cid = cigen.cid;
if (!cid) return null;
// 不做缓存,保持与你原 Kotlin 逻辑一致
const list = await CigenWordDbAccess.shared.getCigenWordsByCid(cid);
if (!list || list.length === 0) return null;
const titleSet = new Set<strin... | AST#method_declaration#Left static async getRefWords AST#parameter_list#Left ( AST#parameter#Left cigen : AST#type_annotation#Left AST#primary_type#Left CigenWord 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 getRefWords(cigen: CigenWord): Promise<Array<WordUser> | null> {
const cid = cigen.cid;
if (!cid) return null;
const list = await CigenWordDbAccess.shared.getCigenWordsByCid(cid);
if (!list || list.length === 0) return null;
const titleSet = new Set<string>();
for (const ite... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/cigen/CigenWordHelper.ets#L13-L33 | 6e8afe7b47b44687d6aa1919b1ebf77139adfe18 | github |
lulululing/calendar.git | c87b7e3ffb50a34941a5db50afe6a513c113bd0b | entry/src/main/ets/utils/DateUtil.ets | arkts | getFirstDayOfMonth | 获取月份第一天是星期几 (0-6, 0代表周日) | static getFirstDayOfMonth(year: number, month: number): number {
return new Date(year, month, 1).getDay()
} | AST#method_declaration#Left static getFirstDayOfMonth AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left month : AST#type_annotation#Left AST#primary_type#Left number AST#prim... | static getFirstDayOfMonth(year: number, month: number): number {
return new Date(year, month, 1).getDay()
} | https://github.com/lulululing/calendar.git/blob/c87b7e3ffb50a34941a5db50afe6a513c113bd0b/entry/src/main/ets/utils/DateUtil.ets#L26-L28 | 116e94db050f04420fb75934cca26fe7276ec58e | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/user/RrewardSection.ets | arkts | RewardSectionComponent | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct RewardSectionComponent {
@Builder
options(img: Resource, label: Resource) {
Column() {
Image(img)
.aspectRatio(1)
.width(40)
.objectFit(ImageFit.Contain)
Text(label)
.margin({
top: 12
})
.fontSize(12)
}
.width... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct RewardSectionComponent AST#component_body#Left { AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right options AST#parameter_list#Left ( AST#parameter#Left img : AST#type_annotation#Left AST#pri... | @Component
export struct RewardSectionComponent {
@Builder
options(img: Resource, label: Resource) {
Column() {
Image(img)
.aspectRatio(1)
.width(40)
.objectFit(ImageFit.Contain)
Text(label)
.margin({
top: 12
})
.fontSize(12)
}
.width... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Solutions/Shopping/OrangeShopping/feature/navigationHome/src/main/ets/components/user/RrewardSection.ets#L16-L52 | a4439e63b54b8c829d75422da425ddc7fd07e073 | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/services/NotificationService.ets | arkts | requestNotificationPermission | 请求通知权限 | private async requestNotificationPermission(context: common.UIAbilityContext): Promise<boolean> {
try {
const isEnabled = await notificationManager.isNotificationEnabled();
if (!isEnabled) {
// 引导用户开启通知权限
await notificationManager.requestEnableNotification(context);
}
return ... | AST#method_declaration#Left private async requestNotificationPermission AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) ... | private async requestNotificationPermission(context: common.UIAbilityContext): Promise<boolean> {
try {
const isEnabled = await notificationManager.isNotificationEnabled();
if (!isEnabled) {
await notificationManager.requestEnableNotification(context);
}
return await notific... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/NotificationService.ets#L89-L101 | ddea3e944bb0a5a6265fec24bf8d02e129257b31 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/TaskManagement/ReminderAgentManager/entry/src/main/ets/util/TimeConversion.ets | arkts | timeToMillisecond | Converts the time units obtained in the time selection component to milliseconds | timeToMillisecond(hour: number, minute: number) {
let nowTime: Date = new Date
let nowAllTime: number = nowTime.getHours() * HOUR_SECONDS + nowTime.getMinutes() *
MINUTES_SECONDS + nowTime.getSeconds()
let selectAllTime: number = (hour * HOUR_SECONDS + minute * MINUTES_SECONDS)
let delayTime: number... | AST#method_declaration#Left timeToMillisecond AST#parameter_list#Left ( AST#parameter#Left hour : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left minute : AST#type_annotation#Left AST#primary_type#Left number AST#primary_typ... | timeToMillisecond(hour: number, minute: number) {
let nowTime: Date = new Date
let nowAllTime: number = nowTime.getHours() * HOUR_SECONDS + nowTime.getMinutes() *
MINUTES_SECONDS + nowTime.getSeconds()
let selectAllTime: number = (hour * HOUR_SECONDS + minute * MINUTES_SECONDS)
let delayTime: number... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/TaskManagement/ReminderAgentManager/entry/src/main/ets/util/TimeConversion.ets#L27-L36 | 9b4c07f7878027ee5a81f7267453d5c478966ac1 | gitee |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | keys | Set the key value.
@since 10 | static keys(): Array<string> {
throw new Error("PersistentStorage.keys is not implemented")
} | AST#method_declaration#Left static keys AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#... | static keys(): Array<string> {
throw new Error("PersistentStorage.keys is not implemented")
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L420-L422 | ffcc61d9da7772c53249a9030181510b914373ef | gitee |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/animation/param/RotateAnimateOptions.ets | arkts | @author: HHBin
@date: 2024-11-23
@desc: 旋转动画 | export class RotateAnimateOptions implements INavAnimateOptions {
_options?: RotateOptions;
_isBeforePage: boolean = false
constructor | AST#export_declaration#Left export AST#ERROR#Left class RotateAnimateOptions AST#implements_clause#Left implements INavAnimateOptions AST#implements_clause#Right { AST#property_declaration#Left _options ? : AST#type_annotation#Left AST#primary_type#Left RotateOptions AST#primary_type#Right AST#type_annotation#Right ; A... | export class RotateAnimateOptions implements INavAnimateOptions {
_options?: RotateOptions;
_isBeforePage: boolean = false
constructor | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/animation/param/RotateAnimateOptions.ets#L10-L14 | 661b52bdae42a4eff2484b19df34883d082d1c73 | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets | arkts | calculate | Calculates the minimum / maximum and range values of the axis with the given
minimum and maximum values from the chart data.
@param dataMin the min value according to chart data
@param dataMax the max value according to chart data | public calculate(dataMin: number, dataMax: number): void {
// if custom, use value as is, else use data value
var min: number = this.mCustomAxisMin ? this.mAxisMinimum : dataMin - this.mSpaceMin;
var max: number = this.mCustomAxisMax ? this.mAxisMaximum : dataMax + this.mSpaceMax;
// temporary range (b... | AST#method_declaration#Left public calculate AST#parameter_list#Left ( AST#parameter#Left dataMin : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataMax : AST#type_annotation#Left AST#primary_type#Left number AST#primary_... | public calculate(dataMin: number, dataMax: number): void {
var min: number = this.mCustomAxisMin ? this.mAxisMinimum : dataMin - this.mSpaceMin;
var max: number = this.mCustomAxisMax ? this.mAxisMaximum : dataMax + this.mSpaceMax;
var range: number = Math.abs(max - min);
if (range == 0)... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/AxisBase.ets#L754-L773 | 3fd1557af902f23b3fcf3b342c80fc10b1e69e88 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/timer/TimerDialog.ets | arkts | closeDialog | 关闭窗口 | private closeDialog() {
this.stopTimer();
this.showTimerDialog = false;
} | AST#method_declaration#Left private closeDialog AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . stopTimer AST#me... | private closeDialog() {
this.stopTimer();
this.showTimerDialog = false;
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/timer/TimerDialog.ets#L51-L54 | 010bcf8720dd653711e86d673c3fbb25b83e2773 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/view/ProfilePage.ets | arkts | ProfileContent | 个人中心页面内容视图
@returns {void} 无返回值 | @Builder
private ProfileContent(): void {
Scroll() {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
top: $r("app.float.space_vertical_medium")
}
}) {
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private ProfileContent 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#arkts_ui_element#Left AST#u... | @Builder
private ProfileContent(): void {
Scroll() {
ColumnStart({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
top: $r("app.float.space_vertical_medium")
}
}) {
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/view/ProfilePage.ets#L54-L91 | a9eef05a629ee8e9305137566d4ee9f6313497d6 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | common full length. | export const FULL_LENGTH = '100%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left FULL_LENGTH = AST#expression#Left '100%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declaration#Right AST#export_declaration#Right | export const FULL_LENGTH = '100%'; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets#L33-L33 | cfe16bec6ed136a25b1e2ccd88062e176864b1a9 | gitee | |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/models/TaskModel.ets | arkts | 任务数据模型 | export interface TaskItem {
id: string;
name: string;
estimatedTime: number; // 预估时长(秒)
actualTime?: number; // 实际用时(秒)
completedTime?: number; // 完成时间戳
status: 'pending' | 'completed';
} | AST#export_declaration#Left export AST#interface_declaration#Left interface TaskItem AST#object_type#Left { AST#type_member#Left id : 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 name : AST#type_annotation#Left AST#pr... | export interface TaskItem {
id: string;
name: string;
estimatedTime: number;
actualTime?: number;
completedTime?: number;
status: 'pending' | 'completed';
} | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/models/TaskModel.ets#L4-L11 | 4461de0e85af68726dfe14a611e1b85e18c6c4c3 | github | |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/pages/components/ChatTitleBar.ets | arkts | CustomeTitleBar | 聊天界面的自定义标题栏组件。
@author Jack Jiang(http://www.52im.net/thread-2792-1-1.html) | @Preview
@Component
export struct CustomeTitleBar {
// 连接状态:false 连接断开、true 连接正常
@Prop connectStatus: boolean;
@Prop keepAliveStatus: boolean;
// 返回按钮图片
backImg: Resource = $r("app.media.widget_title_btn_back_normal");
build() {
Column() {
Row() {
Row() {
Text('HarmonyChat')... | AST#decorated_export_declaration#Left AST#decorator#Left @ Preview AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct CustomeTitleBar AST#component_body#Left { // 连接状态:false 连接断开、true 连接正常 AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right connectStatus : AST#t... | @Preview
@Component
export struct CustomeTitleBar {
@Prop connectStatus: boolean;
@Prop keepAliveStatus: boolean;
backImg: Resource = $r("app.media.widget_title_btn_back_normal");
build() {
Column() {
Row() {
Row() {
Text('HarmonyChat')
.textAlign(TextAlign.Sta... | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/components/ChatTitleBar.ets#L19-L157 | 6cad832276fbe059d3bfdf2ad27741e7beefa84a | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example2/components/MonthDataSource.ets | arkts | should be insert by ui-plugins | export interface Month {
month: string; // 具体年月
num: number; // 月份
days: number[]; // 该月日期
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Month AST#object_type#Left { AST#type_member#Left month : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; // 具体年月 AST#type_member#Left num : AST#type_annotation#Left... | export interface Month {
month: string;
num: number;
days: number[];
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example2/components/MonthDataSource.ets#L35-L39 | 47193cf84e7c69b83796feabf2b6aa8a8e2c41ad | gitee | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/CategoryPage.ets | arkts | SubCategoryGrid | 子分类网格 | @Builder
SubCategoryGrid(children: CategoryChild[]) {
Grid() {
ForEach(children, (child: CategoryChild) => {
GridItem() {
Column({ space: AppDimensions.spaceXSmall }) {
Image(child.pic)
.width('100%')
.aspectRatio(1)
.borderRadius(AppDi... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right SubCategoryGrid AST#parameter_list#Left ( AST#parameter#Left children : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left CategoryChild [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Ri... | @Builder
SubCategoryGrid(children: CategoryChild[]) {
Grid() {
ForEach(children, (child: CategoryChild) => {
GridItem() {
Column({ space: AppDimensions.spaceXSmall }) {
Image(child.pic)
.width('100%')
.aspectRatio(1)
.borderRadius(AppDi... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/pages/CategoryPage.ets#L142-L169 | 67e3b0da3a0135dccdbf0a74244f6d9c19accdb2 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | GraphicImage/GestureScreenshot/entry/src/main/ets/view/AreaScreenshot.ets | arkts | AreaScreenShot | Custom component to determine the screenshot area. | @Component
export default struct AreaScreenShot {
@Link showScreen: boolean;
@Link pixelMap: image.PixelMap;
@Link scaleNum: ScaleInterface;
private screenAspectRatio: number = 0;
dialogController: CustomDialogController = new CustomDialogController({
builder: ScreenshotDialog({
pixelMap: this.pixel... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct AreaScreenShot AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right showScreen : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right A... | @Component
export default struct AreaScreenShot {
@Link showScreen: boolean;
@Link pixelMap: image.PixelMap;
@Link scaleNum: ScaleInterface;
private screenAspectRatio: number = 0;
dialogController: CustomDialogController = new CustomDialogController({
builder: ScreenshotDialog({
pixelMap: this.pixel... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/GraphicImage/GestureScreenshot/entry/src/main/ets/view/AreaScreenshot.ets#L29-L160 | 6494a7ea4deed3fc67fcf1119e942ca9286b367d | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api20/entry/src/main/ets/MainAbility/pages/Swiper/BasicDataSource.ets | arkts | deleteData | 在index位置删除1个数据 | public deleteData(index: number): void {
this.dataArray.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 {
this.dataArray.splice(index, 1);
this.notifyDataDelete(index);
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_api20/entry/src/main/ets/MainAbility/pages/Swiper/BasicDataSource.ets#L97-L100 | 8fe90a8ff3a6907909b04f28b18aa98f0f21c8b7 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | 渲染布局
@returns {void} 无返回值
@example
RowStartCenter() { Text("Hi"); } | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: VerticalAlign.Center,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,
... | AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left RowBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expression#L... | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: VerticalAlign.Center,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.marginValue,
... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L284-L299 | afc8260adb570aeb60952e6e6b516b8f842f3ecc | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | RowCenterTop | 横向居中 + 垂直顶部 | @ComponentV2
export struct RowCenterTop {
/**
* Row 构造参数
*/
@Param
options: RowOptions | RowOptionsV2 = {};
/**
* 宽度
*/
@Param
widthValue: Length | undefined = undefined;
/**
* 高度
*/
@Param
heightValue: Length | undefined = undefined;
/**
* 尺寸(对应官方 size 属性)
*/
@Param
size... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RowCenterTop AST#component_body#Left { /**
* Row 构造参数
*/ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right options : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Lef... | @ComponentV2
export struct RowCenterTop {
@Param
options: RowOptions | RowOptionsV2 = {};
@Param
widthValue: Length | undefined = undefined;
@Param
heightValue: Length | undefined = undefined;
@Param
sizeValue: SizeOptions | undefined = undefined;
@Param
paddingValue: Padding | Length... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L625-L700 | 029079df4a527599e1c13845d1d17b7f47fd71b1 | github |
batiluoxuanwan/MomentFlow.git | e57aa461223abca74f48893afc2ccf7c2d73e9b8 | frontend/entry/src/main/ets/utils/ExportUtil.ets | arkts | 💡 导入文件 URI 转换工具 | export class ExportUtil {
static async downloadAndSharePdf(diaryId: number, context: common.UIAbilityContext): Promise<void> {
const httpRequest: http.HttpRequest = http.createHttp();
try {
// 1. 获取 PDF 数据
const res: http.HttpResponse = await httpRequest.request(
`http://10.0.2.2:8080/api... | AST#export_declaration#Left export AST#class_declaration#Left class ExportUtil AST#class_body#Left { AST#method_declaration#Left static async downloadAndSharePdf AST#parameter_list#Left ( AST#parameter#Left diaryId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ... | export class ExportUtil {
static async downloadAndSharePdf(diaryId: number, context: common.UIAbilityContext): Promise<void> {
const httpRequest: http.HttpRequest = http.createHttp();
try {
const res: http.HttpResponse = await httpRequest.request(
`http://10.0.2.2:8080/api/diary/export/p... | https://github.com/batiluoxuanwan/MomentFlow.git/blob/e57aa461223abca74f48893afc2ccf7c2d73e9b8/frontend/entry/src/main/ets/utils/ExportUtil.ets#L8-L62 | 7650253557b3a0a5eb1e7fb06f45a24d6d6b634d | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/eraser/src/main/ets/model/RenderNodeModel.ets | arkts | draw | RenderNode进行绘制时会调用draw方法 | draw(context: DrawContext): void {
const canvas = context.canvas;
// 设置画笔的颜色混合模式,根据不同的混合模式实现涂鸦和擦除效果
this.pen.setBlendMode(this.blendMode);
// 设置画笔的线宽,单位px
this.pen.setStrokeWidth(this.lineStrokeWidth);
// 将Pen画笔设置到canvas中
canvas.attachPen(this.pen);
// 绘制path
canvas.drawPath(this.pat... | AST#method_declaration#Left draw AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left DrawContext 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 ... | draw(context: DrawContext): void {
const canvas = context.canvas;
this.pen.setBlendMode(this.blendMode);
this.pen.setStrokeWidth(this.lineStrokeWidth);
canvas.attachPen(this.pen);
canvas.drawPath(this.path);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/eraser/src/main/ets/model/RenderNodeModel.ets#L50-L60 | 2a2441c7a996297f6df09df8401a76b0fbdb87b4 | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_onAreaChange/entry/src/main/ets/MainAbility/view/position/WaterFlowView.ets | arkts | WaterFlowView | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct WaterFlowView {
@Link _position: Position;
private componentKey: string;
@State minSize: number = 50;
@State maxSize: number = 100;
@State fontSize: number = 24;
@State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F];
scroller: Scroller = new Scroll... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct WaterFlowView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ Link AST#decorator#Right _position : AST#type_annotation#Left AST#primary_type#Left Position AST#primary_type#Right AST#type_a... | @Component
export struct WaterFlowView {
@Link _position: Position;
private componentKey: string;
@State minSize: number = 50;
@State maxSize: number = 100;
@State fontSize: number = 24;
@State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F];
scroller: Scroller = new Scroll... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_onAreaChange/entry/src/main/ets/MainAbility/view/position/WaterFlowView.ets#L16-L38 | d48813f8410499f4165671061d94462675ddf550 | gitee |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/viewmodel/SecurityData.ets | arkts | 安防模式Item实体 | export class SecurityModeItemType {
type: string = ""
name: string
imageSrc: ResourceStr
constructor | AST#export_declaration#Left export AST#ERROR#Left class SecurityModeItemType { type AST#ERROR#Left : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "" AST#expression#Right name : string imageSrc AST#ERROR#Right : ResourceStr AST#ERROR#Right A... | export class SecurityModeItemType {
type: string = ""
name: string
imageSrc: ResourceStr
constructor | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/SecurityData.ets#L41-L46 | f6a8825394b05ddc8c31a9059e035d00fe27d6ae | github | |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/models/UserModel.ets | arkts | login | 用户登录 | static async login(username: string, password: string): Promise<OperationResult> {
if (!username || !password) {
const result: OperationResult = { success: false, message: '用户名和密码不能为空' };
return result;
}
try {
const users = await UserManager.getAllUsers();
const user = users[userna... | AST#method_declaration#Left static async login AST#parameter_list#Left ( AST#parameter#Left username : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left password : AST#type_annotation#Left AST#primary_type#Left string AST#prim... | static async login(username: string, password: string): Promise<OperationResult> {
if (!username || !password) {
const result: OperationResult = { success: false, message: '用户名和密码不能为空' };
return result;
}
try {
const users = await UserManager.getAllUsers();
const user = users[userna... | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/models/UserModel.ets#L84-L117 | 833e8044d84a7ca33da8253b9cdeacaf80b67c21 | github |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/ui_tools.ets | arkts | Continue
Determines if the url is ok to be continued on another device.
@param url The url.
@param storage The LocalStorage. If filled then the result is saved to 'sharable_continuable'.
@returns True or false. | export function is_address_continuable(url: string, storage?: LocalStorage) {
let result = true;
if (url.substring(0, 7) == 'meow://') {
// Is internal page
console.log('[is_address_continuable] False! [' + url + '].');
result = false
} else {
console.log('[is_address_continuable] True! [' + url +... | AST#export_declaration#Left export AST#function_declaration#Left function is_address_continuable AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left storage ? : AST#type_annotat... | export function is_address_continuable(url: string, storage?: LocalStorage) {
let result = true;
if (url.substring(0, 7) == 'meow://') {
console.log('[is_address_continuable] False! [' + url + '].');
result = false
} else {
console.log('[is_address_continuable] True! [' + url + '].');
}
stora... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L122-L133 | 8d68462d2a6d4aaa2867db4771c4688b553c70dc | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/toolbox/Index.ets | arkts | FloatingWindow | 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 { FloatingWindow } from './src/main/ets/utils/FloatingWindow' | AST#export_declaration#Left export { FloatingWindow } from './src/main/ets/utils/FloatingWindow' AST#export_declaration#Right | export { FloatingWindow } from './src/main/ets/utils/FloatingWindow' | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/Index.ets#L16-L16 | f0cf82f4058fef317289540f000c267b4b61c1f6 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/arkweb/ArkWebHelper.ets | arkts | deleteAllData | 清除Web SQL数据库当前使用的所有存储。
@param incognito 清除Web SQL数据库当前使用的所有存储。 | static deleteAllData(incognito?: boolean): void {
webview.WebStorage.deleteAllData(incognito);
} | AST#method_declaration#Left static deleteAllData AST#parameter_list#Left ( AST#parameter#Left incognito ? : 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#pri... | static deleteAllData(incognito?: boolean): void {
webview.WebStorage.deleteAllData(incognito);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkWebHelper.ets#L266-L268 | 35866fcfdbd9d2a9320093ea39acd18741cf8dd9 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets | arkts | getBaseWordByText | ========================================================== 根据英文文本查询 BaseWord(带编码/去盐处理) ========================================================== | async getBaseWordByText(enText: string): Promise<BaseWord | null> {
if (!this.db) return null;
const encodedText = StringEncoder.encodedToBase64(enText);
if (!encodedText) return null;
const sql = `
SELECT *
FROM ${Table.Name.baseWord}
WHERE SUBSTR(${Table.Col.titleEn}, ${DB.salt + 1... | AST#method_declaration#Left async getBaseWordByText AST#parameter_list#Left ( AST#parameter#Left enText : 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_typ... | async getBaseWordByText(enText: string): Promise<BaseWord | null> {
if (!this.db) return null;
const encodedText = StringEncoder.encodedToBase64(enText);
if (!encodedText) return null;
const sql = `
SELECT *
FROM ${Table.Name.baseWord}
WHERE SUBSTR(${Table.Col.titleEn}, ${DB.salt + 1... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets#L88-L100 | 834d8a51ee5e3c6cab7e975850a448f7b1f7eae3 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets | arkts | getInstance | Obtaining a class instance.
@returns Class instance. | static getInstance(): RemoteDeviceUtil {
if (RemoteDeviceUtil.dmInstance === undefined) {
RemoteDeviceUtil.dmInstance = new RemoteDeviceUtil();
}
return RemoteDeviceUtil.dmInstance;
} | AST#method_declaration#Left static getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RemoteDeviceUtil AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Le... | static getInstance(): RemoteDeviceUtil {
if (RemoteDeviceUtil.dmInstance === undefined) {
RemoteDeviceUtil.dmInstance = new RemoteDeviceUtil();
}
return RemoteDeviceUtil.dmInstance;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributeDraw/entry/src/main/ets/common/utils/RemoteDeviceUtil.ets#L43-L48 | f5dd4c9f6fdb71deb40f4230afcecc0739e4ae1b | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.file.PhotoPickerComponent.d.ets | arkts | AnimatorParams
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 12 | export declare class AnimatorParams {
/**
* Animate duration
*
* @type { ?number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/
duration?: number;
/**
* Animate curve
*
* @type { ?Curve | ICurve | string }
* @syscap SystemCapabi... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class AnimatorParams AST#class_body#Left { /**
* Animate duration
*
* @type { ?number }
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/ AST#property_... | export declare class AnimatorParams {
duration?: number;
curve?: Curve | ICurve | string;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.PhotoPickerComponent.d.ets#L696-L716 | 1fad4c84e56940eeffc9480f58ccac40e83d39d6 | gitee | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | DealStrideSolution/entry/src/main/ets/utils/CameraServiceTwo.ets | arkts | createPreviewOutputFn | Create the previewOutput output object | createPreviewOutputFn(cameraManager: camera.CameraManager, previewProfileObj: camera.Profile,
surfaceId: string): camera.PreviewOutput | undefined {
let previewOutput: camera.PreviewOutput | undefined = undefined;
try {
previewOutput = cameraManager.createPreviewOutput(previewProfileObj, surfaceId);
... | AST#method_declaration#Left createPreviewOutputFn AST#parameter_list#Left ( AST#parameter#Left cameraManager : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . CameraManager AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ... | createPreviewOutputFn(cameraManager: camera.CameraManager, previewProfileObj: camera.Profile,
surfaceId: string): camera.PreviewOutput | undefined {
let previewOutput: camera.PreviewOutput | undefined = undefined;
try {
previewOutput = cameraManager.createPreviewOutput(previewProfileObj, surfaceId);
... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/DealStrideSolution/entry/src/main/ets/utils/CameraServiceTwo.ets#L277-L287 | f1fb8dee7d1255b756eb08878757c24977e7e03a | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/component/TextInputDialogView.ets | arkts | getMaxWidth | 获取底部类弹框的最大宽度
@param maxWidth 默认360vp
@returns 单位vp | private getMaxWidth(maxWidth: Length = 360): number {
if (this.isLargeScreen()) {
let oldWidth = 360;
try {
if (typeof maxWidth === 'number') { //number
oldWidth = maxWidth;
} else if (typeof maxWidth === 'string') { //string
oldWidth = this.getVpByStr(maxWidth);
... | AST#method_declaration#Left private getMaxWidth AST#parameter_list#Left ( AST#parameter#Left maxWidth : AST#type_annotation#Left AST#primary_type#Left Length AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 360 AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotati... | private getMaxWidth(maxWidth: Length = 360): number {
if (this.isLargeScreen()) {
let oldWidth = 360;
try {
if (typeof maxWidth === 'number') {
oldWidth = maxWidth;
} else if (typeof maxWidth === 'string') {
oldWidth = this.getVpByStr(maxWidth);
} else {
... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/component/TextInputDialogView.ets#L191-L219 | 58f56963f5b91cf6a9a8830d999d86335e68b800 | gitee |
LiuAnclouds/Harmony-ArkTS-App.git | 2119ce333927599b81a31081bc913e1416837308 | WeatherMind/entry/src/main/ets/pages/ChooseCity.ets | arkts | getSortedLetters | 获取排序后的字母列表 | private getSortedLetters(): string[] {
let cityGroups = this.groupCitiesByLetter();
return Array.from(cityGroups.keys()).sort();
} | AST#method_declaration#Left private getSortedLetters AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_decla... | private getSortedLetters(): string[] {
let cityGroups = this.groupCitiesByLetter();
return Array.from(cityGroups.keys()).sort();
} | https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/ChooseCity.ets#L896-L899 | 83e9de8033bfc9c573ca42f63b6cd26b5124a168 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/exception_throw/exception_finally_001_T.ets | arkts | Introduction 异常抛出-finally块 | export function exception_finally_001_T(taint_src : string) {
try {}
catch (e) {}
finally {
taint.Sink(taint_src);
}
} | AST#export_declaration#Left export AST#function_declaration#Left function exception_finally_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_state... | export function exception_finally_001_T(taint_src : string) {
try {}
catch (e) {}
finally {
taint.Sink(taint_src);
}
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/exception_throw/exception_finally_001_T.ets#L6-L12 | 3c73cfbafc6330069edbcdf135ccb11610d6d7ae | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/social/CommunityService.ets | arkts | followUser | 关注用户 | async followUser(userId: string): Promise<boolean> {
try {
if (!this.currentUser || userId === this.currentUser.id) return false;
// TODO: 关注用户
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `User followed: ${userId}`);
return true;
} catch (error) {
hilog.error(LogCons... | AST#method_declaration#Left async followUser 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_type#Left ... | async followUser(userId: string): Promise<boolean> {
try {
if (!this.currentUser || userId === this.currentUser.id) return false;
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `User followed: ${userId}`);
return true;
} catch (error) {
hilog.error(LogConstants.DOMAIN_... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/social/CommunityService.ets#L608-L620 | f684825d43ed8ecb3482543c620b89fcb8a1fc1c | github |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/utils/DataSyncVerifier.ets | arkts | simulatePomodoroSessions | 模拟番茄钟执行过程 | async simulatePomodoroSessions(taskId: number, sessionCount: number): Promise<string[]> {
const results: string[] = [];
try {
const task = this.taskViewModel.getTaskById(taskId);
if (!task) {
results.push(`❌ 任务 ${taskId} 不存在`);
return results;
}
results.push(`🍅 开始模拟任务「... | AST#method_declaration#Left async simulatePomodoroSessions AST#parameter_list#Left ( AST#parameter#Left taskId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sessionCount : AST#type_annotation#Left AST#primary_type#Left n... | async simulatePomodoroSessions(taskId: number, sessionCount: number): Promise<string[]> {
const results: string[] = [];
try {
const task = this.taskViewModel.getTaskById(taskId);
if (!task) {
results.push(`❌ 任务 ${taskId} 不存在`);
return results;
}
results.push(`🍅 开始模拟任务「... | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/utils/DataSyncVerifier.ets#L109-L151 | 16894a8bcfcb895054798d598a707648692ed6e0 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets | arkts | setSpaceTop | Sets the top axis space in percent of the full range. Default 10f
@param percent | public setSpaceTop(percent: number): void {
this.mSpacePercentTop = percent;
} | AST#method_declaration#Left public setSpaceTop AST#parameter_list#Left ( AST#parameter#Left percent : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_ty... | public setSpaceTop(percent: number): void {
this.mSpacePercentTop = percent;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L272-L274 | eb691c2fbaa7d8b59345c784658d9ab8b0a8a38e | gitee |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/pages/Protocol.ets | arkts | aboutToAppear(): void { const componentContent = new ComponentContent( this.uiContext, wrapBuilder<[Params]>(builderOverlay), new Params(this.uiContext, { x: '2%', y: '3%', }) ) this.overlayNode.addComponentContent(componentContent, 100) // 设置较高层级 this.overlayContent.push(componentContent) } aboutToDisappear(): void { ... | build() {
Column() {
// 资源文件route.html存放路径src/main/resources/rawfile
Web({ src: $rawfile('Protocol.html'), controller: this.webviewController })
}
} | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { // 资源文件route.html存放路径src/main/resources/rawfile AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Web ( A... | build() {
Column() {
Web({ src: $rawfile('Protocol.html'), controller: this.webviewController })
}
} | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/pages/Protocol.ets#L53-L59 | eba8d9a78158bba21d9ed15dc18738ab9bc658a6 | gitee | |
IceYuanyyy/OxHornCampus.git | bb5686f77fa36db89687502e35898cda218d601f | entry/src/main/ets/controller/MapController.ets | arkts | getResourceString | Obtains the resource name.
@param resource Resource file.
@returns Resource File Name. | getResourceString(resource: Resource): string {
let resourceString: string = '';
try {
resourceString = uiContext!.getHostContext()!.resourceManager.getStringSync(resource.id);
} catch (error) {
Logger.error(TAG, `getResourceString failed, error code: ${(error as BusinessError).code},
mes... | AST#method_declaration#Left getResourceString AST#parameter_list#Left ( AST#parameter#Left resource : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primar... | getResourceString(resource: Resource): string {
let resourceString: string = '';
try {
resourceString = uiContext!.getHostContext()!.resourceManager.getStringSync(resource.id);
} catch (error) {
Logger.error(TAG, `getResourceString failed, error code: ${(error as BusinessError).code},
mes... | https://github.com/IceYuanyyy/OxHornCampus.git/blob/bb5686f77fa36db89687502e35898cda218d601f/entry/src/main/ets/controller/MapController.ets#L146-L155 | 1768a64604b20099e43f83436b8005d853bdaa77 | github |
L1rics06/arkTS-.git | 991fd131bfdb11e2933152133c97453d86092ac0 | entry/src/main/ets/pages/NetworkUtil.ets | arkts | 通知列表请求参数 | export interface NoticeListParams {
id: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface NoticeListParams AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#interface_declaration#R... | export interface NoticeListParams {
id: string;
} | https://github.com/L1rics06/arkTS-.git/blob/991fd131bfdb11e2933152133c97453d86092ac0/entry/src/main/ets/pages/NetworkUtil.ets#L195-L197 | 2e37003a35a8e4add74fcd083109f1e47f9ce9eb | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/CommonTypes.ets | arkts | 搜索参数接口 | export interface SearchParams {
keyword?: string;
relationType?: RelationType;
gender?: Gender;
tags?: string[];
isLunar?: boolean;
sortBy?: string;
sortOrder?: 'asc' | 'desc';
} | AST#export_declaration#Left export AST#interface_declaration#Left interface SearchParams AST#object_type#Left { AST#type_member#Left keyword ? : 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 relationType ? : AST#type_a... | export interface SearchParams {
keyword?: string;
relationType?: RelationType;
gender?: Gender;
tags?: string[];
isLunar?: boolean;
sortBy?: string;
sortOrder?: 'asc' | 'desc';
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/CommonTypes.ets#L164-L172 | 34c15bfd70605ba485583a331e38d234d3500d45 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | BptaUseResources/entry/src/main/ets/pages/music/AudioRenderer.ets | arkts | onForeground | Create an AudioRenderer based on the service requirements at the foreground | onForeground(): void {
audio.createAudioRenderer(audioRendererOptions, ((err: BusinessError) => {}));
} | AST#method_declaration#Left onForeground AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#... | onForeground(): void {
audio.createAudioRenderer(audioRendererOptions, ((err: BusinessError) => {}));
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/BptaUseResources/entry/src/main/ets/pages/music/AudioRenderer.ets#L43-L45 | 619fe713b1139959d2c3adc58b1460e4ed994897 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/IPC/ObjectTransfer/IPC_Client/entry/src/main/ets/client/cnn/IPC_Client.ets | arkts | sendArrayBuffer | 处理arraybuffer数据,调用sendData发送至服务端 | static sendArrayBuffer(str: string) {
if (proxy == undefined) {
hilog.info(DOMAIN, TAG, 'undefined proxy');
return;
}
let option = new rpc.MessageOption();
let data = rpc.MessageSequence.create();
let reply = rpc.MessageSequence.create();
// 将str转为ArrayBuffer
const encoder = new... | AST#method_declaration#Left static sendArrayBuffer 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_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left ... | static sendArrayBuffer(str: string) {
if (proxy == undefined) {
hilog.info(DOMAIN, TAG, 'undefined proxy');
return;
}
let option = new rpc.MessageOption();
let data = rpc.MessageSequence.create();
let reply = rpc.MessageSequence.create();
const encoder = new util.TextEncoder('u... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/IPC/ObjectTransfer/IPC_Client/entry/src/main/ets/client/cnn/IPC_Client.ets#L93-L122 | f8e4ee647728e707bd71bb560e900427588d3d2f | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets | arkts | push | 通过获取页面栈跳转到指定页面 | public static async push(url: string): Promise<void>{
// 分解url
// 获取包名、路由名、页面名
let params = url.split("/");
const harName = params[0];
let context = params[params.length - 1].split("-");
const routerName = context[0];
const builderName = context[1];
// 获取路径
let path = ".";
for (l... | AST#method_declaration#Left public static async push AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#... | public static async push(url: string): Promise<void>{
let params = url.split("/");
const harName = params[0];
let context = params[params.length - 1].split("-");
const routerName = context[0];
const builderName = context[1];
let path = ".";
for (let i = 1; i < params.length - ... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/ApplicationModels/DynamicRouter/RouterModule/src/main/ets/utils/RouterModule.ets#L42-L59 | 9e6486b4183ed181d1e1ce99b0ceb4ff87270a60 | gitee |
huaweicloud/huaweicloud-iot-device-sdk-arkts.git | 72954bea19e7e7f93567487b036c0664457bdaf3 | huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets | arkts | onEvent | 事件处理。收到平台下发的事件时此接口被自动调用。默认为空实现
@param deviceEvent 服务事件 | onEvent(deviceEvent: DeviceEvent): void {
LogUtil.log("onEvent")
} | AST#method_declaration#Left onEvent AST#parameter_list#Left ( AST#parameter#Left deviceEvent : AST#type_annotation#Left AST#primary_type#Left DeviceEvent 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... | onEvent(deviceEvent: DeviceEvent): void {
LogUtil.log("onEvent")
} | https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/huaweicloud_iot_device_library/src/main/ets/service/AbstractService.ets#L218-L220 | 56ef0a67b852debbfcf0d047052c73d50fe1d41e | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets | arkts | notifyDataDelete | 通知控制器数据删除 | notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDataDelete(index);
})
} | AST#method_declaration#Left notifyDataDelete 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#R... | notifyDataDelete(index: number): void {
this.listeners.forEach(listener => {
listener.onDataDelete(index);
})
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/waterFlow/WaterFlowDataSource.ets#L54-L58 | 8d49b91477640a17db210e2ca0f2d1518ed4524c | gitee |
wuyuanwuhui99/harmony-arkts-music-app-ui.git | fc75b993b76293666f9122f527ea3bc6caf7f75c | entry/src/main/ets/pages/MusicClassifyListPage.ets | arkts | useMusicListByClassifyId | @description: 根据分类id查询音乐列表
@date: 2024-07-25 23:18
@author wuwenqiang | useMusicListByClassifyId(){
getMusicListByClassifyIdService(this.musicClassify.id,this.pageNum,PAGE_SIZE).then((res) => {
this.musicList.push(...res.data);
this.total = res.total;
})
} | AST#method_declaration#Left useMusicListByClassifyId 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 getMusicListByClassifyIdService ( AST#expression#Left AST#member_expression#Left AST#expression#Le... | useMusicListByClassifyId(){
getMusicListByClassifyIdService(this.musicClassify.id,this.pageNum,PAGE_SIZE).then((res) => {
this.musicList.push(...res.data);
this.total = res.total;
})
} | https://github.com/wuyuanwuhui99/harmony-arkts-music-app-ui.git/blob/fc75b993b76293666f9122f527ea3bc6caf7f75c/entry/src/main/ets/pages/MusicClassifyListPage.ets#L48-L53 | e2de49f5288742c879719ee3f5ae8248f21617a2 | github |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Security/Huks/entry/src/main/ets/model/HuksModel.ets | arkts | getSm4DeryptProperties | SM4 解密密钥属性 | function getSm4DeryptProperties(properties: HuksProperties[]): void {
let index = 0;
properties[index++] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM4
};
properties[index++] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128,
... | AST#function_declaration#Left function getSm4DeryptProperties AST#parameter_list#Left ( AST#parameter#Left properties : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left HuksProperties [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Rig... | function getSm4DeryptProperties(properties: HuksProperties[]): void {
let index = 0;
properties[index++] = {
tag: huks.HuksTag.HUKS_TAG_ALGORITHM,
value: huks.HuksKeyAlg.HUKS_ALG_SM4
};
properties[index++] = {
tag: huks.HuksTag.HUKS_TAG_KEY_SIZE,
value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128,
... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Security/Huks/entry/src/main/ets/model/HuksModel.ets#L264-L291 | 252078df36cd6f8663dd03afd1e783b1cb0d890e | gitee |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/pages/utils/ToolKits.ets | arkts | getTimeHH24Human | 获取仅包含“时间:分钟”部分的字符串,24小时制,且可以显示“上午”、“下午”、“晚上”这样的描述。
@param srcDateObj 原始日期对象
@param timeWithSegmentStr 表示在时间字符串前带上“上午”、“下午”、“晚上”这样的描述
@return 如果成功则返回结果,否则返回空字符串""(不是null) | static getTimeHH24Human(srcDateObj: Date, timeWithSegmentStr: boolean): string {
let ret: string = '';
try {
let timePattern: string = 'hh:mm';
// 原始的时间分钟字符串
let timeStr: string = ToolKits.formatDate(srcDateObj, timePattern);
// 时间段描述(形如:“上午”、“下午”、“晚上”这样的描述),只在中文语言下生效
let timeSegm... | AST#method_declaration#Left static getTimeHH24Human AST#parameter_list#Left ( AST#parameter#Left srcDateObj : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left timeWithSegmentStr : AST#type_annotation#Left AST#primary_type#Left ... | static getTimeHH24Human(srcDateObj: Date, timeWithSegmentStr: boolean): string {
let ret: string = '';
try {
let timePattern: string = 'hh:mm';
let timeStr: string = ToolKits.formatDate(srcDateObj, timePattern);
let timeSegmentStr: string = '';
if(timeWithSegmentStr)
... | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/utils/ToolKits.ets#L277-L296 | 2bea59b10360c9e6f5ad13691a7bdcf3a94ea5a7 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | 关键帧接口 | export interface Keyframe {
time: number;
position?: Vector3D;
rotation?: Vector3D;
scale?: Vector3D;
opacity?: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Keyframe AST#object_type#Left { AST#type_member#Left time : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left position ? : AST#type_annotation#Lef... | export interface Keyframe {
time: number;
position?: Vector3D;
rotation?: Vector3D;
scale?: Vector3D;
opacity?: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L133-L139 | 498be9142085d33526bdbbe39461a510330ae3b9 | github | |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/common/database/tables/AccountTable.ets | arkts | 类构造函数,用于初始化数据库表 | constructor(callback: Function = () => {
}) {
// 获取数据库表的 RdbStore 对象,并调用回调函数
this.accountTable.getRdbStore(callback);
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#arrow_function#Left AST#parameter_list#Left ( ) AST#parameter_list#Right => AST#expressi... | constructor(callback: Function = () => {
}) {
this.accountTable.getRdbStore(callback);
} | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/database/tables/AccountTable.ets#L19-L23 | 8dcd35c4a9cd1134986af24d1630fa16f5c17211 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/CrashUtil.ets | arkts | restartApp | 重启APP,并拉起应用启动时第一个Ability,可以配合errorManager相关接口使用。
如果该Ability存在已经保存的状态,这些状态数据会在Ability的OnCreate生命周期回调的want参数中作为wantParam属性传入。
API10时将启动由setRestartWant指定的Ability。如果没有指定则按以下规则启动:
如果当前应用前台的Ability支持恢复,则重新拉起该Ability。
如果存在多个支持恢复的Ability处于前台,则只拉起最后一个。
如果没有Ability处于前台,则不拉起。 | static restartApp() {
appRecovery.restartApp();
} | AST#method_declaration#Left static restartApp 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 appRecovery AST#expression#Right . restartApp ... | static restartApp() {
appRecovery.restartApp();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/CrashUtil.ets#L181-L183 | 8ff9ff1e9ff95071279bd85f779ad8ae1eb73de5 | gitee |
zl3624/harmonyos_network_samples | b8664f8bf6ef5c5a60830fe616c6807e83c21f96 | code/web/UploadInWeb/entry/src/main/ets/pages/Index.ets | arkts | selectFile | 选择上传的文件 | async selectFile(): Promise<boolean> {
//资源文件中的demo.txt
if (this.uploadFileType == 0) {
return this.copyResFile2Sandbox("demo.txt")
} else if (this.uploadFileType == 1) {//选择图像文件
let imgPicker = new picker.PhotoViewPicker();
let result = await imgPicker.select();
if (result.photoUris... | AST#method_declaration#Left async selectFile AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right > AST#type_ar... | async selectFile(): Promise<boolean> {
if (this.uploadFileType == 0) {
return this.copyResFile2Sandbox("demo.txt")
} else if (this.uploadFileType == 1) {
let imgPicker = new picker.PhotoViewPicker();
let result = await imgPicker.select();
if (result.photoUris.length > 0) {
r... | https://github.com/zl3624/harmonyos_network_samples/blob/b8664f8bf6ef5c5a60830fe616c6807e83c21f96/code/web/UploadInWeb/entry/src/main/ets/pages/Index.ets#L135-L154 | aa575a373f5211ce797eb71ed8d71efd57aac4d6 | gitee |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/strings/BruteForce.ets | arkts | findNonOverlappingMatches | 查找所有不重叠的匹配位置
@param text 文本字符串
@param pattern 模式串
@returns 不重叠的匹配位置数组 | static findNonOverlappingMatches(text: string, pattern: string): number[] {
if (!text || !pattern || pattern.length === 0) {
return [];
}
const result: number[] = [];
const n = text.length;
const m = pattern.length;
let i = 0;
while (i <= n - m) {
let j = 0;
while (j < m ... | AST#method_declaration#Left static findNonOverlappingMatches 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#Left pattern : AST#type_annotation#Left AST#primary_type#Left string... | static findNonOverlappingMatches(text: string, pattern: string): number[] {
if (!text || !pattern || pattern.length === 0) {
return [];
}
const result: number[] = [];
const n = text.length;
const m = pattern.length;
let i = 0;
while (i <= n - m) {
let j = 0;
while (j < m ... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/strings/BruteForce.ets#L112-L137 | 7470a2a75cfe7b78f3c2e4c66bbeb33090e620d9 | github |
WinWang/HarmoneyOpenEye.git | 57f0542795336009aa0d46fd9fa5b07facc2ae87 | entry/src/main/ets/http/apiService.ets | arkts | 获取分类详情接口
@param id
@param start | export function getCategoryDetailList(id: number, start: number) {
return axiosClient.get<HomeModel>(
{
url: baseUrl + "api/v4/categories/videoList",
params: {
"id": id,
"start": start,
"udid": CommonConstants.UUID,
deviceModel: CommonConstants.DEVICE_NUM
}
}
... | AST#export_declaration#Left export AST#function_declaration#Left function getCategoryDetailList AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left start : AST#type_annotation#Le... | export function getCategoryDetailList(id: number, start: number) {
return axiosClient.get<HomeModel>(
{
url: baseUrl + "api/v4/categories/videoList",
params: {
"id": id,
"start": start,
"udid": CommonConstants.UUID,
deviceModel: CommonConstants.DEVICE_NUM
}
}
... | https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/http/apiService.ets#L122-L134 | 47be6870b9e4cd87cecbfc4cfa4c7b01bb7e1bdb | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/LazyImport/entry/src/main/ets/pages/A.ets | arkts | c | [End export_variable_a] | export { c }; | AST#export_declaration#Left export { c } ; AST#export_declaration#Right | export { c }; | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkTS/ArkTSRuntime/ArkTSModule/LazyImport/entry/src/main/ets/pages/A.ets#L22-L22 | bcd9d2495e848320897ffbe19323d6df482d0ee5 | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | ETSUI/CategorySample/entry/src/main/ets/viewmodel/CategoryViewModel.ets | arkts | getDetailListItems | Get detail list item info.
@return {Array<DetailListItem>} detailListItems | getDetailListItems() {
let detailListItems: Array<DetailListItem> = [];
for (let i = 0; i < CommonConstants.LIST_SIZE; i++) {
let detailListItem = new DetailListItem();
detailListItem.title = $r('app.string.detail_list_item_text');
detailListItem.gridItemData = this.getGridItems();
detai... | AST#method_declaration#Left getDetailListItems AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left detailListItems : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments... | getDetailListItems() {
let detailListItems: Array<DetailListItem> = [];
for (let i = 0; i < CommonConstants.LIST_SIZE; i++) {
let detailListItem = new DetailListItem();
detailListItem.title = $r('app.string.detail_list_item_text');
detailListItem.gridItemData = this.getGridItems();
detai... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/CategorySample/entry/src/main/ets/viewmodel/CategoryViewModel.ets#L49-L58 | 49613e5f2bef6a704f826bd23d014d89f79d5d2d | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PasteboardUtil.ets | arkts | TODO 剪贴板工具类
需要权限:ohos.permission.READ_PASTEBOARD //允许应用读取剪贴板。
author: 桃花镇童长老ᥫ᭡
since: 2024/05/01 | export class PasteboardUtil {
/**
* 申请剪贴板权限
* @returns
*/
static async requestPermissions(): Promise<boolean> {
return await PermissionUtil.requestPermissionsEasy('ohos.permission.READ_PASTEBOARD');
}
/**
* 获取系统剪贴板对象
* @returns
*/
static getSystemPasteboard(): pasteboard.SystemPastebo... | AST#export_declaration#Left export AST#class_declaration#Left class PasteboardUtil AST#class_body#Left { /**
* 申请剪贴板权限
* @returns
*/ AST#method_declaration#Left static async requestPermissions AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type... | export class PasteboardUtil {
static async requestPermissions(): Promise<boolean> {
return await PermissionUtil.requestPermissionsEasy('ohos.permission.READ_PASTEBOARD');
}
static getSystemPasteboard(): pasteboard.SystemPasteboard {
const systemPasteboard: pasteboard.SystemPasteboard = pasteboard... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L27-L379 | 5b4b91fd99a6e00a82cf123c5105aaf68ae90041 | gitee | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/arkui/component/gesture.d.ets | arkts | onActionStart | Pinch gesture recognition success callback.
@param { Callback<GestureEvent> } event
@returns { PinchGesture }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20 | onActionStart(event: Callback<GestureEvent>): PinchGesture; | AST#method_declaration#Left onActionStart AST#parameter_list#Left ( AST#parameter#Left event : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Callback AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left GestureEvent AST#primary_type#Right AST#type_annotation#Right > AST#type_a... | onActionStart(event: Callback<GestureEvent>): PinchGesture; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/gesture.d.ets#L603-L603 | 1148a85e41f786bf58067a331936ab97edeb0c1a | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/design/DesignSystem.ets | arkts | withOpacity | 获取带透明度的颜色 | static withOpacity(color: string, opacity: number): string {
// 简单的透明度处理,实际项目中可以使用更复杂的颜色处理库
const alpha = Math.round(opacity * 255).toString(16).padStart(2, '0');
return `${color}${alpha}`;
} | AST#method_declaration#Left static withOpacity AST#parameter_list#Left ( AST#parameter#Left color : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left opacity : AST#type_annotation#Left AST#primary_type#Left number AST#primary_... | static withOpacity(color: string, opacity: number): string {
const alpha = Math.round(opacity * 255).toString(16).padStart(2, '0');
return `${color}${alpha}`;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/design/DesignSystem.ets#L206-L210 | 78f16dfbeff1b356523cc392096b0389ab44ef26 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/Highlight.ets | arkts | getYPx | returns the y-position of the highlight in pixels | public getYPx(): number {
return this.mYPx;
} | AST#method_declaration#Left public getYPx AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression... | public getYPx(): number {
return this.mYPx;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/highlight/Highlight.ets#L128-L130 | dac2fd34453b55761bd2e1061be73d4f741e91f4 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/database/ContactDAO.ets | arkts | getAllContacts | 获取所有联系人
@returns 联系人数组 | async getAllContacts(): Promise<ContactEntity[]> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('contacts');
predicates.orderByAsc('name'); // 按姓名排序
cons... | AST#method_declaration#Left async getAllContacts 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#array_type#Left ContactEntity [ ] AST#array_type#Right AST#pri... | async getAllContacts(): Promise<ContactEntity[]> {
const rdbStore = this.dbManager.getRdbStore();
if (!rdbStore) {
throw new Error('Database not initialized');
}
try {
const predicates = new relationalStore.RdbPredicates('contacts');
predicates.orderByAsc('name');
const result... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/ContactDAO.ets#L94-L115 | 373ae029d462edbc5a661932b75b82c41540a20f | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.file.AlbumPickerComponent.d.ets | arkts | The callback of onEmptyAreaClick event
@typedef { function } EmptyAreaClickCallback
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 13 | export type EmptyAreaClickCallback = () => void; | AST#export_declaration#Left export AST#type_declaration#Left type EmptyAreaClickCallback = AST#type_annotation#Left AST#function_type#Left 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#function_type#Right ... | export type EmptyAreaClickCallback = () => void; | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.file.AlbumPickerComponent.d.ets#L66-L66 | 8ab67c3fa785a9ed554cca35cc3f70d37ff73b69 | github | |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/components/menu/VHInviteDialog.ets | arkts | VHInviteDialog | 邀请底部弹窗视图 | @CustomDialog
export struct VHInviteDialog {
controller: CustomDialogController
@Consume inviteCard: VHInviteCard;
@Require webinars: VHWebinarData;
@Require inviteCode: string;
@State selectedCardId: string = '-1';
// 选中的图片资源
@State selectedImage: string ='';
// 预览图是否显示
@State showPreview: boolean =... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export struct VHInviteDialog AST#component_body#Left { AST#property_declaration#Left controller : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#proper... | @CustomDialog
export struct VHInviteDialog {
controller: CustomDialogController
@Consume inviteCard: VHInviteCard;
@Require webinars: VHWebinarData;
@Require inviteCode: string;
@State selectedCardId: string = '-1';
@State selectedImage: string ='';
@State showPreview: boolean = true;
@State s... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/components/menu/VHInviteDialog.ets#L26-L352 | 1ccc02bf015c13fc52ae22fc2a08d005724d562c | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/DataRenderer.ets | arkts | drawExtras | Draws any kind of additional information (e.g. line-circles).
@param c | public abstract drawExtras(): Paint[]; | AST#method_declaration#Left public abstract drawExtras AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Paint [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | public abstract drawExtras(): Paint[]; | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/DataRenderer.ets#L185-L185 | afdc948bafcef048f413e1047ab5e661f8c45b03 | gitee |
ChangweiZhang/chardet-arkts.git | 3a214882ec6a2753c0fed84162952aa659341c19 | src/main/ets/components/encoding/mbcs.ets | arkts | match | Test the match of this charset with the input text data
which is obtained via the CharsetDetector object.
@param det The CharsetDetector, which contains the input text
to be checked for being in this charset.
@return Two values packed into one int (Damn java, anyhow)
bits 0-7: the match confidence, ranging from... | match(det: Context): Match | null {
let doubleByteCharCount = 0,
commonCharCount = 0,
badCharCount = 0,
totalCharCount = 0,
confidence = 0;
const iter = new IteratedChar();
detectBlock: {
for (iter.reset(); this.nextChar(iter, det); ) {
totalCharCount++;
if (i... | AST#method_declaration#Left match AST#parameter_list#Left ( AST#parameter#Left det : 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#type_annotation#Left AST#union_type#Left AST#primary_type#Left Match AST#prima... | match(det: Context): Match | null {
let doubleByteCharCount = 0,
commonCharCount = 0,
badCharCount = 0,
totalCharCount = 0,
confidence = 0;
const iter = new IteratedChar();
detectBlock: {
for (iter.reset(); this.nextChar(iter, det); ) {
totalCharCount++;
if (i... | https://github.com/ChangweiZhang/chardet-arkts.git/blob/3a214882ec6a2753c0fed84162952aa659341c19/src/main/ets/components/encoding/mbcs.ets#L99-L174 | 15bf1b170f3ef8d40fa0dbe25eff460dc41cf14e | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | TaskPoolPractice/entry/src/main/ets/pages/sample7/AxiosAdapter.ets | arkts | Initialize axios object according to configuration and return the object. | export function getAxios(): Axios {
let instance: AxiosInstance = axios.create();
if (AxiosGlobalConfig.instance.baseURL) {
instance.defaults.url = AxiosGlobalConfig.instance.baseURL;
}
for (let entry of AxiosGlobalConfig.instance.headers.entries()) {
instance.defaults.headers[entry[0]] = entry[1];
}
... | AST#export_declaration#Left export AST#function_declaration#Left function getAxios AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Axios AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let ... | export function getAxios(): Axios {
let instance: AxiosInstance = axios.create();
if (AxiosGlobalConfig.instance.baseURL) {
instance.defaults.url = AxiosGlobalConfig.instance.baseURL;
}
for (let entry of AxiosGlobalConfig.instance.headers.entries()) {
instance.defaults.headers[entry[0]] = entry[1];
}
... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/TaskPoolPractice/entry/src/main/ets/pages/sample7/AxiosAdapter.ets#L21-L49 | 5bb2a0c2f38e43cc050a3a4538b8860c97349ab2 | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/eraser/src/main/ets/model/RenderNodeModel.ets | arkts | 画笔线宽 | constructor() {
super();
// 设置画笔颜色
const pen_color: common2D.Color = {
alpha: 0xFF,
red: 0xFA,
green: 0x64,
blue: 0x00
};
this.pen.setColor(pen_color);
// 设置画笔开启反走样,可以使得图形的边缘在显示时更平滑
this.pen.setAntiAlias(true);
// 开启画笔的抖动绘制效果。抖动绘制可以使得绘制出的颜色更加真实。
this.pen.setDi... | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left super AST#expression#Right AST#argument_list#Left ( ) AST#argument_list#Right AST... | constructor() {
super();
const pen_color: common2D.Color = {
alpha: 0xFF,
red: 0xFA,
green: 0x64,
blue: 0x00
};
this.pen.setColor(pen_color);
this.pen.setAntiAlias(true);
this.pen.setDither(true);
this.pen.setJoinStyle(drawing.JoinStyle.ROUND_JOIN)... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/eraser/src/main/ets/model/RenderNodeModel.ets#L29-L47 | 41b2090fb130d4ca68b2f53cb1f188bac3111442 | gitee | |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.Dialog.d.ets | arkts | ConfirmDialog | Declare CustomDialog ConfirmDialog
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declare CustomDialog ConfirmDialog
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | @CustomDialog
export declare struct ConfirmDialog {
/**
* Sets the ConfirmDialog Controller.
* @type { CustomDialogController }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Sets the ConfirmDialog Controller.
* @type { CustomDialogController }.
* @sysc... | AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct ConfirmDialog AST#component_body#Left { /**
* Sets the ConfirmDialog Controller.
* @type { CustomDialogController }.
* @syscap SystemCapability.ArkUI.ArkUI.Full... | @CustomDialog
export declare struct ConfirmDialog {
controller: CustomDialogController;
title: ResourceStr;
content?: ResourceStr;
checkTips?: ResourceStr;
@Prop
isChecked?: boolean;
primaryButton?: ButtonOptions;
seco... | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Dialog.d.ets#L436-L565 | 19a51b747913693bbaed3905a7df777c05055da3 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets | arkts | startRecordingProcess | 开始录制对应的流程 | async startRecordingProcess(): Promise<void> {
if (this.avRecorder !== undefined) {
await this.avRecorder.release();
this.avRecorder = undefined;
}
// 1.创建录制实例
this.avRecorder = await media.createAVRecorder();
this.setAudioRecorderCallback();
// 2.获取录制文件fd赋予avConfig里的url;参考FilePicker... | AST#method_declaration#Left async startRecordingProcess 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... | async startRecordingProcess(): Promise<void> {
if (this.avRecorder !== undefined) {
await this.avRecorder.release();
this.avRecorder = undefined;
}
this.avRecorder = await media.createAVRecorder();
this.setAudioRecorderCallback();
const context = getContext(this);
const pat... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets#L54-L81 | 698820bc4ade47d4e21e8b0736eabc61d0a741e8 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ar/ARCardService.ets | arkts | 手势识别器接口 | export interface GestureRecognizer {
name: string;
pattern: HandGesturePattern;
action: InteractionAction;
confidence: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface GestureRecognizer 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 pattern : AST#type_annotati... | export interface GestureRecognizer {
name: string;
pattern: HandGesturePattern;
action: InteractionAction;
confidence: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L241-L246 | 848e6718bf3ee31d0b9b0c420ac6273b56da9665 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.