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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/ui_tools.ets | arkts | Listens to the Free-window Mode change and automatically switch modes.
@param context
@param windowClass
@param storage
@param id | export function listen_free_window_mode(context: Context, windowClass: window.Window, storage: LocalStorage, id: string) {
console.log(`[listen_free_window_mode] ON for window ${id}!`)
settings.registerKeyObserver(context, 'window_pcmode_switch_status', settings.domainName.USER_PROPERTY,
() => {
settings.... | AST#export_declaration#Left export AST#function_declaration#Left function listen_free_window_mode AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left windowClass : AST#type... | export function listen_free_window_mode(context: Context, windowClass: window.Window, storage: LocalStorage, id: string) {
console.log(`[listen_free_window_mode] ON for window ${id}!`)
settings.registerKeyObserver(context, 'window_pcmode_switch_status', settings.domainName.USER_PROPERTY,
() => {
settings.... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/ui_tools.ets#L292-L313 | 9b5b477e9a1531d70917ccb48893bf1d6fbe8f29 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LanguageSettingsPage.ets | arkts | showFallbackLanguageDialog | 显示回退语言对话框 | private showFallbackLanguageDialog(): void {
// TODO: 实现回退语言选择对话框
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Show fallback language dialog');
} | AST#method_declaration#Left private showFallbackLanguageDialog 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 { // TODO: 实现回退语言选择对话框 AST#expression_statement#Left AST#expression#Le... | private showFallbackLanguageDialog(): void {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Show fallback language dialog');
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LanguageSettingsPage.ets#L624-L627 | 533aad57357fc1d8575d53187d50436f806000dc | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/types/SettingsTypes.ets | arkts | 提醒设置接口 | export interface ReminderSettings {
enabled: boolean;
advanceDays: number[];
frequency: ReminderFrequency;
customTime: string;
weekendReminder: boolean;
lunarBirthdayReminder: boolean;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ReminderSettings AST#object_type#Left { AST#type_member#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left advanceDays : AST#type_a... | export interface ReminderSettings {
enabled: boolean;
advanceDays: number[];
frequency: ReminderFrequency;
customTime: string;
weekendReminder: boolean;
lunarBirthdayReminder: boolean;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/types/SettingsTypes.ets#L529-L536 | 972fd042e1702593a3aa3275b50fc29132037382 | github | |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/view/WorldClock/ClockArea.ets | arkts | drawClockArea | 开始绘制时钟区域 | private drawClockArea(): void {
if (!this.isReady) {
return;
}
this.renderContext.clearRect(
-this.canvasSize,
-this.canvasSize / CommonConstants.DEFAULT_DOUBLE,
this.canvasSize * CommonConstants.DEFAULT_DOUBLE,
this.canvasSize);
let date = new Date(this.now);
let hours... | AST#method_declaration#Left private drawClockArea AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression... | private drawClockArea(): void {
if (!this.isReady) {
return;
}
this.renderContext.clearRect(
-this.canvasSize,
-this.canvasSize / CommonConstants.DEFAULT_DOUBLE,
this.canvasSize * CommonConstants.DEFAULT_DOUBLE,
this.canvasSize);
let date = new Date(this.now);
let hours... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/view/WorldClock/ClockArea.ets#L32-L54 | 66e7325cc54e3aadd5e1f9c9a85699ee4730ed65 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/network/src/main/ets/datasource/auth/AuthNetworkDataSource.ets | arkts | @file 认证相关网络数据源接口
定义认证模块所需的所有网络请求操作
@author Joker.X | export interface AuthNetworkDataSource {
/**
* 微信 APP 授权登录
* @param {Record<string, string>} params - 微信授权参数
* @returns {Promise<NetworkResponse<Auth>>} 认证结果
*/
loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>>;
/**
* QQ APP 授权登录
* @param {QQLoginRequest} params - QQ ... | AST#export_declaration#Left export AST#interface_declaration#Left interface AuthNetworkDataSource AST#object_type#Left { /**
* 微信 APP 授权登录
* @param {Record<string, string>} params - 微信授权参数
* @returns {Promise<NetworkResponse<Auth>>} 认证结果
*/ AST#type_member#Left loginByWxApp AST#parameter_list#Left ( AST#par... | export interface AuthNetworkDataSource {
loginByWxApp(params: Record<string, string>): Promise<NetworkResponse<Auth>>;
loginByQqApp(params: QQLoginRequest): Promise<NetworkResponse<Auth>>;
register(params: Record<string, string>): Promise<NetworkResponse<Auth>>;
getSmsCode(params: Record<string, ... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/auth/AuthNetworkDataSource.ets#L8-L63 | 7d5f56264707219f9c7fd5f3e2c38f7a2e33cc62 | github | |
wuyuanwuhui999/harmony-arkts-movie-app-ui.git | d5e9bebe1dca2759cba417d2b6b402941d3bc273 | entry/src/main/ets/pages/MoviePlayPage.ets | arkts | getGroup | @author: wuwenqiang
@description: 电影播放地址分组
@date: 2025-01-7 23:49 | getGroup(movieUrlList:Array<MovieUrlInterface>):Array<Array<MovieUrlInterface|null>>{
const movieUrlGroup:Array<Array<MovieUrlInterface>> = [];
let myMovieUrlList:Array<MovieUrlInterface|null>
movieUrlList.forEach((item:MovieUrlInterface,index:number)=>{
if(movieUrlGroup.length === 0 || movieUrlGroup[... | AST#method_declaration#Left getGroup AST#parameter_list#Left ( AST#parameter#Left movieUrlList : 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 MovieUrlInterface AST#primary_type#Right AST#type_annotation#Right > AST#ty... | getGroup(movieUrlList:Array<MovieUrlInterface>):Array<Array<MovieUrlInterface|null>>{
const movieUrlGroup:Array<Array<MovieUrlInterface>> = [];
let myMovieUrlList:Array<MovieUrlInterface|null>
movieUrlList.forEach((item:MovieUrlInterface,index:number)=>{
if(movieUrlGroup.length === 0 || movieUrlGroup[... | https://github.com/wuyuanwuhui999/harmony-arkts-movie-app-ui.git/blob/d5e9bebe1dca2759cba417d2b6b402941d3bc273/entry/src/main/ets/pages/MoviePlayPage.ets#L89-L107 | cd6d676732f1ab7226e364ef03a1a98839330d17 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/SM3Sync.ets | arkts | hmac | 消息认证码计算
@param str 计算字符串
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns | static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return DynamicSyncUtil.hmac(str, 'SM3', resultCoding);
} | AST#method_declaration#Left static hmac AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left... | static hmac(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return DynamicSyncUtil.hmac(str, 'SM3', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SM3Sync.ets#L44-L46 | a85c00f1d626d83f34b284fc0b326bb4d25b75ec | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/accuracy/path_sensitive/loop_stmt/while_body_001_T.ets | arkts | Introduction 循环结构-body语句
Level 3 | export function while_body_001_T(taint_src : string) {
let i = 0
let res = ""
while (i < 2) {
res = taint_src
i++
}
taint.Sink(res)
} | AST#export_declaration#Left export AST#function_declaration#Left function while_body_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Le... | export function while_body_001_T(taint_src : string) {
let i = 0
let res = ""
while (i < 2) {
res = taint_src
i++
}
taint.Sink(res)
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/path_sensitive/loop_stmt/while_body_001_T.ets#L8-L16 | 3364a4712b8ea08b52608b382cbb6399c4d1bd11 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_gcm_seg_encryption_decryption/aes_gcm_seg_encryption_decryption_synchronous.ets | arkts | decryptMessage | 分段解密消息 | function decryptMessage(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|GCM|PKCS7');
decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParams);
let updateLength = 20; // 假设以20字节为单位进行分段update,实际并无要求
let decryptText = ne... | AST#function_declaration#Left function decryptMessage 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 c... | function decryptMessage(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|GCM|PKCS7');
decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParams);
let updateLength = 20;
let decryptText = new Uint8Array();
for (let i =... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_gcm_seg_encryption_decryption/aes_gcm_seg_encryption_decryption_synchronous.ets#L71-... | 203ea61fc2ab1eea2caab446b05e0e3ba3d9aaf1 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/util/CountDownTimer.ets | arkts | 倒计时器工具类
提供开始、暂停、恢复、取消等功能 | export class CountDownTimer {
/**
* 总倒计时时间(毫秒)
* */
private totalTime: number;
/**
* 间隔时间(毫秒),默认1000ms
* */
private interval: number = 1000;
/**
* 剩余时间(毫秒)
* */
private remainingTime: number;
/**
* 定时器ID
* */
private timerId: number | null = null;
/**
* 是否处于暂停状态
* */
... | AST#export_declaration#Left export AST#class_declaration#Left class CountDownTimer AST#class_body#Left { /**
* 总倒计时时间(毫秒)
* */ AST#property_declaration#Left private totalTime : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right ... | export class CountDownTimer {
private totalTime: number;
private interval: number = 1000;
private remainingTime: number;
private timerId: number | null = null;
private isPaused: boolean = false;
private onTickCallback?: (millisUntilFinished: number) => void;
private onFinishCallback?:... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/util/CountDownTimer.ets#L5-L136 | de67fa8358bf8d34bf4bd8ec24b7d2311a2f3cf7 | gitee | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | HDRVivid/AVRecorder/entry/src/main/ets/pages/Record.ets | arkts | stopRecord | [End start_record] | async stopRecord() {
if (this.avRecorder) {
try {
if (this.videoOutput) {
this.videoOutput.stop((err: BusinessError) => {
if (err) {
Logger.error(TAG, `Failed to stop the video output. error: ${JSON.stringify(err)}`);
return;
}
... | AST#method_declaration#Left async stopRecord 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 this AST#expression#Right . avRecorder AST#member_expression#Right AST#expression#... | async stopRecord() {
if (this.avRecorder) {
try {
if (this.videoOutput) {
this.videoOutput.stop((err: BusinessError) => {
if (err) {
Logger.error(TAG, `Failed to stop the video output. error: ${JSON.stringify(err)}`);
return;
}
... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVRecorder/entry/src/main/ets/pages/Record.ets#L455-L512 | 94213e307fadde56256dfb2c3efad34940f14111 | gitee |
wuyukobe24/HMApp_ArkTS.git | 6d09d9b07a4fdc4713e5a13b61b85bc1e7893956 | entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets | arkts | loadHomeRequestInfoListData | 请求首页资讯列表数据 | loadHomeRequestInfoListData(success:(str:string)=>void, fail:(error:NetError)=>void) {
let param:Record<string, string> = {
"main_feeds":"1",
"plat":"iOS",
"ip":"0.0.0.0",
"network":"wifi",
"favzone":"",
"zone":"plat",
"channel":"1",
"transport":"docids%3D600464078727... | AST#method_declaration#Left loadHomeRequestInfoListData AST#parameter_list#Left ( AST#parameter#Left success : AST#type_annotation#Left AST#function_type#Left 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#par... | loadHomeRequestInfoListData(success:(str:string)=>void, fail:(error:NetError)=>void) {
let param:Record<string, string> = {
"main_feeds":"1",
"plat":"iOS",
"ip":"0.0.0.0",
"network":"wifi",
"favzone":"",
"zone":"plat",
"channel":"1",
"transport":"docids%3D600464078727... | https://github.com/wuyukobe24/HMApp_ArkTS.git/blob/6d09d9b07a4fdc4713e5a13b61b85bc1e7893956/entry/src/main/ets/pages/home/ViewModel/QQHomeViewModel.ets#L84-L109 | 2ea502089fc9172930a8a1840e81937ae421b2da | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PreferencesUtil.ets | arkts | getPreferences | 获取Preferences实例
@param name
@returns | private static async getPreferences(preferenceName: string = PreferencesUtil.defaultPreferenceName): Promise<preferences.Preferences> {
if (preferenceName !== PreferencesUtil.defaultPreferenceName) {
return await dataPreferences.getPreferences(AppUtil.getContext(), preferenceName);
} else if (!Preferences... | AST#method_declaration#Left private static async getPreferences AST#parameter_list#Left ( AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtil AST#ex... | private static async getPreferences(preferenceName: string = PreferencesUtil.defaultPreferenceName): Promise<preferences.Preferences> {
if (preferenceName !== PreferencesUtil.defaultPreferenceName) {
return await dataPreferences.getPreferences(AppUtil.getContext(), preferenceName);
} else if (!Preferences... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L64-L71 | e3f0e28425a5a3ec8aa45872caa62fa6f5c2612b | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/common/MyUtils.ets | arkts | getComponentRect | 获取组件所占矩形区域坐标 | static getComponentRect(key: string): RectValue {
let strJson: string = getInspectorByKey(key);
let rectInfo: Array<string> = JSON.parse('[' + JSON.parse(strJson).$rect + ']');
Utils.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0];
Utils.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1];
Utils.re... | AST#method_declaration#Left static getComponentRect AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RectValue AST#prim... | static getComponentRect(key: string): RectValue {
let strJson: string = getInspectorByKey(key);
let rectInfo: Array<string> = JSON.parse('[' + JSON.parse(strJson).$rect + ']');
Utils.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0];
Utils.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1];
Utils.re... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_scroll/ace_ets_module_scroll_nowear_api11/entry/src/main/ets/MainAbility/common/MyUtils.ets#L50-L60 | b5a737a824533b747299d32fd3da487c36e9dbb9 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/YAxis.ets | arkts | calculate | @Override | public calculate(dataMin: number, dataMax: number): void {
let min: number = dataMin;
let max: number = dataMax;
// Make sure max is greater than min
if (min > max) {
if (this.mCustomAxisMax && this.mCustomAxisMin) {
let t: number = min;
min = max;
max = t;
}
... | 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 {
let min: number = dataMin;
let max: number = dataMax;
if (min > max) {
if (this.mCustomAxisMax && this.mCustomAxisMin) {
let t: number = min;
min = max;
max = t;
}
else if (this.mCustomAxisMax) {
... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/YAxis.ets#L493-L529 | b77bffcc0f540f24136a644558230284f52fb245 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/auth/src/main/ets/view/LoginPage.ets | arkts | LoginContent | 登录页内容视图
@returns {void} 无返回值 | @Builder
private LoginContent() {
MediumPaddingVerticalScroll() {
ColumnBase({ widthValue: P100 }) {
IBestButton({
text: $r("app.string.login_action"),
type: "primary",
buttonSize: "large",
round: true,
btnWidth: P100,
loading: this.vm.isLo... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private LoginContent 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 MediumPaddingVerticalScroll ( ) AST#container_content... | @Builder
private LoginContent() {
MediumPaddingVerticalScroll() {
ColumnBase({ widthValue: P100 }) {
IBestButton({
text: $r("app.string.login_action"),
type: "primary",
buttonSize: "large",
round: true,
btnWidth: P100,
loading: this.vm.isLo... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/auth/src/main/ets/view/LoginPage.ets#L35-L53 | 5af20f5b299e107fe6247a1ab434766bf4b351c1 | github |
dcm23333/FishManager.git | 952dde4475268ac16f3480f3d55f82033aa6b467 | FishManager/entry/src/main/ets/common/contants/commonContants.ets | arkts | THOUSANDTH | export const THOUSANDTH_15: string = '1.5%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left THOUSANDTH_15 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '1.5%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_declar... | export const THOUSANDTH_15: string = '1.5%'; | https://github.com/dcm23333/FishManager.git/blob/952dde4475268ac16f3480f3d55f82033aa6b467/FishManager/entry/src/main/ets/common/contants/commonContants.ets#L46-L46 | ed2306a024aa4f5c1f65a1f036c55c50ac802e38 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/DateUtils.ets | arkts | toDateString | 格式化为日期字符串[YYYY-MM-DD]
@param date 要格式化的日期对象
@returns "YYYY-MM-DD"格式的日期字符串 | static toDateString(date: Date): string {
return DateUtils.formatDate(date, 'YYYY-MM-DD');
} | AST#method_declaration#Left static toDateString AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type... | static toDateString(date: Date): string {
return DateUtils.formatDate(date, 'YYYY-MM-DD');
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DateUtils.ets#L138-L140 | 6f8223135bdf30469724e2790bcbc9dc5b027687 | github |
njkndxz/learn-ArkTs.git | 70fabab8ee28e3637329d53a4ec93afc72a001c2 | entry/src/main/ets/entryability/EntryAbility.ets | arkts | onWindowStageDestroy | 当窗口舞台销毁时 | onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
} | AST#method_declaration#Left onWindowStageDestroy 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 { // Main window is destroyed, release UI related resources AST#expression_statement... | onWindowStageDestroy(): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
} | https://github.com/njkndxz/learn-ArkTs.git/blob/70fabab8ee28e3637329d53a4ec93afc72a001c2/entry/src/main/ets/entryability/EntryAbility.ets#L45-L48 | 87b7a88977406f40789aa1c253ee8a9b9f3b4eb4 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/toolbox/src/main/ets/model/CustomTool.ets | arkts | 自定义工具项 | export class CustomTool {
// 工具项UI
private builder_: WrappedBuilder<[ToolInterface]>;
// 工具项相对于悬浮球中心的偏移
private offset_: Offset;
// 悬浮球位于角落时工具项相对于悬浮球中心的偏移
private cornerOffset_: Offset;
// 工具项属性集
private attributeSet_?: AttributeSet;
constructor(builder: WrappedBuilder<[ToolInterface]>, offset: Offse... | AST#export_declaration#Left export AST#class_declaration#Left class CustomTool AST#class_body#Left { // 工具项UI AST#property_declaration#Left private builder_ : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left WrappedBuilder AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#... | export class CustomTool {
private builder_: WrappedBuilder<[ToolInterface]>;
private offset_: Offset;
private cornerOffset_: Offset;
private attributeSet_?: AttributeSet;
constructor(builder: WrappedBuilder<[ToolInterface]>, offset: Offset, cornerOffset: Offset,attributeSet?: AttributeSet) {
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/toolbox/src/main/ets/model/CustomTool.ets#L23-L55 | 7f64420f3c81b3e49a508f3a6b9b39f888425f56 | gitee | |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets | arkts | getYOffset | Returns the used offset on the x-axis for drawing the axis labels. This
offset is applied before and after the label.
@return | public getYOffset(): number {
return this.mYOffset;
} | AST#method_declaration#Left public getYOffset 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 getYOffset(): number {
return this.mYOffset;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/ComponentBase.ets#L80-L82 | 8b2deb81037e4e2079dbbf4f390d96f2b37b94f2 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/base/PickerUtil.ets | arkts | initSuffixList | 初始化内置的文件选择后缀
@returns | private static initSuffixList(): Array<string> {
let suffixList = new Array<string>();
suffixList.push('.doc');
suffixList.push('.docx');
suffixList.push('.pdf');
suffixList.push('.ppt');
suffixList.push('.pptx');
suffixList.push('.txt');
suffixList.push('.wps');
suffixList.push('.xl... | AST#method_declaration#Left private static initSuffixList 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 > A... | private static initSuffixList(): Array<string> {
let suffixList = new Array<string>();
suffixList.push('.doc');
suffixList.push('.docx');
suffixList.push('.pdf');
suffixList.push('.ppt');
suffixList.push('.pptx');
suffixList.push('.txt');
suffixList.push('.wps');
suffixList.push('.xl... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/PickerUtil.ets#L36-L48 | 12b636b7ec36ed089a281375b5f8046de9586be0 | 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/DES.ets | arkts | decryptECB | 解密(ECB模式),异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@returns | static async decryptECB(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey): Promise<cryptoFramework.DataBlob> {
return DES.decrypt(data, symKey, null, '3DES192|ECB|PKCS7');
} | AST#method_declaration#Left static async decryptECB AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sym... | static async decryptECB(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey): Promise<cryptoFramework.DataBlob> {
return DES.decrypt(data, symKey, null, '3DES192|ECB|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/DES.ets#L53-L55 | 532e7976f814b8f50a0eb7f40aa209183fcdd58e | github |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/commons/network/HttpUtils.ets | arkts | postHttpRequest | The method of initiating a POST request through HTTP. | async postHttpRequest(): Promise<ListInfo[]> {
let responseData: Array<ListInfo> = [];
await this.httpRequest.request(RESOURCE_URL,
{
method: http.RequestMethod.POST, extraData: {
'status': '1',
'belong': '1',
'language': 'cn',
'needTop': 1,
'displayChannel'... | AST#method_declaration#Left async postHttpRequest 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 ListInfo [ ] AST#array_type#Right AST#primary... | async postHttpRequest(): Promise<ListInfo[]> {
let responseData: Array<ListInfo> = [];
await this.httpRequest.request(RESOURCE_URL,
{
method: http.RequestMethod.POST, extraData: {
'status': '1',
'belong': '1',
'language': 'cn',
'needTop': 1,
'displayChannel'... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/network/HttpUtils.ets#L55-L77 | 0efb2bead03d9f11e1f20236c1f7da99e8ecced7 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets | arkts | BreakpointCard | 当前断点信息
@returns {void} 无返回值 | @Builder
private BreakpointCard(): void {
Column() {
this.CardTitle($r("app.string.demo_screen_adapt_breakpoint_label"));
SpaceVerticalSmall();
this.CardDesc(this.breakpointState.current);
}
.width(P100)
.padding($r("app.float.space_padding_medium"))
.backgroundColor($r("app.colo... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private BreakpointCard 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 BreakpointCard(): void {
Column() {
this.CardTitle($r("app.string.demo_screen_adapt_breakpoint_label"));
SpaceVerticalSmall();
this.CardDesc(this.breakpointState.current);
}
.width(P100)
.padding($r("app.float.space_padding_medium"))
.backgroundColor($r("app.colo... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/ScreenAdaptDemoPage.ets#L184-L195 | 84a64fd27f9edbadc44db94f5f585eec1d97ac03 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/datatype/primitives/primitives_number_002_F.ets | arkts | Introduction 基础数据类型-number | export function primitives_number_002_F(taint_src : number) : void {
let _t : number = taint_src;
let _clean = 1;
taint.Sink(_clean);
} | AST#export_declaration#Left export AST#function_declaration#Left function primitives_number_002_F AST#parameter_list#Left ( AST#parameter#Left taint_src : 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_anno... | export function primitives_number_002_F(taint_src : number) : void {
let _t : number = taint_src;
let _clean = 1;
taint.Sink(_clean);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/datatype/primitives/primitives_number_002_F.ets#L6-L10 | 3376bca20f12faf97576f4cf5e32b1f38972c16f | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | 渲染布局
@returns {void} 无返回值
@example
RowStartBottom() { Text("Hi"); } | build(): void {
RowBase({
options: this.options,
justifyContent: FlexAlign.Start,
alignItems: VerticalAlign.Bottom,
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.Bottom,
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#L924-L939 | 85fc394286a2457cb685cd6f617f087b66f9eca7 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/CryptoUtil.ets | arkts | generateSymKeySync | 生成对称密钥SymKey,同步
@param algName 待生成对称密钥生成器的算法名称(AES128、AES192、AES256、3DES192、SM4_128、HMAC、HMAC|SHA1、HMAC|SHA256、HMAC|SHA512、HMAC|SM3、等)
@returns | static generateSymKeySync(algName: string): cryptoFramework.SymKey {
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(algName); //创建对称密钥生成器
let symKey = symKeyGenerator.generateSymKeySync(); //获取该对称密钥生成器随机生成的密钥
return symKey;
} | AST#method_declaration#Left static generateSymKeySync AST#parameter_list#Left ( AST#parameter#Left algName : 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#qualifie... | static generateSymKeySync(algName: string): cryptoFramework.SymKey {
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(algName);
let symKey = symKeyGenerator.generateSymKeySync();
return symKey;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoUtil.ets#L111-L115 | e537118a30afe284d44fc23988031b29b3185346 | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/constants/MsgType.ets | arkts | 聊天消息类型常量定义。
特别注意:本类中定义的常量切勿重复,否则将影响聊天列表UI的正常展现! | export default class MsgType {
/** 聊天消息类型之:普通文字消息 */
static readonly TYPE_TEXT: number = 0;
/** 聊天消息类型之:图片消息(即消息内容就是存放于服务端的磁盘图片文件名) */
static readonly TYPE_IMAGE: number = 1;
/** 聊天消息类型之:语音留言消息(即消息内容就是存放于服务端的语音留言文件名) */
static readonly TYPE_VOICE: number = 2;
/** 聊天消息类型之:系统消息或提示信息(... | AST#export_declaration#Left export default AST#class_declaration#Left class MsgType AST#class_body#Left { /** 聊天消息类型之:普通文字消息 */ AST#property_declaration#Left static readonly TYPE_TEXT : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#exp... | export default class MsgType {
static readonly TYPE_TEXT: number = 0;
static readonly TYPE_IMAGE: number = 1;
static readonly TYPE_VOICE: number = 2;
static readonly TYPE_SYSTEAM$INFO: number = 90;
static readonly VOD_MOMENT_TIME: string = "vod_moment";
static readonly V... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/constants/MsgType.ets#L6-L22 | 7d7e22f358b3829ec7b7460da4c72f497338378f | gitee | |
Delsin-Yu/JustPDF.git | d53f566e02820dac46e1752151750144acbed50a | entry/src/main/ets/components/PageInfo.ets | arkts | prefetchPagesAround | Prefetches pages around the center index and evicts caches for distant pages.
@param centerIndex The current page index being viewed
@param prefetchRange Number of pages to prefetch on each side (default: 3)
@param evictionRange Pages beyond this range will have their viewer caches evicted (default: 5) | public prefetchPagesAround(
centerIndex: number,
prefetchRange: number = 3,
evictionRange: number = 5
): void {
const totalPages = this.totalPageCount();
// Prefetch pages within range
for (let offset = -prefetchRange; offset <= prefetchRange; offset++) {
const pageIndex = centerInd... | AST#method_declaration#Left public prefetchPagesAround AST#parameter_list#Left ( AST#parameter#Left centerIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left prefetchRange : AST#type_annotation#Left AST#primary_type#Left... | public prefetchPagesAround(
centerIndex: number,
prefetchRange: number = 3,
evictionRange: number = 5
): void {
const totalPages = this.totalPageCount();
for (let offset = -prefetchRange; offset <= prefetchRange; offset++) {
const pageIndex = centerIndex + offset;
if (pageInd... | https://github.com/Delsin-Yu/JustPDF.git/blob/d53f566e02820dac46e1752151750144acbed50a/entry/src/main/ets/components/PageInfo.ets#L488-L530 | 3ed2fb8f068d51b25a4d1c3f27e099a4719be4d2 | github |
Hyricane/Interview_Success.git | 9783273fe05fc8951b99bf32d3887c605268db8f | entry/src/main/ets/models/index.ets | arkts | 单个分类 | export interface QuestionType {
id: number
name: string
displayNewestFlag: 0 | 1
} | AST#export_declaration#Left export AST#interface_declaration#Left interface QuestionType AST#object_type#Left { AST#type_member#Left id : 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 name : AST#type_annotation#Left AST#... | export interface QuestionType {
id: number
name: string
displayNewestFlag: 0 | 1
} | https://github.com/Hyricane/Interview_Success.git/blob/9783273fe05fc8951b99bf32d3887c605268db8f/entry/src/main/ets/models/index.ets#L11-L15 | 087cdac873b9b2669bda1a0ac0885617672000fa | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/Performance/PerformanceLibrary/feature/smartPerfEditor/src/main/ets/view/SmartPerfEditorView.ets | arkts | SmartPerfEditorView | 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 SmartPerfEditorView {
@State isVisible: Visibility = Visibility.None;
build() {
Column() {
Button($r('app.string.show_hide_image'))
.id('showImageBtn')
.onClick(() => {
if (this.isVisible == Visibility.Visible) {
this.isVisible = Visibility.N... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct SmartPerfEditorView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isVisible : AST#type_annotation#Left AST#primary_type#Left Visibility AST#primary_type#Right A... | @Component
export struct SmartPerfEditorView {
@State isVisible: Visibility = Visibility.None;
build() {
Column() {
Button($r('app.string.show_hide_image'))
.id('showImageBtn')
.onClick(() => {
if (this.isVisible == Visibility.Visible) {
this.isVisible = Visibility.N... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/Performance/PerformanceLibrary/feature/smartPerfEditor/src/main/ets/view/SmartPerfEditorView.ets#L16-L38 | 99f7b8f4f534fba954faa4ea56a2d4adbca3b9c7 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ProgressButtonV2.d.ets | arkts | Defines ClickCallback of the ProgressButtonV2.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@crossplatform
@since 18 | export type ClickCallback = () => void; | AST#export_declaration#Left export AST#type_declaration#Left type ClickCallback = 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 AST#type_... | export type ClickCallback = () => void; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ProgressButtonV2.d.ets#L182-L182 | 097054a9f4f7943dbf3a07e38293ca3c59550aee | gitee | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/feature/PixelMapQueue.ets | arkts | Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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 l... | export default class PixelMapQueue {
private items: PixelMap[];
constructor() {
this.items = [];
}
push(pm: PixelMap): void {
this.items.push(pm);
}
pop(): PixelMap | undefined{
return this.items.pop();
}
} | AST#export_declaration#Left export default AST#class_declaration#Left class PixelMapQueue AST#class_body#Left { AST#property_declaration#Left private items : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left PixelMap [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right ; AST#proper... | export default class PixelMapQueue {
private items: PixelMap[];
constructor() {
this.items = [];
}
push(pm: PixelMap): void {
this.items.push(pm);
}
pop(): PixelMap | undefined{
return this.items.pop();
}
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Media/Image/photomodify/src/main/ets/components/feature/PixelMapQueue.ets#L16-L30 | 00b9dfe82e4a5e1059954d2d99a7a6592e4fe4a6 | gitee | |
LiuAnclouds/Harmony-ArkTS-App.git | 2119ce333927599b81a31081bc913e1416837308 | WeatherMind/entry/src/main/ets/pages/ChooseCity.ets | arkts | filterCities | 过滤城市列表 | private filterCities() {
if (!this.searchText.trim()) {
this.isSearching = false;
this.filteredCities = [];
} else {
this.isSearching = true;
this.filteredCities = this.allCities.filter(city =>
city.city_name.includes(this.searchText.trim())
);
}
} | AST#method_declaration#Left private filterCities AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_express... | private filterCities() {
if (!this.searchText.trim()) {
this.isSearching = false;
this.filteredCities = [];
} else {
this.isSearching = true;
this.filteredCities = this.allCities.filter(city =>
city.city_name.includes(this.searchText.trim())
);
}
} | https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/ChooseCity.ets#L214-L224 | a0d556c0db0c2a5084bc63bb6d8a8e105428d456 | github |
openharmony/applications_settings | aac607310ec30e30d1d54db2e04d055655f72730 | product/phone/src/main/ets/pages/bluetooth.ets | arkts | pairDevice | Pair device
@param device | pairDevice(device: BluetoothDevice) {
if (this.controller) {
this.controller.pair(device.deviceId);
}
} | AST#method_declaration#Left pairDevice AST#parameter_list#Left ( AST#parameter#Left device : AST#type_annotation#Left AST#primary_type#Left BluetoothDevice AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_... | pairDevice(device: BluetoothDevice) {
if (this.controller) {
this.controller.pair(device.deviceId);
}
} | https://github.com/openharmony/applications_settings/blob/aac607310ec30e30d1d54db2e04d055655f72730/product/phone/src/main/ets/pages/bluetooth.ets#L606-L610 | c7010afa1bfd057631341336a3aaf7f7eac5960a | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets | arkts | savePixelMap | 保存pixelMap,返回路径
@param pm
@returns | async savePixelMap(context: Context, pm: PixelMap): Promise<string> {
if (pm === null) {
logger.error(TAG, 'pm is null');
return '';
}
const imagePackerApi: image.ImagePacker = image.createImagePacker();
let packOpts: image.PackingOption = { format: 'image/jpeg', quality: 30 };
try {
... | AST#method_declaration#Left async savePixelMap AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left pm : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_... | async savePixelMap(context: Context, pm: PixelMap): Promise<string> {
if (pm === null) {
logger.error(TAG, 'pm is null');
return '';
}
const imagePackerApi: image.ImagePacker = image.createImagePacker();
let packOpts: image.PackingOption = { format: 'image/jpeg', quality: 30 };
try {
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/util/FileUtil.ets#L31-L48 | 8964b49827a51bc0aa291ce2fc43f461f18ea129 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/videotrimmer/src/main/ets/videotrimmer/VideoThumbOption.ets | arkts | 视频帧图片选项 | export class ThumbContent {
// 当加载帧没有完成,默认的占位图
framePlaceholder?: PixelMap = undefined;
// 裁剪视频预览长方形条状区域背景颜色
frameBackground: string = '#000000';
// 视频帧加载成功后的图片信息
pixelMap?: PixelMap = undefined;
} | AST#export_declaration#Left export AST#class_declaration#Left class ThumbContent AST#class_body#Left { // 当加载帧没有完成,默认的占位图 AST#property_declaration#Left framePlaceholder ? : AST#type_annotation#Left AST#primary_type#Left PixelMap AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left undefined AST#expres... | export class ThumbContent {
framePlaceholder?: PixelMap = undefined;
frameBackground: string = '#000000';
pixelMap?: PixelMap = undefined;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/src/main/ets/videotrimmer/VideoThumbOption.ets#L19-L26 | b657755078388b44d6656a55ced8134b73613fa8 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/List/entry/src/main/ets/common/CommonConstants.ets | arkts | thousandth | export const GOODS_LIST_HEIGHT: string = '20%'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left GOODS_LIST_HEIGHT : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '20%' AST#expression#Right AST#variable_declarator#Right ; AST#variable_dec... | export const GOODS_LIST_HEIGHT: string = '20%'; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/List/entry/src/main/ets/common/CommonConstants.ets#L17-L17 | 74749b786a53636b62d8034f99db6088f4174b3c | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/utils/Transformer.ets | arkts | generateTransformedValuesBubble | Transforms an List of Entry into a float array containing the x and
y values transformed with all matrices for the BUBBLECHART.
@param data
@return | public generateTransformedValuesBubble(data: IBubbleDataSet, phaseY: number, from: number, to: number): number[] {
const count = (to - from + 1) * 2; // (int) Math.ceil((to - from) * phaseX) * 2;
if (this.valuePointsForGenerateTransformedValuesBubble.length != count) {
this.valuePointsForGenerateTransfo... | AST#method_declaration#Left public generateTransformedValuesBubble AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left IBubbleDataSet AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left phaseY : AST#type_annotation#Left AST#primary_typ... | public generateTransformedValuesBubble(data: IBubbleDataSet, phaseY: number, from: number, to: number): number[] {
const count = (to - from + 1) * 2;
if (this.valuePointsForGenerateTransformedValuesBubble.length != count) {
this.valuePointsForGenerateTransformedValuesBubble = new Array<number>(count);
... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L144-L169 | 16dc26167c2b4c237e13f7c7a1862c1cb66f7a43 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_axios/src/main/ets/axios/AxiosUtil.ets | arkts | getAxios | 获取默认的axios对象
@returns AxiosStatic | private static getAxios(): AxiosStatic {
const context = axios.create({
baseURL: efAxiosParams.baseURL,
timeout: 10000
});
return context as AxiosStatic;
} | AST#method_declaration#Left private static getAxios AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AxiosStatic AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator... | private static getAxios(): AxiosStatic {
const context = axios.create({
baseURL: efAxiosParams.baseURL,
timeout: 10000
});
return context as AxiosStatic;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_axios/src/main/ets/axios/AxiosUtil.ets#L42-L48 | 5a23e6a1cb1548dc20f1ca8a1b43f2d28ed6813b | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/utils/ShareUtils.ets | arkts | shareText | 分享文本
@param title
@param content
@param description | static shareText(
title: string,
content: string,
description: string = '来自--xxxAPP'): Promise<boolean> {
let shareData: systemShare.SharedData = new systemShare.SharedData({
utd: utd.UniformDataType.TEXT,
title: title,
content: content,
description: description,
})
retur... | AST#method_declaration#Left static shareText AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left content : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty... | static shareText(
title: string,
content: string,
description: string = '来自--xxxAPP'): Promise<boolean> {
let shareData: systemShare.SharedData = new systemShare.SharedData({
utd: utd.UniformDataType.TEXT,
title: title,
content: content,
description: description,
})
retur... | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/utils/ShareUtils.ets#L50-L61 | 51682d60e557e258f68b747a6f6b3b58c1d4f9fb | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/charts/PieChartModel.ets | arkts | setEntryLabelTextSize | Sets the size of the entry labels in vp. Default: 14vp
@param size | public setEntryLabelTextSize(size: number): void {
( /*(PieChartRenderer)*/
this.mRenderer as PieChartRenderer).getPaintEntryLabels()
.setTextSize(Utils.handleDataValues(size));
} | AST#method_declaration#Left public setEntryLabelTextSize AST#parameter_list#Left ( AST#parameter#Left size : 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#pri... | public setEntryLabelTextSize(size: number): void {
(
this.mRenderer as PieChartRenderer).getPaintEntryLabels()
.setTextSize(Utils.handleDataValues(size));
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/charts/PieChartModel.ets#L739-L743 | a9b6424315b78daa9d438b03eb65a9802d44fc1d | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/util/ChatTools.ets | arkts | getTimeSegmentStr | 将一个两位24小时时间的转换为上午、下午这样的描述。
@param hh24 两位的24小时制时间的小时部分
@return 如果成功转换则返回形如:“凌晨”、“上午”等,否则返回空字符串(不是null)
@since 3.1 | static getTimeSegmentStr(hh24: string): string {
let ret: string = '';
if (hh24 && hh24.length >= 2) {
try {
// 取出“小时”部分
let a = parseInt(hh24.substring(0, 2));
if (a >= 0 && a <= 6) {
ret = "凌晨";
} else if (a > 6 && a <= 12) {
ret = "上午";
} else... | AST#method_declaration#Left static getTimeSegmentStr AST#parameter_list#Left ( AST#parameter#Left hh24 : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#prima... | static getTimeSegmentStr(hh24: string): string {
let ret: string = '';
if (hh24 && hh24.length >= 2) {
try {
let a = parseInt(hh24.substring(0, 2));
if (a >= 0 && a <= 6) {
ret = "凌晨";
} else if (a > 6 && a <= 12) {
ret = "上午";
} else if (a > 12... | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/util/ChatTools.ets#L282-L305 | a09546cc35352c12276dfb65ad18d6ab5177e891 | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_information/ace_ets_module_information_api16/entry/src/main/ets/MainAbility/pages/dataPanel/DataPanelContentModifier.ets | arkts | buildDataPanel | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Builder
function buildDataPanel(config: DataPanelConfiguration) {
Column() {
Column() {
ForEach(config.values, (item: number, index: number) => {
ChildItem({ item: item, index: index, max: config.maxValue })
}, (item: string) => item)
}.padding(10)
Column() {
Line().width('100%... | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildDataPanel AST#parameter_list#Left ( AST#parameter#Left config : AST#type_annotation#Left AST#primary_type#Left DataPanelConfiguration AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#paramete... | @Builder
function buildDataPanel(config: DataPanelConfiguration) {
Column() {
Column() {
ForEach(config.values, (item: number, index: number) => {
ChildItem({ item: item, index: index, max: config.maxValue })
}, (item: string) => item)
}.padding(10)
Column() {
Line().width('100%... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_information/ace_ets_module_information_api16/entry/src/main/ets/MainAbility/pages/dataPanel/DataPanelContentModifier.ets#L15-L33 | c6839ac1f14796fc476f8e2c7c10f789a4dcfcb8 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | setGridColor | Sets the color of the grid lines for this axis (the horizontal lines
coming from each label).
@param color | public setGridColor(color: number): void {
this.mGridColor = color;
} | AST#method_declaration#Left public setGridColor AST#parameter_list#Left ( AST#parameter#Left color : 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 setGridColor(color: number): void {
this.mGridColor = color;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L245-L247 | 896ea79132b3d597f817146dc981c38b45212ac5 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/settings/SettingsService.ets | arkts | getAISettings | 获取AI设置
@returns AI设置 | async getAISettings(): Promise<AISettings> {
const settings = await this.getSettings();
return settings.ai;
} | AST#method_declaration#Left async getAISettings 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 AISettings AST#primary_type#Right AST#type_annotation#Right > AST#t... | async getAISettings(): Promise<AISettings> {
const settings = await this.getSettings();
return settings.ai;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/settings/SettingsService.ets#L248-L251 | a5886aabb8d0e290dab0ec24268643a6bcdc5659 | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/WindowViewModel.ets | arkts | getFirstGridData | 主页第一个模块数据
@return {Array<GridItem>} firstGridData. | getFirstGridData(): Array<GridItem> {
let firstGridData: GridItem[] = [
new GridItem($r('app.string.my_love'), $r('app.media.ic_love')),
new GridItem($r('app.string.history_record'), $r('app.media.ic_record')),
new GridItem($r('app.string.message'), $r('app.media.ic_message')),
new GridItem(... | AST#method_declaration#Left getFirstGridData 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 GridItem AST#primary_type#Right AST#type_annotation#Right > AST#type_arg... | getFirstGridData(): Array<GridItem> {
let firstGridData: GridItem[] = [
new GridItem($r('app.string.my_love'), $r('app.media.ic_love')),
new GridItem($r('app.string.history_record'), $r('app.media.ic_record')),
new GridItem($r('app.string.message'), $r('app.media.ic_message')),
new GridItem(... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/framework/ArkUI/ArkUI_Experiment_frame/entry/src/main/ets/viewmodel/WindowViewModel.ets#L40-L52 | 1cfdf8b8fe963228dd4a8f57b06813593cc8a831 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/highlight/PieRadarHighlighter.ets | arkts | getClosestHighlight | Returns the closest Highlight object of the given objects based on the touch position inside the chart.
@param index
@param x
@param y
@return | protected abstract getClosestHighlight(index: number, x: number, y: number): Highlight | null; | AST#method_declaration#Left protected abstract getClosestHighlight 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#Left x : AST#type_annotation#Left AST#primary_type#Left numbe... | protected abstract getClosestHighlight(index: number, x: number, y: number): Highlight | null; | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/highlight/PieRadarHighlighter.ets#L78-L78 | ca54dec1217305473d67e8f1979542b35117bee1 | gitee |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/core/src/main/ets/datasource/BasicDataSource.ets | arkts | notifyDataMove | 通知LazyForEach组件将from索引和to索引处的子组件进行交换 | notifyDataMove(from: number, to: number): void {
this.listeners.forEach(listener => {
listener.onDataMove(from, to);
})
} | AST#method_declaration#Left notifyDataMove AST#parameter_list#Left ( AST#parameter#Left from : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left to : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right... | notifyDataMove(from: number, to: number): void {
this.listeners.forEach(listener => {
listener.onDataMove(from, to);
})
} | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/core/src/main/ets/datasource/BasicDataSource.ets#L96-L100 | fb1929c2d39cfa85a26a04cc38a5428ec4db2190 | gitee |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/structures/ClientUserGuildSettings.ets | arkts | update | Update a specific property of the guild settings. | update(name: string, value: any): Promise<Object> {
// 应用约束:对象字面量动态属性(约束5),使用Map替代
const updateData = new Map<string, any>();
updateData.set(name, value);
return this.client.rest.methods.patchClientUserGuildSettings(
this.guildID,
updateData
);
} | AST#method_declaration#Left update AST#parameter_list#Left ( AST#parameter#Left name : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left any AST#primary_type#Right AST#typ... | update(name: string, value: any): Promise<Object> {
const updateData = new Map<string, any>();
updateData.set(name, value);
return this.client.rest.methods.patchClientUserGuildSettings(
this.guildID,
updateData
);
} | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/structures/ClientUserGuildSettings.ets#L59-L67 | eb703645bd110a2179f0edcdea379c640fab65a7 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/utils/NotificationUtils.ets | arkts | getDefaultWantAgent | 创建一个可拉起Ability的Want
@returns | static async getDefaultWantAgent(uri: string = ''): Promise<WantAgent> {
const context = ArkWebHelper.getContext(); //获取当前上下文对象
const wantAgentInfo: wantAgent.WantAgentInfo = {
wants: [
{
deviceId: '',
bundleName: context.abilityInfo.bundleName,
moduleName: context.ab... | AST#method_declaration#Left static async getDefaultWantAgent AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#expression#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_a... | static async getDefaultWantAgent(uri: string = ''): Promise<WantAgent> {
const context = ArkWebHelper.getContext();
const wantAgentInfo: wantAgent.WantAgentInfo = {
wants: [
{
deviceId: '',
bundleName: context.abilityInfo.bundleName,
moduleName: context.abilityInfo.m... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/utils/NotificationUtils.ets#L449-L468 | 0247835126dda732754efd5ec9ef0b02d5148114 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | slider small track thick ness | export const SMALL_TRACK_THICK_NESS: number = 2; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SMALL_TRACK_THICK_NESS : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 2 AST#expression#Right AST#variable_declarator#Right ; AST#variable_de... | export const SMALL_TRACK_THICK_NESS: number = 2; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/SimpleVideo/entry/src/main/ets/common/constants/CommonConstants.ets#L59-L59 | ead264e66165f6d63c28e0a848b0d748e57292ff | gitee | |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/model/database/PreferencesHandler.ets | arkts | addPreferencesListener | 添加用户首选项变化监听器,以便在数据变化时得到通知。
@param listener 偏好设置监听器对象 | public addPreferencesListener(listener: PreferencesListener) {
this.listeners.push(listener);
} | AST#method_declaration#Left public addPreferencesListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left PreferencesListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expres... | public addPreferencesListener(listener: PreferencesListener) {
this.listeners.push(listener);
} | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/model/database/PreferencesHandler.ets#L74-L76 | e584d5b8ea51bf95335841ce87964c47fcf0c91a | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/util/src/main/ets/image/ImageUtil.ets | arkts | pixelMapToBase64 | PixelMap转base64
@param {image.PixelMap} pixelMap 图像的PixelMap对象
@param {string} format 目标格式(默认png,当前只支持jpg、webp和png)
@returns {Promise<string>} 返回图像的base64字符串 | static async pixelMapToBase64(pixelMap: image.PixelMap, format: string = 'image/png'): Promise<string> {
const options: image.PackingOption = { format: format, quality: 100 };
const arrayBuffer: ArrayBuffer = await ImageUtil.packingFromPixelMap(pixelMap, options);
const base64Helper: util.Base64Helper = new... | AST#method_declaration#Left static async pixelMapToBase64 AST#parameter_list#Left ( AST#parameter#Left pixelMap : 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#Left for... | static async pixelMapToBase64(pixelMap: image.PixelMap, format: string = 'image/png'): Promise<string> {
const options: image.PackingOption = { format: format, quality: 100 };
const arrayBuffer: ArrayBuffer = await ImageUtil.packingFromPixelMap(pixelMap, options);
const base64Helper: util.Base64Helper = new... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/util/src/main/ets/image/ImageUtil.ets#L64-L74 | 6f36873469b499ffef880c1dfd20541b0728715a | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/pages/SearchPage.ets | arkts | buildHotSearchSection | 构建热门搜索区域 | @Builder
buildHotSearchSection() {
Column({ space: 12 }) {
Row() {
Image($r('app.media.ic_hot'))
.width(16)
.height(16)
.fillColor('#ff6b6b')
Text('热门搜索')
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildHotSearchSection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#compone... | @Builder
buildHotSearchSection() {
Column({ space: 12 }) {
Row() {
Image($r('app.media.ic_hot'))
.width(16)
.height(16)
.fillColor('#ff6b6b')
Text('热门搜索')
.fontSize(16)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/pages/SearchPage.ets#L361-L388 | b63931f678073f79a65a015542566cd74c47c3d7 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pageloading/src/main/ets/view/CommodityList.ets | arkts | CommodityList | 自上而下渐变 | @Component
export struct CommodityList {
private commodityData: CommodityDataSource = new CommodityDataSource();
aboutToAppear() {
this.commodityData.pushData(PRODUCTS_DATA)
}
build() {
Column() {
Column() {
Image($r("app.media.page_loading_light_mode_banner"))
.objectFit(Image... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CommodityList AST#component_body#Left { AST#property_declaration#Left private commodityData : AST#type_annotation#Left AST#primary_type#Left CommodityDataSource AST#primary_type#Right AST#type_annotation#Right = AST#e... | @Component
export struct CommodityList {
private commodityData: CommodityDataSource = new CommodityDataSource();
aboutToAppear() {
this.commodityData.pushData(PRODUCTS_DATA)
}
build() {
Column() {
Column() {
Image($r("app.media.page_loading_light_mode_banner"))
.objectFit(Image... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pageloading/src/main/ets/view/CommodityList.ets#L28-L86 | 4b426aae4968daffe0b65e9eb1d88d98655893ac | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/main/sub/list/SubListOneView.ets | arkts | updateSelectedIndexOnScroll | 根据滚动位置更新选中的字母索引 | private updateSelectedIndexOnScroll(index: number): void {
const sections = this.sectionWords.allSections();
///ListGroup整体占一个索引,所以index是ListGroup的索引
if (index >0 && index < sections.length) {
let char = sections[index]
let i = this.indexers.findIndex((ch, index)=> char === ch)
if (i > ... | AST#method_declaration#Left private updateSelectedIndexOnScroll 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... | private updateSelectedIndexOnScroll(index: number): void {
const sections = this.sectionWords.allSections();
if (index >0 && index < sections.length) {
let char = sections[index]
let i = this.indexers.findIndex((ch, index)=> char === ch)
if (i > 0 && i < this.indexers.length) {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/list/SubListOneView.ets#L101-L115 | e266fcd5229e1eb0252dde5f1ccdd503b8fee9f2 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/KeyGenerationConversion/SpecifiedParametersGenerateAsymmetricKeyPair/entry/src/main/ets/pages/ecc/Promise.ets | arkts | testEccUseCommKeySpecGet | 根据EccCommonSpec实例生成ECC密钥对,获取密钥规格 | function testEccUseCommKeySpecGet() {
try {
let commKeySpec = genEccCommonSpec(); // 使用参数属性,构造ECC公私钥公共密钥参数对象
let generatorBySpec = cryptoFramework.createAsyKeyGeneratorBySpec(commKeySpec); // 使用密钥参数对象创建生成器
let keyPairPromise = generatorBySpec.generateKeyPair(); // Generate an ECC key pair.
keyPairProm... | AST#function_declaration#Left function testEccUseCommKeySpecGet AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left commKeySpec = AST#exp... | function testEccUseCommKeySpecGet() {
try {
let commKeySpec = genEccCommonSpec();
let generatorBySpec = cryptoFramework.createAsyKeyGeneratorBySpec(commKeySpec);
let keyPairPromise = generatorBySpec.generateKeyPair();
keyPairPromise.then(keyPair => {
showEccSpecDetailInfo(keyPair.priKey, 'pr... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/KeyGenerationConversion/SpecifiedParametersGenerateAsymmetricKeyPair/entry/src/main/ets/pages/ecc/Promise.ets#L100-L119 | 10348853deb64d135a42bb7f8a9720c88aa9d92a | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/chat/VoiceManage/SpeechManager.ets | arkts | countDownLatch | 计时 | private async countDownLatch(count: number) {
while (count > 0) {
await this.sleep(40)
count--
}
} | AST#method_declaration#Left private async countDownLatch AST#parameter_list#Left ( AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#while_stat... | private async countDownLatch(count: number) {
while (count > 0) {
await this.sleep(40)
count--
}
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/Wechat_Arkts-master/entry/src/main/ets/pages/chat/VoiceManage/SpeechManager.ets#L79-L84 | 53f6114ecbf7784c3e94494f849557c1b7213693 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangSeekBarOption.ets | arkts | 视频剪辑长度选项 | export class RangSeekBarOption {
// 左边进度位置
public mLeftProgressPos: number = 0;
// 右边进度位置
public mRightProgressPos: number = 10;
// 最小时间 比如一屏幕10张图 间隔10s, 现在最小时间是3s,那么leftThumb和rightThumb的最小间隔是3张图宽度
public mMinShootTime: number = 3;
// 最大时间 约束了右侧thumb和左侧thumb的距离
public mMaxShootTime: number = 10;
// 一屏... | AST#export_declaration#Left export AST#class_declaration#Left class RangSeekBarOption AST#class_body#Left { // 左边进度位置 AST#property_declaration#Left public mLeftProgressPos : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Righ... | export class RangSeekBarOption {
public mLeftProgressPos: number = 0;
public mRightProgressPos: number = 10;
public mMinShootTime: number = 3;
public mMaxShootTime: number = 10;
public mMaxCountRange: number = 10;
public mThumbWidth: number = 30
public mPaddingTopBottom: number = 10;
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/VideoTrimmer/entry/src/main/ets/videotrimmer/RangSeekBarOption.ets#L19-L37 | 5c867726734ef1d19a047a2769c92157d11e3c5d | gitee | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Column.ets | arkts | 渲染布局
@returns {void} 无返回值
@example
ColumnSpaceEvenly() { Text("A"); Text("B"); Text("C"); } | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceEvenly,
alignItems: HorizontalAlign.Center,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.mar... | 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 ColumnBase ( AST#component_parameters#Left { AST#component_parameter#Left options : AST#expression#Left AST#member_expressio... | build(): void {
ColumnBase({
options: this.options,
justifyContent: FlexAlign.SpaceEvenly,
alignItems: HorizontalAlign.Center,
widthValue: this.widthValue,
heightValue: this.heightValue,
sizeValue: this.sizeValue,
paddingValue: this.paddingValue,
marginValue: this.mar... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Column.ets#L604-L619 | 2941f1fe36d454983d4b024ada5b884642d5691e | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/processes/tabs_actions.ets | arkts | Cancel in-page search for current tab.
@param storage The LocalStorage. | export function cancel_in_page_search(storage: LocalStorage) {
let tabs = storage.get('bunch_of_tabs') as bunch_of_tabs;
storage.set('current_in_page_searching_keyword', '');
storage.set('current_in_page_searching_stats_current', 0);
storage.set('current_in_page_searching_stats_total', 0);
tabs.workingMainTab... | AST#export_declaration#Left export AST#function_declaration#Left function cancel_in_page_search AST#parameter_list#Left ( AST#parameter#Left storage : AST#type_annotation#Left AST#primary_type#Left LocalStorage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_sta... | export function cancel_in_page_search(storage: LocalStorage) {
let tabs = storage.get('bunch_of_tabs') as bunch_of_tabs;
storage.set('current_in_page_searching_keyword', '');
storage.set('current_in_page_searching_stats_current', 0);
storage.set('current_in_page_searching_stats_total', 0);
tabs.workingMainTab... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/tabs_actions.ets#L148-L161 | 3a46f08d5bb6d7436a313b46b17fde8ce31bd934 | gitee | |
openharmony/notification_common_event_service | 5ee1b4f273fe5bab5c2c14b85b7efbd76ece9558 | interfaces/kits/ani/common_event/ets/commonEvent/commonEventSubscribeInfo.ets | arkts | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export interface CommonEventSubscribeInfo {
events: Array<string>;
publisherPermission?: string;
publisherDeviceId?: string;
userId?: number;
priority?: number;
publisherBundleName?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface CommonEventSubscribeInfo AST#object_type#Left { AST#type_member#Left events : 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... | export interface CommonEventSubscribeInfo {
events: Array<string>;
publisherPermission?: string;
publisherDeviceId?: string;
userId?: number;
priority?: number;
publisherBundleName?: string;
} | https://github.com/openharmony/notification_common_event_service/blob/5ee1b4f273fe5bab5c2c14b85b7efbd76ece9558/interfaces/kits/ani/common_event/ets/commonEvent/commonEventSubscribeInfo.ets#L16-L23 | 444cbb17bdbb77f897b51b934bb001e1311495ac | gitee | |
openharmony/communication_wifi | 387ba7fa8f98578629a6148635a4d630b2b99aa1 | wifi/frameworks/ets/ani/wifi_manager/ets/@ohos.wifiManager.ets | arkts | loadLibrary | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export namespace wifiManager {
loadLibrary | AST#export_declaration#Left export AST#ERROR#Left namespace w if iManager AST#ERROR#Right { loadLibrary AST#export_declaration#Right | export namespace wifiManager {
loadLibrary | https://github.com/openharmony/communication_wifi/blob/387ba7fa8f98578629a6148635a4d630b2b99aa1/wifi/frameworks/ets/ani/wifi_manager/ets/@ohos.wifiManager.ets#L16-L17 | 5cf780461cdb7d21a7358d787216aa7ae9a414ae | gitee |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets | arkts | updateDisplayData | 将数据库数据转换为UI显示数据 | updateDisplayData(): void {
this.datas = this.cartItems.map((item: CartItem): Type1 => {
return {
img: this.getImageByKey(item.image_key), // 根据image_key映射
contents: item.product_name,
dvalue: `${item.price}币`, // 原价
cvalue: `${item.price}币`, // 现价(这里假设没有折扣)
amount: `X$... | AST#method_declaration#Left updateDisplayData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#... | updateDisplayData(): void {
this.datas = this.cartItems.map((item: CartItem): Type1 => {
return {
img: this.getImageByKey(item.image_key),
contents: item.product_name,
dvalue: `${item.price}币`,
cvalue: `${item.price}币`,
amount: `X${item.quantity}`,
avalue: `$... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/gouwuche.ets#L223-L236 | 5710b7c96613e70a7d2132eb615e57afc39be7c0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/shortvideo/src/main/ets/model/DataModel.ets | arkts | 视频遮罩层数据 | export interface VideoMaskData {
name: string; // 博主名称
description: string; // 视频描述
time: string; // 视频日期
head: ResourceStr; // 头像路径
likeCount: string; // 点赞数量
commentCount: string; // 评论数量
favoriteCount: string; // 收藏数量
shareCount: string; // 分享次数
hotspot: string; // 热点
commentDataSource: CommentDa... | AST#export_declaration#Left export AST#interface_declaration#Left interface VideoMaskData 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 description : AST#type_... | export interface VideoMaskData {
name: string;
description: string;
time: string;
head: ResourceStr;
likeCount: string;
commentCount: string;
favoriteCount: string;
shareCount: string;
hotspot: string;
commentDataSource: CommentDataSource;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/shortvideo/src/main/ets/model/DataModel.ets#L31-L42 | 9ced77b980faf6f2a06b2752cbc06da2340e3f42 | gitee | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets | arkts | setOrCreate | Called when setting or creating.
@since 10 | static setOrCreate<T>(propName: string, newValue: T): void {
StorageMap.shared.set(propName, newValue, true)
} | AST#method_declaration#Left static setOrCreate AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left propName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#para... | static setOrCreate<T>(propName: string, newValue: T): void {
StorageMap.shared.set(propName, newValue, true)
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/arkoala-arkts/arkui/src/Storage.ets#L172-L174 | 35bf7738b8ece9ef541ea3d3e8bdef550d34c645 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/common/i18n/I18nManager.ets | arkts | getTranslationByKey | 根据键获取翻译 | private getTranslationByKey(key: string, language: SupportedLanguage): string | undefined {
const translations = this.translations.get(language);
if (!translations) return undefined;
const keys = key.split('.');
let current: any = translations;
for (const k of keys) {
if (current && typeof c... | AST#method_declaration#Left private getTranslationByKey AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left language : AST#type_annotation#Left AST#primary_type#Left SupportedLa... | private getTranslationByKey(key: string, language: SupportedLanguage): string | undefined {
const translations = this.translations.get(language);
if (!translations) return undefined;
const keys = key.split('.');
let current: any = translations;
for (const k of keys) {
if (current && typeof c... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/common/i18n/I18nManager.ets#L633-L665 | 8aa82e5b3bc12bd610c5bb7fa961c0ce3ab9582f | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/notification/TimedReminderService.ets | arkts | updateDailyCheckTime | 更新每日检查时间 | public async updateDailyCheckTime(hour: number, minute: number): Promise<boolean> {
try {
// 取消现有的每日检查提醒
const existingId = `daily_check_${hour}_${minute}`;
await this.cancelReminder(existingId);
// 创建新的每日检查提醒
return await this.createDailyCheckReminder(hour, minute);
} catch (erro... | AST#method_declaration#Left public async updateDailyCheckTime 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... | public async updateDailyCheckTime(hour: number, minute: number): Promise<boolean> {
try {
const existingId = `daily_check_${hour}_${minute}`;
await this.cancelReminder(existingId);
return await this.createDailyCheckReminder(hour, minute);
} catch (error) {
hilog.error(LogC... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/TimedReminderService.ets#L226-L239 | 64e71c6d11f86fc539d8373dc9382f529c885450 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets | arkts | getButtonItemValues | Gets the data in the clicked button. | getButtonItemValues() {
let values: Array<ButtonItemData> = [
new ButtonItemData(
$r('app.string.write_data_btn_text'),
() => {
// Write data.
PreferenceModel.writeData(this.fruit);
}
),
new ButtonItemData(
$r('app.string.read_data_btn_text'),
... | AST#method_declaration#Left getButtonItemValues AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left values : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < ... | getButtonItemValues() {
let values: Array<ButtonItemData> = [
new ButtonItemData(
$r('app.string.write_data_btn_text'),
() => {
PreferenceModel.writeData(this.fruit);
}
),
new ButtonItemData(
$r('app.string.read_data_btn_text'),
() => {
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets#L49-L81 | b2e1df12a314f199983a0a0b2c48fb40953eaa7d | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example2/view/CalendarView.ets | arkts | aboutToAppear | 初始化当前月的日期排列数组 获取当前日期 | aboutToAppear(): void {
this.dateModel = getRealTimeDate(); // 获取当前年月日信息
this.currentMonth = this.dateModel.month; // 获取当前月份
this.currentDay = this.dateModel.day; // 获取当前日
this.currentYear = this.dateModel.year; // 获取当前年份
this.currentMonthDay = getMonthDate(this.currentMonth, this.currentYear);
... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#... | aboutToAppear(): void {
this.dateModel = getRealTimeDate();
this.currentMonth = this.dateModel.month;
this.currentDay = this.dateModel.day;
this.currentYear = this.dateModel.year;
this.currentMonthDay = getMonthDate(this.currentMonth, this.currentYear);
if (this.currentMonth === MONTHS... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/ArkTS1.2/ComponentSample/entry/src/main/ets/pages/Example2/view/CalendarView.ets#L118-L149 | 575aed100c309b294bf8b1408c7ab5d65a2f21fa | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/KvUtil.ets | arkts | getUint8Array | 获取指定键的值。
@param key 要查询数据的Key
@param callback | static async getUint8Array(key: string, defValue?: Uint8Array): Promise<Uint8Array> {
let value = await KvUtil.get(key, defValue);
return value as Uint8Array;
} | AST#method_declaration#Left static async getUint8Array AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left defValue ? : AST#type_annotation#Left AST#primary_type#Left Uint8Array... | static async getUint8Array(key: string, defValue?: Uint8Array): Promise<Uint8Array> {
let value = await KvUtil.get(key, defValue);
return value as Uint8Array;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/KvUtil.ets#L114-L117 | 2edd86702b471c639675e0cab0c726bf0c65641a | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/shortvideo/Index.ets | arkts | VideoSwiper | 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 { VideoSwiper } from './src/main/ets/utils/VideoSwiper'; | AST#export_declaration#Left export { VideoSwiper } from './src/main/ets/utils/VideoSwiper' ; AST#export_declaration#Right | export { VideoSwiper } from './src/main/ets/utils/VideoSwiper'; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/shortvideo/Index.ets#L16-L16 | 6b3c1b6497e8d32c4c940c536c9a354acde3fe9a | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/chinesetopinyin/src/main/ets/pages/ChineseToPinyin.ets | arkts | ChineseToPinyinComponent | 功能描述: 本示例介绍使用第三方库的pinyin4js组件实现汉字转大写拼音。
推荐场景: 身份信息展示场景
核心组件:
1. 三方库pinyin4js组件
实现步骤:
1. 引入第三方库pinyin4js组件。
2. 使用convertToPinyinString实现汉字转拼音。 | @Component
export struct ChineseToPinyinComponent {
@State userName: string | Resource = $r('app.string.pinyin_name_content');
// 个人信息分组
@State userGroup: ListConstruction[] = [
new ListConstruction($r('app.string.pinyin_id'), $r('app.string.pinyin_name_change_title'), $r('app.string.pinyin_name_change_conten... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ChineseToPinyinComponent AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right userName : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#... | @Component
export struct ChineseToPinyinComponent {
@State userName: string | Resource = $r('app.string.pinyin_name_content');
@State userGroup: ListConstruction[] = [
new ListConstruction($r('app.string.pinyin_id'), $r('app.string.pinyin_name_change_title'), $r('app.string.pinyin_name_change_content')),
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/chinesetopinyin/src/main/ets/pages/ChineseToPinyin.ets#L53-L151 | 7e0416e57494b69e66ddd29fa1680701ffa90fcd | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/CryptoHelper.ets | arkts | getKeyDataBlob | 获取DataBlob类型的公钥或私钥
@param data 待转换的公钥或私钥。
@param keyCoding 秘钥的编码方式(base64/hex/utf8/utf-8),data为字符串时用到 | static getKeyDataBlob(data: string | Uint8Array | cryptoFramework.DataBlob | null,
keyCoding: crypto.BhuCoding = 'utf-8'): cryptoFramework.DataBlob | null {
if (data === null) {
return null;
} else if (typeof data === 'string') {
return { data: CryptoHelper.strToUint8Array(data, keyCoding) };
... | AST#method_declaration#Left static getKeyDataBlob AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Uint8Array AST#primary_type#Right | AST#primary_type#Left AST#qualified_type#Left cryptoFramework... | static getKeyDataBlob(data: string | Uint8Array | cryptoFramework.DataBlob | null,
keyCoding: crypto.BhuCoding = 'utf-8'): cryptoFramework.DataBlob | null {
if (data === null) {
return null;
} else if (typeof data === 'string') {
return { data: CryptoHelper.strToUint8Array(data, keyCoding) };
... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/CryptoHelper.ets#L116-L127 | 66dc1228a2048c8d6d350f102fb1bd194e770ffd | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/CanvasComponent/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Common constants for all features. | export default class CommonConstants {
/**
* Watermelon image url.
*/
static readonly WATERMELON_IMAGE_URL: string = '../../../resources/base/media/ic_watermelon.png';
/**
* Hamburg image url.
*/
static readonly HAMBURG_IMAGE_URL: string = '../../../resources/base/media/ic_hamburg.png';
/**
*... | AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /**
* Watermelon image url.
*/ AST#property_declaration#Left static readonly WATERMELON_IMAGE_URL : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Rig... | export default class CommonConstants {
static readonly WATERMELON_IMAGE_URL: string = '../../../resources/base/media/ic_watermelon.png';
static readonly HAMBURG_IMAGE_URL: string = '../../../resources/base/media/ic_hamburg.png';
static readonly CAKE_IMAGE_URL: string = '../../../resources/base/media/ic... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/CanvasComponent/entry/src/main/ets/common/constants/CommonConstants.ets#L19-L194 | 985a109bd0ae16c0f53593005a20fde1b968a4ae | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | 完整农历系统设计.ets | arkts | createLunarDateInfo | 创建农历日期信息对象 | private static createLunarDateInfo(year: number, month: number, day: number, isLeapMonth: boolean, yearConfig: LunarYearConfig): LunarDateInfo {
return {
year: year,
month: month,
day: day,
isLeapMonth: isLeapMonth,
yearCn: NewLunarCalendar.getLunarYearCn(year),
monthCn: NewLunar... | AST#method_declaration#Left private static createLunarDateInfo 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... | private static createLunarDateInfo(year: number, month: number, day: number, isLeapMonth: boolean, yearConfig: LunarYearConfig): LunarDateInfo {
return {
year: year,
month: month,
day: day,
isLeapMonth: isLeapMonth,
yearCn: NewLunarCalendar.getLunarYearCn(year),
monthCn: NewLunar... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/完整农历系统设计.ets#L378-L394 | 5307f74d71ae14230e33eb6a91e2e2faaaad4012 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/entity/SelectedGoods.ets | arkts | @param {Partial<SelectedGoods>} init - 初始化数据 | constructor(init?: Partial<SelectedGoods>) {
if (!init) {
return;
}
this.goodsId = init.goodsId ?? this.goodsId;
this.goodsInfo = init.goodsInfo ?? this.goodsInfo;
this.spec = init.spec ?? this.spec;
this.count = init.count ?? this.count;
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left init ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Partial AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left SelectedGoods AST#primary_type#Right AST#type_annotation#Right > AST#ty... | constructor(init?: Partial<SelectedGoods>) {
if (!init) {
return;
}
this.goodsId = init.goodsId ?? this.goodsId;
this.goodsInfo = init.goodsInfo ?? this.goodsInfo;
this.spec = init.spec ?? this.spec;
this.count = init.count ?? this.count;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/SelectedGoods.ets#L31-L39 | 3e4725bb7d5614f0e03b54ec1d297a6c314519d5 | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | getValueFormatter | Returns the formatter used for formatting the axis labels.
@return | public getValueFormatter(): IAxisValueFormatter {
if (!this.mAxisValueFormatter ||
(this.mAxisValueFormatter instanceof DefaultAxisValueFormatter &&
(this.mAxisValueFormatter as DefaultAxisValueFormatter).getDecimalDigits() != this.mDecimals))
this.mAxisValueFormatter = new DefaultAxisValueFormatter(... | AST#method_declaration#Left public getValueFormatter AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left IAxisValueFormatter AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST... | public getValueFormatter(): IAxisValueFormatter {
if (!this.mAxisValueFormatter ||
(this.mAxisValueFormatter instanceof DefaultAxisValueFormatter &&
(this.mAxisValueFormatter as DefaultAxisValueFormatter).getDecimalDigits() != this.mDecimals))
this.mAxisValueFormatter = new DefaultAxisValueFormatter(... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L566-L574 | ab141f4af1c4aa062dce8de3a3aecc776e166506 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/SettingsTypes.ets | arkts | 代理配置接口 | export interface ProxyConfig {
host: string;
port: number;
username?: string;
password?: string;
type: 'http' | 'https' | 'socks5';
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ProxyConfig AST#object_type#Left { AST#type_member#Left host : 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 port : AST#type_annotation#Left A... | export interface ProxyConfig {
host: string;
port: number;
username?: string;
password?: string;
type: 'http' | 'https' | 'socks5';
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/SettingsTypes.ets#L464-L470 | 0dbd2af0573ef8e36d9a054a128ce502b90063d1 | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/DESSync.ets | arkts | encodeCBC | 加密-CBC模式
@param str 待加密的字符串
@param aesKey 3DES密钥
@param iv iv偏移量字符串
@param keyCoding 密钥编码方式(utf8/hex/base64) 普通字符串则选择utf8格式
@param resultCoding 加密后数据的编码方式(hex/base64)-不传默认为base64
@returns | static encodeCBC(str: string, desKey: string, iv: string,
keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.encodeCBC(str, desKey, iv, '3DES192', '3DES192|CBC|PKCS7', 192, keyCoding, resultCoding);
} | AST#method_declaration#Left static encodeCBC AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left desKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#... | static encodeCBC(str: string, desKey: string, iv: string,
keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.encodeCBC(str, desKey, iv, '3DES192', '3DES192|CBC|PKCS7', 192, keyCoding, resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/DESSync.ets#L60-L63 | 29c013b88ae5b32ddf66c251d6ba9704d235b527 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/model/src/main/ets/entity/GoodsSpec.ets | arkts | @file 规格模型
@author Joker.X | export class GoodsSpec {
/**
* ID
*/
id: number = 0;
/**
* 商品ID
*/
goodsId: number = 0;
/**
* 名称
*/
name: string = "";
/**
* 价格
*/
price: number = 0;
/**
* 库存
*/
stock: number = 0;
/**
* 排序
*/
sortNum: number = 0;
/**
* 图片
*/
images?: string[] | null... | AST#export_declaration#Left export AST#class_declaration#Left class GoodsSpec AST#class_body#Left { /**
* ID
*/ AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_decl... | export class GoodsSpec {
id: number = 0;
goodsId: number = 0;
name: string = "";
price: number = 0;
stock: number = 0;
sortNum: number = 0;
images?: string[] | null = null;
createTime?: string | null = null;
updateTime?: string | null = null;
constructor(init?: Partial<Go... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/GoodsSpec.ets#L5-L57 | b948bad8411deccc571d9b04bf2b95800787042f | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.util.d.ets | arkts | isArrayBuffer | Check whether the entered value is of arraybuffer type.
@param { Object } value - A arraybuffer value
@returns { boolean } Returns true if the value is a built-in ArrayBuffer instance.
This does not include SharedArrayBuffer instances.
Usually, it is desirable to test for both; See isAnyArrayBuffer() for that.
@syscap... | isArrayBuffer(value: Object): boolean; | AST#method_declaration#Left isArrayBuffer AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left Object AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#R... | isArrayBuffer(value: Object): boolean; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1158-L1158 | 446fe83d4ffa4e9c27ed64a079b485b2713e21d9 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/RSA.ets | arkts | recover | 对数据进行签名恢复原始数据,异步,目前仅RSA支持
@param signData 已签名数据
@param pubKey 公钥
@param algName 指定签名算法(RSA1024|PKCS1|SHA256、RSA1024|PKCS1|NoHash|OnlySign、RSA1024|PKCS1|NoHash|Recover、等)。
@returns | static async recover(signData: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|NoHash|Recover'): Promise<cryptoFramework.DataBlob | null> {
let verifier = cryptoFramework.createVerify(algName);
await verifier.init(pubKey);
let rawSignData = await verifier.recover(s... | AST#method_declaration#Left static async recover AST#parameter_list#Left ( AST#parameter#Left signData : 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 pu... | static async recover(signData: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|NoHash|Recover'): Promise<cryptoFramework.DataBlob | null> {
let verifier = cryptoFramework.createVerify(algName);
await verifier.init(pubKey);
let rawSignData = await verifier.recover(s... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/RSA.ets#L338-L343 | b52ac9dfe02e90722c3414c51f0d91764174714b | gitee |
zhonghaojie/ArkTSComponentPractice.git | 73f56243f10439a872d0990320bb3f8df17d0001 | entry/src/main/ets/pages/Login.ets | arkts | inputStyle | 输入框样式 | @Extend(TextInput) function inputStyle () {
.placeholderColor($r('app.color.placeholder_color'))
.height($r('app.float.login_input_height'))
.fontSize($r('app.float.big_text_size'))
.backgroundColor($r('app.color.background'))
.width('100%')
.padding({ left: 0 })
.margin({ top: $r('app.float.input_margin_... | AST#decorated_function_declaration#Left AST#decorator#Left @ Extend ( AST#expression#Left TextInput AST#expression#Right ) AST#decorator#Right function inputStyle AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . placeholderColor ( AST#expression#L... | @Extend(TextInput) function inputStyle () {
.placeholderColor($r('app.color.placeholder_color'))
.height($r('app.float.login_input_height'))
.fontSize($r('app.float.big_text_size'))
.backgroundColor($r('app.color.background'))
.width('100%')
.padding({ left: 0 })
.margin({ top: $r('app.float.input_margin_... | https://github.com/zhonghaojie/ArkTSComponentPractice.git/blob/73f56243f10439a872d0990320bb3f8df17d0001/entry/src/main/ets/pages/Login.ets#L8-L16 | 29b3105f9715a90c7a5db861e9931d6a4cc52a7c | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/ContactTypes.ets | arkts | 联系人导入数据接口 | export interface ContactImportData {
name: string;
relation?: string;
birthday?: string;
birthdayYear?: number | string; // 出生年份
birthdayMonth?: number | string; // 出生月份
birthdayDay?: number | string; // 出生日期
isLunar?: boolean | string;
age?: number | string; // 年龄(用于农历生日)
gender?... | AST#export_declaration#Left export AST#interface_declaration#Left interface ContactImportData 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 relation ? : AST#type_annot... | export interface ContactImportData {
name: string;
relation?: string;
birthday?: string;
birthdayYear?: number | string;
birthdayMonth?: number | string;
birthdayDay?: number | string;
isLunar?: boolean | string;
age?: number | string;
gender?: string;
phone?: string;
emai... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/ContactTypes.ets#L254-L281 | 7212949db17e70b0ca124dac447d033897c85ff1 | github | |
Active-hue/ArkTS-Accounting.git | c432916d305b407557f08e35017c3fd70668e441 | entry/src/main/ets/common/BillData.ets | arkts | 账单数据模型 | export interface BillItem {
id: string; // 唯一ID
type: number; // 0: 支出, 1: 收入
amount: string; // 金额
category: string; // 分类
categoryIcon: string; // 分类图标编号
remark: string; // 备注
date: string; // 日期
time: string; // 时间
} | AST#export_declaration#Left export AST#interface_declaration#Left interface BillItem 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 ; // 唯一ID AST#type_member#Left type : AST#type_annotation#Lef... | export interface BillItem {
id: string;
type: number;
amount: string;
category: string;
categoryIcon: string; 图标编号
remark: string;
date: string;
time: string;
} | https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/common/BillData.ets#L3-L12 | 666580d96d0080fbf30a962704c3fd39c1c67424 | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Row.ets | arkts | RowSpaceAroundTop | 横向环绕分布 + 垂直顶部 | @ComponentV2
export struct RowSpaceAroundTop {
/**
* Row 构造参数
*/
@Param
options: RowOptions | RowOptionsV2 = {};
/**
* 宽度
*/
@Param
widthValue: Length | undefined = undefined;
/**
* 高度
*/
@Param
heightValue: Length | undefined = undefined;
/**
* 尺寸(对应官方 size 属性)
*/
@Param
... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct RowSpaceAroundTop 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_typ... | @ComponentV2
export struct RowSpaceAroundTop {
@Param
options: RowOptions | RowOptionsV2 = {};
@Param
widthValue: Length | undefined = undefined;
@Param
heightValue: Length | undefined = undefined;
@Param
sizeValue: SizeOptions | undefined = undefined;
@Param
paddingValue: Padding | L... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Row.ets#L1265-L1340 | b412c74e6811aa17e8138cab1ed18273a2c1bcb9 | github |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/modules/auth/AuthService.ets | arkts | loginWithBiometric | 生物识别登录(指纹/面容) | async loginWithBiometric(): Promise<boolean> {
try {
Logger.info('AuthService', 'Biometric login attempt');
// Mock 生物识别登录
// 实际实现需要使用 @ohos.userIAM.userAuth API
const token = await StorageManager.getString(this.TOKEN_KEY, '');
if (token) {
// 如果已有token,直接使用
... | AST#method_declaration#Left async loginWithBiometric 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... | async loginWithBiometric(): Promise<boolean> {
try {
Logger.info('AuthService', 'Biometric login attempt');
const token = await StorageManager.getString(this.TOKEN_KEY, '');
if (token) {
const userInfoStr = await StorageManager.getString(this.USER_INFO_... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/modules/auth/AuthService.ets#L326-L350 | 736bd177caef161f96ab348c33cffe88e7790a98 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/VideoPlayer/entry/src/main/ets/viewmodel/HomeDialogModel.ets | arkts | failureCallback | This parameter is used to report error information when an error occurs in function invoking.
@param error Error information. | failureCallback(error: Error) {
Logger.error(`[HomeDialogModel] error happened: ` + JSON.stringify(error));
this.showPrompt($r('app.string.link_check_fail'));
} | AST#method_declaration#Left failureCallback AST#parameter_list#Left ( AST#parameter#Left error : AST#type_annotation#Left AST#primary_type#Left Error AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#express... | failureCallback(error: Error) {
Logger.error(`[HomeDialogModel] error happened: ` + JSON.stringify(error));
this.showPrompt($r('app.string.link_check_fail'));
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/VideoPlayer/entry/src/main/ets/viewmodel/HomeDialogModel.ets#L130-L133 | 2c8db1c29fb386ae7b326965e870a1796dcf4f28 | gitee |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/class.ets | arkts | getShowContent | **********获取课程信息网络**********// | async getShowContent() {
let httpRequest = http.createHttp();
let encodedClass = encodeURIComponent(this.courseId); // 编码中文
let url = address.IP + `/getSingleCourse?id=${encodedClass}`;
try {
let response = await httpRequest.request(url, {
method: http.RequestMethod.GET,
header: {
... | AST#method_declaration#Left async getShowContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left httpRequest = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST... | async getShowContent() {
let httpRequest = http.createHttp();
let encodedClass = encodeURIComponent(this.courseId);
let url = address.IP + `/getSingleCourse?id=${encodedClass}`;
try {
let response = await httpRequest.request(url, {
method: http.RequestMethod.GET,
header: {
... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/class.ets#L450-L470 | 2a29d982bdbe8de06fae023e2f8e2c417c3d8c28 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/launch/src/main/ets/navigation/SplashNav.ets | arkts | SplashNav | @file 启动页导航入口
@returns {void} 无返回值
@author Joker.X | @Builder
export function SplashNav(): void {
SplashPage();
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SplashNav AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_comp... | @Builder
export function SplashNav(): void {
SplashPage();
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/launch/src/main/ets/navigation/SplashNav.ets#L8-L11 | e5a5db73857fe980367f243aa046a65ae44cee02 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/TcpSocket.ets | arkts | connectSocket | 连接Socket
@param address
@param port | async connectSocket(address: string, port: number): Promise<boolean> {
Logger.info(`${TAG} tcp connectSocket address: ${address}`);
try {
if (!this.tcpSocket) {
return false;
}
if (await this.isConnected()) {
Logger.info(`${TAG} tcp connectSocket sucess`);
return true;... | AST#method_declaration#Left async connectSocket AST#parameter_list#Left ( AST#parameter#Left address : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left port : AST#type_annotation#Left AST#primary_type#Left number AST#primary_... | async connectSocket(address: string, port: number): Promise<boolean> {
Logger.info(`${TAG} tcp connectSocket address: ${address}`);
try {
if (!this.tcpSocket) {
return false;
}
if (await this.isConnected()) {
Logger.info(`${TAG} tcp connectSocket sucess`);
return true;... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Connectivity/StageSocket/entry/src/main/ets/socket/TcpSocket.ets#L57-L83 | 436dc2695c0510e4d8b052c12eae982fe69090ba | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_position/entry/src/main/ets/MainAbility/view/position/TabsView.ets | arkts | TabsView | 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 TabsView {
@State fontColor: string = '#182431';
@State selectedFontColor: string = '#007DFF';
@State currentIndex: number = 0;
private controller: TabsController = new TabsController();
@Link _position: Position;
private componentKey: string = '';
@Builder TabBuilder(index: numb... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TabsView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right fontColor : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotat... | @Component
export struct TabsView {
@State fontColor: string = '#182431';
@State selectedFontColor: string = '#007DFF';
@State currentIndex: number = 0;
private controller: TabsController = new TabsController();
@Link _position: Position;
private componentKey: string = '';
@Builder TabBuilder(index: numb... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_common_attrss/ace_ets_component_common_attrss_position/entry/src/main/ets/MainAbility/view/position/TabsView.ets#L16-L84 | 880dd16dea8a3ddbd60c16d9e0d3d9ceeea09130 | gitee |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/BackgroundTaskManagement/ResourceManager/entry/src/main/ets/pages/Index.ets | arkts | JumpToResApiExample | 订阅事件回调 | function JumpToResApiExample (err: BusinessError, data: CommonEventManager.CommonEventData) {
if (err) {
console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else {
router.pushUrl({ url: 'pages/BasicResources' });
}
} | AST#function_declaration#Left function JumpToResApiExample AST#parameter_list#Left ( AST#parameter#Left err : AST#type_annotation#Left AST#primary_type#Left BusinessError AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#q... | function JumpToResApiExample (err: BusinessError, data: CommonEventManager.CommonEventData) {
if (err) {
console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else {
router.pushUrl({ url: 'pages/BasicResources' });
}
} | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/BackgroundTaskManagement/ResourceManager/entry/src/main/ets/pages/Index.ets#L25-L31 | ea84fb3afbdea7e2240cd8431ea2ff27388a7aec | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/device/HoverEffect.ets | arkts | HoverEffectSample | [Start mouse_hover_effect] | @Entry
@Component
export struct HoverEffectSample {
@State buttonText: string = '';
@State columnText: string = '';
@State hoverText: string = 'Not Hover';
@State color: Color = Color.Gray;
build() {
NavDestination() {
Column({ space: 12 }) {
Column({ space: 10 }) {
Button('Auto'... | AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export struct HoverEffectSample AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right buttonText : AST#type_annotation#Left AST#primary... | @Entry
@Component
export struct HoverEffectSample {
@State buttonText: string = '';
@State columnText: string = '';
@State hoverText: string = 'Not Hover';
@State color: Color = Color.Gray;
build() {
NavDestination() {
Column({ space: 12 }) {
Column({ space: 10 }) {
Button('Auto'... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/device/HoverEffect.ets#L17-L51 | feadc1f5fa72926e9e373d4ad800c67deee0c3cd | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | picker_utils/src/main/ets/Utils.ets | arkts | isEmpty | 判断字符串是否为空(undefined、null、字符串长度为0)
@param str 被检测的字符串
@return 是否为空 | static isEmpty(str: string | undefined | null): boolean {
return str === undefined || str === null || str.length === 0;
} | AST#method_declaration#Left static isEmpty AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right... | static isEmpty(str: string | undefined | null): boolean {
return str === undefined || str === null || str.length === 0;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/Utils.ets#L32-L34 | 5fcd9c27d8e207265fe735c56dcc4fcd790311a5 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/contacts/ContactImportPage.ets | arkts | buildJsonImportSection | 构建JSON导入区域 | @Builder
buildJsonImportSection() {
Column({ space: 16 }) {
// 说明
this.buildJsonInstructions()
// JSON内容输入
this.buildJsonInput()
// 解析预览
if (this.showJsonPreview) {
this.buildJsonPreview()
}
// 导入按钮
this.buildImportButton('JSON')
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildJsonImportSection AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#compon... | @Builder
buildJsonImportSection() {
Column({ space: 16 }) {
this.buildJsonInstructions()
this.buildJsonInput()
if (this.showJsonPreview) {
this.buildJsonPreview()
}
this.buildImportButton('JSON')
}
.width('100%')
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/contacts/ContactImportPage.ets#L138-L156 | 8623d00b3cb3b14031755c925e3331f5b3c24e70 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/encryption/RSASync.ets | arkts | generateRSAKey | 生成RSA的非对称密钥
@param resultCoding 生成RSA秘钥的字符串格式(hex/base64)-默认不传为base64格式
@returns RSA密钥{publicKey:公钥,privateKey:私钥} | static generateRSAKey(resultCoding: buffer.BufferEncoding = 'base64'): CryptoKey {
return CryptoSyncUtil.generateCryptoKey('RSA1024', resultCoding);
} | AST#method_declaration#Left static generateRSAKey AST#parameter_list#Left ( AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expres... | static generateRSAKey(resultCoding: buffer.BufferEncoding = 'base64'): CryptoKey {
return CryptoSyncUtil.generateCryptoKey('RSA1024', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/encryption/RSASync.ets#L35-L37 | 069fe11547afed00a4d7ba0c10ebefce6b6ca897 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.