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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Hyricane/Interview_Success.git | 9783273fe05fc8951b99bf32d3887c605268db8f | entry/src/main/ets/commons/utils/Auth.ets | arkts | checkAuth | 封装一个页面访问控制逻辑 用于某些重要页面 在游客访问时 跳转至登录(登录完成后 需要回到刚刚没去成的页面) Authorization 授权 登录 | checkAuth(obj: router.RouterOptions) {
const user = this.getUser()
if (user.token) {
// 登录了
router.pushUrl(obj) // 会拿到item
} else {
// 没登录 去登录(带上个参数 刚刚没去成的页面url)
const params = obj.params as Record<string, string> || {}
params.return_url = obj.url
router.pushUrl({
... | AST#method_declaration#Left checkAuth AST#parameter_list#Left ( AST#parameter#Left obj : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left router . RouterOptions AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statem... | checkAuth(obj: router.RouterOptions) {
const user = this.getUser()
if (user.token) {
router.pushUrl(obj)
} else {
const params = obj.params as Record<string, string> || {}
params.return_url = obj.url
router.pushUrl({
url: '/pages/LoginPage'.slice(1),
pa... | https://github.com/Hyricane/Interview_Success.git/blob/9783273fe05fc8951b99bf32d3887c605268db8f/entry/src/main/ets/commons/utils/Auth.ets#L23-L42 | ea3366e61131f231901131e4d0e5a837ff8309ac | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_ui/ace_ets_module_platform/ace_ets_module_platform_api11/entry/src/main/ets/MainAbility/pages/XComponent/Log.ets | arkts | showInfo | print info level log
@param {string} tag - Page or class tag
@param {string} log - Log needs to be printed | static showInfo(tag: string, log: undefined|null|string|number) {
console.info(`${TAG} tag: ${tag} --> ${log}`);
} | AST#method_declaration#Left static showInfo AST#parameter_list#Left ( AST#parameter#Left tag : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left log : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left undefine... | static showInfo(tag: string, log: undefined|null|string|number) {
console.info(`${TAG} tag: ${tag} --> ${log}`);
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_ui/ace_ets_module_platform/ace_ets_module_platform_api11/entry/src/main/ets/MainAbility/pages/XComponent/Log.ets#L28-L30 | b099b9e878d43edea539d493c89e469e0e5d53f4 | gitee |
openharmony-sig/knowledge_demo_smart_home | 6cdf5d81ef84217f386c4200bfc4124a0ded5a0d | FA/DistScheduleEts/entry/src/main/ets/controlPage/common/utils/controlPageUtil.ets | arkts | getCoalGasCommand | 获取可燃气体命令
@return Command | static getCoalGasCommand() {
let param = {}
param["BeepStatus"] = "OFF";
return new DeviceCommandModel("SetBeep", "GasDetection", JSON.stringify(param));
} | AST#method_declaration#Left static getCoalGasCommand AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left param = AST#expression#Left AST#subscript_expression#Left AST#expression#Left AST#object_literal#Left { }... | static getCoalGasCommand() {
let param = {}
param["BeepStatus"] = "OFF";
return new DeviceCommandModel("SetBeep", "GasDetection", JSON.stringify(param));
} | https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/controlPage/common/utils/controlPageUtil.ets#L95-L99 | a8c35d44480bb2473c4a791f5b76f0b334b1c669 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/NetworkUtil.ets | arkts | getIpAddress | 获取当前设备的IP地址(设备连接Wi-Fi后) | static getIpAddress() {
let ipAddress = wifiManager.getIpInfo().ipAddress;
let ip = (ipAddress >>> 24) + "." + (ipAddress >> 16 & 0xFF) + "." + (ipAddress >> 8 & 0xFF) + "." + (ipAddress & 0xFF);
return ip;
} | AST#method_declaration#Left static getIpAddress AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left ipAddress = AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#ex... | static getIpAddress() {
let ipAddress = wifiManager.getIpInfo().ipAddress;
let ip = (ipAddress >>> 24) + "." + (ipAddress >> 16 & 0xFF) + "." + (ipAddress >> 8 & 0xFF) + "." + (ipAddress & 0xFF);
return ip;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/NetworkUtil.ets#L230-L234 | 8c336581cbbc2a1467c39825f9ffac340e269d17 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/viewmodel/OrderListViewModel.ets | arkts | showRebuyModal | 显示再次购买弹窗
@returns {void} 无返回值 | showRebuyModal(): void {
this.rebuyModalVisible = true;
} | AST#method_declaration#Left showRebuyModal 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#mem... | showRebuyModal(): void {
this.rebuyModalVisible = true;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderListViewModel.ets#L72-L74 | 3d50277b9a53a274a164d8f28c5f6cbf7eaa5ec0 | github |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets | arkts | getStartOfDay | 获取当天的开始时间
@returns 当天开始时间的Date对象 | static getStartOfDay(): Date {
const date = new Date();
date.setHours(0, 0, 0, 0);
return date;
} | AST#method_declaration#Left static getStartOfDay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left date... | static getStartOfDay(): Date {
const date = new Date();
date.setHours(0, 0, 0, 0);
return date;
} | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/utils/TimeUtils.ets#L150-L154 | 4542543c0bebd014ac81ea49025483a9141b8509 | github |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/function_call/arrow_function/arrow_function_001_T.ets | arkts | Introduction 箭头函数-一阶 | export function arrow_function_001_T(taint_src : string) {
let arrowFunction = (t : string): void => taint.Sink(t)
arrowFunction(taint_src);
} | AST#export_declaration#Left export AST#function_declaration#Left function arrow_function_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_statemen... | export function arrow_function_001_T(taint_src : string) {
let arrowFunction = (t : string): void => taint.Sink(t)
arrowFunction(taint_src);
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/function_call/arrow_function/arrow_function_001_T.ets#L6-L9 | ad61420bda79ce712390b0af7e626d7378a48a49 | github | |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | AvoidTimeComsume/entry/src/main/ets/views/NegativeOfLazyForEach.ets | arkts | itemGeneratorFunc | Simulate time-consuming operations | itemGeneratorFunc(item: number): number {
let temp: number = 0;
for (let index = 0; index < 1000000; index++) {
temp += 1;
}
item += temp;
return item;
} | AST#method_declaration#Left itemGeneratorFunc AST#parameter_list#Left ( AST#parameter#Left item : 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 number AST#primary_type... | itemGeneratorFunc(item: number): number {
let temp: number = 0;
for (let index = 0; index < 1000000; index++) {
temp += 1;
}
item += temp;
return item;
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AvoidTimeComsume/entry/src/main/ets/views/NegativeOfLazyForEach.ets#L63-L70 | 1c7974aa13fe3c73379d367f639560e66169147f | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/utils/SoundUtil.ets | arkts | playFd | 初始化,创建实例 | async playFd(fd: resourceManager.RawFileDescriptor): Promise<void> {
Logger.info(TAG,`create AVPlayer playFd ${fd.fd}`);
try {
this.release();
this.avPlayer = await media.createAVPlayer();
this.avPlayer.on('stateChange', (state: media.AVPlayerState, reason: media.StateChangeReason) => {
... | AST#method_declaration#Left async playFd AST#parameter_list#Left ( AST#parameter#Left fd : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left resourceManager . RawFileDescriptor AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right :... | async playFd(fd: resourceManager.RawFileDescriptor): Promise<void> {
Logger.info(TAG,`create AVPlayer playFd ${fd.fd}`);
try {
this.release();
this.avPlayer = await media.createAVPlayer();
this.avPlayer.on('stateChange', (state: media.AVPlayerState, reason: media.StateChangeReason) => {
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/utils/SoundUtil.ets#L27-L40 | 339fdad4a7d6c0f8b52dce3bae08fbf3948702f7 | gitee |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/common/RdbHelper.ets | arkts | getEndOfDay | Get end of today (23:59:59) as timestamp | private getEndOfDay(): number {
const now = new Date();
now.setHours(23, 59, 59, 999);
return now.getTime();
} | AST#method_declaration#Left private getEndOfDay AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left now... | private getEndOfDay(): number {
const now = new Date();
now.setHours(23, 59, 59, 999);
return now.getTime();
} | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/common/RdbHelper.ets#L618-L622 | fb8e522a6462bd7b5a9ee1ee730588d4e62dbbd8 | github |
from-north-to-north/OpenHarmony_p7885 | f6ea526c039db535a7c958fa154ccfcb3668b37c | hap/easy_demo/float_windows/float_windows_3.5.14.43/entry/src/main/ets/controller/FloatWindowController.ets | arkts | hideMain | 此处有一个bug,当前ability调用windowStage.getMainWindow().hide()方法,会与上一个ability一起hide | async hideMain() {
if(this.windowStage){
let mainWin: window.Window = await this.windowStage.getMainWindow();
mainWin.hide();
}
} | AST#method_declaration#Left async hideMain 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 . windowStage AST#member_expression#Right AST#expression#R... | async hideMain() {
if(this.windowStage){
let mainWin: window.Window = await this.windowStage.getMainWindow();
mainWin.hide();
}
} | https://github.com/from-north-to-north/OpenHarmony_p7885/blob/f6ea526c039db535a7c958fa154ccfcb3668b37c/hap/easy_demo/float_windows/float_windows_3.5.14.43/entry/src/main/ets/controller/FloatWindowController.ets#L51-L56 | 5a934345b81b92f4fd61802e90fd585811e98472 | gitee |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/usemoney.ets | arkts | incomeView | 收入 tab 内容 | @Builder
incomeView() {
Column({ space: 10 }) {
ForEach([
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right incomeView 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#component_paramete... | @Builder
incomeView() {
Column({ space: 10 }) {
ForEach([
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/usemoney.ets#L181-L248 | afd4c6d55c2b892ba2ce8ee97d036daaaaefc194 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/Functions.ets | arkts | 获取兼容性宽度
@param { number } width
@param { number } height
@param { number } menuLength
@returns { number } 适配当菜单数量,取菜单的宽度和tabs高度,把小数值返回作为后续使用 | export function getMinWidth(width: number, height: number, menuLength: number = 0): number {
return Math.min(width / menuLength, height);
} | AST#export_declaration#Left export AST#function_declaration#Left function getMinWidth AST#parameter_list#Left ( AST#parameter#Left width : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left height : AST#type_annotation#Left AST... | export function getMinWidth(width: number, height: number, menuLength: number = 0): number {
return Math.min(width / menuLength, height);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customdrawtabbar/src/main/ets/utils/Functions.ets#L44-L46 | 254ffdee6928c428730f69de074ab10a4e19c8b2 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/SearchHistoryRepository.ets | arkts | clearAllSearchHistory | 清空所有搜索历史记录
@returns {Promise<void>} Promise<void> | clearAllSearchHistory(): Promise<void> {
return this.dataSource.clearAllSearchHistory();
} | AST#method_declaration#Left clearAllSearchHistory AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_... | clearAllSearchHistory(): Promise<void> {
return this.dataSource.clearAllSearchHistory();
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/SearchHistoryRepository.ets#L54-L56 | 95bb90897cdc04ad5a103b2601c8d563e27ba969 | github |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/pages/MainPage.ets | arkts | filterEpisodes | 过滤单集列表(无搜索关键词时) | filterEpisodes() {
// 如果有搜索关键词且有搜索结果,保持搜索结果不变
if (this.episodeSearchKeyword && this.episodeSearchKeyword.trim() !== '' && this.searchTotal > 0) {
return;
}
this.filteredEpisodes = this.allEpisodes;
} | AST#method_declaration#Left filterEpisodes AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 如果有搜索关键词且有搜索结果,保持搜索结果不变 AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary... | filterEpisodes() {
if (this.episodeSearchKeyword && this.episodeSearchKeyword.trim() !== '' && this.searchTotal > 0) {
return;
}
this.filteredEpisodes = this.allEpisodes;
} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/MainPage.ets#L209-L215 | 87ca32cdddfa792b0513017412bd1d09c5e410b9 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets | arkts | onFontSizeChange | 切换字体大小 | async onFontSizeChange(size: FontSizeType) {
try {
this.selectedFontSize = size;
await this.themeManager.setFontSize(size);
this.currentTheme = this.themeManager.getCurrentTheme();
} catch (error) {
console.error('Failed to change font size:', error);
}
} | AST#method_declaration#Left async onFontSizeChange AST#parameter_list#Left ( AST#parameter#Left size : AST#type_annotation#Left AST#primary_type#Left FontSizeType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_stateme... | async onFontSizeChange(size: FontSizeType) {
try {
this.selectedFontSize = size;
await this.themeManager.setFontSize(size);
this.currentTheme = this.themeManager.getCurrentTheme();
} catch (error) {
console.error('Failed to change font size:', error);
}
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/ThemeCustomizationPage.ets#L101-L109 | 246b404164bd4a16459147b2f1f3cc34e500214b | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/accessibility/AccessibilityService.ets | arkts | initialize | 初始化无障碍服务 | async initialize(context: Context): Promise<void> {
try {
this.context = context;
this.preferences = await preferences.getPreferences(context, 'accessibility_prefs');
// 加载保存的设置
await this.loadSettings();
// 初始化语音合成
await this.initializeSpeechSynthesis();
... | AST#method_declaration#Left async initialize AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Context AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Lef... | async initialize(context: Context): Promise<void> {
try {
this.context = context;
this.preferences = await preferences.getPreferences(context, 'accessibility_prefs');
await this.loadSettings();
await this.initializeSpeechSynthesis();
await this... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/accessibility/AccessibilityService.ets#L191-L211 | abefbc90438cee58d78de3101f4515419b20df87 | github |
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/ECDSA.ets | arkts | signSegment | 对数据进行分段签名,异步
@param data 待签名数据
@param priKey 私钥
@param len 自定义的数据拆分长度,此处取64
@returns | static async signSegment(data: Uint8Array, priKey: cryptoFramework.PriKey, len: number = 64): Promise<cryptoFramework.DataBlob> {
return CryptoUtil.signSegment(data, priKey, 'ECC256|SHA256', len);
} | AST#method_declaration#Left static async signSegment AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left AST#qualifi... | static async signSegment(data: Uint8Array, priKey: cryptoFramework.PriKey, len: number = 64): Promise<cryptoFramework.DataBlob> {
return CryptoUtil.signSegment(data, priKey, 'ECC256|SHA256', len);
} | 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/ECDSA.ets#L81-L83 | aab20c8f6d3a776013539b8ddc77d1726f3efbc0 | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/products/entry/src/main/ets/pages/mine/MineView.ets | arkts | FunctionItem | 构建功能模块项 | @Builder
FunctionItem(commonService: MinePageCommonService) {
Row() {
Image($r(commonService.icon))
.width(24)
.height(24)
.margin({ left: 12 })
Text(commonService.label)
.fontSize(16)
.fontWeight(FontWeight.Medium)
.margin({ left: 16 })
Blank()
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right FunctionItem AST#parameter_list#Left ( AST#parameter#Left commonService : AST#type_annotation#Left AST#primary_type#Left MinePageCommonService AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#... | @Builder
FunctionItem(commonService: MinePageCommonService) {
Row() {
Image($r(commonService.icon))
.width(24)
.height(24)
.margin({ left: 12 })
Text(commonService.label)
.fontSize(16)
.fontWeight(FontWeight.Medium)
.margin({ left: 16 })
Blank()
... | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/products/entry/src/main/ets/pages/mine/MineView.ets#L147-L183 | 2b627c2feca0bc9dc905741141344a5508bdf4cc | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/DataRenderer.ets | arkts | getPaintHighlight | Returns the Paint object this renderer uses for drawing highlight
indicators.
@return | public getPaintHighlight(): Paint {
return this.mHighlightPaint;
} | AST#method_declaration#Left public getPaintHighlight AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left Paint 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_... | public getPaintHighlight(): Paint {
return this.mHighlightPaint;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/DataRenderer.ets#L103-L105 | 5f2b45039daeface9d08ae7f99fc5ad639c92a19 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/OrderRepository.ets | arkts | getOrderPage | 获取订单分页列表
@param params 分页查询参数
@returns 订单分页数据 | async getOrderPage(params: OrderPageRequest): Promise<NetworkResponse<NetworkPageData<Order>>> {
return this.networkDataSource.getOrderPage(params);
} | AST#method_declaration#Left async getOrderPage AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left OrderPageRequest AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generi... | async getOrderPage(params: OrderPageRequest): Promise<NetworkResponse<NetworkPageData<Order>>> {
return this.networkDataSource.getOrderPage(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderRepository.ets#L65-L67 | f94d2b187f1881fa357a4c0b7031e7417ebfd584 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/settings/SettingsService.ets | arkts | isVersionCompatible | 检查版本兼容性
@param version 版本号
@returns 是否兼容 | private isVersionCompatible(version: string): boolean {
// 简单的版本兼容性检查
const currentMajor = parseInt(BusinessConstants.SETTINGS_VERSION.split('.')[0]);
const importMajor = parseInt(version.split('.')[0]);
return importMajor <= currentMajor;
} | AST#method_declaration#Left private isVersionCompatible AST#parameter_list#Left ( AST#parameter#Left version : 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 boolean AS... | private isVersionCompatible(version: string): boolean {
const currentMajor = parseInt(BusinessConstants.SETTINGS_VERSION.split('.')[0]);
const importMajor = parseInt(version.split('.')[0]);
return importMajor <= currentMajor;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/settings/SettingsService.ets#L818-L824 | f536041b8b3acfdaad5002c0be76c92f3ae4efca | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/ActionParameter.ets | arkts | initToastTipDefault | 初始化ToastTipOptions参数
@param options | static initToastTipDefault(options: ToastTipOptions) {
options.uiContext = options.uiContext ?? DialogHelper.getMainUIContext();
options.maskColor = Color.Transparent; //弹框自定义蒙层颜色。
options.autoCancel = false; //点击遮障层时,是否关闭弹窗。
options.isModal = false; //弹窗是否为模态窗口。
options.backCancel = options.backCan... | AST#method_declaration#Left static initToastTipDefault AST#parameter_list#Left ( AST#parameter#Left options : AST#type_annotation#Left AST#primary_type#Left ToastTipOptions AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_sta... | static initToastTipDefault(options: ToastTipOptions) {
options.uiContext = options.uiContext ?? DialogHelper.getMainUIContext();
options.maskColor = Color.Transparent;
options.autoCancel = false;
options.isModal = false;
options.backCancel = options.backCancel ?? ActionParameter.config.backCancel... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/ActionParameter.ets#L596-L637 | a34691b363a594d3770fb09e50f5f3f3aa97fda4 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | getAnniversariesOnDate | 获取指定日期的纪念日 | private getAnniversariesOnDate(date: Date): Anniversary[] {
return this.anniversaries.filter(anniversary => {
const anniversaryDate = anniversary.date;
return anniversaryDate.getFullYear() === date.getFullYear() &&
anniversaryDate.getMonth() === date.getMonth() &&
anniversaryDa... | AST#method_declaration#Left private getAnniversariesOnDate AST#parameter_list#Left ( AST#parameter#Left date : AST#type_annotation#Left AST#primary_type#Left Date AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_ty... | private getAnniversariesOnDate(date: Date): Anniversary[] {
return this.anniversaries.filter(anniversary => {
const anniversaryDate = anniversary.date;
return anniversaryDate.getFullYear() === date.getFullYear() &&
anniversaryDate.getMonth() === date.getMonth() &&
anniversaryDa... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L4385-L4392 | c4178a97029979e254fc3f9fe98ab9b595b5690a | github |
fmtjava/Ohs_ArkTs_Eyepetizer.git | 79578f394ccb926da1455e63b7fe0722df9b9a22 | entry/src/main/ets/common/PreferencesUtil.ets | arkts | putNumber | 存储数字数据(如整型计数等)
@param context 应用上下文
@param key 键
@param value 值 | static async putNumber(context: common.UIAbilityContext, key: string, value: number): Promise<void> {
try {
const dataPreferences = await PreferencesUtil.getPreferences(context);
await dataPreferences.put(key, value);
await dataPreferences.flush();
} catch (error) {
console.error('Prefer... | AST#method_declaration#Left static async putNumber AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left ke... | static async putNumber(context: common.UIAbilityContext, key: string, value: number): Promise<void> {
try {
const dataPreferences = await PreferencesUtil.getPreferences(context);
await dataPreferences.put(key, value);
await dataPreferences.flush();
} catch (error) {
console.error('Prefer... | https://github.com/fmtjava/Ohs_ArkTs_Eyepetizer.git/blob/79578f394ccb926da1455e63b7fe0722df9b9a22/entry/src/main/ets/common/PreferencesUtil.ets#L75-L83 | f3cdc9d174413ed11d61023a8cc8dd591bd4221b | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ImageViewer/entry/src/main/ets/utils/Constrain.ets | arkts | 计算图片的偏移结构 | export interface ConstrainOffsetAndAnimationType {
// 此次计算的方向 宽或者高
dimensionWH: ImageFitType,
// 此次图片的默认尺寸
imageDefaultSize: image.Size,
// 此次图片相对应的偏移信息
imageOffsetInfo: OffsetModel,
// 此次图片的放大尺寸
scaleValue: number,
// 当前图片的旋转角度
rotate: number,
/**
* 当超出限制多少时去判断
* 取值:0 ~ 1
* 当滑动在视图中,... | AST#export_declaration#Left export AST#interface_declaration#Left interface ConstrainOffsetAndAnimationType AST#object_type#Left { // 此次计算的方向 宽或者高 AST#type_member#Left dimensionWH : AST#type_annotation#Left AST#primary_type#Left ImageFitType AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right , // 此次... | export interface ConstrainOffsetAndAnimationType {
dimensionWH: ImageFitType,
imageDefaultSize: image.Size,
imageOffsetInfo: OffsetModel,
scaleValue: number,
rotate: number,
togglePercent: number
imageListOffset: number
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ImageViewer/entry/src/main/ets/utils/Constrain.ets#L35-L60 | 616f3adcb166ae32dcbab52cee0ef75527c38aa0 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/SimpleBirthdayApp.ets | arkts | buildContactsContent | 构建联系人内容 | @Builder
buildContactsContent() {
Column({ space: 16 }) {
// 搜索栏
Row({ space: 12 }) {
Search({ placeholder: '搜索联系人姓名、关系或标签' })
.searchButton('搜索')
.width('100%')
.height(40)
.backgroundColor('#f8f9fa')
.borderRadius(20)
.placeholderCo... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContactsContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen... | @Builder
buildContactsContent() {
Column({ space: 16 }) {
Row({ space: 12 }) {
Search({ placeholder: '搜索联系人姓名、关系或标签' })
.searchButton('搜索')
.width('100%')
.height(40)
.backgroundColor('#f8f9fa')
.borderRadius(20)
.placeholderColor('#... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/SimpleBirthdayApp.ets#L774-L864 | 5d61dbd65fa0e68ce2d4e22d5545b2bc29be1459 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/fitfordarkmode/src/main/ets/view/GoodsList.ets | arkts | GoodsList | 超过规定列数6时自动换行 | @Component
export struct GoodsList {
build() {
GridRow({ gutter: { x: GUTTER_X, y: GUTTER_Y }, }) {
// GridRow组件不支持LazyForEach方法
ForEach(PRODUCT_DATA, (item: ProductDataModel) => {
GridCol({ span: SPAN }) {
ItemView({ item: item })
}
}, (item: ProductDataModel) => item.... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct GoodsList AST#component_body#Left { AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left GridRow ( AST#component_parameters#Left { AS... | @Component
export struct GoodsList {
build() {
GridRow({ gutter: { x: GUTTER_X, y: GUTTER_Y }, }) {
ForEach(PRODUCT_DATA, (item: ProductDataModel) => {
GridCol({ span: SPAN }) {
ItemView({ item: item })
}
}, (item: ProductDataModel) => item.id.toString())
}
.pa... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/fitfordarkmode/src/main/ets/view/GoodsList.ets#L27-L46 | 49306a5cbb0aedb6815f9da58d9d16802a241253 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | getDayArray | 获取日期数组 | private getDayArray(): number[] {
return [0, 1, 2, 3, 4, 5, 6];
} | AST#method_declaration#Left private getDayArray AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left number [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Le... | private getDayArray(): number[] {
return [0, 1, 2, 3, 4, 5, 6];
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L4187-L4189 | 628976b9c3e05aa0281d4fb8f2b00d8e819d3ae0 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/highlight/ChartHighlighter.ets | arkts | getHighlight | @Override | public getHighlight(x: number, y: number): Highlight | null {
let pos: MPPointD = this.getValsForTouch(x, y);
let xVal: number = pos.x;
MPPointD.recycleInstance(pos);
let high: Highlight | null = this.getHighlightForX(xVal, x, y);
return high;
} | AST#method_declaration#Left public getHighlight AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Righ... | public getHighlight(x: number, y: number): Highlight | null {
let pos: MPPointD = this.getValsForTouch(x, y);
let xVal: number = pos.x;
MPPointD.recycleInstance(pos);
let high: Highlight | null = this.getHighlightForX(xVal, x, y);
return high;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/highlight/ChartHighlighter.ets#L44-L52 | e104678c2f35cc37542e86b988bb32a8fdd8e243 | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/ImageDialogBuilderProxy.ets | arkts | onAction | 点击图片时回调
@param action
@returns | onAction(action: ActionCallback) {
this.builderOptions.onAction = action
return this;
} | AST#method_declaration#Left onAction AST#parameter_list#Left ( AST#parameter#Left action : AST#type_annotation#Left AST#primary_type#Left ActionCallback AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#... | onAction(action: ActionCallback) {
this.builderOptions.onAction = action
return this;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/ImageDialogBuilderProxy.ets#L26-L29 | af73d5a6985eb9021a8f88527cd7fa46484a2240 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_speech/src/main/ets/Helper.ets | arkts | getTodayStr | 获取今天的时间,字符串类型
@param format 格式化字符串,(yyyy-MM-dd HH:mm:ss)
@returns | static getTodayStr(format?: string): string {
return Helper.getFormatDateStr(new Date(), format)
} | AST#method_declaration#Left static getTodayStr AST#parameter_list#Left ( AST#parameter#Left format ? : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | static getTodayStr(format?: string): string {
return Helper.getFormatDateStr(new Date(), format)
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/Helper.ets#L155-L157 | 0d58dd0b8fd8121ea4c412432720746e3b7cd6ab | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/PieChartRenderer.ets | arkts | releaseBitmap | Releases the drawing bitmap. This should be called when {@link LineChart#onDetachedFromWindow()}. | public releaseBitmap(): void {
// if (this.mBitmapCanvas != null) {
// this.mBitmapCanvas.setBitmap(null);
// this.mBitmapCanvas = null;
// }
// if (this.mDrawBitmap != null) {
// let drawBitmap:Bitmap = this.mDrawBitmap.get([]);
// if (drawBitmap != null) {
// drawBi... | AST#method_declaration#Left public releaseBitmap 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 { // if (this.mBitmapCanvas != null) { // this.mBitmapCanvas.setBitmap(null); // ... | public releaseBitmap(): void {
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/PieChartRenderer.ets#L1127-L1140 | 285138a88adc853d3137cd02c06bef96bfa62316 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/SimpleDownloader/SimpleDownloader.ets | arkts | resumeDownload | 恢复下载任务
@param {request.DownloadTask} downloadTask - 要恢复的下载任务实例
@returns {Promise<boolean>} 恢复操作结果的Promise,true表示成功
@throws {BusinessError} 恢复失败时抛出错误 | async resumeDownload(downloadTask: request.DownloadTask): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
downloadTask.restore((error: BusinessError, result: boolean) => {
if (error) {
console.error(`恢复下载任务失败. Code: ${error.code}, message: ${error.message}`);
... | AST#method_declaration#Left async resumeDownload AST#parameter_list#Left ( AST#parameter#Left downloadTask : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left request . DownloadTask AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Ri... | async resumeDownload(downloadTask: request.DownloadTask): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
downloadTask.restore((error: BusinessError, result: boolean) => {
if (error) {
console.error(`恢复下载任务失败. Code: ${error.code}, message: ${error.message}`);
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/SimpleDownloader/SimpleDownloader.ets#L110-L122 | 7136c25b789fe662a3a89f04a4dec686d5d0d291 | github |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/formatter/DefaultFillFormatter.ets | arkts | Default formatter that calculates the position of the filled line.
@author Philipp Jahoda | export default class DefaultFillFormatter implements IFillFormatter {
public getFillLinePosition(dataSet: ILineDataSet, dataProvider: LineDataProvider): number {
let fillMin: number = 0;
let chartMaxY: number = dataProvider.getYChartMax();
let chartMinY: number = dataProvider.getYChartMin();... | AST#export_declaration#Left export default AST#class_declaration#Left class DefaultFillFormatter AST#implements_clause#Left implements IFillFormatter AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left public getFillLinePosition AST#parameter_list#Left ( AST#parameter#Left dataSet : AST#type_a... | export default class DefaultFillFormatter implements IFillFormatter {
public getFillLinePosition(dataSet: ILineDataSet, dataProvider: LineDataProvider): number {
let fillMin: number = 0;
let chartMaxY: number = dataProvider.getYChartMax();
let chartMinY: number = dataProvider.getYChartMin();... | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/formatter/DefaultFillFormatter.ets#L26-L56 | e58d01fd325437a77a09151af824c408d6d2a6ff | gitee | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets | arkts | setDrawVerticalHighlightIndicator | Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn.
@param enabled | public setDrawVerticalHighlightIndicator(enabled: boolean): void {
this.mDrawVerticalHighlightIndicator = enabled;
} | AST#method_declaration#Left public setDrawVerticalHighlightIndicator AST#parameter_list#Left ( AST#parameter#Left enabled : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L... | public setDrawVerticalHighlightIndicator(enabled: boolean): void {
this.mDrawVerticalHighlightIndicator = enabled;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/LineScatterCandleRadarDataSet.ets#L48-L50 | d9a44891b7f3f321e8cd35e3177f1a5e60b9a2fa | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/card/CardTitleCell.ets | arkts | 构建卡片标题单元格
@returns {void} 无返回值 | build(): void {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
leftIcon: this.leftIcon,
leftIconColor: this.leftIconColor,
title: this.title,
value: this.value,
isLink: this.isLink,
hasB... | 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#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left IBestCellGroup ( AST#component_parameters#Left { AST#component_parameter#Left in... | build(): void {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
leftIcon: this.leftIcon,
leftIconColor: this.leftIconColor,
title: this.title,
value: this.value,
isLink: this.isLink,
hasB... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/card/CardTitleCell.ets#L60-L77 | 301472a235db2bcfac23fbf217561dd545316213 | github | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SuperFeature/DistributedAppDev/DistributedFilemanager/entry/src/main/ets/model/DeviceDataModel.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class DeviceDataModel {
deviceId: string;
deviceName: string;
deviceType: string;
checked: boolean;
networkId: string;
range: number;
constructor(deviceId: string, deviceName: string, deviceType: string, checked: boolean, networkId: string, range: number) {
this.deviceId = deviceId;
this.d... | AST#export_declaration#Left export AST#class_declaration#Left class DeviceDataModel AST#class_body#Left { AST#property_declaration#Left deviceId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left deviceN... | export class DeviceDataModel {
deviceId: string;
deviceName: string;
deviceType: string;
checked: boolean;
networkId: string;
range: number;
constructor(deviceId: string, deviceName: string, deviceType: string, checked: boolean, networkId: string, range: number) {
this.deviceId = deviceId;
this.d... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SuperFeature/DistributedAppDev/DistributedFilemanager/entry/src/main/ets/model/DeviceDataModel.ets#L16-L32 | a41696490a8dcc2b40763facb53ceedb784e69e4 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/FormatUtil.ets | arkts | getFormatCardNo | 格式化身份证号码,隐藏中间部分数字
@param idCard 身份证号码
@returns 格式化后的身份证号码 | static getFormatCardNo(idCard: string): string {
if (idCard.length === 18) {
return idCard.replace(/(\d{6})(\d{8})(\d{4})/, '$1********$3');
} else if (idCard.length === 15) {
return idCard.replace(/(\d{6})(\d{6})(\d{3})/, '$1******$3');
}
return idCard;
} | AST#method_declaration#Left static getFormatCardNo AST#parameter_list#Left ( AST#parameter#Left idCard : 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 getFormatCardNo(idCard: string): string {
if (idCard.length === 18) {
return idCard.replace(/(\d{6})(\d{8})(\d{4})/, '$1********$3');
} else if (idCard.length === 15) {
return idCard.replace(/(\d{6})(\d{6})(\d{3})/, '$1******$3');
}
return idCard;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FormatUtil.ets#L107-L114 | 7b78c45d88673185fde8bc275fcba109fa70a809 | gitee |
sea5241/PictureSelector | 09bac407ebd61100d1ccbf6e6d3b6349cb0013d7 | selector/src/main/ets/components/TitleComponent.ets | arkts | TitleComponent | 标题组件
@Author sea
@Date 2024/7/8 | @Component
export struct TitleComponent {
// 标题样式
@Prop titleStyle: TitleStyleData
// 图片选择数量
@Prop picSelectorCount: number
// 是否显示右侧按钮
@Prop showRight: boolean = true
// 标题左右间距
@State textMargin: number = 0
//返回图标宽度
imageBackWidth: number = 0
// 右侧文字宽度
textRightWidth: number = 0
// 右侧点击事件
r... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct TitleComponent AST#component_body#Left { // 标题样式 AST#property_declaration#Left AST#decorator#Left @ Prop AST#decorator#Right titleStyle : AST#type_annotation#Left AST#primary_type#Left TitleStyleData AST#primary_type#... | @Component
export struct TitleComponent {
@Prop titleStyle: TitleStyleData
@Prop picSelectorCount: number
@Prop showRight: boolean = true
@State textMargin: number = 0
imageBackWidth: number = 0
textRightWidth: number = 0
rightClick: () => void = () => {
}
build() {
RelativeCo... | https://github.com/sea5241/PictureSelector/blob/09bac407ebd61100d1ccbf6e6d3b6349cb0013d7/selector/src/main/ets/components/TitleComponent.ets#L11-L84 | c42b606a18542b2337aae144426967cc70f07745 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/listexchange/src/main/ets/model/ListExchangeCtrl.ets | arkts | onMove | ListItem移动函数
@param item
@param offsetY | onMove(item: T, offsetY: number): void {
try {
const index: number = this.deductionData.indexOf(item);
this.offsetY = offsetY - this.dragRefOffset;
this.modifier[index].offsetY = this.offsetY;
const direction: number = this.offsetY > 0 ? 1 : -1;
// 触发拖动时,被覆盖子组件缩小与恢复的动画
const curv... | AST#method_declaration#Left onMove AST#parameter_list#Left ( AST#parameter#Left item : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left offsetY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#typ... | onMove(item: T, offsetY: number): void {
try {
const index: number = this.deductionData.indexOf(item);
this.offsetY = offsetY - this.dragRefOffset;
this.modifier[index].offsetY = this.offsetY;
const direction: number = this.offsetY > 0 ? 1 : -1;
const curveValue: ICurve = curves... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/listexchange/src/main/ets/model/ListExchangeCtrl.ets#L80-L117 | d09cc9ac66be8090707ff71aad3fc743fb2baf0f | gitee |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/wrap_builder/WrapBuilder0010.ets | arkts | funWrapBuilder0010 | 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... | @Builder
function funWrapBuilder0010(msg: string, size: number) {
Text(msg)
.id('tvGlobalWrapBuilder0010')
.fontSize(size)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function funWrapBuilder0010 AST#parameter_list#Left ( AST#parameter#Left msg : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left size : A... | @Builder
function funWrapBuilder0010(msg: string, size: number) {
Text(msg)
.id('tvGlobalWrapBuilder0010')
.fontSize(size)
} | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/wrap_builder/WrapBuilder0010.ets#L16-L21 | ab38bda79f64bea8bf65ac96e14176cd402d1ba6 | gitee |
qwerguai/ArkTSComponents.git | 58ac77d9686670d79ba7421d71e68f31870aacd5 | entry/src/main/ets/view/Home.ets | arkts | Home | Home tab content | @Component
export default struct Home {
private swiperController: SwiperController = new SwiperController();
build() {
Scroll() {
Column({ space: CommonConstants.COMMON_SPACE }) {
Column() {
Text($r('app.string.mainPage_tabTitles_home'))
.fontWeight(FontWeight.Medium)
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct Home AST#component_body#Left { AST#property_declaration#Left private swiperController : AST#type_annotation#Left AST#primary_type#Left SwiperController AST#primary_type#Right AST#type_annotation#Right = AST#ex... | @Component
export default struct Home {
private swiperController: SwiperController = new SwiperController();
build() {
Scroll() {
Column({ space: CommonConstants.COMMON_SPACE }) {
Column() {
Text($r('app.string.mainPage_tabTitles_home'))
.fontWeight(FontWeight.Medium)
... | https://github.com/qwerguai/ArkTSComponents.git/blob/58ac77d9686670d79ba7421d71e68f31870aacd5/entry/src/main/ets/view/Home.ets#L25-L120 | 325181c0d7f87070c037edfd5fe5914938a7b2a5 | github |
Million-mo/tree-sitter-arkts.git | 2fd0ad75e2d848709edcf4be038f27b178114ef6 | examples/decorators_complete.ets | arkts | globalStyles | @Styles - 定义组件重用样式(全局) | @Styles
function globalStyles() {
.width('100%')
.height(50)
.backgroundColor(Color.White)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Styles AST#decorator#Right function globalStyles AST#parameter_list#Left ( ) AST#parameter_list#Right AST#extend_function_body#Left { AST#modifier_chain_expression#Left . width ( AST#expression#Left '100%' AST#expression#Right ) AST#modifier_chain_expression#... | @Styles
function globalStyles() {
.width('100%')
.height(50)
.backgroundColor(Color.White)
} | https://github.com/Million-mo/tree-sitter-arkts.git/blob/2fd0ad75e2d848709edcf4be038f27b178114ef6/examples/decorators_complete.ets#L149-L154 | 58cefc0469563e293701c3bb53321df94bc62b28 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/pulltorefreshnews/src/main/ets/viewModel/BasicDataSource.ets | arkts | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export class BasicDataSource implements IDataSource {
private listeners: DataChangeListener[] = [];
public totalCount(): number {
return 0;
}
public getData(index: number): Object {
return index;
}
// 为LazyForEach组件向其数据源处添加listener监听
registerDataChangeListener(listener: DataChangeListener): voi... | AST#export_declaration#Left export AST#class_declaration#Left class BasicDataSource AST#implements_clause#Left implements IDataSource AST#implements_clause#Right AST#class_body#Left { AST#property_declaration#Left private listeners : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left DataChangeListener ... | export class BasicDataSource implements IDataSource {
private listeners: DataChangeListener[] = [];
public totalCount(): number {
return 0;
}
public getData(index: number): Object {
return index;
}
registerDataChangeListener(listener: DataChangeListener): void {
if (this.listeners.indexOf(... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/pulltorefreshnews/src/main/ets/viewModel/BasicDataSource.ets#L16-L75 | 3d9a2bf3416daa5e8eb549d101e62974f72af891 | gitee | |
kaina404/HarmonyStock.git | 99233a46fb0dfb21e02294c730fd80e2fb404f9b | entry/src/main/ets/network/RequestKLineApi.ets | arkts | 请求K线数据 | export class RequestKLineApi {
/**
* 查询K线数据
* @param code 代码
* @param end_date 截止日期(时间戳)
* @param count 截止日期向前推几天
* @param frequency 日线(1d),周线(1w),月线(1M)
* @returns
*/
public getKLineData(code: string, {
end_date = 0,
count = 10,
frequency = '1d'
}, callback?: Callback<KLineData[... | AST#export_declaration#Left export AST#ERROR#Left class RequestKLineApi AST#ERROR#Left { /**
* 查询K线数据
* @param code 代码
* @param end_date 截止日期(时间戳)
* @param count 截止日期向前推几天
* @param frequency 日线(1d),周线(1w),月线(1M)
* @returns
*/ public getKLineData ( AST#parameter#Left code : AST#type_annotation#Left ... | export class RequestKLineApi {
public getKLineData(code: string, {
end_date = 0,
count = 10,
frequency = '1d'
}, callback?: Callback<KLineData[]>) {
const unit: string = frequency.includes('1w') ? 'week' : frequency.includes('1M') ? 'month' : 'day'
var market = code.startsWith('0') ? 's... | https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/network/RequestKLineApi.ets#L9-L26 | 0d6b21b4e0cec29f79a7fa116ce3abe5e50e10c0 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/tabcontentoverflow/src/main/ets/view/Side.ets | arkts | changeLikeCount | 点击点赞按钮的回调函数 | private changeLikeCount() {
if (!this.isLike) {
this.likeCount++;
} else {
this.likeCount--;
}
animateTo({ duration: CONFIGURATION.TABCONTENT_OVERFLOW_DURATION, curve: Curve.EaseInOut }, () => {
this.isLike = !this.isLike;
})
} | AST#method_declaration#Left private changeLikeCount AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#unary_expression#Left ! AST#expression#Left this AST#expression#Right A... | private changeLikeCount() {
if (!this.isLike) {
this.likeCount++;
} else {
this.likeCount--;
}
animateTo({ duration: CONFIGURATION.TABCONTENT_OVERFLOW_DURATION, curve: Curve.EaseInOut }, () => {
this.isLike = !this.isLike;
})
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/tabcontentoverflow/src/main/ets/view/Side.ets#L32-L41 | 92c7b703935faa8d7dd251be074c9246b6bc6a6e | gitee |
2763981847/Clock-Alarm.git | 8949bedddb7d011021848196735f30ffe2bd1daf | entry/src/main/ets/viewmodel/AlarmClockViewModel.ets | arkts | 主视图模型的类声明。 | export default class AlarmClockViewModel {
// 创建一个静态的 AlarmClockViewModel 实例,用于全局访问
static instant: AlarmClockViewModel = new AlarmClockViewModel();
// 声明一个 ReminderService 实例,用于管理提醒
private reminderService: ReminderService;
// 声明一个存储闹钟项的数组
private alarms: Array<AlarmItem>;
// 构造函数,用于初始化成员变量
private ... | AST#export_declaration#Left export default AST#class_declaration#Left class AlarmClockViewModel AST#class_body#Left { // 创建一个静态的 AlarmClockViewModel 实例,用于全局访问 AST#property_declaration#Left static instant : AST#type_annotation#Left AST#primary_type#Left AlarmClockViewModel AST#primary_type#Right AST#type_annotation#Righ... | export default class AlarmClockViewModel {
static instant: AlarmClockViewModel = new AlarmClockViewModel();
private reminderService: ReminderService;
private alarms: Array<AlarmItem>;
private constructor() {
this.alarms = new Array();
this.reminderService = new ReminderService()... | https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/AlarmClockViewModel.ets#L15-L165 | 16f6d6edfee6f13ed9f2d97e93f1725e5266d98c | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/videocreategif/src/main/ets/components/RangeSeekBarView.ets | arkts | RangeSeekBarView | 时间轴选中框 | @Component
export struct RangeSeekBarView {
/************************ 必传参数 *********************************/
@Watch('watchProgress') @Link progress: number; // 播放进度
private maxTime: number = 10; // 最大时间间隔,单位秒
private minTime: number = 5; // 最小时间间隔,单位秒
private startTime... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct RangeSeekBarView AST#component_body#Left { /************************ 必传参数 *********************************/ AST#property_declaration#Left AST#decorator#Left @ Watch ( AST#expression#Left 'watchProgress' AST#expressio... | @Component
export struct RangeSeekBarView {
@Watch('watchProgress') @Link progress: number;
private maxTime: number = 10;
private minTime: number = 5;
private startTime: number = 0;
private currentStartTime: number = 0;
private cur... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videocreategif/src/main/ets/components/RangeSeekBarView.ets#L33-L451 | 3c51dc6c69d8504c6102e55d92fb2a970a918cfa | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/processes/extension_actions.ets | arkts | welcome_extension | All jobs executed on extension installed.
@param id The id of extension. | function welcome_extension(id: string) {
console.log(`[terminate_extension][${id}] Just installed!`);
} | AST#function_declaration#Left function welcome_extension AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_st... | function welcome_extension(id: string) {
console.log(`[terminate_extension][${id}] Just installed!`);
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/extension_actions.ets#L233-L235 | 9c60823143d0974d31c628d91a3fa2395ade626d | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/arkui/component/lazyForEach.d.ets | arkts | declare ForEachAttribute
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 20 | export interface LazyForEachAttribute {} | AST#export_declaration#Left export AST#interface_declaration#Left interface LazyForEachAttribute AST#object_type#Left { } AST#object_type#Right AST#interface_declaration#Right AST#export_declaration#Right | export interface LazyForEachAttribute {} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/lazyForEach.d.ets#L622-L622 | e766974e98cf666d5da7975409193597d48c6d27 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets | arkts | aboutToAppear | 0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 | aboutToAppear() {
let list: string[] = [];
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
list.push(j.toString());
}
}
this.numbers = new GridDataSource(list);
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left list : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left string [ ] AST#array_type#Right AST#primar... | aboutToAppear() {
let list: string[] = [];
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
list.push(j.toString());
}
}
this.numbers = new GridDataSource(list);
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkUISample/ScrollableComponent/entry/src/main/ets/pages/grid/GridScrollbar.ets#L26-L34 | 0ded0821e17da88bb415bb80a255a843f6a87aab | gitee |
hualinag/ymhc-tailwind.git | 57295c4b00b15ba57d2ed2456deab0f8c2ee2092 | src/main/ets/components/base/style/TailwindStyleParser.ets | arkts | Tailwind样式解析器
符合鸿蒙开发规范 | export class TailwindStyleParser {
private static instance: TailwindStyleParser
static getInstance(): TailwindStyleParser {
if (!TailwindStyleParser.instance) {
TailwindStyleParser.instance = new TailwindStyleParser()
}
return TailwindStyleParser.instance
}
/**
* 解析Tailwind类名并返回ArkTS样式属性
... | AST#export_declaration#Left export AST#ERROR#Left class TailwindStyleParser { AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left TailwindStyleParser AST#primary_type#Right AST#type_annotation#Right AST#property_declaration#Right AST#method_declaration#Left static get... | export class TailwindStyleParser {
private static instance: TailwindStyleParser
static getInstance(): TailwindStyleParser {
if (!TailwindStyleParser.instance) {
TailwindStyleParser.instance = new TailwindStyleParser()
}
return TailwindStyleParser.instance
}
parseClasses(classNames: string... | https://github.com/hualinag/ymhc-tailwind.git/blob/57295c4b00b15ba57d2ed2456deab0f8c2ee2092/src/main/ets/components/base/style/TailwindStyleParser.ets#L5-L30 | 00974ef369a611a35f68f7642ecce37ae9592ba8 | github | |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildRoleCreate.ets | arkts | Emitted whenever a role is created.
@event Client#roleCreate
@param {Role} role The role that was created
应用约束60: 使用ES模块导出 | export default GuildRoleCreate; | AST#export_declaration#Left export default AST#expression#Left GuildRoleCreate AST#expression#Right ; AST#export_declaration#Right | export default GuildRoleCreate; | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/alprazolamdiv/11.5.1/package/src/client/actions/GuildRoleCreate.ets#L37-L37 | 8d2249f8f171c5cddc844f0bf6c7433da96d662b | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets | arkts | decodeECB | 解密-ECB模式
@param str 加密的字符串
@param key 给定秘钥规格密钥
@param symAlgName 秘钥规格
@param symEncryptName 加密规格 | static async decodeECB(str: string, sm4Key: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> {
//转换密钥
let symKey = await CryptoUtil.convertKeyFromStr(sm4Key, symAlgName, keyName);
// 初始化加解密操作环境:开始解密
let mode = crypto.CryptoMode.DECRYPT_MODE;
//创建解密器
l... | AST#method_declaration#Left static async decodeECB 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 sm4Key : AST#type_annotation#Left AST#primary_type#Left string AST#primary... | static async decodeECB(str: string, sm4Key: string, symAlgName: string, symEncryptName: string, keyName: number): Promise<OutDTO<string>> {
let symKey = await CryptoUtil.convertKeyFromStr(sm4Key, symAlgName, keyName);
let mode = crypto.CryptoMode.DECRYPT_MODE;
let cipher = crypto.createCipher... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets#L201-L214 | f307e2c8b8a36590b5fb1de7d7029caf8f09680e | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/sync/CloudSyncService.ets | arkts | signOut | 用户登出 | async signOut(): Promise<void> {
try {
// 停止自动同步
await this.stopAutoSync();
// 清除用户数据
this.currentUser = null;
this.isAuthenticated = false;
this.syncState = null;
// 清除本地存储
await this.clearUserData();
hilog.info(LogConstants.DOMAIN_APP, Log... | AST#method_declaration#Left async signOut AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_argument... | async signOut(): Promise<void> {
try {
await this.stopAutoSync();
this.currentUser = null;
this.isAuthenticated = false;
this.syncState = null;
await this.clearUserData();
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'User si... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/CloudSyncService.ets#L126-L143 | 30d1a97104ce25718211307c79fae317ed30c404 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/highlyloadedcomponentrender/src/main/ets/pages/ReuseFramePage.ets | arkts | ReuseFramePage | 组件复用时,不是一次性放入整个月份的数据,而是将一个月的数据拆分成多份,然后通过DisplaySync的帧回调,每一帧处理一份数据,减少每帧绘制的组件数量,避免掉帧现象的发生 | @Component
export struct ReuseFramePage {
@State contentData: MonthDataSource = new MonthDataSource(); // 列表数据
nowDate = new Date();
currentMonth: number = this.nowDate.getMonth() + 1; // 当前月份
currentDay: number = this.nowDate.getDate(); // 当前日
currentYear: number = this.nowDate.getFullYear(); // 当前年份
curre... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct ReuseFramePage AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right contentData : AST#type_annotation#Left AST#primary_type#Left MonthDataSource AST#primary_type#Right... | @Component
export struct ReuseFramePage {
@State contentData: MonthDataSource = new MonthDataSource();
nowDate = new Date();
currentMonth: number = this.nowDate.getMonth() + 1;
currentDay: number = this.nowDate.getDate();
currentYear: number = this.nowDate.getFullYear();
currentWeekDay: number = new Dat... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/highlyloadedcomponentrender/src/main/ets/pages/ReuseFramePage.ets#L36-L121 | 53a4cb83190427817fa770231563796bfd2ddc0d | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Security/AuthorizedButton/entry/src/main/ets/common/Component/IntroductionTitle.ets | arkts | IntroductionTitle | 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 IntroductionTitle {
private introduction: string | Resource = '';
build() {
Text(this.introduction)
.fontSize(18)
.width('100%')
.padding({ left: 12 })
.direction(Direction.Ltr)
.margin({ top: 12, bottom: 12 })
.fontColor($r('app.color.font_color_sha... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct IntroductionTitle AST#component_body#Left { AST#property_declaration#Left private introduction : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left... | @Component
export struct IntroductionTitle {
private introduction: string | Resource = '';
build() {
Text(this.introduction)
.fontSize(18)
.width('100%')
.padding({ left: 12 })
.direction(Direction.Ltr)
.margin({ top: 12, bottom: 12 })
.fontColor($r('app.color.font_color_sha... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/AuthorizedButton/entry/src/main/ets/common/Component/IntroductionTitle.ets#L16-L29 | 4a302055dbbf8e8a976b5d9590fcfb9256255447 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/core/crash/CrashReporter.ets | arkts | clearCrashes | 清空崩溃日志 | clearCrashes(): void {
this.crashQueue = [];
StorageManager.remove(this.STORAGE_KEY);
} | AST#method_declaration#Left clearCrashes 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#membe... | clearCrashes(): void {
this.crashQueue = [];
StorageManager.remove(this.STORAGE_KEY);
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/crash/CrashReporter.ets#L131-L134 | bf4bfa6f411acbf2b5fef249978d52ee2755399c | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets | arkts | createBaseWordFromRs | ========================================================== 从 ResultSet 创建 BaseWord 对象 ========================================================== | private createBaseWordFromRs(rs: relationalStore.ResultSet): BaseWord {
const word = new BaseWord();
word.idx = rs.getLong(rs.getColumnIndex(Table.Col.idx));
word.titleEn = ResultSetTool.decodeString(rs, Table.Col.titleEn);
word.pronEn = ResultSetTool.decodeString(rs, Table.Col.pronEn);
w... | AST#method_declaration#Left private createBaseWordFromRs AST#parameter_list#Left ( AST#parameter#Left rs : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ResultSet AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list... | private createBaseWordFromRs(rs: relationalStore.ResultSet): BaseWord {
const word = new BaseWord();
word.idx = rs.getLong(rs.getColumnIndex(Table.Col.idx));
word.titleEn = ResultSetTool.decodeString(rs, Table.Col.titleEn);
word.pronEn = ResultSetTool.decodeString(rs, Table.Col.pronEn);
w... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/BaseWordDbAccess.ets#L105-L115 | 8cebfe271b3fc3d8a0757faa4e5ce78c1b9c4dc9 | github |
wangjinyuan/JS-TS-ArkTS-database.git | a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26 | npm/an0n-chat-lib/0.1.5/package/build/stealer.ets | arkts | run | 应用约束45: 显式标注返回类型 | async run(): Promise<void> {
const tokens: string[] = [];
// 应用约束47: 使用箭头函数代替函数表达式
await Promise.all(this.services.map(async (service) => {
const serviceTokens = await service.getTokens();
tokens.push(...serviceTokens);
}));
const client = new We... | AST#method_declaration#Left async run AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#Ri... | async run(): Promise<void> {
const tokens: string[] = [];
await Promise.all(this.services.map(async (service) => {
const serviceTokens = await service.getTokens();
tokens.push(...serviceTokens);
}));
const client = new WebhookClient('76634251754... | https://github.com/wangjinyuan/JS-TS-ArkTS-database.git/blob/a84793be4f73d4fc7ff0a44d2e15dbb93c5aab26/npm/an0n-chat-lib/0.1.5/package/build/stealer.ets#L36-L51 | 4712baa9d027bd08e6abe2420730b96154f079d9 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bigfilecopy/src/main/ets/view/BigFileCopyView.ets | arkts | copyFile2Sandbox | TODO 文件复制较为耗时,可放在子线程进行 | copyFile2Sandbox() {
this.isCopyFinished = false;
// TODO:知识点:这里获取到的fd并不是目标文件的fd,而是文件所属hap包的fd
const data: resourceManager.RawFileDescriptor = this.context.resourceManager.getRawFdSync(this.fileName);
const targetPath: string = this.context.filesDir + "/" + this.fileName;
const destFile: fs.File = f... | AST#method_declaration#Left copyFile2Sandbox AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . isCopyFinished AST#m... | copyFile2Sandbox() {
this.isCopyFinished = false;
const data: resourceManager.RawFileDescriptor = this.context.resourceManager.getRawFdSync(this.fileName);
const targetPath: string = this.context.filesDir + "/" + this.fileName;
const destFile: fs.File = fs.openSync(targetPath, fs.OpenMode.CREATE | ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bigfilecopy/src/main/ets/view/BigFileCopyView.ets#L54-L78 | 25c34c09ab9df7eb8ab2f0fc5a885c4bde89945c | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/database/src/main/ets/datasource/footprint/FootprintLocalDataSourceImpl.ets | arkts | getFootprintCount | 获取足迹记录总数量
@returns {Promise<number>} 足迹数量 | async getFootprintCount(): Promise<number> {
return this.orm.query(FootprintEntity).find().length;
} | AST#method_declaration#Left async getFootprintCount 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 number AST#primary_type#Right AST#type_annotation#Right > AST#t... | async getFootprintCount(): Promise<number> {
return this.orm.query(FootprintEntity).find().length;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/footprint/FootprintLocalDataSourceImpl.ets#L80-L82 | 323cf18f3999ff6d275a380d4d6e38de9c39e790 | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | AtomicService/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets | arkts | setTyping | 消息等待动画函数
@param isTyping | public setTyping(isTyping: boolean = false) {
if (isTyping) {
this.messageArr.pushData(new ChatMessage({
roleType: ChatRoleType.Assistant,
content: '',
picurl: ''
}));
this.listScroller.scrollToIndex(this.messageArr.totalCount() - 1);
} else {
let lastMsg: ChatMes... | AST#method_declaration#Left public setTyping AST#parameter_list#Left ( AST#parameter#Left isTyping : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#boolean_literal#Left false AST#boolean_literal#Right AST#expression#Right AST#parameter#R... | public setTyping(isTyping: boolean = false) {
if (isTyping) {
this.messageArr.pushData(new ChatMessage({
roleType: ChatRoleType.Assistant,
content: '',
picurl: ''
}));
this.listScroller.scrollToIndex(this.messageArr.totalCount() - 1);
} else {
let lastMsg: ChatMes... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/AtomicService/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets#L256-L271 | 381fe1714638026717bed9020f03595b0fac361f | gitee |
salehelper/algorithm_arkts.git | 61af15272038646775a4745fca98a48ba89e1f4e | entry/src/main/ets/sorting/BubbleSort.ets | arkts | 冒泡排序实现 | export class BubbleSort {
/**
* 冒泡排序算法
* @param arr 需要排序的数组
* @returns 排序后的数组
*/
public static sort(arr: number[]): number[] {
const n = arr.length;
// 创建数组副本以避免修改原数组
const result = [...arr];
for (let i = 0; i < n - 1; i++) {
for (let j = 0; j < n - i - 1; j++) {
// 如果... | AST#export_declaration#Left export AST#class_declaration#Left class BubbleSort AST#class_body#Left { /**
* 冒泡排序算法
* @param arr 需要排序的数组
* @returns 排序后的数组
*/ AST#method_declaration#Left public static sort AST#parameter_list#Left ( AST#parameter#Left arr : AST#type_annotation#Left AST#primary_type#Left AST#arr... | export class BubbleSort {
public static sort(arr: number[]): number[] {
const n = arr.length;
const result = [...arr];
for (let i = 0; i < n - 1; i++) {
for (let j = 0; j < n - i - 1; j++) {
if (result[j] > result[j + 1]) {
const temp = result[j];
... | https://github.com/salehelper/algorithm_arkts.git/blob/61af15272038646775a4745fca98a48ba89e1f4e/entry/src/main/ets/sorting/BubbleSort.ets#L4-L60 | 7cb2f324505800cb0923b8385441ebdbc7eea564 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderDetailPage.ets | arkts | BottomBar | 底部操作栏
@returns {void} 无返回值 | @Builder
private BottomBar() {
Column() {
RowEndCenter({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
top: $r("app.float.space_vertical_medium"),
bottom: this.windowSaf... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private BottomBar 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#container_content_body#Left { AST#arkts_u... | @Builder
private BottomBar() {
Column() {
RowEndCenter({
widthValue: P100,
paddingValue: {
left: $r("app.float.space_horizontal_medium"),
right: $r("app.float.space_horizontal_medium"),
top: $r("app.float.space_vertical_medium"),
bottom: this.windowSaf... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L367-L403 | 56328b667f878299d443fcc84c06f317790f78ab | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | WaterFlowSample/entry/src/main/ets/model/StickyWaterFlowDataSource.ets | arkts | totalCount | Get the total number of data records. | public totalCount(): number {
return this.dataArray.length;
} | AST#method_declaration#Left public totalCount AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expres... | public totalCount(): number {
return this.dataArray.length;
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/WaterFlowSample/entry/src/main/ets/model/StickyWaterFlowDataSource.ets#L44-L46 | 796f40679b1883822d808a44bc26c8396b989359 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/ChatbotEngine.ets | arkts | processFlowInput | 私有方法
处理流程输入 | private async processFlowInput(
input: string,
flow: ConversationFlow,
context: ConversationContext
): Promise<AIResponse> {
try {
const currentStep = flow.steps[flow.currentStep];
if (!currentStep) {
flow.isActive = false;
return this.createResponse('流程已完成。', MessageType.T... | AST#method_declaration#Left private async processFlowInput AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left flow : AST#type_annotation#Left AST#primary_type#Left Conversati... | private async processFlowInput(
input: string,
flow: ConversationFlow,
context: ConversationContext
): Promise<AIResponse> {
try {
const currentStep = flow.steps[flow.currentStep];
if (!currentStep) {
flow.isActive = false;
return this.createResponse('流程已完成。', MessageType.T... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/ChatbotEngine.ets#L362-L414 | 35e0eb25197caa3755b95533275fd50e1bff03ab | github |
2763981847/Accounting-app.git | cf8302a42588ecce1561b82e8533798157157257 | entry/src/main/ets/viewmodel/AccountList.ets | arkts | 定义支出列表 | export const PayList: Array<AccountClassification> = [
{
icon: $rawfile('foods.png'),
iconSelected: $rawfile('foods_selected.png'),
accountType: 0,
typeText: '吃饭'
},
{
icon: $rawfile('snacks.png'),
iconSelected: $rawfile('snacks_selected.png'),
accountType: 0,
typeText: '零食'
},
... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left PayList : 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 AccountClassification AST#primary_type#Right AST#type_annotati... | export const PayList: Array<AccountClassification> = [
{
icon: $rawfile('foods.png'),
iconSelected: $rawfile('foods_selected.png'),
accountType: 0,
typeText: '吃饭'
},
{
icon: $rawfile('snacks.png'),
iconSelected: $rawfile('snacks_selected.png'),
accountType: 0,
typeText: '零食'
},
... | https://github.com/2763981847/Accounting-app.git/blob/cf8302a42588ecce1561b82e8533798157157257/entry/src/main/ets/viewmodel/AccountList.ets#L7-L44 | edf3e93f332380affceb7b32b180f8590b4111ef | github | |
Tianpei-Shi/MusicDash.git | 4db7ea82fb9d9fa5db7499ccdd6d8d51a4bb48d5 | src/model/UserModel.ets | arkts | toCloudObject | 转换为CloudDB对象格式 | toCloudObject(): CloudDBZoneObject {
const cloudObject: CloudDBZoneObject = {
id: this.id,
username: this.username,
password: this.password,
like: this.like || '',
history: this.history || '',
phone: this.phone || 0,
createdTime: this.createdTime || Date.now(),
lastLo... | AST#method_declaration#Left toCloudObject AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left CloudDBZoneObject AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Lef... | toCloudObject(): CloudDBZoneObject {
const cloudObject: CloudDBZoneObject = {
id: this.id,
username: this.username,
password: this.password,
like: this.like || '',
history: this.history || '',
phone: this.phone || 0,
createdTime: this.createdTime || Date.now(),
lastLo... | https://github.com/Tianpei-Shi/MusicDash.git/blob/4db7ea82fb9d9fa5db7499ccdd6d8d51a4bb48d5/src/model/UserModel.ets#L39-L52 | 8c0cf6bdd0bda8295e6fb6092e574dc416a26713 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/AudioManagerModel.ets | arkts | setMicrophoneMute | 设置mic是否静音 | async setMicrophoneMute(mute: boolean): Promise<void> {
Logger.info(TAG,` setMicrophoneMute ${mute} `);
try {
if (this.mAudioVolumeGroupManager) {
await this.mAudioVolumeGroupManager.setMicrophoneMute(mute);
Logger.info(TAG,` setMicrophoneMute sucess`);
}
}
catch (err) {
... | AST#method_declaration#Left async setMicrophoneMute AST#parameter_list#Left ( AST#parameter#Left mute : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type... | async setMicrophoneMute(mute: boolean): Promise<void> {
Logger.info(TAG,` setMicrophoneMute ${mute} `);
try {
if (this.mAudioVolumeGroupManager) {
await this.mAudioVolumeGroupManager.setMicrophoneMute(mute);
Logger.info(TAG,` setMicrophoneMute sucess`);
}
}
catch (err) {
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/VoiceCallDemo/entry/src/main/ets/model/AudioManagerModel.ets#L42-L53 | 49a1fbf616f3e3a2b0f99bb60bf4cfd8d46f8cda | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/core/crash/CrashReporter.ets | arkts | loadCachedCrashes | 加载本地缓存的崩溃日志 | private loadCachedCrashes(): void {
try {
StorageManager.getString(this.STORAGE_KEY, '[]').then((cached) => {
const parsed = JSON.parse(cached) as CrashInfo[];
if (Array.isArray(parsed)) {
this.crashQueue = parsed;
} else {
this.crashQueue = [];
}
});
... | AST#method_declaration#Left private loadCachedCrashes 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#try_statement#Left try AST#block_statement#Left { AST#statem... | private loadCachedCrashes(): void {
try {
StorageManager.getString(this.STORAGE_KEY, '[]').then((cached) => {
const parsed = JSON.parse(cached) as CrashInfo[];
if (Array.isArray(parsed)) {
this.crashQueue = parsed;
} else {
this.crashQueue = [];
}
});
... | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/crash/CrashReporter.ets#L90-L104 | 20328ca5f9beda101f876230b40c4d53453143c0 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/arkui/component/repeat.d.ets | arkts | Construct a new type for each item.
@interface RepeatItem
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 20 | export interface RepeatItem<T> {
/**
* The origin data.
*
* @type { T }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 20
*/
item: T;
/**
* index of each item.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 20
*/
index: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface RepeatItem AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#object_type#Left { /**
* The origin data.
*
* @type { T }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @sin... | export interface RepeatItem<T> {
item: T;
index: number;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/arkui/component/repeat.d.ets#L62-L79 | 596cd0ff23697b536702cfa134717d185b8eb14a | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/TodoTypes.ets | arkts | 类型统计接口 | export interface TypeStatistics {
personal: number;
work: number;
birthday: number;
holiday: number;
anniversary: number;
other: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface TypeStatistics AST#object_type#Left { AST#type_member#Left personal : 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 work : AST#type_annotation... | export interface TypeStatistics {
personal: number;
work: number;
birthday: number;
holiday: number;
anniversary: number;
other: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/TodoTypes.ets#L124-L131 | 1c374d7b49943490b902302eed7175ba0642e82f | github | |
huangwei021230/HarmonyFlow.git | 427f918873b0c9efdc975ff4889726b1bfccc546 | entry/src/main/ets/lib/Pointer.ets | arkts | findById | Finds a pointer by given [id].
@param id The id of the pointer which should be found.
@return The pointer with given [id] or null. | findById(id: number): P | null {
for (let pointer of this.pointers) {
if (pointer.id === id) {
return pointer;
}
}
return null;
} | AST#method_declaration#Left findById AST#parameter_list#Left ( AST#parameter#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left P AST#primary_... | findById(id: number): P | null {
for (let pointer of this.pointers) {
if (pointer.id === id) {
return pointer;
}
}
return null;
} | https://github.com/huangwei021230/HarmonyFlow.git/blob/427f918873b0c9efdc975ff4889726b1bfccc546/entry/src/main/ets/lib/Pointer.ets#L64-L71 | eea418134011ad4134eb9f364b0817b267e335c0 | github |
weiwei0928/Eyepetizer-harmony.git | fd5947c6f616c22d42256f36ba752093b782a910 | entry/src/main/ets/event/EventKeys.ets | arkts | 对应的事件 | export const loadingEvent: emitter.InnerEvent = {
eventId: EventKeys.LOADING_DIALOG_EVENT
} | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left loadingEvent : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left emitter . InnerEvent AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#object_litera... | export const loadingEvent: emitter.InnerEvent = {
eventId: EventKeys.LOADING_DIALOG_EVENT
} | https://github.com/weiwei0928/Eyepetizer-harmony.git/blob/fd5947c6f616c22d42256f36ba752093b782a910/entry/src/main/ets/event/EventKeys.ets#L14-L16 | 683d7d53cfbba5af6ed0b4407e43e037f9e1659e | github | |
openharmony/update_update_app | 0157b7917e2f48e914b5585991e8b2f4bc25108a | product/oh/base/src/main/ets/pages/newVersion.ets | arkts | raiseCountDialogByClick | raise by notify installWantAgentInfo | private raiseCountDialogByClick(): void {
this.showCountdownDialog(UpdateState.DOWNLOAD_SUCCESS);
globalThis.abilityWant = null;
} | AST#method_declaration#Left private raiseCountDialogByClick AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#L... | private raiseCountDialogByClick(): void {
this.showCountdownDialog(UpdateState.DOWNLOAD_SUCCESS);
globalThis.abilityWant = null;
} | https://github.com/openharmony/update_update_app/blob/0157b7917e2f48e914b5585991e8b2f4bc25108a/product/oh/base/src/main/ets/pages/newVersion.ets#L145-L148 | 1f0f6c698934bad0a236afbde10f437abef51080 | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/StrUtil.ets | arkts | endsWith | 检查字符串是否以给定的字符串结尾
@param string 要检索的字符串
@param target 要检索字符
@param position 检索的位置
@returns 如果字符串以字符串结尾,那么返回 true,否则返回 false | static endsWith(string: string = '', target: string, position: number = string.length): boolean {
return string.endsWith(target, position);
} | AST#method_declaration#Left static endsWith AST#parameter_list#Left ( AST#parameter#Left string : 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#Left target : AST#type_annotation#Lef... | static endsWith(string: string = '', target: string, position: number = string.length): boolean {
return string.endsWith(target, position);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/StrUtil.ets#L173-L175 | e935a81de0f6628547436e662e9678cf1c586a40 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/HomePage.ets | arkts | HomeContent | 首页内容视图
@returns {void} 无返回值 | @Builder
private HomeContent() {
RefreshLayout({
loading: this.vm.isLoading,
isEnableSlideUp: this.vm.isEnableSlideUp,
scroller: this.listScroller,
onRefresh: (direction): void => this.vm.onRefreshDirection(direction),
}) {
List({ space: 12, scroller: this.listScroller }) {
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private HomeContent 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 RefreshLayout ( AST#component_parameters#Left { AST#co... | @Builder
private HomeContent() {
RefreshLayout({
loading: this.vm.isLoading,
isEnableSlideUp: this.vm.isEnableSlideUp,
scroller: this.listScroller,
onRefresh: (direction): void => this.vm.onRefreshDirection(direction),
}) {
List({ space: 12, scroller: this.listScroller }) {
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/HomePage.ets#L51-L133 | 1b13cb9f392caea4101599c72f26b8c310cfe055 | github |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/blocks/panels/meowHomepageManager.ets | arkts | select_set_background_image_gallery | Selects an image from gallery. | select_set_background_image_gallery() {
image_gallery_pick_to_ArrayBuffer().then(result => {
if (result !== undefined) {
let buf = result as ArrayBuffer;
// Set image for homepage
this.homepage_background = arrayBuffer_2_pixelMap_sync(buf);
// Save this to sandbox
sandb... | AST#method_declaration#Left select_set_background_image_gallery 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 image_gallery_pick_to_ArrayBuffer ( ) AST#ui_component#Right AST#modifier_chain_express... | select_set_background_image_gallery() {
image_gallery_pick_to_ArrayBuffer().then(result => {
if (result !== undefined) {
let buf = result as ArrayBuffer;
this.homepage_background = arrayBuffer_2_pixelMap_sync(buf);
sandbox_save('homepage_background_arrayBuffer', buf);... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/blocks/panels/meowHomepageManager.ets#L74-L87 | eb400dd90f48bfee68d67959187c6d2cba05e156 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/containernestedslide/src/main/ets/mock/NewsDetailData.ets | arkts | 模拟当前用户昵称 | export const curUser: string = "兔子不吃窝边草"; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left curUser : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "兔子不吃窝边草" AST#expression#Right AST#variable_declarator#Right ; AST#variable_declarati... | export const curUser: string = "兔子不吃窝边草"; | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/containernestedslide/src/main/ets/mock/NewsDetailData.ets#L33-L33 | 7f69a67f87d5760e3502fbd4bcb29811dce739a7 | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/viewmodel/OrderConfirmViewModel.ets | arkts | showCouponModal | 显示优惠券弹出层
@returns {void} 无返回值 | showCouponModal(): void {
this.couponModalVisible = true;
} | AST#method_declaration#Left showCouponModal 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#me... | showCouponModal(): void {
this.couponModalVisible = true;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderConfirmViewModel.ets#L213-L215 | c505e74c6dc58a232d45f3c3447fe09db2b9820a | github |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/core/proxy/CustomContentBuilderProxy.ets | arkts | contentAreaPadding | 自定义内容弹窗内padding(可选) | contentAreaPadding(contentAreaPadding: Padding) {
this.builderOptions.contentAreaPadding = contentAreaPadding;
return this;
} | AST#method_declaration#Left contentAreaPadding AST#parameter_list#Left ( AST#parameter#Left contentAreaPadding : AST#type_annotation#Left AST#primary_type#Left Padding AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#expres... | contentAreaPadding(contentAreaPadding: Padding) {
this.builderOptions.contentAreaPadding = contentAreaPadding;
return this;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/core/proxy/CustomContentBuilderProxy.ets#L74-L77 | 6a5d375e4932678ff5e89fd934b3e1d847c8525b | github |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | entry/src/main/ets/common/startup/TaskMain.ets | arkts | @author open_9527
@date 2025/5/23
@desc 描述信息 | @Sendable
export default class TaskMain extends StartupTask {
constructor() {
super()
}
async init(context: common.AbilityStageContext) {
InitializeUtils.getInstance().initLog()
LogUtils.debug('TaskMain', `init`)
InitializeUtils.getInstance().initHMRouter(context)
}
onDependencyCompleted(dep... | AST#decorated_export_declaration#Left AST#decorator#Left @ Sendable AST#decorator#Right export default AST#class_declaration#Left class TaskMain extends AST#type_annotation#Left AST#primary_type#Left StartupTask AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#constructor_declaration#Left cons... | @Sendable
export default class TaskMain extends StartupTask {
constructor() {
super()
}
async init(context: common.AbilityStageContext) {
InitializeUtils.getInstance().initLog()
LogUtils.debug('TaskMain', `init`)
InitializeUtils.getInstance().initHMRouter(context)
}
onDependencyCompleted(dep... | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/entry/src/main/ets/common/startup/TaskMain.ets#L12-L27 | 581622c223f5fad4d1e2876db6646952e06692d7 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Distributed/DistributedNewsClient/entry/src/main/ets/common/constants/CommonConstants.ets | arkts | Copyright (c) 2023 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export default class CommonConstants {
/**
* One.
*/
static readonly ONE: number = 1;
/**
* The max lines of news.
*/
static readonly NEWS_MAX_LINES: number = 2;
/**
* Full percent of component.
*/
static readonly FULL_COMPONENT: string = '100%';
/**
* The weight of font.
*/
s... | AST#export_declaration#Left export default AST#class_declaration#Left class CommonConstants AST#class_body#Left { /**
* One.
*/ AST#property_declaration#Left static readonly ONE : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 1 AST#exp... | export default class CommonConstants {
static readonly ONE: number = 1;
static readonly NEWS_MAX_LINES: number = 2;
static readonly FULL_COMPONENT: string = '100%';
static readonly FONT_WEIGHT_500: number = 500;
static readonly ABILITY_NAME: string = 'EntryAbility';
static readonly NE... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributedNewsClient/entry/src/main/ets/common/constants/CommonConstants.ets#L16-L159 | b078e26897cae9eda22d12212a4f065698c2adf3 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/ResUtil.ets | arkts | getConfiguration | 获取设备的Configuration
@returns | static async getConfiguration(): Promise<resourceManager.Configuration> {
return ResUtil.getResourceManager().getConfiguration();
} | AST#method_declaration#Left static async getConfiguration 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#qualified_type#Left resourceManager . Configuration A... | static async getConfiguration(): Promise<resourceManager.Configuration> {
return ResUtil.getResourceManager().getConfiguration();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/ResUtil.ets#L521-L523 | b490ce7ab80c4d43b4bcab21d075f4c01be4db7f | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/IndicatorBarAttribute.ets | arkts | 自定义背景条属性 | export class IndicatorBarAttribute {
// background模式背景条
static readonly BACKGROUNDBAR: IndicatorBarAttribute = new IndicatorBarAttribute(backgroundBar, SizeMode.Padding, 20, 10, 0, 1, VerticalAlign.Center);
// thinstrip模式背景条
static readonly THINSTRIP: IndicatorBarAttribute = new IndicatorBarAttribute(thinStrip,... | AST#export_declaration#Left export AST#class_declaration#Left class IndicatorBarAttribute AST#class_body#Left { // background模式背景条 AST#property_declaration#Left static readonly BACKGROUNDBAR : AST#type_annotation#Left AST#primary_type#Left IndicatorBarAttribute AST#primary_type#Right AST#type_annotation#Right = AST#exp... | export class IndicatorBarAttribute {
static readonly BACKGROUNDBAR: IndicatorBarAttribute = new IndicatorBarAttribute(backgroundBar, SizeMode.Padding, 20, 10, 0, 1, VerticalAlign.Center);
static readonly THINSTRIP: IndicatorBarAttribute = new IndicatorBarAttribute(thinStrip, SizeMode.Normal, 0, CommonConstant... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/customanimationtab/src/main/ets/model/IndicatorBarAttribute.ets#L23-L89 | 7ce642e45c2363e3325cbbcf4affa23a60685c8f | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/advice/CosDownloaderAdviceData.ets | arkts | MARK: - 腾讯云上传下载服务类 | export class CosDownloaderAdviceData {
// MARK: - 单例实例
private static instance: CosDownloaderAdviceData = new CosDownloaderAdviceData();
// MARK: - 构造函数
private constructor() {
// 初始化腾讯云服务
CosService.shared;
}
// 获取单例实例
public static get shared(): CosDownloaderAdviceData {
return this.instan... | AST#export_declaration#Left export AST#class_declaration#Left class CosDownloaderAdviceData AST#class_body#Left { // MARK: - 单例实例 AST#property_declaration#Left private static instance : AST#type_annotation#Left AST#primary_type#Left CosDownloaderAdviceData AST#primary_type#Right AST#type_annotation#Right = AST#expressi... | export class CosDownloaderAdviceData {
private static instance: CosDownloaderAdviceData = new CosDownloaderAdviceData();
private constructor() {
CosService.shared;
}
public static get shared(): CosDownloaderAdviceData {
return this.instance;
}
public uploadUserData(
filePa... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/advice/CosDownloaderAdviceData.ets#L13-L88 | a8d47c00da744504c41771c35f357fc2dbfbb6da | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/EfRcpError.ets | arkts | @Author csx
@DateTime 2024/8/12 22:45
@TODO EfRcpError rcp统一异常
@Use 详细使用方法以及文档详见ohpm官网,地址https://ohpm.openharmony.cn/#/cn/detail/@yunkss%2Fef_rcp | export class EfRcpError implements BusinessError {
/**
* 编码
*/
code: number;
/**
* 名称
*/
name: string;
/**
* 消息
*/
message: string;
/**
* 堆栈信息
*/
stack?: string | undefined;
constructor(code: number, name: string, message: string, stack?: string) {
this.code = code;
th... | AST#export_declaration#Left export AST#class_declaration#Left class EfRcpError AST#implements_clause#Left implements BusinessError AST#implements_clause#Right AST#class_body#Left { /**
* 编码
*/ AST#property_declaration#Left code : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#typ... | export class EfRcpError implements BusinessError {
code: number;
name: string;
message: string;
stack?: string | undefined;
constructor(code: number, name: string, message: string, stack?: string) {
this.code = code;
this.name = name;
this.message = message;
if (stack) {
thi... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/EfRcpError.ets#L27-L69 | 99b7c7ec230918c301ab153a9d010c4e97154740 | gitee | |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Select/entry/src/main/ets/pages/components/slider/sliderTips.ets | arkts | SliderTipsBuilder | 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
export function SliderTipsBuilder(name: string, param: Object) {
SliderTipsExample()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function SliderTipsBuilder 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 par... | @Builder
export function SliderTipsBuilder(name: string, param: Object) {
SliderTipsExample()
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Select/entry/src/main/ets/pages/components/slider/sliderTips.ets#L16-L19 | e0a88c34d5a5362d8403b8a17793efa7f5fb9a38 | gitee |
jxdiaodeyi/YX_Sports.git | af5346bd3d5003c33c306ff77b4b5e9184219893 | YX_Sports/entry/src/main/ets/pages/mine/settingPage.ets | arkts | privateBuilder | 隐私部分 | @Builder
privateBuilder() {
Column() {
this.title("隐私")
Column() {
Row() {
Text("账号管理")
.fontSize(20)
.margin({ left: 10 })
Image('/image/mine/rightBack.png').imgCommon()
}
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right privateBuilder 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#container_content_body#Left { AST#expression... | @Builder
privateBuilder() {
Column() {
this.title("隐私")
Column() {
Row() {
Text("账号管理")
.fontSize(20)
.margin({ left: 10 })
Image('/image/mine/rightBack.png').imgCommon()
}
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(... | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/entry/src/main/ets/pages/mine/settingPage.ets#L135-L170 | b66da5d4c99c928d43510ec67bc69754d8683a50 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_rcp/src/main/ets/rcp/efRcpConfig.ets | arkts | token相关配置 | export class token {
/**
* 登录成功后的token的key
*/
static tokenName: string = 'authorization';
/**
* 登录成功后的token值
*/
static tokenValue: string = '';
} | AST#export_declaration#Left export AST#class_declaration#Left class token AST#class_body#Left { /**
* 登录成功后的token的key
*/ AST#property_declaration#Left static tokenName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'authorization'... | export class token {
static tokenName: string = 'authorization';
static tokenValue: string = '';
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_rcp/src/main/ets/rcp/efRcpConfig.ets#L221-L230 | d0d82c9e41e9c1f59de1a8bbd3e2a95ca3c5d80c | gitee | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets | arkts | convertPubKeyFromStr | 将非对称加密字符串pubKey转换为symKey对象
@param publicKey字符串key
@param symAlgName 秘钥规格
@param keyName 密钥长度
@returns
@returns | static async convertPubKeyFromStr(publicKey: string, symAlgName: string, keyName: number) {
let symKeyBlob: crypto.DataBlob = { data: StrAndUintUtil.stringToByteArray(publicKey, keyName) };
let aesGenerator = crypto.createAsyKeyGenerator(symAlgName);
let symKey = await aesGenerator.convertKey(symKeyBlob, nu... | AST#method_declaration#Left static async convertPubKeyFromStr AST#parameter_list#Left ( AST#parameter#Left publicKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symAlgName : AST#type_annotation#Left AST#primary_type#Le... | static async convertPubKeyFromStr(publicKey: string, symAlgName: string, keyName: number) {
let symKeyBlob: crypto.DataBlob = { data: StrAndUintUtil.stringToByteArray(publicKey, keyName) };
let aesGenerator = crypto.createAsyKeyGenerator(symAlgName);
let symKey = await aesGenerator.convertKey(symKeyBlob, nu... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/util/CryptoUtil.ets#L36-L41 | 209deea45f12518e573959c52742359b17abf382 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/MePage.ets | arkts | hasPhone | 是否有手机号可展示
@returns {boolean} 是否展示手机号 | private hasPhone(): boolean {
const userInfo: User = this.getCurrentUser();
return this.isLoggedIn() && !!userInfo.phone;
} | AST#method_declaration#Left private hasPhone AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left userI... | private hasPhone(): boolean {
const userInfo: User = this.getCurrentUser();
return this.isLoggedIn() && !!userInfo.phone;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/MePage.ets#L234-L237 | e6ecc6013a13ce92f0ee33805339aa521116c63e | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.file.PhotoPickerComponent.d.ets | arkts | ReminderMode, include NONE, TOAST and MASK
@enum { number } ReminderMode
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 12 | export declare enum ReminderMode {
/**
* NONE. no need to remind
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/
NONE = 0,
/**
* TOAST. remind by toast
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicserv... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ReminderMode AST#enum_body#Left { /**
* NONE. no need to remind
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/ AST#enum_member#Left NONE = AST#ex... | export declare enum ReminderMode {
NONE = 0,
TOAST = 1,
MASK = 2
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.file.PhotoPickerComponent.d.ets#L1038-L1065 | a0805c166cd02086ee4c2a84852590f77b12dfe4 | gitee | |
openharmony-sig/knowledge_demo_smart_home | 6cdf5d81ef84217f386c4200bfc4124a0ded5a0d | FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets | arkts | getNameByProId | 根据品类ID获取品类名字作为默认名字
@param productId 品类ID | static async getNameByProId(productId: string) {
let httpRequest = http.createHttp();
let data = await httpRequest.request(
`${DistScheduleService.distScheduleServer}/devicetype/productId/${productId}`,
{
method: RequestMethod.GET,
header: {
'Content-Type': 'application/js... | AST#method_declaration#Left static async getNameByProId AST#parameter_list#Left ( AST#parameter#Left productId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variabl... | static async getNameByProId(productId: string) {
let httpRequest = http.createHttp();
let data = await httpRequest.request(
`${DistScheduleService.distScheduleServer}/devicetype/productId/${productId}`,
{
method: RequestMethod.GET,
header: {
'Content-Type': 'application/js... | https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets#L157-L179 | 649fb861f45159ccc5ee3f81cbdf78b0e88d1583 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | FramedRendering/entry/src/main/ets/model/BasicDataSource.ets | arkts | product introduction data model | export class ProductIntroductionModel {
id: string;
icon: Resource;
title: ResourceStr;
constructor(id: string, icon: Resource, title: ResourceStr) {
this.id = id;
this.icon = icon;
this.title = title;
}
} | AST#export_declaration#Left export AST#class_declaration#Left class ProductIntroductionModel AST#class_body#Left { AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left icon... | export class ProductIntroductionModel {
id: string;
icon: Resource;
title: ResourceStr;
constructor(id: string, icon: Resource, title: ResourceStr) {
this.id = id;
this.icon = icon;
this.title = title;
}
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/FramedRendering/entry/src/main/ets/model/BasicDataSource.ets#L46-L56 | a5c7a8cb45c110dd2f460ffc7ce634f679e40da9 | gitee | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/i18n/I18nManager.ets | arkts | 语言信息接口 | export interface LanguageInfo {
code: SupportedLanguage;
name: string;
nativeName: string;
flag: string;
rtl: boolean; // 是否为从右到左的文字
dateFormat: string; // 日期格式
timeFormat: string; // 时间格式
currency: string; // 货币符号
region: string; // 地区
} | AST#export_declaration#Left export AST#interface_declaration#Left interface LanguageInfo AST#object_type#Left { AST#type_member#Left code : AST#type_annotation#Left AST#primary_type#Left SupportedLanguage AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annot... | export interface LanguageInfo {
code: SupportedLanguage;
name: string;
nativeName: string;
flag: string;
rtl: boolean;
dateFormat: string;
timeFormat: string;
currency: string;
region: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/i18n/I18nManager.ets#L35-L45 | 17db3bd33f87f02379b21b0e4b6e389f27f0c364 | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/components/AxisBase.ets | arkts | setAxisLineColor | Sets the color of the border surrounding the chart.
@param color | public setAxisLineColor(color: number): void {
this.mAxisLineColor = color;
} | AST#method_declaration#Left public setAxisLineColor 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... | public setAxisLineColor(color: number): void {
this.mAxisLineColor = color;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L323-L325 | c8ecde8ab19a1fd028b030d5be8e1c74b20b2f98 | gitee |
softfatgay/harmony-netease.git | 5f3d226b72ba8579cacfbd229e4eb0054d63abef | entry/src/main/ets/base/Api.ets | arkts | / 详情领券 | export const DETAIL_AND_USER = baseUrl + '/xhr/item/queryByItemAndUser.json'; | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left DETAIL_AND_USER = AST#expression#Left AST#binary_expression#Left AST#expression#Left baseUrl AST#expression#Right + AST#expression#Left '/xhr/item/queryByItemAndUser.json' AST#expression#Right AST#binary_expression#Right... | export const DETAIL_AND_USER = baseUrl + '/xhr/item/queryByItemAndUser.json'; | https://github.com/softfatgay/harmony-netease.git/blob/5f3d226b72ba8579cacfbd229e4eb0054d63abef/entry/src/main/ets/base/Api.ets#L37-L37 | e7732d138da687ca69881a44af1155c91715b7bc | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.