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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/constants/CommonConstants.ets | arkts | 一般属性信息 | export class CommonConstants {
static readonly RDB_NAME = { dbName: 'recordingInfo.db' } as CommonConstantsInfo; // db name
/** 每日记账信息统计表 */
static readonly DAY_INFO = {
tableName: 'dayInfo',
columns: ['date', 'expense', 'income']
} as CommonConstantsInfo
static readonly ACCOUNTING_INFO = {
tabl... | AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { AST#property_declaration#Left static readonly RDB_NAME = AST#expression#Left AST#as_expression#Left AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left dbName AST#prope... | export class CommonConstants {
static readonly RDB_NAME = { dbName: 'recordingInfo.db' } as CommonConstantsInfo;
static readonly DAY_INFO = {
tableName: 'dayInfo',
columns: ['date', 'expense', 'income']
} as CommonConstantsInfo
static readonly ACCOUNTING_INFO = {
tableName: 'accountingInfo',
... | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/constants/CommonConstants.ets#L20-L207 | 708a6c3aba76371b93d116ae9f802ed63b93f76e | github | |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets | arkts | unSubscribeUnCollectUrlEvent | 取消收藏Url事件
@param key
@param callback | unSubscribeUnCollectUrlEvent(key: string) {
EventBus.getInstance().unregistByKey(WanEventId.EVENT_UNCOLLECT_URL, key)
} | AST#method_declaration#Left unSubscribeUnCollectUrlEvent AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left... | unSubscribeUnCollectUrlEvent(key: string) {
EventBus.getInstance().unregistByKey(WanEventId.EVENT_UNCOLLECT_URL, key)
} | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalCollectViewModel.ets#L143-L145 | 3eb320c60881a7e6f7a62da2ba918c6985fea396 | github |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@system.router.d.ets | arkts | getState | Obtains information about the current page state.
@returns { RouterState } Page state.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 3
@deprecated since 8 | static getState(): RouterState; | AST#method_declaration#Left static getState AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left RouterState AST#primary_type#Right AST#type_annotation#Right ; AST#method_declaration#Right | static getState(): RouterState; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@system.router.d.ets#L311-L311 | 205e57bbe1d61995c1d4d588bd752f4e9a85a532 | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/pages/MainPage.ets | arkts | buildQueueTab | 队列页签 | @Builder
buildQueueTab() {
Column() {
if (this.queueEpisodes.length === 0) {
this.buildEmptyView('播放队列为空', '添加单集到队列');
} else {
// 队列操作栏
Row() {
Text(`待听 ${this.queueEpisodes.length} 集`)
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildQueueTab 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#ui_control_... | @Builder
buildQueueTab() {
Column() {
if (this.queueEpisodes.length === 0) {
this.buildEmptyView('播放队列为空', '添加单集到队列');
} else {
Row() {
Text(`待听 ${this.queueEpisodes.length} 集`)
.fontSize(14)
.fontColor($r('app.color.text_secondary'))
... | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/MainPage.ets#L706-L748 | ac410173ef7d699e4f302b40376be31025b55394 | github |
JackJiang2011/harmonychat.git | bca3f3e1ce54d763720510f99acf595a49e37879 | entry/src/main/ets/pages/ChatPage.ets | arkts | switchToLoginPage | 切换到登陆界面。 | switchToLoginPage() {
// init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作)
IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub);
// goto login page!
router.replaceUrl({ url: 'pages/LoginPage', });
} | AST#method_declaration#Left switchToLoginPage AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // init MobileIMSDK first(必须保证此代码被调用,否则IM框架无法完成IM服务器的连接等工作) AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#ex... | switchToLoginPage() {
IMClientManager.getInstance().initMobileIMSDK(getContext(this).getApplicationContext(), getContext(this).eventHub);
router.replaceUrl({ url: 'pages/LoginPage', });
} | https://github.com/JackJiang2011/harmonychat.git/blob/bca3f3e1ce54d763720510f99acf595a49e37879/entry/src/main/ets/pages/ChatPage.ets#L220-L225 | baa7f427b8e40b09fa559e8cca1f4947d68dbb3a | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LLMConfigPage.ets | arkts | buildBasicConfigSection | 构建基础配置区域 | @Builder
buildBasicConfigSection() {
Column({ space: 16 }) {
Text('基础配置')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
// API密钥
Column({ space: 8 }) {
Text('API密钥')
.fontSize(14)
.fontW... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildBasicConfigSection 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#compo... | @Builder
buildBasicConfigSection() {
Column({ space: 16 }) {
Text('基础配置')
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontColor('#333333')
.alignSelf(ItemAlign.Start)
Column({ space: 8 }) {
Text('API密钥')
.fontSize(14)
.fontWeight(Fo... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LLMConfigPage.ets#L276-L352 | e2ba826db67835a37b354a7e1866b6d2461b740c | github |
lentozi/DailyPlan.git | 96ce0bec8f545511c51b577c4aa8327c2c5bb0c8 | entry/src/main/ets/tabcontent/HomeContent.ets | arkts | stackState | @Watch | stackState() {
this.index = this.state.index;
hilog.info(0x0000, '[Debug.HomeContent]', this.index.toString())
this.getCurrentDayTodo();
} | AST#method_declaration#Left stackState AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . index AST#member_expression#Right = AST... | stackState() {
this.index = this.state.index;
hilog.info(0x0000, '[Debug.HomeContent]', this.index.toString())
this.getCurrentDayTodo();
} | https://github.com/lentozi/DailyPlan.git/blob/96ce0bec8f545511c51b577c4aa8327c2c5bb0c8/entry/src/main/ets/tabcontent/HomeContent.ets#L45-L49 | 78093490dcc1d932064bb1adbafa47ec9232e946 | github |
wenfujing/honms-super-market.git | 0858abecd8be5db7b8dcf88dcd77b7c66d37517a | common/src/main/ets/utils/CommonDataSource.ets | arkts | Data Change Listener. | export class CommonDataSource<T> implements IDataSource {
private dataArray: T[] = []
private listeners: DataChangeListener[] = []
constructor | AST#export_declaration#Left export AST#ERROR#Left class CommonDataSource AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#implements_clause#Left implements IDataSource AST#implements_clause#Right { AST#property_declaration#Left private dataArray : AST#type_an... | export class CommonDataSource<T> implements IDataSource {
private dataArray: T[] = []
private listeners: DataChangeListener[] = []
constructor | https://github.com/wenfujing/honms-super-market.git/blob/0858abecd8be5db7b8dcf88dcd77b7c66d37517a/common/src/main/ets/utils/CommonDataSource.ets#L4-L8 | deadcacb584098dbaab0659027f80bb120c55546 | github | |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.atomicservice.HalfScreenLaunchComponent.d.ets | arkts | HalfScreenLaunchComponent | Declare component HalfScreenLaunchComponent
@struct { HalfScreenLaunchComponent }
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 18 | @Component
export declare struct HalfScreenLaunchComponent {
/**
* Sets the component content.
* @type { Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 18
*/
@BuilderParam content: Callback<void>;
/**
* Indicates atomic service appId.
* @type { strin... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export AST#ERROR#Left declare AST#ERROR#Right struct HalfScreenLaunchComponent AST#component_body#Left { /**
* Sets the component content.
* @type { Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomic... | @Component
export declare struct HalfScreenLaunchComponent {
@BuilderParam content: Callback<void>;
appId: string;
options?: AtomicServiceOptions;
onError?: ErrorCallback;
onTerminated?: Callback<TerminationInfo>;
onReceive?: Callback<Record<string, Object>>;
} | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.atomicservice.HalfScreenLaunchComponent.d.ets#L31-L82 | cb21044e51b8ae391cab3e4ae8dc931e6b0078bc | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/word/WordDbAccess.ets | arkts | private db: DBAccessor | null = null; | constructor(textDb: string | null) {
this.textDb = textDb;
if (this.resDb) {
//this.db = new DBAccessor(this.resDb.filePath, null);
}
this.init();
} | AST#constructor_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left textDb : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left null AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AST... | constructor(textDb: string | null) {
this.textDb = textDb;
if (this.resDb) {
}
this.init();
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/word/WordDbAccess.ets#L54-L62 | d61a88d28f6f7a0af7f0f69e39ddcd967f09a3e7 | github | |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/utils/speech/AudioCapturerHelper.ets | arkts | onReadDataCallback | 监听音频数据读取回调事件(当需要读取音频流数据时触发),使用callback方式返回结果.
@param filePath 文件全路径
@returns | static onReadDataCallback(filePath: string) {
let bufferSize: number = 0;
AudioCapturerHelper.file = Helper.openSync(filePath);
let readDataCallback: Callback<ArrayBuffer> = (buffer: ArrayBuffer) => {
Helper.writeSync(AudioCapturerHelper.file!!.fd, buffer, { offset: bufferSize, length: buffer.byteLeng... | AST#method_declaration#Left static onReadDataCallback AST#parameter_list#Left ( AST#parameter#Left filePath : 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#variable_d... | static onReadDataCallback(filePath: string) {
let bufferSize: number = 0;
AudioCapturerHelper.file = Helper.openSync(filePath);
let readDataCallback: Callback<ArrayBuffer> = (buffer: ArrayBuffer) => {
Helper.writeSync(AudioCapturerHelper.file!!.fd, buffer, { offset: bufferSize, length: buffer.byteLeng... | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/utils/speech/AudioCapturerHelper.ets#L76-L85 | d97a89667f828976b1e43e823a2c08b5ecbbb31c | github |
chenyy0708/wanharmony.git | 00e95a536122accf51518d674989d12fafbf37c2 | entry/src/main/ets/view/TabBar.ets | arkts | TabBar | The tabBar component. | @Component
@Preview
export default struct TabBar {
@State tabBarArray: TabBean[] = MainViewModel.getTabList();
@State currentIndex: number = 0;
@State currentPage: number = 1;
@Provide('isBig') isBig: boolean = false;
@Builder
TabBuilder(index: number, tabBean: TabBean) {
Column() {
Text(this.tab... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right AST#decorator#Left @ Preview AST#decorator#Right export default struct TabBar AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right tabBarArray : AST#type_annotation#Left AST#primary... | @Component
@Preview
export default struct TabBar {
@State tabBarArray: TabBean[] = MainViewModel.getTabList();
@State currentIndex: number = 0;
@State currentPage: number = 1;
@Provide('isBig') isBig: boolean = false;
@Builder
TabBuilder(index: number, tabBean: TabBean) {
Column() {
Text(this.tab... | https://github.com/chenyy0708/wanharmony.git/blob/00e95a536122accf51518d674989d12fafbf37c2/entry/src/main/ets/view/TabBar.ets#L26-L94 | 350f2612c6df3f6b44e44987f27ef6c3c4dc13f4 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/database/DatabaseService.ets | arkts | getAllContacts | 获取所有联系人 | async getAllContacts(): Promise<ContactEntity[]> {
this.checkInitialization();
return await this.contactDAO.getAllContacts();
} | AST#method_declaration#Left async getAllContacts AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left ContactEntity [ ] AST#array_type#Right AST#pri... | async getAllContacts(): Promise<ContactEntity[]> {
this.checkInitialization();
return await this.contactDAO.getAllContacts();
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/database/DatabaseService.ets#L99-L102 | c90b045137df625db7f795837a77da911589c0c8 | github |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/Index.ets | arkts | AnimationUtils | 导出工具类 | export { AnimationUtils } from './src/main/ets/utils/AnimationUtils'; | AST#export_declaration#Left export { AnimationUtils } from './src/main/ets/utils/AnimationUtils' ; AST#export_declaration#Right | export { AnimationUtils } from './src/main/ets/utils/AnimationUtils'; | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/Index.ets#L31-L31 | bfd63053e1e320121b76be6e3309be33b765f56c | github |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/ui/pages/collect/CollectPage.ets | arkts | pageTransition | 转场动画 从右边弹出 | pageTransition() {
// 定义页面进入时的效果,从右侧滑入,时长为1200ms,页面栈发生push操作时该效果才生效
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Right)
// 定义页面进入时的效果,从左侧滑入,时长为1200ms,页面栈发生pop操作时该效果才生效
PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
.translate({
x: -100... | AST#method_declaration#Left pageTransition AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { // 定义页面进入时的效果,从右侧滑入,时长为1200ms,页面栈发生push操作时该效果才生效 AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left PageTransitionEnter ( AST#component_parameters#Left { AST#c... | pageTransition() {
PageTransitionEnter({ type: RouteType.Push, duration: 300 })
.slide(SlideEffect.Right)
PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
.translate({
x: -100,
y: 0,
})
PageTransitionExit({ type: RouteType.Push, duration: 300 })... | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/ui/pages/collect/CollectPage.ets#L78-L101 | 63065bc436006834f776a84f350aec5d1a13349c | github |
waylau/harmonyos-tutorial | 74e23dfa769317f8f057cc77c2d09f0b1f2e0773 | samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets | arkts | getAudioCapturer | 获取音频采集器实例 | async getAudioCapturer() {
// 如果已经存在,直接返回
if (this.audioCapturer) {
return this.audioCapturer
}
// 创建音频采集器
const audioCapturer = await audio.createAudioCapturer({
streamInfo: this.audioStreamInfo,
capturerInfo: this.audioCapturerInfo
})
// 保存方便下次直接获取
this.audioCapturer ... | AST#method_declaration#Left async getAudioCapturer 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 . audioCapturer AST#member_expressi... | async getAudioCapturer() {
if (this.audioCapturer) {
return this.audioCapturer
}
const audioCapturer = await audio.createAudioCapturer({
streamInfo: this.audioStreamInfo,
capturerInfo: this.audioCapturerInfo
})
this.audioCapturer = audioCapturer
return audio... | https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSAudioCapturer/entry/src/main/ets/pages/Index.ets#L85-L99 | 689829d1cf60e745e28c586835a740808c433797 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Scroll.ets | arkts | MediumPaddingVerticalScroll | 带中等内边距的垂直滚动布局 | @ComponentV2
export struct MediumPaddingVerticalScroll {
/**
* 滚动控制器
*/
@Param
scroller: Scroller = new Scroller();
/**
* 是否填充最大尺寸
*/
@Param
fillMaxSize: boolean = false;
/**
* 是否填充最大宽度
*/
@Param
fillMaxWidth: boolean = true;
/**
* 宽度
*/
@Param
widthValue: Length | undefi... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct MediumPaddingVerticalScroll AST#component_body#Left { /**
* 滚动控制器
*/ AST#property_declaration#Left AST#decorator#Left @ Param AST#decorator#Right scroller : AST#type_annotation#Left AST#primary_type#Left Scrol... | @ComponentV2
export struct MediumPaddingVerticalScroll {
@Param
scroller: Scroller = new Scroller();
@Param
fillMaxSize: boolean = false;
@Param
fillMaxWidth: boolean = true;
@Param
widthValue: Length | undefined = undefined;
@Param
heightValue: Length | undefined = undefined;
@P... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L174-L228 | 55b3945188222b130d454980880db9678e3abd19 | github |
mayuanwei/harmonyOS_bilibili | 8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5 | NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets | arkts | submitUserInput | 用户输入消息函数
@param userIputText | public submitUserInput(userIputText: string) {
if (userIputText == '') {
console.log(`dxin => "输入内容为空,请重新输入!" `)
return;
}
this.userInput = userIputText;
if (this.userInput && !this.isResponding) {
if (this.onSendMessage) {
this.isResponding = true;
this.onSendMessage(t... | AST#method_declaration#Left public submitUserInput AST#parameter_list#Left ( AST#parameter#Left userIputText : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statem... | public submitUserInput(userIputText: string) {
if (userIputText == '') {
console.log(`dxin => "输入内容为空,请重新输入!" `)
return;
}
this.userInput = userIputText;
if (this.userInput && !this.isResponding) {
if (this.onSendMessage) {
this.isResponding = true;
this.onSendMessage(t... | https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/NEXT/XiaoXunAI/entry/src/main/ets/view/ChatUI.ets#L271-L286 | 91a373a213272313b194cf384d553e60f2f451e1 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/dealstridesolution/src/main/ets/model/CameraServiceUint.ets | arkts | initCamera | 初始化相机功能
@param cameraDeviceIndex - 相机设备索引
@returns 无返回值 | async initCamera(cameraDeviceIndex: number): Promise<void> {
logger.debug(TAG, `initCamera cameraDeviceIndex: ${cameraDeviceIndex}`);
try {
await this.releaseCamera();
// 获取相机管理器实例
this.cameraManager = CameraService.getCameraManagerFn();
if (this.cameraManager === undefined) {
lo... | AST#method_declaration#Left async initCamera AST#parameter_list#Left ( AST#parameter#Left cameraDeviceIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic... | async initCamera(cameraDeviceIndex: number): Promise<void> {
logger.debug(TAG, `initCamera cameraDeviceIndex: ${cameraDeviceIndex}`);
try {
await this.releaseCamera();
this.cameraManager = CameraService.getCameraManagerFn();
if (this.cameraManager === undefined) {
logger.error(T... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/dealstridesolution/src/main/ets/model/CameraServiceUint.ets#L119-L176 | 51f117ebae948bd7ce6d7e99712b7af9b539f8ac | gitee |
waylau/harmonyos-tutorial | 74e23dfa769317f8f057cc77c2d09f0b1f2e0773 | samples/ArkUICalculator/entry/src/main/ets/CalculatorButtonInfo.ets | arkts | 按钮样式信息 | export class CalculatorButtonInfo {
text: string // 按钮上的文字
textColor: number // 文字的颜色
bgColor: number // 按钮背景颜色
constructor | AST#export_declaration#Left export AST#ERROR#Left class CalculatorButtonInfo { text : AST#ERROR#Left string // 按钮上的文字 textColor : number // 文字的颜色 bgColor : AST#ERROR#Right number AST#ERROR#Right // 按钮背景颜色 AST#variable_declaration#Left const AST#variable_declarator#Left ructor AST#variable_declarator#Right AST#variable... | export class CalculatorButtonInfo {
text: string
textColor: number
bgColor: number
constructor | https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkUICalculator/entry/src/main/ets/CalculatorButtonInfo.ets#L2-L7 | b3eb14a0f5d282266e915c946d3e9b2310227cf8 | gitee | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_dialog/src/main/ets/dialog/ActionBaseCore.ets | arkts | update | 刷新自定义弹窗 | update<T extends BaseDialogOptions>(dialogId: string, params: T) {
const promptActionArg = this.getArgById(dialogId);
if (promptActionArg) {
promptActionArg.componentContent.update(params);
}
} | AST#method_declaration#Left update AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left BaseDialogOptions AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left dialogId : A... | update<T extends BaseDialogOptions>(dialogId: string, params: T) {
const promptActionArg = this.getArgById(dialogId);
if (promptActionArg) {
promptActionArg.componentContent.update(params);
}
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/ActionBaseCore.ets#L241-L246 | 822ed90493687d614397dc7519c6f888a7c76443 | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets | arkts | enableDashedLine | Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -"
@param lineLength the length of the line pieces
@param spaceLength the length of space inbetween the pieces
@param phase offset, in degrees (normally, use 0) | public enableDashedLine(lineLength: number, spaceLength: number, phase: number) {
this.mDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase);
} | AST#method_declaration#Left public enableDashedLine AST#parameter_list#Left ( AST#parameter#Left lineLength : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left spaceLength : AST#type_annotation#Left AST#primary_type#Left numbe... | public enableDashedLine(lineLength: number, spaceLength: number, phase: number) {
this.mDashPathEffect = new DashPathEffect([lineLength, spaceLength], phase);
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/LimitLine.ets#L114-L116 | 2979858e4141542d2d59940550ae4276bca1cd35 | gitee |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/services/ConfigService.ets | arkts | AGV配置接口定义 | export interface AgvConfig {
id: number;
host: string;
drivePort: number;
analysisPort: number;
cloudUrl: string;
cam1: string;
cam2: string;
cam3: string;
cam4: string;
username1: string;
username2: string;
username3: string;
username4: string;
password1: string;
password2: string;
pass... | AST#export_declaration#Left export AST#interface_declaration#Left interface AgvConfig AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left host : AST#type_annotation#Left AST#p... | export interface AgvConfig {
id: number;
host: string;
drivePort: number;
analysisPort: number;
cloudUrl: string;
cam1: string;
cam2: string;
cam3: string;
cam4: string;
username1: string;
username2: string;
username3: string;
username4: string;
password1: string;
password2: string;
pass... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/ConfigService.ets#L6-L25 | f8a875ff0dce6750d74caa0eb744339c72ec4e23 | github | |
LiuAnclouds/Harmony-ArkTS-App.git | 2119ce333927599b81a31081bc913e1416837308 | WeatherMind/entry/src/main/ets/pages/ChooseCity.ets | arkts | getCurrentLocation | 获取当前位置 | private async getCurrentLocation() {
try {
promptAction.showToast({ message: '正在获取当前位置...' });
let requestInfo: geoLocationManager.CurrentLocationRequest = {
'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX,
'scenario': geoLocationManager.LocationRequestScenario.UNSET,
... | AST#method_declaration#Left private async getCurrentLocation AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Left AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expressi... | private async getCurrentLocation() {
try {
promptAction.showToast({ message: '正在获取当前位置...' });
let requestInfo: geoLocationManager.CurrentLocationRequest = {
'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX,
'scenario': geoLocationManager.LocationRequestScenario.UNSET,
... | https://github.com/LiuAnclouds/Harmony-ArkTS-App.git/blob/2119ce333927599b81a31081bc913e1416837308/WeatherMind/entry/src/main/ets/pages/ChooseCity.ets#L310-L336 | 40c7790437a831eab4bfc6eeeb4fc9c6584ae7c2 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/component/HomeTopBar.ets | arkts | rightBuilder | 右侧图标构建
@returns {void} 无返回值 | @Builder
private rightBuilder() {
Image($r("app.media.ic_github"))
.attributeModifier(size(27))
.onClick((): void => this.onRightTap());
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private rightBuilder 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 ( AST#expression#Left AST#resource_expression#L... | @Builder
private rightBuilder() {
Image($r("app.media.ic_github"))
.attributeModifier(size(27))
.onClick((): void => this.onRightTap());
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/component/HomeTopBar.ets#L89-L94 | d92bbabbaa3f2f9a763a3463dc97c39e80707dc2 | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets | arkts | getSimpleQuestionCount | 获取简单题数量
@returns | public getSimpleQuestionCount(): number {
return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.SIMPLE).length;
} | AST#method_declaration#Left public getSimpleQuestionCount 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#m... | public getSimpleQuestionCount(): number {
return this.examDetails.filter(item => item.classificationType === ClassificationTypeEnum.SIMPLE).length;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/DriverLicenseExam-master/commons/datasource/src/main/ets/ExamService.ets#L220-L222 | 702de7db46b463b4f469490f81dc5a81355ebf54 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets | arkts | set | Set value.
@param left
@param top
@param right
@param bottom | set(left: number, top: number, right: number, bottom: number): void {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
} | AST#method_declaration#Left set AST#parameter_list#Left ( AST#parameter#Left left : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left top : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_... | set(left: number, top: number, right: number, bottom: number): void {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/viewModel/Rect.ets#L55-L60 | 5615771036c0fdf319387dcacab606096182586c | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | eftool/src/main/ets/core/media/ImageUtil.ets | arkts | packingFromPixelMap | PixelMap转ArrayBuffer
@param target PixelMap
@param format 目标格式。只支持jpg、webp 、 png
@returns | static async packingFromPixelMap(target: image.PixelMap, format: string = 'image/png'): Promise<OutDTO<ArrayBuffer>> {
const imagePacker: image.ImagePacker = image.createImagePacker();
//转换
let res = await imagePacker.packing(target, { format: format, quality: 98 });
//释放资源
imagePacker.release();
... | AST#method_declaration#Left static async packingFromPixelMap AST#parameter_list#Left ( AST#parameter#Left target : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left image . PixelMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fo... | static async packingFromPixelMap(target: image.PixelMap, format: string = 'image/png'): Promise<OutDTO<ArrayBuffer>> {
const imagePacker: image.ImagePacker = image.createImagePacker();
let res = await imagePacker.packing(target, { format: format, quality: 98 });
imagePacker.release();
ret... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/eftool/src/main/ets/core/media/ImageUtil.ets#L282-L290 | 9eb7258f7ab6469e1bdf2876fd0744a688bca827 | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | AdaptiveCapabilities/entry/src/main/ets/pages/atomicLayoutCapability/flexibleCapability/FlexibleCapability1.ets | arkts | slider | Bottom slider - adjust container size by dragging the slider. | @Builder
slider() {
Slider({ value: this.sliderWidth, min: 300, max: 1000 })
.blockColor(Color.White)
.width('60%')
.onChange((value: number) => {
this.sliderWidth = value;
})
.position({ x: '20%', y: '80%' })
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right slider 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 Slider ( AST#component_parameters#Left { AST#component_parameter#Le... | @Builder
slider() {
Slider({ value: this.sliderWidth, min: 300, max: 1000 })
.blockColor(Color.White)
.width('60%')
.onChange((value: number) => {
this.sliderWidth = value;
})
.position({ x: '20%', y: '80%' })
} | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/AdaptiveCapabilities/entry/src/main/ets/pages/atomicLayoutCapability/flexibleCapability/FlexibleCapability1.ets#L23-L32 | b26b61b33deeda1d8f73c7803fbefca6d86e6360 | gitee |
Jolin-Kan/HarmonyOS-App.git | 5b2c84ed90d89d721bc107f2100a64d0203a6e72 | entry/src/main/components/WarningDialog.ets | arkts | constructor | 使用 Link 来链接动态文本 | constructor(controller?: CustomDialogController, warnText: string = '') {
super();
this.controller = controller;
this.warnText = warnText; // 初始化 warnText
} | AST#method_declaration#Left constructor AST#parameter_list#Left ( AST#parameter#Left controller ? : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left warnText : AST#type_annotation#Left AST#primary_type#Left st... | constructor(controller?: CustomDialogController, warnText: string = '') {
super();
this.controller = controller;
this.warnText = warnText;
} | https://github.com/Jolin-Kan/HarmonyOS-App.git/blob/5b2c84ed90d89d721bc107f2100a64d0203a6e72/entry/src/main/components/WarningDialog.ets#L7-L11 | f2938b7049910960d76edc067d36fd708e4b4f42 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/collapsemenu/src/main/ets/model/BasicDataSource.ets | arkts | getData | 获取指定索引数据 | public getData(index: number): T {
return this.articleData[index];
} | AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left T AST#primary_type#Right ... | public getData(index: number): T {
return this.articleData[index];
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/collapsemenu/src/main/ets/model/BasicDataSource.ets#L89-L91 | e09dede78ebeeedbab390b2a164d8d92786c77ee | gitee |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | HDRVivid/AVCodecVideo/entry/src/main/ets/pages/Recorder.ets | arkts | isVideoStabilizationModeSupported | [Start set_video_color] | function isVideoStabilizationModeSupported(session: camera.VideoSession, mode: camera.VideoStabilizationMode): boolean {
let isSupported: boolean = false;
try {
isSupported = session.isVideoStabilizationModeSupported(mode);
} catch (error) {
// If the failure occurs, the error code error.code is returned ... | AST#function_declaration#Left function isVideoStabilizationModeSupported AST#parameter_list#Left ( AST#parameter#Left session : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left camera . VideoSession AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST... | function isVideoStabilizationModeSupported(session: camera.VideoSession, mode: camera.VideoStabilizationMode): boolean {
let isSupported: boolean = false;
try {
isSupported = session.isVideoStabilizationModeSupported(mode);
} catch (error) {
let err = error as BusinessError;
console.error(`The is... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/HDRVivid/AVCodecVideo/entry/src/main/ets/pages/Recorder.ets#L100-L110 | 03038eec4576a7525d8b32ee4d8e43264b22e123 | gitee |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets | arkts | ItemType. include CAMERA and THUMBNAIL
@enum { number } ItemType
@syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
@atomicservice
@since 12 | export declare enum ItemType {
/**
* THUMBNAIL. photos or videos item
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/
THUMBNAIL = 0,
/**
* CAMERA. camera item
*
* @syscap SystemCapability.FileManagement.PhotoAcce... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ItemType AST#enum_body#Left { /**
* THUMBNAIL. photos or videos item
*
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
* @atomicservice
* @since 12
*/ AST#enum_member#L... | export declare enum ItemType {
THUMBNAIL = 0,
CAMERA = 1
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.file.PhotoPickerComponent.d.ets#L533-L550 | c6be5d89242399cd1ba6056a98a4e9771d0ef03b | github | |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_ui/src/main/ets/ui/base/PreviewUtil.ets | arkts | previewTxt | 预览文本
@param uri 预览uri | static async previewTxt(uri: string): Promise<void> {
await PreviewUtil.openPreview('txt', uri);
} | AST#method_declaration#Left static async previewTxt AST#parameter_list#Left ( AST#parameter#Left uri : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#L... | static async previewTxt(uri: string): Promise<void> {
await PreviewUtil.openPreview('txt', uri);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_ui/src/main/ets/ui/base/PreviewUtil.ets#L35-L37 | 6072cf0067b3f2ee3560a3f2d8384627f83db0d9 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/search/SearchDetails.ets | arkts | aboutToAppear | 初始化 | aboutToAppear(): void {
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | aboutToAppear(): void {
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/componets/search/SearchDetails.ets#L77-L79 | 63c8893ef477b20d2ab794b2f8bb8280df9abb39 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/model/DataModel.ets | arkts | 基础的icon数据 | export const IconList3: IconListsType[] = [
{ name: "头条", num: "0" },
{ name: "获赞", num: "0" },
{ name: "粉丝", num: "0" },
{ name: "关注", num: "0" }
]
// 基础服务的icon数据 | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left IconList3 : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left IconListsType [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#array_literal#Left [ AST#ex... | export const IconList3: IconListsType[] = [
{ name: "头条", num: "0" },
{ name: "获赞", num: "0" },
{ name: "粉丝", num: "0" },
{ name: "关注", num: "0" }
] | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/navigationinterceptor/src/main/ets/model/DataModel.ets#L35-L42 | 8ea97745f418e418e8226bcbf53d8a446b092775 | gitee | |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets | arkts | The font weight of application. | export enum FontWeight {
BOLD = '400',
BOLDER = '500',
}; | AST#export_declaration#Left export AST#enum_declaration#Left enum FontWeight AST#enum_body#Left { AST#enum_member#Left BOLD = AST#expression#Left '400' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left BOLDER = AST#expression#Left '500' AST#expression#Right AST#enum_member#Right , } AST#enum_body#Right ... | export enum FontWeight {
BOLD = '400',
BOLDER = '500',
}; | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/RankingDemo/entry/src/main/ets/common/constants/Constants.ets#L30-L33 | fc8818018a4f20ce794318bc8bb8eb25adf59589 | gitee | |
meltsama/Arkts_HarmonyOS_App.git | 546adabde1c0f2e9abb988dd26c5722f4f0e2514 | version_1/entry/src/main/ets/pages/qiud/DzfPage.ets | arkts | buildText | 自定义弹窗 内部文本按钮等 | @Builder
function buildText(params: Params) {
Column() {
//标题文本
Text(params.text)
.fontSize(18)
.padding({top: 20})
//内容文本
Text('是否继续操作取消申请?')
.fontSize(16)
.margin(40)
//两个按钮的实现
Row(){
Button({type:ButtonType.Normal}){
Text('取消')
}
.padding({t... | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function buildText AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left Params AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#buil... | @Builder
function buildText(params: Params) {
Column() {
Text(params.text)
.fontSize(18)
.padding({top: 20})
Text('是否继续操作取消申请?')
.fontSize(16)
.margin(40)
Row(){
Button({type:ButtonType.Normal}){
Text('取消')
}
.padding({top: 20, bottom: 20})
... | https://github.com/meltsama/Arkts_HarmonyOS_App.git/blob/546adabde1c0f2e9abb988dd26c5722f4f0e2514/version_1/entry/src/main/ets/pages/qiud/DzfPage.ets#L11-L57 | 58af188d42f26ee8c45d0f8c50a4bc6c81221a78 | github |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/components/review/ReviewCardComponents.ets | arkts | AchievementBadges | 成就徽章墙 | @Builder
export function AchievementBadges(
completedCount: number,
onTimeCount: number
) {
Column({ space: 12 }) {
Row() {
Text('成就徽章')
.fontSize(18)
.fontWeight(FontWeight.Bold)
Blank()
SymbolGlyph($r('sys.symbol.rosette'))
.fontSize(20)
.fontColor(['#FFD700... | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function AchievementBadges AST#parameter_list#Left ( AST#parameter#Left completedCount : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#paramete... | @Builder
export function AchievementBadges(
completedCount: number,
onTimeCount: number
) {
Column({ space: 12 }) {
Row() {
Text('成就徽章')
.fontSize(18)
.fontWeight(FontWeight.Bold)
Blank()
SymbolGlyph($r('sys.symbol.rosette'))
.fontSize(20)
.fontColor(['#FFD700... | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/review/ReviewCardComponents.ets#L281-L323 | 0ff89365ae8d42e506cebada3cb2de25b1ba3d05 | github |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/utils/DateHelper.ets | arkts | hasSecond | 是否含有秒 | static hasSecond(type: DateType): boolean {
return type == DateType.YmdHms || type == DateType.Hms || type == DateType.Ms;
} | AST#method_declaration#Left static hasSecond AST#parameter_list#Left ( AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left DateType AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_ty... | static hasSecond(type: DateType): boolean {
return type == DateType.YmdHms || type == DateType.Hms || type == DateType.Ms;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/DateHelper.ets#L86-L88 | e967f4426ebf51443ffaf8f311e25c94456d3840 | github |
openharmony/graphic_graphic_2d | 46a11e91c9709942196ad2a7afea2e0fcd1349f3 | frameworks/text/interface/export/ani/@ohos.graphics.text.ets | arkts | Enumerates of ellipsis mode.
@enum { number }
@syscap SystemCapability.Graphics.Drawing
@since 12 | export enum EllipsisMode {
/**
* The ellipsis is shown in the start of text.
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
START,
/**
* The ellipsis is shown in the middle of text.
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/
MIDDLE,
... | AST#export_declaration#Left export AST#enum_declaration#Left enum EllipsisMode AST#enum_body#Left { /**
* The ellipsis is shown in the start of text.
* @syscap SystemCapability.Graphics.Drawing
* @since 12
*/ AST#enum_member#Left START AST#enum_member#Right , /**
* The ellipsis is shown in the ... | export enum EllipsisMode {
START,
MIDDLE,
END,
} | https://github.com/openharmony/graphic_graphic_2d/blob/46a11e91c9709942196ad2a7afea2e0fcd1349f3/frameworks/text/interface/export/ani/@ohos.graphics.text.ets#L1176-L1197 | e108017830a6588467aea2509a3a0325e43b318b | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/ArkTsComponentCollection/MediaQuery/entry/src/main/ets/model/New.ets | arkts | Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | export const newsList = [{ title: $r('app.string.new_title1'), publisher: $r('app.string.new_publisher1'), newId: 0 },
{ title: $r('app.string.new_title2'), publisher: $r('app.string.new_publisher2'), newId: 1 },
{ title: $r('app.string.new_title3'), publisher: $r('app.... | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left newsList = AST#expression#Left AST#array_literal#Left [ AST#expression#Left AST#object_literal#Left { AST#property_assignment#Left AST#property_name#Left title AST#property_name#Right : AST#expression#Left AST#resource_e... | export const newsList = [{ title: $r('app.string.new_title1'), publisher: $r('app.string.new_publisher1'), newId: 0 },
{ title: $r('app.string.new_title2'), publisher: $r('app.string.new_publisher2'), newId: 1 },
{ title: $r('app.string.new_title3'), publisher: $r('app.... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/MediaQuery/entry/src/main/ets/model/New.ets#L15-L18 | 3adf9b72d672edaff2c3db467efba4bd8d961697 | gitee | |
fengmingdev/protobuf-arkts-generator.git | 75888d404fd6ce52a046cba2a94807ecf1350147 | runtime/arkpb/MessageUtils.ets | arkts | toBinaryBatch | ========== 批量操作 ==========
批量序列化消息为二进制
@param messages 消息数组
@returns 二进制数据数组
使用示例:
```typescript
const people = [person1, person2, person3]
const binaries = MessageUtils.toBinaryBatch(people)
``` | static toBinaryBatch<T extends Message>(messages: T[]): Uint8Array[] {
return messages.map(m => m.toBinary())
} | AST#method_declaration#Left static toBinaryBatch AST#type_parameters#Left < AST#type_parameter#Left T extends AST#type_annotation#Left AST#primary_type#Left Message AST#primary_type#Right AST#type_annotation#Right AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left messages... | static toBinaryBatch<T extends Message>(messages: T[]): Uint8Array[] {
return messages.map(m => m.toBinary())
} | https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/MessageUtils.ets#L41-L43 | 4065fd54374b1ca242edf913dadb73539c785c7d | 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/action/ToastUtil.ets | arkts | showShort | 弹出土司,时长为:1.5s,距离底部默认为80vp
@param message 提示消息
@param options (距离屏幕底部的位置、是否显示在应用之上) | static showShort(message: string | Resource, options: ToastOptions = new ToastOptions()) {
if (message || (typeof message === 'string' && message.length > 0)) {
options = ToastUtil.initToastDefault(options, 1);
let toastOptions = options as promptAction.ShowToastOptions;
toastOptions.message = mes... | AST#method_declaration#Left static showShort AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ... | static showShort(message: string | Resource, options: ToastOptions = new ToastOptions()) {
if (message || (typeof message === 'string' && message.length > 0)) {
options = ToastUtil.initToastDefault(options, 1);
let toastOptions = options as promptAction.ShowToastOptions;
toastOptions.message = mes... | 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/action/ToastUtil.ets#L60-L67 | d1ced23095eeb19f5b43204aafebf322d582ced6 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets | arkts | @Author csx
@DateTime 2024/3/20 21:43
@TODO SHA | export class SHASync {
/**
* SHA1摘要
* @param str 带摘要的字符串
* @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
* @returns 摘要后的字符串
*/
static digestSHA1(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.digest(str, 'SHA1', resultCoding);
}
... | AST#export_declaration#Left export AST#class_declaration#Left class SHASync AST#class_body#Left { /**
* SHA1摘要
* @param str 带摘要的字符串
* @param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
* @returns 摘要后的字符串
*/ AST#method_declaration#Left static digestSHA1 AST#parameter_list#Left ( AST#parameter#Left st... | export class SHASync {
static digestSHA1(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil.digest(str, 'SHA1', resultCoding);
}
static digestSHA224(str: string, resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<string> {
return CryptoSyncUtil... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHASync.ets#L27-L87 | b295f29e564c50614fbb4a1a67baa36a3adf196f | gitee | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets | arkts | deleteEmitter | 取消事件订阅 | deleteEmitter() {
emitter.off(2);
} | AST#method_declaration#Left deleteEmitter AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left emitter AST#expression#Right . off AST#member_expr... | deleteEmitter() {
emitter.off(2);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/statusbaranimation/src/main/ets/model/WindowModel.ets#L192-L194 | 8a2bd0ee42153dd7eb927820937c04de917d97e9 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/AIAssistantService.ets | arkts | 消息附件接口 | export interface MessageAttachment {
id: string;
type: AttachmentType;
url: string;
filename: string;
size: number;
thumbnail?: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface MessageAttachment AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left type : AST#type_annotation#Le... | export interface MessageAttachment {
id: string;
type: AttachmentType;
url: string;
filename: string;
size: number;
thumbnail?: string;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L57-L64 | 4db97c1b6a4c59e4460a6531fe7876a5231b523e | github | |
harmonyos/samples | f5d967efaa7666550ee3252d118c3c73a77686f5 | HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets | arkts | 使用Worker开启子线程,执行轨道计算任务
@param totalTimeSteps 时间推移量 | export function computeNBodyByWorker(totalTimeSteps: number): void {
Logger.info(TAG, "computeNBodyByWorker: start executing");
let workerInstance = new worker.ThreadWorker("entry/ets/workers/CalculateWorker.ts");
// 设置如何处理,来自worker线程的消息
workerInstance.onmessage = (e: MessageEvents): void => {
let data: Re... | AST#export_declaration#Left export AST#function_declaration#Left function computeNBodyByWorker AST#parameter_list#Left ( AST#parameter#Left totalTimeSteps : 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_an... | export function computeNBodyByWorker(totalTimeSteps: number): void {
Logger.info(TAG, "computeNBodyByWorker: start executing");
let workerInstance = new worker.ThreadWorker("entry/ets/workers/CalculateWorker.ts");
workerInstance.onmessage = (e: MessageEvents): void => {
let data: Record<string, Object> = ... | https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/Performance/NBody/entry/src/main/ets/model/CalculateUtil.ets#L86-L99 | 650492e908d3cea1d8771346e1eb1d6c2f826005 | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/detailitem/DetailItemManager.ets | arkts | init | MARK: - 初始化 | init(): void {
this.loadPreference()
} | AST#method_declaration#Left init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST... | init(): void {
this.loadPreference()
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/detailitem/DetailItemManager.ets#L83-L85 | 49abf9bc00911a4375f113adcc3a9bcece51cde3 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/NavigationParam.ets | arkts | 订单 ID 参数 | export interface OrderIdParam {
/**
* 订单 ID
*/
orderId: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface OrderIdParam AST#object_type#Left { /**
* 订单 ID
*/ AST#type_member#Left orderId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type#Right AST#i... | export interface OrderIdParam {
orderId: number;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/NavigationParam.ets#L19-L24 | d3bc1937067c4f809101cc7c968df3a071761e0a | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/LocationUtil.ets | arkts | getCountryCode | 获取当前的国家码(无需申请定位权限)
@returns 返回当前位置中文描述 | static async getCountryCode(): Promise<string> {
let result = await geoLocationManager.getCountryCode(); //获取当前的国家码
if (result.country) {
return result.country;
}
return "";
} | AST#method_declaration#Left static async getCountryCode AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > A... | static async getCountryCode(): Promise<string> {
let result = await geoLocationManager.getCountryCode();
if (result.country) {
return result.country;
}
return "";
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L277-L283 | 7e5da817b4c7892e4480814861afe28db158c76c | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets | arkts | size | 获取栈大小 | public static size() {
return RouterModule._stack.size();
} | AST#method_declaration#Left public static size AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AS... | public static size() {
return RouterModule._stack.size();
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets#L103-L105 | a18fccbe5b9793fc2d5c508386d0723b05706bc0 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets | arkts | customSegmentButtonItem | 自定义分段按钮项
@param index 自定义分段按钮索引。这里对应自定义日历视图类型。0:年视图YEAR,1:月视图MONTH,2:周视图WEEK
@param name 自定义分段按钮名。这里对应'年','月','周' | @Builder
customSegmentButtonItem(index: number, name: string) {
Column() {
Text(name)
.width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH)
.textAlign(TextAlign.Center)
.height($r('app.integer.calendar_switch_size_thirty_five'))
.fontSize($r('app.integer.calendar_switch_size_fourteen'))
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right customSegmentButtonItem AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left name : AST#type_annota... | @Builder
customSegmentButtonItem(index: number, name: string) {
Column() {
Text(name)
.width(CUSTOM_SEGMENT_BUTTON_MONTH_WIDTH)
.textAlign(TextAlign.Center)
.height($r('app.integer.calendar_switch_size_thirty_five'))
.fontSize($r('app.integer.calendar_switch_size_fourteen'))
... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets#L253-L305 | 81062902f6f0a8284ab95e5b359a4d1f99d8f62f | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets | arkts | updateTitleInput | 更新标题输入
@param {string} value - 输入内容
@returns {void} 无返回值 | updateTitleInput(value: string): void {
this.titleInput = value;
} | AST#method_declaration#Left updateTitleInput AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#R... | updateTitleInput(value: string): void {
this.titleInput = value;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/DatabaseViewModel.ets#L53-L55 | 10b18bb0f7682cc38749bef6d4e88d0719773b3e | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto/src/main/ets/crypto/util/StrAndUintUtil.ets | arkts | stringToByteArray | 字符串转换为Uint8Array数组
@param str 字符串C1C3C2格式的,true为是
@param keyName 密钥长度
@param isC1C3C2 传入的字符串是否为
@returns Uint8Array数组 | static stringToByteArray(str: string, keyName: number, isC1C3C2?: boolean): Uint8Array {
if (isC1C3C2) {
str = new SM2Convert().i2dSM2(str);
}
//判断是否为HarmonyOS自己生成的字符串,只包含小写a-z和数字
if (str.length != keyName / 8) {
const hexString = str.match(/.{1,2}/g); // 将字符串按每两个字符分割为数组
let arr = new ... | AST#method_declaration#Left static stringToByteArray 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 keyName : AST#type_annotation#Left AST#primary_type#Left number AST#prim... | static stringToByteArray(str: string, keyName: number, isC1C3C2?: boolean): Uint8Array {
if (isC1C3C2) {
str = new SM2Convert().i2dSM2(str);
}
if (str.length != keyName / 8) {
const hexString = str.match(/.{1,2}/g);
let arr = new Array<string>();
hexString?.forEach((val) => {
... | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto/src/main/ets/crypto/util/StrAndUintUtil.ets#L166-L186 | 51285b2448d9e41528781e231ad7708986677898 | gitee |
Active-hue/ArkTS-Accounting.git | c432916d305b407557f08e35017c3fd70668e441 | entry/src/main/ets/pages/ReminderSetting.ets | arkts | formatTime | 格式化时间(补零) | formatTime(time: number): string {
return time < 10 ? `0${time}` : `${time}`;
} | AST#method_declaration#Left formatTime AST#parameter_list#Left ( AST#parameter#Left time : 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 string AST#primary_type#Right ... | formatTime(time: number): string {
return time < 10 ? `0${time}` : `${time}`;
} | https://github.com/Active-hue/ArkTS-Accounting.git/blob/c432916d305b407557f08e35017c3fd70668e441/entry/src/main/ets/pages/ReminderSetting.ets#L135-L137 | 931af48a72d280ab7ae2c9d48a2ae5a252e4c8fb | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/sync/CloudStorageProvider.ets | arkts | 腾讯云存储实现 | export class TencentCloudStorageProvider extends CloudStorageProvider {
async initialize(): Promise<void> {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Initializing Tencent Cloud Storage');
// TODO: 实现腾讯云存储初始化
}
async upload(options: UploadOptions): Promise<string> {
// TODO: 实现腾讯云上传
... | AST#export_declaration#Left export AST#class_declaration#Left class TencentCloudStorageProvider extends AST#type_annotation#Left AST#primary_type#Left CloudStorageProvider AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { AST#method_declaration#Left async initialize AST#parameter_list#Left ( ) AST#... | export class TencentCloudStorageProvider extends CloudStorageProvider {
async initialize(): Promise<void> {
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, 'Initializing Tencent Cloud Storage');
}
async upload(options: UploadOptions): Promise<string> {
throw new Error('Tencent Cloud s... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/sync/CloudStorageProvider.ets#L370-L405 | c05d0acdb9a8a62d4f1c20131152664a6211971a | github | |
wasd09090030/MyHongmengProject.git | a8ed386b658ceeac69ef5bc42a92d78c7980821c | entry/src/main/ets/components/TimerPage.ets | arkts | onTaskSwitch | 当信号变化时调用 | onTaskSwitch() {
this.checkAndSetupTask();
} | AST#method_declaration#Left onTaskSwitch AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . checkAndSetupTask AST#m... | onTaskSwitch() {
this.checkAndSetupTask();
} | https://github.com/wasd09090030/MyHongmengProject.git/blob/a8ed386b658ceeac69ef5bc42a92d78c7980821c/entry/src/main/ets/components/TimerPage.ets#L41-L43 | af294ecd2f08c390a68e52a604a0f313c0633956 | github |
Million-mo/tree-sitter-arkts.git | 2fd0ad75e2d848709edcf4be038f27b178114ef6 | examples/custom_builders.ets | arkts | tabBuilder | 本地Builder方法 - 标签页Builder | @Builder
tabBuilder(title: string, index: number, icon: string) {
Column() {
Text(icon)
.fontSize(20)
.margin({ bottom: 4 })
Text(title)
.fontSize(12)
.fontColor(this.currentTab === index ? Color.Blue : Color.Gray)
}
.width(80)
.height(60)
.justif... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right tabBuilder AST#parameter_list#Left ( AST#parameter#Left title : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left index : AST#type_annotation#Left AS... | @Builder
tabBuilder(title: string, index: number, icon: string) {
Column() {
Text(icon)
.fontSize(20)
.margin({ bottom: 4 })
Text(title)
.fontSize(12)
.fontColor(this.currentTab === index ? Color.Blue : Color.Gray)
}
.width(80)
.height(60)
.justif... | https://github.com/Million-mo/tree-sitter-arkts.git/blob/2fd0ad75e2d848709edcf4be038f27b178114ef6/examples/custom_builders.ets#L141-L160 | 71798756166460d7badf5679e5290bf6b8ea7c6c | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/networks/Server_Routes.ets | arkts | 定义路由枚举 | export enum Route {
advice = "advice",
user_data = "user_data",
login = "login",
reclaimWord = "reclaim_word",
subscription = "subscription",
servercfg = "servercfg",//TODO
//dict
word = "w",
search ... | AST#export_declaration#Left export AST#enum_declaration#Left enum Route AST#enum_body#Left { AST#enum_member#Left advice = AST#expression#Left "advice" AST#expression#Right AST#enum_member#Right , AST#enum_member#Left user_data = AST#expression#Left "user_data" AST#expression#Right AST#enum_member#Right , AST#enum_memb... | export enum Route {
advice = "advice",
user_data = "user_data",
login = "login",
reclaimWord = "reclaim_word",
subscription = "subscription",
servercfg = "servercfg",
word = "w",
search = "s... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/networks/Server_Routes.ets#L20-L35 | a402a08f76742ade95e6f6649a64172ef83419f1 | github | |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/utils/MD5.ets | arkts | hmac | 消息认证码计算,异步
@param data 传入的消息
@param symKey 共享对称密钥。
@param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。 | static async hmac(data: string, symKey: cryptoFramework.SymKey = MD5.symKey,
resultCoding: crypto.BhCoding = 'hex'): Promise<string> {
return CryptoUtil.hmac(data, 'MD5', symKey, resultCoding);
} | AST#method_declaration#Left static async hmac AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Lef... | static async hmac(data: string, symKey: cryptoFramework.SymKey = MD5.symKey,
resultCoding: crypto.BhCoding = 'hex'): Promise<string> {
return CryptoUtil.hmac(data, 'MD5', symKey, resultCoding);
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/utils/MD5.ets#L81-L84 | 8a5391ec86783500b4502c3811ae3281952b4aa7 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/data/src/main/ets/repository/OrderRepository.ets | arkts | alipayAppPay | 发起支付宝 App 支付
@param params 支付参数
@returns 支付签名结果 | async alipayAppPay(params: Record<string, number>): Promise<NetworkResponse<string>> {
return this.networkDataSource.alipayAppPay(params);
} | AST#method_declaration#Left async alipayAppPay AST#parameter_list#Left ( AST#parameter#Left params : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Record AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right , AST#type_ann... | async alipayAppPay(params: Record<string, number>): Promise<NetworkResponse<string>> {
return this.networkDataSource.alipayAppPay(params);
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderRepository.ets#L38-L40 | fd3366992e460520869de3068512058f3ef4a7da | github |
ashcha0/line-inspection-terminal-frontend_arkts.git | c82616097e8a3b257b7b01e75b6b83ce428b518c | entry/src/main/ets/services/TaskService.ets | arkts | 任务接口定义 | export interface AgvTask {
id: number;
taskCode: string;
taskName: string;
startPos: string;
taskTrip: string;
creator: string;
executor: string;
execTime?: Date;
endTime?: Date;
createTime: Date;
taskStatus: string;
round: number;
uploaded: boolean;
remark?: string;
cloudTaskId?: number;
... | AST#export_declaration#Left export AST#interface_declaration#Left interface AgvTask AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left taskCode : AST#type_annotation#Left AST... | export interface AgvTask {
id: number;
taskCode: string;
taskName: string;
startPos: string;
taskTrip: string;
creator: string;
executor: string;
execTime?: Date;
endTime?: Date;
createTime: Date;
taskStatus: string;
round: number;
uploaded: boolean;
remark?: string;
cloudTaskId?: number;
... | https://github.com/ashcha0/line-inspection-terminal-frontend_arkts.git/blob/c82616097e8a3b257b7b01e75b6b83ce428b518c/entry/src/main/ets/services/TaskService.ets#L5-L22 | 2655814011fdbf15eca270d774b176af1f3b3767 | github | |
OHPG/FinVideo.git | 2b288396af5b2a20a24575faa317b46214965391 | entry/src/main/ets/pages/home/prefer/PreferViewModel.ets | arkts | @Author peerless2012
@Email peerless2012@126.com
@DateTime 2024/11/28 21:12
@Version V1.0
@Description | export class PreferViewModel extends AppViewModel {
} | AST#export_declaration#Left export AST#class_declaration#Left class PreferViewModel extends AST#type_annotation#Left AST#primary_type#Left AppViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { } AST#class_body#Right AST#class_declaration#Right AST#export_declaration#Right | export class PreferViewModel extends AppViewModel {
} | https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/pages/home/prefer/PreferViewModel.ets#L10-L12 | 64bf7e1c9914ab79e948bebeb286b06ff77b907a | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/model/DataSource.ets | arkts | getData | 获取指定数据项 | public getData(index: number): T | void {
logger.info('getData, index:' + index);
} | AST#method_declaration#Left public getData AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left T AST... | public getData(index: number): T | void {
logger.info('getData, index:' + index);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/model/DataSource.ets#L29-L31 | b3d326dc4cb453be942834c053293d3bcfc1d375 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/notification/NotificationManager.ets | arkts | cancelNotification | 取消通知 | async cancelNotification(notificationId: number): Promise<void> {
try {
await notificationManager.cancel(notificationId);
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION,
`Notification cancelled: ${notificationId}`);
} catch (error) {
hilog.error(LogConstants.DOMAIN_... | AST#method_declaration#Left async cancelNotification AST#parameter_list#Left ( AST#parameter#Left notificationId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#ge... | async cancelNotification(notificationId: number): Promise<void> {
try {
await notificationManager.cancel(notificationId);
hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_NOTIFICATION,
`Notification cancelled: ${notificationId}`);
} catch (error) {
hilog.error(LogConstants.DOMAIN_... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/notification/NotificationManager.ets#L563-L572 | dc8b791be4ec8043daa562cd393dfe981448593d | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets | arkts | stopRecordingProcess | 停止录制对应的流程 | async stopRecordingProcess(): Promise<void> {
if (this.avRecorder !== undefined) {
// 1. 停止录制
if (this.avRecorder.state === 'started'
|| this.avRecorder.state === 'paused') { // 仅在started或者paused状态下调用stop为合理状态切换
await this.avRecorder.stop();
clearInterval(this.time);
}
... | AST#method_declaration#Left async stopRecordingProcess AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#... | async stopRecordingProcess(): Promise<void> {
if (this.avRecorder !== undefined) {
if (this.avRecorder.state === 'started'
|| this.avRecorder.state === 'paused') {
await this.avRecorder.stop();
clearInterval(this.time);
}
await this.avRecorder.reset();
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/voicerecordynamiceffect/src/main/ets/models/AudioRecorder.ets#L98-L112 | 1874d8c1f2916e7cbf0161358e5336b0b9ae9269 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets | arkts | repeal | 撤销功能 | async repeal(): Promise<void> {
const pm: image.PixelMap | undefined = this.pixelMapQueue.pop();
if (pm !== null && pm !== undefined) {
this.pixelMap = await copyPixelMap(pm);
}
} | AST#method_declaration#Left async repeal 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... | async repeal(): Promise<void> {
const pm: image.PixelMap | undefined = this.pixelMapQueue.pop();
if (pm !== null && pm !== undefined) {
this.pixelMap = await copyPixelMap(pm);
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/Image/photomodify/src/main/ets/components/pages/EditImage.ets#L197-L202 | d69ff26a760930f3374755567cc5f9696a98fb1a | gitee |
XiangRui_FuZi/harmony-oscourse | da885f9a777a1eace7a07e1cd81137746687974b | class1/entry/src/main/ets/commons/constants/CommonConstants.ets | arkts | Public constants. | export class CommonConstants {
static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi';
static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium';
static readonly HARMONY_HEI_TI_BOLD_FONT_FAMILY = 'HarmonyHeiTi-Bold';
// StatusBarContentColor
static readonly StatusBarContentWhiteColor: str... | AST#export_declaration#Left export AST#class_declaration#Left class CommonConstants AST#class_body#Left { AST#property_declaration#Left static readonly HARMONY_HEI_TI_FONT_FAMILY = AST#expression#Left 'HarmonyHeiTi' AST#expression#Right ; AST#property_declaration#Right AST#property_declaration#Left static readonly HARM... | export class CommonConstants {
static readonly HARMONY_HEI_TI_FONT_FAMILY = 'HarmonyHeiTi';
static readonly HARMONY_HEI_TI_MEDIUM_FONT_FAMILY = 'HarmonyHeiTi-Medium';
static readonly HARMONY_HEI_TI_BOLD_FONT_FAMILY = 'HarmonyHeiTi-Bold';
static readonly StatusBarContentWhiteColor: string = '#ffffff';
stati... | https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/commons/constants/CommonConstants.ets#L9-L400 | 545d865244068b4581ef289630eaa8b3fc61e82b | gitee | |
YShelter/Accouting_ArkTS.git | 8c663c85f2c11738d4eabf269c23dc1ec84eb013 | entry/src/main/ets/common/database/Rdb/TableHelper.ets | arkts | createTableSql | 生成创建数据表的SQL语句 | createTableSql(tableName: string, columns: Array<ColumnInfo>): string {
let sql = `create table if not exists ${tableName}(`;
for (let column of columns) {
sql = sql.concat(`${column.name} ${column.type}`);
sql = sql.concat(`${column.length && column.length > 0 ? `(${column.length})` : ''}`);
... | AST#method_declaration#Left createTableSql AST#parameter_list#Left ( AST#parameter#Left tableName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left columns : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Le... | createTableSql(tableName: string, columns: Array<ColumnInfo>): string {
let sql = `create table if not exists ${tableName}(`;
for (let column of columns) {
sql = sql.concat(`${column.name} ${column.type}`);
sql = sql.concat(`${column.length && column.length > 0 ? `(${column.length})` : ''}`);
... | https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/TableHelper.ets#L7-L19 | a8717578c51b36ff89f01089df3aaa1d73f61121 | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets | arkts | CustomCalendarSamplePage | 功能描述:本示例介绍如何使用自定义日历组件CustomCalendar实现日历年视图,月视图,周视图以及视图切换功能。还有如何使用Calendar Kit日历服务实现日程提醒的功能。
推荐场景:需要使用左右滑动切换年视图,月视图,周视图以及需要添加日程提醒的应用场景
核心组件:
1.CustomCalendar
2.SchedulePoint
实现步骤:
日历切换场景:
1.使用Tabs进行年、月、周视图页面布局。
2.调用自定义日历组件CustomCalendar组件分别在TabContent中显示对应年、月、周视图。
3.点击自定义分段按钮customSegmentButton进行年、月、周视图间切换。使用视图控制器的sw... | @Component
export struct CustomCalendarSamplePage {
// 屏幕宽度
@State screenWidth: number = 0;
// 当前显示的年份
@State currentShowYear: number = TODAY_YEAR;
// 当前显示的月份
@State currentShowMonth: number = TODAY_MONTH;
// 当前月视图或周视图中选中的日期
@State currentSelectDay: DayInfo =
new DayInfo(new Date().getFullYear(), ne... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct CustomCalendarSamplePage AST#component_body#Left { // 屏幕宽度 AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right screenWidth : AST#type_annotation#Left AST#primary_type#Left number AST#primary_t... | @Component
export struct CustomCalendarSamplePage {
@State screenWidth: number = 0;
@State currentShowYear: number = TODAY_YEAR;
@State currentShowMonth: number = TODAY_MONTH;
@State currentSelectDay: DayInfo =
new DayInfo(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate()... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/CalendarViewSwitch/casesfeature/calendarswitch/src/main/ets/pages/CustomCalendarSample.ets#L73-L473 | 977d4f961d53620c1309f5508c32076437fee3dc | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/DatabaseConnection.ets | arkts | insertData | 插入数据库 | public async insertData(context: common.Context, Contact: Contact): Promise<void> {
logger.info(TAG, 'insert begin');
if (!context) {
logger.info(TAG, 'context is null or undefined');
}
const predicates = new rdb.RdbPredicates(TABLE_NAME);
if (predicates === null || predicates === undefined) ... | AST#method_declaration#Left public async insertData AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . Context AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left Contact : ... | public async insertData(context: common.Context, Contact: Contact): Promise<void> {
logger.info(TAG, 'insert begin');
if (!context) {
logger.info(TAG, 'context is null or undefined');
}
const predicates = new rdb.RdbPredicates(TABLE_NAME);
if (predicates === null || predicates === undefined) ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/perfermance/operaterdbintaskpool/src/main/ets/view/DatabaseConnection.ets#L177-L220 | 166275d0d4d324034591124f1652f760faa63da7 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.EditableTitleBar.d.ets | arkts | Declaration of the menu item on the right side.
@syscap SystemCapability.ArkUI.ArkUI.Full
@since 10
Declaration of the menu item on the right side.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 11 | export declare class EditableTitleBarMenuItem {
/**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomi... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#class_declaration#Left class EditableTitleBarMenuItem AST#class_body#Left { /**
* Icon resource for this menu item.
* @type { ResourceStr }.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/ /**
* Icon resource for ... | export declare class EditableTitleBarMenuItem {
value: ResourceStr;
symbolStyle?: SymbolGlyphModifier;
label?: ResourceStr;
isEnabled?: boolean;
action?: () => void;
accessibilityText?: ResourceStr;
accessibilityDescription?: ResourceStr;
accessibilityLevel?: stri... | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.EditableTitleBar.d.ets#L36-L137 | af6ccf4263c562f64fe38c17b4133924b226b5c5 | gitee | |
OHPG/FinVideo.git | 2b288396af5b2a20a24575faa317b46214965391 | entry/src/main/ets/router/AppRouter.ets | arkts | goToPlayer | 跳转到播放页
@param context
@param args | public static goToPlayer(context: UIContext, args: PlayerArgs) {
context.getRouter().pushUrl({url: "pages/player/PlayerPage", params: args})
} | AST#method_declaration#Left public static goToPlayer AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left args : AST#type_annotation#Left AST#primary_type#Left PlayerArgs ... | public static goToPlayer(context: UIContext, args: PlayerArgs) {
context.getRouter().pushUrl({url: "pages/player/PlayerPage", params: args})
} | https://github.com/OHPG/FinVideo.git/blob/2b288396af5b2a20a24575faa317b46214965391/entry/src/main/ets/router/AppRouter.ets#L17-L19 | fb0c4784fa93ab780d40003ef4ab543e16425c4f | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/GlobalTypes.ets | arkts | 尺寸接口 | export interface Size {
width: number;
height: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Size AST#object_type#Left { AST#type_member#Left width : 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 height : AST#type_annotation#Left AST#p... | export interface Size {
width: number;
height: number;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GlobalTypes.ets#L124-L127 | 2572c8b562a2469a985462f32d9428fa2537ee03 | 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/SM4.ets | arkts | decryptCBC | 解密(CBC模式),异步
@param data 加密或者解密的数据。data不能为null。
@param symKey 指定加密或解密的密钥。
@param ivParams 指定加密或解密的参数,对于ECB等没有参数的算法模式,可以传入null。API 10之前只支持ParamsSpec, API 10之后增加支持null。
@returns | static async decryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
ivParams: cryptoFramework.IvParamsSpec): Promise<cryptoFramework.DataBlob> {
return SM4.decrypt(data, symKey, ivParams, 'SM4_128|CBC|PKCS7');
} | AST#method_declaration#Left static async decryptCBC AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . DataBlob AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left sym... | static async decryptCBC(data: cryptoFramework.DataBlob, symKey: cryptoFramework.SymKey,
ivParams: cryptoFramework.IvParamsSpec): Promise<cryptoFramework.DataBlob> {
return SM4.decrypt(data, symKey, ivParams, 'SM4_128|CBC|PKCS7');
} | https://github.com/jxdiaodeyi/YX_Sports.git/blob/af5346bd3d5003c33c306ff77b4b5e9184219893/YX_Sports/oh_modules/.ohpm/@pura+harmony-utils@1.3.6/oh_modules/@pura/harmony-utils/src/main/ets/crypto/SM4.ets#L130-L133 | cfa8d8a0618c1bada5a2efd5d23a1bfda3adb04a | github |
de8gemaker/AccountApp.git | b5156cd90ac02239b39fd0f91d32851acad8ba42 | entry/src/main/ets/service/account.ets | arkts | getAccountByMonth | 按月份获取记账记录 | getAccountByMonth(time: string | number) {
const startMonth = dayjs(time).startOf('month').toDate().getTime();
const endMonth = dayjs(time).endOf('month').toDate().getTime();
return AccountModel.queryByDateRange(startMonth, endMonth);
} | AST#method_declaration#Left getAccountByMonth AST#parameter_list#Left ( AST#parameter#Left time : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right AST#union_type#Right AST#type_annotation#Right AST#parameter#Right ) AS... | getAccountByMonth(time: string | number) {
const startMonth = dayjs(time).startOf('month').toDate().getTime();
const endMonth = dayjs(time).endOf('month').toDate().getTime();
return AccountModel.queryByDateRange(startMonth, endMonth);
} | https://github.com/de8gemaker/AccountApp.git/blob/b5156cd90ac02239b39fd0f91d32851acad8ba42/entry/src/main/ets/service/account.ets#L29-L33 | 1b2764796eb52211d342e2471a4a28d80074d251 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/main/sub/report/RadarView.ets | arkts | drawDataPoints | ========== 绘制数据点 ========== | private drawDataPoints(centerX: number, centerY: number, radius: number): void {
if (this.parts.length === 0) return;
const angleStep = (2 * Math.PI) / this.parts.length;
for (let i = 0; i < this.parts.length; i++) {
const part = this.parts[i];
const angle = this.START_ANGLE_OFFSET + angleStep... | AST#method_declaration#Left private drawDataPoints AST#parameter_list#Left ( AST#parameter#Left centerX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left centerY : AST#type_annotation#Left AST#primary_type#Left number AST#pr... | private drawDataPoints(centerX: number, centerY: number, radius: number): void {
if (this.parts.length === 0) return;
const angleStep = (2 * Math.PI) / this.parts.length;
for (let i = 0; i < this.parts.length; i++) {
const part = this.parts[i];
const angle = this.START_ANGLE_OFFSET + angleStep... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/main/sub/report/RadarView.ets#L283-L306 | f6c494c9e1b18c650f8f79f859d428bb46041bd3 | github |
common-apps/ZRouter | 5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6 | RouterApi/src/main/ets/template/ZLifecycleObserver.ets | arkts | onPageHide | @Entry页面的生命周期函数 | onPageHide(): void {
} | AST#method_declaration#Left onPageHide AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | onPageHide(): void {
} | https://github.com/common-apps/ZRouter/blob/5adc9c4bcca6ba7d9b323451ed464e1e9b47eee6/RouterApi/src/main/ets/template/ZLifecycleObserver.ets#L28-L29 | 9d2436043e9003cefbb88685d1f6a077d5e7c685 | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/data/BarDataSet.ets | arkts | setBarShadowColor | Sets the color used for drawing the bar-shadows. The bar shadows is a
surface behind the bar that indicates the maximum value. Don't for get to
use getResources().getColor(...) to set this. Or Color.rgb(...).
@param color | public setBarShadowColor(color: number): void {
this.mBarShadowColor = color;
} | AST#method_declaration#Left public setBarShadowColor 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#primar... | public setBarShadowColor(color: number): void {
this.mBarShadowColor = color;
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/data/BarDataSet.ets#L220-L222 | 1b788ddafba7d02a27036e5be50a537b3b3640f0 | gitee |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/constants/Constants.ets | arkts | Flip page type. | export enum FlipPageType {
COVER_FLIP_PAGE = 0,
SIMULATE_FLIP_PAGE = 1,
SLIDE_FLIP_PAGE = 2,
UP_DOWN_FLIP_PAGE = 3
} | AST#export_declaration#Left export AST#enum_declaration#Left enum FlipPageType AST#enum_body#Left { AST#enum_member#Left COVER_FLIP_PAGE = AST#expression#Left 0 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left SIMULATE_FLIP_PAGE = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#e... | export enum FlipPageType {
COVER_FLIP_PAGE = 0,
SIMULATE_FLIP_PAGE = 1,
SLIDE_FLIP_PAGE = 2,
UP_DOWN_FLIP_PAGE = 3
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/readerLibrary/src/main/ets/common/constants/Constants.ets#L171-L176 | b9708126de0206228752240bd41d4f86b544dbbe | github | |
wcmzllx/axis-render | 34a330085691968cf1c132095e5ce078aa7ee933 | AxisRenderLibrary/src/main/ets/common/AxisRender.ets | arkts | getInstance | 获取 c++ 渲染实例 | getInstance() {
return this.instance
} | AST#method_declaration#Left getInstance AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . instance AST#member_expression#Right AST#expression#R... | getInstance() {
return this.instance
} | https://github.com/wcmzllx/axis-render/blob/34a330085691968cf1c132095e5ce078aa7ee933/AxisRenderLibrary/src/main/ets/common/AxisRender.ets#L265-L267 | aae8d54b942d5b1f84ce4ae05282ba1e4d5b3f9e | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/plan/CreatePlanView.ets | arkts | open | /打开方式 | function open(param: CreatePlanViewConfig.Param){
NavTo(NavKey, param, true)
} | AST#function_declaration#Left function open AST#parameter_list#Left ( AST#parameter#Left param : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left CreatePlanViewConfig . Param AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AS... | function open(param: CreatePlanViewConfig.Param){
NavTo(NavKey, param, true)
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/plan/CreatePlanView.ets#L39-L41 | 9e6b2abdf24240ce552210cc10e082cba9dc067c | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/dbUtils/DBPrepare.ets | arkts | prepareDbIfNeedsByPath | 准备数据库文件(根据具体路径)
@param protocol 数据库协议实现
@param context Ability上下文
@param fromAssetsPath assets路径
@param toTargetPath 目标路径
@param async 是否异步操作 | static async prepareDbIfNeedsByPath(protocol: DBPrepareProtocol, fromAssetsPath: string, toTargetPath: string) {
// 检查磁盘空间
checkDiskSpace();
const exists = FileUtility.isFileExistAt(toTargetPath);
if (!exists) {
// 不存在就拷贝
await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), f... | AST#method_declaration#Left static async prepareDbIfNeedsByPath AST#parameter_list#Left ( AST#parameter#Left protocol : AST#type_annotation#Left AST#primary_type#Left DBPrepareProtocol AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fromAssetsPath : AST#type_annotation#Left AST... | static async prepareDbIfNeedsByPath(protocol: DBPrepareProtocol, fromAssetsPath: string, toTargetPath: string) {
checkDiskSpace();
const exists = FileUtility.isFileExistAt(toTargetPath);
if (!exists) {
await DbFileUtility.copyDatabaseFromAssetsIfNeeds(getAppContext(), fromAssetsPath, toT... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/dbUtils/DBPrepare.ets#L48-L82 | ba3658d19ac658a6983cf2b1d3722966f613a6c7 | github |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/utils/Transformer.ets | arkts | rectValueToPixel | Transform a rectangle with all matrices.
@param r | public rectValueToPixel(r: MyRect) {
this.mMatrixValueToPx.mapRect(r);
this.mViewPortHandler.getMatrixTouch().mapRect(r);
this.mMatrixOffset.mapRect(r);
} | AST#method_declaration#Left public rectValueToPixel AST#parameter_list#Left ( AST#parameter#Left r : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#ex... | public rectValueToPixel(r: MyRect) {
this.mMatrixValueToPx.mapRect(r);
this.mViewPortHandler.getMatrixTouch().mapRect(r);
this.mMatrixOffset.mapRect(r);
} | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L289-L294 | 2e0239fcbb4fef12add2462e859e51e6d4968655 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/ai/FavoritesService.ets | arkts | getAnalyticsData | 获取统计分析数据 | getAnalyticsData(): AnalyticsData {
const now = new Date();
const thisMonth = now.getMonth();
const thisYear = now.getFullYear();
// 祝福语统计
const greetingHistory = this.generationHistory.filter(h => h.type === 'greeting');
const giftHistory = this.generationHistory.filter(h => h.type === 'gift')... | AST#method_declaration#Left getAnalyticsData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AnalyticsData AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left... | getAnalyticsData(): AnalyticsData {
const now = new Date();
const thisMonth = now.getMonth();
const thisYear = now.getFullYear();
const greetingHistory = this.generationHistory.filter(h => h.type === 'greeting');
const giftHistory = this.generationHistory.filter(h => h.type === 'gift');
c... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/FavoritesService.ets#L229-L423 | f0cbf692e062f2174cfa2e7cfa89c7144208b826 | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets | arkts | createKvStore | Create a distributed key-value database.
@param context Ability context.
@param callback Callback. | createKvStore(
context: common.UIAbilityContext,
callback: (data: distributedKVStore.ChangeNotification) => void
): void {
if (this.kvStore !== undefined) {
Logger.info('KvStoreModel', 'createKvStore KVManager is exist');
return;
}
let config: distributedKVStore.KVManagerConfig = {
... | AST#method_declaration#Left createKvStore 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 callback : ... | createKvStore(
context: common.UIAbilityContext,
callback: (data: distributedKVStore.ChangeNotification) => void
): void {
if (this.kvStore !== undefined) {
Logger.info('KvStoreModel', 'createKvStore KVManager is exist');
return;
}
let config: distributedKVStore.KVManagerConfig = {
... | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Distributed/DistributeDraw/entry/src/main/ets/viewmodel/KvStoreModel.ets#L31-L78 | 5eeb02f8370473d35b21a451300ff80346e87f2b | gitee |
openharmony/developtools_profiler | 73d26bb5acfcafb2b1f4f94ead5640241d1e5f73 | host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets | arkts | green | from Color green()
@param color | public static green(color: number): number {
return (color >> 8) & 0xff;
} | AST#method_declaration#Left public static green 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 number AST#primary_t... | public static green(color: number): number {
return (color >> 8) & 0xff;
} | https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/utils/ColorTemplate.ets#L276-L278 | 3486d887d38d0d7a5b53436deda743edb2efdcd8 | gitee |
azhuge233/ASFShortcut-HN.git | d1669c920c56317611b5b0375aa5315c1b91211b | entry/src/main/ets/common/utils/DB.ets | arkts | clearTableSettings | debug 方法 | async clearTableSettings() {
await this.clearTable(this.TN_HostInfo);
} | AST#method_declaration#Left async clearTableSettings AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#await_expression#Left await AST#exp... | async clearTableSettings() {
await this.clearTable(this.TN_HostInfo);
} | https://github.com/azhuge233/ASFShortcut-HN.git/blob/d1669c920c56317611b5b0375aa5315c1b91211b/entry/src/main/ets/common/utils/DB.ets#L202-L204 | fb786b16309649700311fc9ddc093e1303c611a7 | github |
waylau/harmonyos-tutorial | 74e23dfa769317f8f057cc77c2d09f0b1f2e0773 | samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets | arkts | setInternetVideo | Scan the internet video.
@param name Video Name.
@param pixelMap pixelMap object.
@param src Playback Path.
@param duration Video duration.
@return Network video list data. | async setInternetVideo(name: string, src: string, pixelMap?: image.PixelMap) {
this.videoInternetList.push(new VideoBean(name, src, pixelMap));
globalThis.videoInternetList = this.videoInternetList;
return globalThis.videoInternetList;
} | AST#method_declaration#Left async setInternetVideo 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 src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_t... | async setInternetVideo(name: string, src: string, pixelMap?: image.PixelMap) {
this.videoInternetList.push(new VideoBean(name, src, pixelMap));
globalThis.videoInternetList = this.videoInternetList;
return globalThis.videoInternetList;
} | https://github.com/waylau/harmonyos-tutorial/blob/74e23dfa769317f8f057cc77c2d09f0b1f2e0773/samples/ArkTSVideoPlayer/entry/src/main/ets/viewmodel/HomeVideoListModel.ets#L42-L46 | 49ed11d8a6332772fdeaaf42f11848ba5458975f | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/widgets/pages/WidgetCard2x2.ets | arkts | formatUpdateTime | 格式化更新时间 | private formatUpdateTime(): string {
const updateTime = this.widgetData.updateTime || '';
if (!updateTime) return '';
// 只显示时分
const timeParts = updateTime.split(':');
if (timeParts.length >= 2) {
return `${timeParts[0]}:${timeParts[1]}`;
}
return updateTime;
} | AST#method_declaration#Left private formatUpdateTime AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Lef... | private formatUpdateTime(): string {
const updateTime = this.widgetData.updateTime || '';
if (!updateTime) return '';
const timeParts = updateTime.split(':');
if (timeParts.length >= 2) {
return `${timeParts[0]}:${timeParts[1]}`;
}
return updateTime;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/widgets/pages/WidgetCard2x2.ets#L186-L197 | 96e71e52f95d8bb5a6b72ffeb08383e8a758ae2e | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/StrUtil.ets | arkts | isNull | 判断字符串是否为空(undefined、null)
@param str 被检测的字符串
@returns 是否为空 | static isNull(str: string | number | undefined | null): boolean {
return str === undefined || str === null;
} | AST#method_declaration#Left static isNull AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right | AST#primary_type#... | static isNull(str: string | number | undefined | null): boolean {
return str === undefined || str === null;
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/StrUtil.ets#L35-L37 | 313533912d634fdab12b0a260419659b49098642 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/settings/LanguageSettingsPage.ets | arkts | buildAdvancedSettings | 构建高级设置 | @Builder
buildAdvancedSettings() {
Column({ space: 16 }) {
Text('高级设置')
.fontSize(16)
.fontColor($r('app.color.text_primary'))
.fontWeight(FontWeight.Medium)
.width('100%')
Column({ space: 0 }) {
// 自动检测系统语言
this.buildSettingItem(
'自动检测系统语言',
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildAdvancedSettings AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#compone... | @Builder
buildAdvancedSettings() {
Column({ space: 16 }) {
Text('高级设置')
.fontSize(16)
.fontColor($r('app.color.text_primary'))
.fontWeight(FontWeight.Medium)
.width('100%')
Column({ space: 0 }) {
this.buildSettingItem(
'自动检测系统语言',
'... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/settings/LanguageSettingsPage.ets#L412-L454 | 48d6ee958984768b8eab4a6912315ad423b1d899 | github |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets | arkts | Enum for ChipSize
@enum { string }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@since 11
Enum for ChipSize
@enum { string }
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export declare enum ChipSize {
/**
* Normal type.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/
/**
* Normal type.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
NORMAL =... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#enum_declaration#Left enum ChipSize AST#enum_body#Left { /**
* Normal type.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 11
*/ /**
* Normal type.
*
* @syscap SystemCapabilit... | export declare enum ChipSize {
NORMAL = "NORMAL",
SMALL = "SMALL"
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.Chip.d.ets#L37-L70 | 385e71903b04db01bc39626214a4c7fa70cce91c | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/PreferencesUtil.ets | arkts | getPreferencesSync | 获取Preferences实例
@param name
@returns | private static getPreferencesSync(preferenceName: string = PreferencesUtil.defaultPreferenceName): preferences.Preferences {
if (preferenceName !== PreferencesUtil.defaultPreferenceName) {
return dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName });
} else if (!PreferencesUti... | AST#method_declaration#Left private static getPreferencesSync AST#parameter_list#Left ( AST#parameter#Left preferenceName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#member_expression#Left AST#expression#Left PreferencesUtil AST#expr... | private static getPreferencesSync(preferenceName: string = PreferencesUtil.defaultPreferenceName): preferences.Preferences {
if (preferenceName !== PreferencesUtil.defaultPreferenceName) {
return dataPreferences.getPreferencesSync(AppUtil.getContext(), { name: preferenceName });
} else if (!PreferencesUti... | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PreferencesUtil.ets#L50-L57 | 9e13df1108241a91f255987096f9d076784e6f3c | gitee |
vhall/VHLive_SDK_Harmony | 29c820e5301e17ae01bc6bdcc393a4437b518e7c | watchKit/src/main/ets/util/EmitterUtil.ets | arkts | Emitter消息数据结构 | export interface EmitterMsgData {
type: string;
enable?:boolean;
data?: Object;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface EmitterMsgData AST#object_type#Left { AST#type_member#Left type : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left enable ? : AST#type_annotation... | export interface EmitterMsgData {
type: string;
enable?:boolean;
data?: Object;
} | https://github.com/vhall/VHLive_SDK_Harmony/blob/29c820e5301e17ae01bc6bdcc393a4437b518e7c/watchKit/src/main/ets/util/EmitterUtil.ets#L8-L12 | afa0c7a9af35e4546521c16f6f77d3999302485f | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/views/login/LoginView.ets | arkts | login | 登录方法 | private login(): void {
if (!StringUtils.isValidEmail(this.email)) {
Toast.showMessage($r('app.string.login_msg_invalid_email'))
return;
}
if (this.password === '') {
Toast.showMessage($r('app.string.login_msg_need_pwd'))
return;
}
if (!this.checkAggree()) {
return;
... | AST#method_declaration#Left private login AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#call_expression#Left AST#... | private login(): void {
if (!StringUtils.isValidEmail(this.email)) {
Toast.showMessage($r('app.string.login_msg_invalid_email'))
return;
}
if (this.password === '') {
Toast.showMessage($r('app.string.login_msg_need_pwd'))
return;
}
if (!this.checkAggree()) {
return;
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/login/LoginView.ets#L260-L281 | 89c218452ee7920c329ea0f296c0d108dab63114 | github |
kaina404/HarmonyStock.git | 99233a46fb0dfb21e02294c730fd80e2fb404f9b | entry/src/main/ets/pages/component/MinuteLineComponent.ets | arkts | drawMinuteLine | 绘制分时线 | drawMinuteLine() {
this.context.strokeStyle = '#364d92'
this.context.lineWidth = 0.8600009
this.context.beginPath()
let itemCount = Math.max(this.stockData.line.length, 240)
let itemDistance = this.minuteRect.width / itemCount
let path = new Path2D()
this.stockData.line.forEach((value, index... | AST#method_declaration#Left drawMinuteLine AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#assignment_expression#Left AST#member_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#express... | drawMinuteLine() {
this.context.strokeStyle = '#364d92'
this.context.lineWidth = 0.8600009
this.context.beginPath()
let itemCount = Math.max(this.stockData.line.length, 240)
let itemDistance = this.minuteRect.width / itemCount
let path = new Path2D()
this.stockData.line.forEach((value, index... | https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/component/MinuteLineComponent.ets#L307-L329 | 375f76bb94f302bfbff82541a697f173e0527a56 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets | arkts | @file 购物车本地数据源实现
@author Joker.X | export class CartLocalDataSourceImpl implements CartLocalDataSource {
/**
* 迁移标记,防止重复执行 migrate
*/
private static migrated: boolean = false;
/**
* ORM 实例,用于执行数据库操作
*/
private orm = getORM();
/**
* 构造函数,初始化 ORM 并确保购物车表已迁移
* @returns {CartLocalDataSourceImpl} 实例
*/
constructor() {
th... | AST#export_declaration#Left export AST#class_declaration#Left class CartLocalDataSourceImpl AST#implements_clause#Left implements CartLocalDataSource AST#implements_clause#Right AST#class_body#Left { /**
* 迁移标记,防止重复执行 migrate
*/ AST#property_declaration#Left private static migrated : AST#type_annotation#Left AST#... | export class CartLocalDataSourceImpl implements CartLocalDataSource {
private static migrated: boolean = false;
private orm = getORM();
constructor() {
this.ensureMigrated();
}
private ensureMigrated(): void {
if (!CartLocalDataSourceImpl.migrated) {
this.orm.migrate(CartEntity);
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets#L10-L208 | e72370961e34575113693bd08bd83d70ae4d357c | github | |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | feature/demo/src/main/ets/view/NetworkRequestPage.ets | arkts | NetworkRequestPage | @file 通用网络请求示例页视图
@author Joker.X | @ComponentV2
export struct NetworkRequestPage {
/**
* 通用网络请求示例页 ViewModel
*/
@Local
private vm: NetworkRequestViewModel = new NetworkRequestViewModel();
/**
* 构建通用网络请求示例页
* @returns {void} 无返回值
*/
build() {
AppNavDestination({
title: $r("app.string.demo_network_request_title"),
... | AST#decorated_export_declaration#Left AST#decorator#Left @ ComponentV2 AST#decorator#Right export struct NetworkRequestPage AST#component_body#Left { /**
* 通用网络请求示例页 ViewModel
*/ AST#property_declaration#Left AST#decorator#Left @ Local AST#decorator#Right private vm : AST#type_annotation#Left AST#primary_type#Lef... | @ComponentV2
export struct NetworkRequestPage {
@Local
private vm: NetworkRequestViewModel = new NetworkRequestViewModel();
build() {
AppNavDestination({
title: $r("app.string.demo_network_request_title"),
viewModel: this.vm
}) {
this.NetworkRequestContent();
}
}
@Buil... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/view/NetworkRequestPage.ets#L10-L70 | 504897652fdbfd5657cc688233822ee1d9ef1c34 | github |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.