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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets | arkts | 定义通知相关的常量 | export class CSoundNotification {
static readonly NAME_SOUND_LOADED = "Wc.SoundModel.SoundDownloader.soundLoaded"
static readonly UKEY_K_SOUND = "SoundKey"
} | AST#export_declaration#Left export AST#class_declaration#Left class CSoundNotification AST#class_body#Left { AST#property_declaration#Left static readonly NAME_SOUND_LOADED = AST#expression#Left "Wc.SoundModel.SoundDownloader.soundLoaded" AST#expression#Right AST#property_declaration#Right AST#property_declaration#Lef... | export class CSoundNotification {
static readonly NAME_SOUND_LOADED = "Wc.SoundModel.SoundDownloader.soundLoaded"
static readonly UKEY_K_SOUND = "SoundKey"
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Sounds/Cloud/Manager/CSoundManager.ets#L8-L14 | 4e3edbcb9d776e2cddaac3b381bbab9e48d6aff4 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/component/OrderCard.ets | arkts | getGoodsList | 获取订单商品列表
@returns {OrderGoods[]} 商品列表 | private getGoodsList(): OrderGoods[] {
return this.order.goodsList ?? [];
} | AST#method_declaration#Left private getGoodsList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left OrderGoods [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_stateme... | private getGoodsList(): OrderGoods[] {
return this.order.goodsList ?? [];
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/component/OrderCard.ets#L190-L192 | 9eac2677b67e81b0c2b72e62ce62ac0a067140a1 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/user/UserResult.ets | arkts | @file 用户模块导航结果定义
@author Joker.X
选择收货地址返回结果 | export interface UserSelectAddressResult {
/**
* 选择的地址
*/
address: Address;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface UserSelectAddressResult AST#object_type#Left { /**
* 选择的地址
*/ AST#type_member#Left address : AST#type_annotation#Left AST#primary_type#Left Address AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; } AST#object_type... | export interface UserSelectAddressResult {
address: Address;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/user/UserResult.ets#L11-L16 | 77c0553cf020dd1e42fb30ca46a04a629ff73732 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/InteractiveGameService.ets | arkts | getBirthdayQuizQuestions | 获取生日问答题目 | getBirthdayQuizQuestions(difficulty: GameDifficulty, count: number = 10): QuizQuestion[] {
const allQuestions = this.generateBirthdayQuestions();
const filteredQuestions = allQuestions.filter(q => q.difficulty === difficulty);
// 随机选择指定数量的题目
const shuffled = filteredQuestions.sort(() => Math.random... | AST#method_declaration#Left getBirthdayQuizQuestions AST#parameter_list#Left ( AST#parameter#Left difficulty : AST#type_annotation#Left AST#primary_type#Left GameDifficulty AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left count : AST#type_annotation#Left AST#primary_type#Left nu... | getBirthdayQuizQuestions(difficulty: GameDifficulty, count: number = 10): QuizQuestion[] {
const allQuestions = this.generateBirthdayQuestions();
const filteredQuestions = allQuestions.filter(q => q.difficulty === difficulty);
const shuffled = filteredQuestions.sort(() => Math.random() - 0.5);
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/InteractiveGameService.ets#L380-L387 | 48122bca34c59ebf3c61d2db0af6a59dc2c66446 | github |
openharmony/xts_acts | 5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686 | arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/position/NavRouterView.ets | arkts | NavRouterView | Copyright (c) 2024 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Component
export struct NavRouterView {
@State isActive: boolean = false
@State dex: number = 0
@Link _position: Position;
private componentKey: string;
build() {
NavRouter() {
Row() {
Image($r('app.media.icon')).width(30).height(30).borderRadius(30).margin({ left: 3, right: 10 })
... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct NavRouterView AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right isActive : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_an... | @Component
export struct NavRouterView {
@State isActive: boolean = false
@State dex: number = 0
@Link _position: Position;
private componentKey: string;
build() {
NavRouter() {
Row() {
Image($r('app.media.icon')).width(30).height(30).borderRadius(30).margin({ left: 3, right: 10 })
... | https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_component_seven/ace_ets_component_common_seven_attrs_brightness/entry/src/main/ets/MainAbility/view/position/NavRouterView.ets#L16-L53 | 11cb36d64bbe6be56fa957b8c6c8f929d488a3ca | gitee |
sithvothykiv/dialog_hub.git | b676c102ef2d05f8994d170abe48dcc40cd39005 | custom_dialog/src/main/ets/model/system/ButtonOptions.ets | arkts | 按钮配置选项类。系统样式 | export class ButtonOptions {
/**
* 按钮显示文本内容
* @default ''
*/
value: ResourceStr = '';
/**
* 按钮点击事件回调函数(可选)
*/
action?: (index?: number) => void;
/**
* 按钮背景颜色(可选)
*/
background?: ResourceColor;
/**
* 按钮文本颜色(可选)
*/
fontColor?: ResourceColor;
/**
* 按钮样式模式(可选)
*/
buttonS... | AST#export_declaration#Left export AST#class_declaration#Left class ButtonOptions AST#class_body#Left { /**
* 按钮显示文本内容
* @default ''
*/ AST#property_declaration#Left value : AST#type_annotation#Left AST#primary_type#Left ResourceStr AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left '' AST#... | export class ButtonOptions {
value: ResourceStr = '';
action?: (index?: number) => void;
background?: ResourceColor;
fontColor?: ResourceColor;
buttonStyle?: ButtonStyleMode;
role?: ButtonRole;
} | https://github.com/sithvothykiv/dialog_hub.git/blob/b676c102ef2d05f8994d170abe48dcc40cd39005/custom_dialog/src/main/ets/model/system/ButtonOptions.ets#L4-L31 | d4f07e4c0310b57c4685c52b2a7f0c39462699e9 | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | picker_utils/src/main/ets/Utils.ets | arkts | getUriFromPath | 以同步方法获取文件URI。
@param path 应用沙箱路径
@returns | static getUriFromPath(path: string): string {
return fileUri.getUriFromPath(path);
} | AST#method_declaration#Left static getUriFromPath AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_... | static getUriFromPath(path: string): string {
return fileUri.getUriFromPath(path);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/picker_utils/src/main/ets/Utils.ets#L80-L82 | 7eefb1984f2b98db1c2636ef61e2096c3d51c64c | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/editaddress/src/main/ets/view/EditAddressView.ets | arkts | validForm | 保存时,校验表单从上到下每项必填的方法 | validForm(): boolean {
if (!this.addressForm.name) {
promptAction.showToast({ message: $r('app.string.editaddress_name_judge') });
return false;
}
if (!this.addressForm.phone) {
promptAction.showToast({ message: $r('app.string.editaddress_phone_judge') });
return false;
}
if ... | AST#method_declaration#Left validForm AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST... | validForm(): boolean {
if (!this.addressForm.name) {
promptAction.showToast({ message: $r('app.string.editaddress_name_judge') });
return false;
}
if (!this.addressForm.phone) {
promptAction.showToast({ message: $r('app.string.editaddress_phone_judge') });
return false;
}
if ... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/editaddress/src/main/ets/view/EditAddressView.ets#L173-L195 | 1b12e66275e54f832dfa89943caf053adc7fe027 | gitee |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/utils/CardComponent.ets | arkts | CardComponent | 功能描述:
1. 展示当前图片缩略图和大图,通过 isPhotoShow 标志位判断展示大图或缩略图
2. 单击卡片图片,进入全屏模态页面,展示为大图; 再次单击图片,展示为缩略图
3. 按压卡片图片,图片卡片缩小为原始缩略图的90%,按压抬起后恢复
实现原理:
1. 通过Image组件展示当前卡片缩略图,并通过geometryTransition使用id参数绑定两个组件转场关系,实现一镜到底动画
2. 自定义photoShowBuilder组件实现图片全屏模态展示
2. 通过给Image组件bindContentCover绑定全屏模态页面,点击图片实现转场
@param {CardInfo[]} [cardInfo] - 卡片... | @Component
export default struct CardComponent {
// 卡片数据,默认初始化
cardInfo: CardInfo = {
src: $r('app.media.panda'),
width: Constants.CARD_UNIT_LENGTH,
height: Constants.CARD_UNIT_LENGTH
};
// 卡片偏移量
@Prop cardOffset: number = 0;
// 当前卡片的序号
cardIndex: number = 0;
// Swiper 当前显示的卡片序号
@Prop show... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export default struct CardComponent AST#component_body#Left { // 卡片数据,默认初始化 AST#property_declaration#Left cardInfo : AST#type_annotation#Left AST#primary_type#Left CardInfo AST#primary_type#Right AST#type_annotation#Right = AST#exp... | @Component
export default struct CardComponent {
cardInfo: CardInfo = {
src: $r('app.media.panda'),
width: Constants.CARD_UNIT_LENGTH,
height: Constants.CARD_UNIT_LENGTH
};
@Prop cardOffset: number = 0;
cardIndex: number = 0;
@Prop showingCard: number = 0;
@Prop scaleList: number[... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/cardswiperanimation/src/main/ets/utils/CardComponent.ets#L37-L176 | f0e0b5a328656994f3f288bbd2da76e3ad44eefc | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/chat/AIAssistantPage.ets | arkts | buildInputArea | 构建输入区域 | @Builder
buildInputArea() {
Column() {
Divider()
.color($r('app.color.divider'))
.strokeWidth(0.5)
Row({ space: 12 }) {
// 语音按钮
Button() {
Image(this.isListening ? $r('app.media.ic_mic_on') : $r('app.media.ic_mic'))
.width('24vp')
.hei... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildInputArea AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_e... | @Builder
buildInputArea() {
Column() {
Divider()
.color($r('app.color.divider'))
.strokeWidth(0.5)
Row({ space: 12 }) {
Button() {
Image(this.isListening ? $r('app.media.ic_mic_on') : $r('app.media.ic_mic'))
.width('24vp')
.height('24... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/chat/AIAssistantPage.ets#L415-L479 | b0a5090206a68a66909cd71109341c1c35a342af | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/recommendation/RecommendationEngine.ets | arkts | getGreetingRecommendations | 获取祝福语推荐 | async getGreetingRecommendations(
contact: Contact,
occasion: string = 'birthday',
count: number = 5
): Promise<RecommendationItem[]> {
try {
const context: RecommendationContext = {
userId: 'default',
contactId: contact.id,
occasion,
relationship: contact.relatio... | AST#method_declaration#Left async getGreetingRecommendations AST#parameter_list#Left ( AST#parameter#Left contact : AST#type_annotation#Left AST#primary_type#Left Contact AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left occasion : AST#type_annotation#Left AST#primary_type#Left s... | async getGreetingRecommendations(
contact: Contact,
occasion: string = 'birthday',
count: number = 5
): Promise<RecommendationItem[]> {
try {
const context: RecommendationContext = {
userId: 'default',
contactId: contact.id,
occasion,
relationship: contact.relatio... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/recommendation/RecommendationEngine.ets#L355-L380 | 5a8e4a20bfaede0e42fb75981e720e94e2194690 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/view/OrderCommentPage.ets | arkts | getRatingText | 获取评分提示文案
@param {number} rating - 评分
@returns {string | Resource} 评分提示文案 | private getRatingText(rating: number): string | Resource {
if (rating <= 0) {
return $r("app.string.please_rate");
}
if (rating === 1) {
return $r("app.string.rating_very_poor");
}
if (rating === 2) {
return $r("app.string.rating_poor");
}
if (rating === 3) {
return $... | AST#method_declaration#Left private getRatingText AST#parameter_list#Left ( AST#parameter#Left rating : 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#Le... | private getRatingText(rating: number): string | Resource {
if (rating <= 0) {
return $r("app.string.please_rate");
}
if (rating === 1) {
return $r("app.string.rating_very_poor");
}
if (rating === 2) {
return $r("app.string.rating_poor");
}
if (rating === 3) {
return $... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderCommentPage.ets#L165-L182 | a34ad5efb39468ca0b8dde50fc9fc584e47834d7 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/bluetooth/src/main/ets/pages/HeartRate.ets | arkts | tooLow | 心率过低 | tooLow(): boolean {
return this.heartRate < HEART_RATE_TOO_LOW;
} | AST#method_declaration#Left tooLow AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#binary_expression#Left ... | tooLow(): boolean {
return this.heartRate < HEART_RATE_TOO_LOW;
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bluetooth/src/main/ets/pages/HeartRate.ets#L81-L83 | ea9461a31dd5cf5e69a24935f0f2339f56376fb9 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/network/src/main/ets/datasource/goods/GoodsNetworkDataSourceImpl.ets | arkts | getGoodsTypeList | 查询商品分类列表
@returns 商品分类列表响应 | async getGoodsTypeList(): Promise<NetworkResponse<Category[]>> {
const resp: AxiosResponse<NetworkResponse<Category[]>> =
await NetworkClient.http.post("goods/type/list");
return resp.data;
} | AST#method_declaration#Left async getGoodsTypeList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left NetworkResponse AST#type_arguments#Left < ... | async getGoodsTypeList(): Promise<NetworkResponse<Category[]>> {
const resp: AxiosResponse<NetworkResponse<Category[]>> =
await NetworkClient.http.post("goods/type/list");
return resp.data;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/network/src/main/ets/datasource/goods/GoodsNetworkDataSourceImpl.ets#L27-L31 | f7be248d34cdc5866ee821143a4762b53b0c4eff | github |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/designsystem/src/main/ets/component/Scroll.ets | arkts | 构建带大内边距的水平滚动布局
@returns {void} 无返回值 | build(): void {
HorizontalScroll({
scroller: this.scroller,
fillMaxSize: this.fillMaxSize,
fillMaxWidth: this.fillMaxWidth,
widthValue: this.widthValue,
heightValue: this.heightValue,
scrollBarState: this.scrollBarState,
paddingValue: $r("app.float.space_padding_large"),
... | AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#ui_custom_component_statement#Left HorizontalScroll ( AST#component_parameters#Left { AST#component_parameter#Left scroller : AST#expression#Left AST#member_ex... | build(): void {
HorizontalScroll({
scroller: this.scroller,
fillMaxSize: this.fillMaxSize,
fillMaxWidth: this.fillMaxWidth,
widthValue: this.widthValue,
heightValue: this.heightValue,
scrollBarState: this.scrollBarState,
paddingValue: $r("app.float.space_padding_large"),
... | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/designsystem/src/main/ets/component/Scroll.ets#L556-L567 | 074baed270e4b884b2ba615bf38c3fb41f320a4f | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/PieChartRenderer.ets | arkts | drawCenterText | draws the description text in the center of the pie chart makes most
sense when center-hole is enabled | protected drawCenterText(c: CanvasRenderingContext2D): void {
let centerText: string = this.mChart.getCenterText();
if (this.mChart.isDrawCenterTextEnabled() && centerText != null) {
let center: MPPointF = this.mChart.getCenterCircleBox();
let offset: MPPointF = this.mChart.getCenterTextOffset();... | AST#method_declaration#Left protected drawCenterText AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left v... | protected drawCenterText(c: CanvasRenderingContext2D): void {
let centerText: string = this.mChart.getCenterText();
if (this.mChart.isDrawCenterTextEnabled() && centerText != null) {
let center: MPPointF = this.mChart.getCenterCircleBox();
let offset: MPPointF = this.mChart.getCenterTextOffset();... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/PieChartRenderer.ets#L788-L837 | 4a1844e1d3e1287600fb850071f54a8143364a9c | gitee |
bigbear20240612/planner_build-.git | 89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1 | entry/src/main/ets/common/ThemeManager.ets | arkts | getCurrentTheme | 获取当前主题 | getCurrentTheme(): ThemeModel {
return this.currentTheme;
} | AST#method_declaration#Left getCurrentTheme AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ThemeModel AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expr... | getCurrentTheme(): ThemeModel {
return this.currentTheme;
} | https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/common/ThemeManager.ets#L75-L77 | 48b1439e16d9c0b1a900442599b60a1fc097c732 | github |
wustcat404/time-bar | d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8 | time_bar/src/main/ets/components/interface/VideoAreaOption.ets | arkts | Visual options of the "recording area" (colored bar) rendered on the time bar. | export interface VideoAreaOption {
/** Height of the recording strip in pixels. */
height: number;
/** Background fill for the strip. */
backgroundColor: string | number | CanvasGradient | CanvasPattern;
/**
* The offset of the video area from the top of the time-bar,
* with a maximum offset of the he... | AST#export_declaration#Left export AST#interface_declaration#Left interface VideoAreaOption AST#object_type#Left { /** Height of the recording strip in pixels. */ AST#type_member#Left height : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; ... | export interface VideoAreaOption {
height: number;
backgroundColor: string | number | CanvasGradient | CanvasPattern;
topOffset: number;
} | https://github.com/wustcat404/time-bar/blob/d876c3b10aa2538ee2ea0201b9a6fbaad9b693c8/time_bar/src/main/ets/components/interface/VideoAreaOption.ets#L18-L30 | f67e69453fed663c3d07f6c4ad7624c629d7cbc1 | gitee | |
open9527/OpenHarmony | fdea69ed722d426bf04e817ec05bff4002e81a4e | libs/web/src/main/ets/WebViewManager.ets | arkts | initDownloadDelegate | 初始化WebDownloadDelegate 下载任务的状态会通过该类的回调接口通知给用户
@param path
@param downloadDelegate
@param webviewController | private initDownloadDelegate(path: string, downloadDelegate: webview.WebDownloadDelegate,
webviewController: webview.WebviewController): void {
downloadDelegate.onBeforeDownload(async (item: webview.WebDownloadItem) => {
const fileName = item.getSuggestedFileName();
let savePath = `${path}/${fileNam... | AST#method_declaration#Left private initDownloadDelegate AST#parameter_list#Left ( AST#parameter#Left path : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left downloadDelegate : AST#type_annotation#Left AST#primary_type#Left A... | private initDownloadDelegate(path: string, downloadDelegate: webview.WebDownloadDelegate,
webviewController: webview.WebviewController): void {
downloadDelegate.onBeforeDownload(async (item: webview.WebDownloadItem) => {
const fileName = item.getSuggestedFileName();
let savePath = `${path}/${fileNam... | https://github.com/open9527/OpenHarmony/blob/fdea69ed722d426bf04e817ec05bff4002e81a4e/libs/web/src/main/ets/WebViewManager.ets#L78-L108 | 8aef7294d55364d5040c71323ab36d353c05c290 | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_speech/src/main/ets/TextReaderHelper.ets | arkts | playPrev | 播放上一篇文章。 | static playPrev(): boolean {
try {
TextReader.playPrev();
return true;
} catch (e) {
console.error(`TextReader failed to play previous article. Code: ${e.code}, message: ${e.message}`);
return false;
}
} | AST#method_declaration#Left static playPrev AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#try_statement#Left try AST#block_statement#Left { AST#statement#Lef... | static playPrev(): boolean {
try {
TextReader.playPrev();
return true;
} catch (e) {
console.error(`TextReader failed to play previous article. Code: ${e.code}, message: ${e.message}`);
return false;
}
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_speech/src/main/ets/TextReaderHelper.ets#L121-L129 | 7cc50cd60d987d37d6f13d657196acbe6dcebea7 | gitee |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | ETSUI/TransitionAnimation/entry/src/main/ets/viewmodel/AnimationModel.ets | arkts | Animation model. | export default class ClassifyModel {
imgRes: Resource;
url: string;
constructor(imgRes: Resource, url: string) {
this.imgRes = imgRes;
this.url = url;
}
} | AST#export_declaration#Left export default AST#class_declaration#Left class ClassifyModel AST#class_body#Left { AST#property_declaration#Left imgRes : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left u... | export default class ClassifyModel {
imgRes: Resource;
url: string;
constructor(imgRes: Resource, url: string) {
this.imgRes = imgRes;
this.url = url;
}
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/TransitionAnimation/entry/src/main/ets/viewmodel/AnimationModel.ets#L19-L27 | d75545f0b6d182d079387f83a913770bbb92a429 | gitee | |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_gcm_encryption_decryption/aes_gcm_encryption_decryption_synchronous.ets | arkts | decryptMessage | 解密消息 | function decryptMessage(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|GCM|PKCS7');
decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParams);
let decryptUpdate = decoder.updateSync(cipherText);
// gcm模式解密doFinal时传入空,... | AST#function_declaration#Left function decryptMessage AST#parameter_list#Left ( AST#parameter#Left symKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . SymKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left c... | function decryptMessage(symKey: cryptoFramework.SymKey, cipherText: cryptoFramework.DataBlob) {
let decoder = cryptoFramework.createCipher('AES128|GCM|PKCS7');
decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, symKey, gcmParams);
let decryptUpdate = decoder.updateSync(cipherText);
let decryptData = d... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceAesArkTs/entry/src/main/ets/pages/aes_gcm_encryption_decryption/aes_gcm_encryption_decryption_synchronous.ets#L59-L69 | 497b7a21d310adf9dd31611fbcc00997cb11773d | gitee |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/accuracy/flow_sensitive/loop_stmt/for_005_T.ets | arkts | Introduction 循环结构-for | export function for_005_T(taint_src : string) {
let res = ""
let i = 0
for (; i < 1; res = taint_src) {
taint.Sink(res)
}
} | AST#export_declaration#Left export AST#function_declaration#Left function for_005_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement#Left { AS... | export function for_005_T(taint_src : string) {
let res = ""
let i = 0
for (; i < 1; res = taint_src) {
taint.Sink(res)
}
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/accuracy/flow_sensitive/loop_stmt/for_005_T.ets#L6-L12 | beadf9379c242f0ffbbe22eb4facee5bf6a684f4 | github | |
ThePivotPoint/ArkTS-LSP-Server-Plugin.git | 6231773905435f000d00d94b26504433082ba40b | packages/declarations/ets/api/@ohos.arkui.advanced.EditableTitleBar.d.ets | arkts | Indicates the options of the editable title bar.
@interface EditableTitleBarOptions
@syscap SystemCapability.ArkUI.ArkUI.Full
@crossplatform
@atomicservice
@since 12 | export declare interface EditableTitleBarOptions {
/**
* Background color.
*
* @type { ?ResourceColor }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
backgroundColor?: ResourceColor;
/**
* Background blur style.
... | AST#export_declaration#Left export AST#ERROR#Left declare AST#ERROR#Right AST#interface_declaration#Left interface EditableTitleBarOptions AST#object_type#Left { /**
* Background color.
*
* @type { ?ResourceColor }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservi... | export declare interface EditableTitleBarOptions {
backgroundColor?: ResourceColor;
backgroundBlurStyle?: BlurStyle;
safeAreaTypes?: Array<SafeAreaType>;
safeAreaEdges?: Array<SafeAreaEdge>;
} | https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.EditableTitleBar.d.ets#L138-L179 | 19a575167bacaa40bb5704f40dec53490664957c | github | |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/MoneyTrack-master/commons/commonlib/src/main/ets/utils/router/Router.ets | arkts | closeDialog | 关闭全局弹窗 | public static closeDialog<T>(result?: DialogInfo<T>) {
try {
RouterModule._stack.pop(result);
} catch (err) {
Logger.error(TAG, 'close dialog failed::' + JSON.stringify(err));
}
} | AST#method_declaration#Left public static closeDialog AST#type_parameters#Left < AST#type_parameter#Left T AST#type_parameter#Right > AST#type_parameters#Right AST#parameter_list#Left ( AST#parameter#Left result ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left DialogInfo AST#type_arguments#Left ... | public static closeDialog<T>(result?: DialogInfo<T>) {
try {
RouterModule._stack.pop(result);
} catch (err) {
Logger.error(TAG, 'close dialog failed::' + JSON.stringify(err));
}
} | 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#L61-L67 | 939648bd38a529a4a08274eeb577aa4142ba267d | github |
gracienewd/openharmony-App-YunmoAi.git | 181952ab00aab5025a81b7b3a6b88d2a5258c76a | entry/src/main/ets/common/utils/AssetUtils.ets | arkts | updateAssetMap | 更新数据
@param query 要更新的索引数据集
@param attrsToUpdate 要更新的数据集
@returns Promise<AssetStoreResult> 表示添加操作的异步结果 | public static async updateAssetMap(query: asset.AssetMap, attrsToUpdate: asset.AssetMap): Promise<AssetStoreResult> {
try {
if (canIUse("SystemCapability.Security.Asset")) {
await asset.update(query, attrsToUpdate);
return { isSuccess: true };
}
return { isSuccess: false, error: As... | AST#method_declaration#Left public static async updateAssetMap AST#parameter_list#Left ( AST#parameter#Left query : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left asset . AssetMap AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left a... | public static async updateAssetMap(query: asset.AssetMap, attrsToUpdate: asset.AssetMap): Promise<AssetStoreResult> {
try {
if (canIUse("SystemCapability.Security.Asset")) {
await asset.update(query, attrsToUpdate);
return { isSuccess: true };
}
return { isSuccess: false, error: As... | https://github.com/gracienewd/openharmony-App-YunmoAi.git/blob/181952ab00aab5025a81b7b3a6b88d2a5258c76a/entry/src/main/ets/common/utils/AssetUtils.ets#L249-L262 | 0f623bcca4954135689a4b84ec8665edcb4be88c | github |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/pages/common.ets | arkts | webBuilder | @Builder中为动态组件的具体组件内容 | @Builder
function webBuilder(data:Data) {
Web({ src: data.url, controller: data.webController })
.width('100%')
.height('100%')
.borderStyle(BorderStyle.Dashed)
.borderWidth(2)
} | AST#decorated_function_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right function webBuilder AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Data AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder... | @Builder
function webBuilder(data:Data) {
Web({ src: data.url, controller: data.webController })
.width('100%')
.height('100%')
.borderStyle(BorderStyle.Dashed)
.borderWidth(2)
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/ManageWebPageLoadBrowse/NetReqInterceptCacheWinOps/entry3/src/main/ets/pages/common.ets#L36-L43 | b4706a44dc01439dc17076453b8f0772fe563cba | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/TodoTypes.ets | arkts | 变更记录接口 | export interface ChangeRecord {
title?: ChangeValue;
description?: ChangeValue;
date?: ChangeValue;
time?: ChangeValue;
type?: ChangeValue;
priority?: ChangeValue;
status?: ChangeValue;
tags?: ChangeValue;
isAllDay?: ChangeValue;
reminder?: ChangeValue;
reminderTime?: ChangeValue;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface ChangeRecord AST#object_type#Left { AST#type_member#Left title ? : AST#type_annotation#Left AST#primary_type#Left ChangeValue AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left description ? : AST#type... | export interface ChangeRecord {
title?: ChangeValue;
description?: ChangeValue;
date?: ChangeValue;
time?: ChangeValue;
type?: ChangeValue;
priority?: ChangeValue;
status?: ChangeValue;
tags?: ChangeValue;
isAllDay?: ChangeValue;
reminder?: ChangeValue;
reminderTime?: ChangeValue;
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/TodoTypes.ets#L182-L194 | 8999841c56707aade25c972c0be829439f5652eb | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Speech/Wave/WaveView.ets | arkts | aboutToDisappear | ===================== 生命周期方法 =====================
组件销毁时停止动画(避免资源泄漏) | aboutToDisappear() {
if (this.animId !== 0) {
this.cancelAnimationFrame(this.animId); // 取消动画帧
this.animId = 0; // 重置动画ID
}
} | AST#method_declaration#Left aboutToDisappear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#... | aboutToDisappear() {
if (this.animId !== 0) {
this.cancelAnimationFrame(this.animId);
this.animId = 0;
}
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Wave/WaveView.ets#L20-L25 | 75327c91454fe1f66d0b46599d2414472eb8197d | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/WindowUtil.ets | arkts | getWindowStatus | 获取当前应用窗口的模式。
@param windowClass 不传该值,默认主窗口。
@returns | static getWindowStatus(windowClass: window.Window = AppUtil.getMainWindow()): window.WindowStatusType {
return windowClass.getWindowStatus();
} | AST#method_declaration#Left static getWindowStatus AST#parameter_list#Left ( AST#parameter#Left windowClass : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left window . Window AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expression#Left AS... | static getWindowStatus(windowClass: window.Window = AppUtil.getMainWindow()): window.WindowStatusType {
return windowClass.getWindowStatus();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/WindowUtil.ets#L325-L327 | 728e60401c39d91be279d96ea12e1a621586c696 | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/storage_tools.ets | arkts | Converts an ArrayBuffer to sendableImage.PixelMap object.
@param buf the ArrayBuffer
@returns an image.PixelMap | export function arrayBuffer_2_sendable_pixelMap(buf: ArrayBuffer) {
// ArrayBuffer => PixelMap
const imageSource = sendableImage.createImageSource(buf);
console.log('imageSource: ' + JSON.stringify(imageSource));
return imageSource.createPixelMap({}).then((pm) => {
let pixelMap = pm;
return pixelMap;
... | AST#export_declaration#Left export AST#function_declaration#Left function arrayBuffer_2_sendable_pixelMap AST#parameter_list#Left ( AST#parameter#Left buf : AST#type_annotation#Left AST#primary_type#Left ArrayBuffer AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#bloc... | export function arrayBuffer_2_sendable_pixelMap(buf: ArrayBuffer) {
const imageSource = sendableImage.createImageSource(buf);
console.log('imageSource: ' + JSON.stringify(imageSource));
return imageSource.createPixelMap({}).then((pm) => {
let pixelMap = pm;
return pixelMap;
}).finally(() => {
ima... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L778-L789 | 6cc6b7d6f9972c43394ba606ad030bb26052caa9 | gitee | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/DisplayUtils.ets | arkts | 屏幕信息工具类
@description 提供默认屏幕信息的便捷访问(支持px和vp单位) | export class DisplayUtils {
private static _defaultDisplay: display.Display = display.getDefaultDisplaySync();
/**
* 获取默认屏幕信息
*/
public static getDefaultDisplay(): display.Display {
return DisplayUtils._defaultDisplay;
}
// px单位方法(保持原有)
public static getScreenWidthPx(): number {
return Displ... | AST#export_declaration#Left export AST#class_declaration#Left class DisplayUtils AST#class_body#Left { AST#property_declaration#Left private static _defaultDisplay : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left display . Display AST#qualified_type#Right AST#primary_type#Right AST#type_annotati... | export class DisplayUtils {
private static _defaultDisplay: display.Display = display.getDefaultDisplaySync();
public static getDefaultDisplay(): display.Display {
return DisplayUtils._defaultDisplay;
}
public static getScreenWidthPx(): number {
return DisplayUtils._defaultDisplay.width;
}
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/DisplayUtils.ets#L7-L87 | 6b60533e93e1acc050e7bc5b71584f56a8c1e403 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordManager.ets | arkts | isExistsSound | ===================== 数据库操作 ===================== | async isExistsSound(soundName: string): Promise<boolean> {
const sound = await SpeechRecordDbAccessor.shared.getRecordSound(soundName)
return (sound?.pronData) != null;
} | AST#method_declaration#Left async isExistsSound AST#parameter_list#Left ( AST#parameter#Left soundName : 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... | async isExistsSound(soundName: string): Promise<boolean> {
const sound = await SpeechRecordDbAccessor.shared.getRecordSound(soundName)
return (sound?.pronData) != null;
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/components/Speech/Recorder/SpeechRecordManager.ets#L345-L348 | e34a77113803f3963a60e66d950baad37ccd6e4f | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_core/src/main/ets/core/util/Base64Util.ets | arkts | encodeToStrSync | 将Uint8Array转化为字符串-同步
@param array Uint8Array数组
@returns 转码后的字符串 | static encodeToStrSync(array: Uint8Array, options?: util.Type): string {
let base64 = new util.Base64Helper();
let result = base64.encodeToStringSync(array, options);
return result;
} | AST#method_declaration#Left static encodeToStrSync AST#parameter_list#Left ( AST#parameter#Left array : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left options ? : AST#type_annotation#Left AST#primary_type#Left AST#quali... | static encodeToStrSync(array: Uint8Array, options?: util.Type): string {
let base64 = new util.Base64Helper();
let result = base64.encodeToStringSync(array, options);
return result;
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_core/src/main/ets/core/util/Base64Util.ets#L51-L55 | 7e3a126abf327da09d67d357702c8e1baeaf7963 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets | arkts | abiList | 应用二进制接口(Abi)列表 | static abiList(): string {
return deviceInfo.abiList
} | AST#method_declaration#Left static abiList AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_expressio... | static abiList(): string {
return deviceInfo.abiList
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L99-L101 | 599d693f0bf82b964f1e5c33e9659d2e3bb35aaf | gitee |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2.ets | arkts | decode | 解密
@param decodeStr 待解密的字符串
@param priKey SM2私钥 | static async decode(str: string, priKey: string): Promise<OutDTO<string>> {
return CryptoUtil.decodeAsym(str, priKey, 'SM2_256', 'SM2_256|SM3', 256);
} | AST#method_declaration#Left static async decode AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left priKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty... | static async decode(str: string, priKey: string): Promise<OutDTO<string>> {
return CryptoUtil.decodeAsym(str, priKey, 'SM2_256', 'SM2_256|SM3', 256);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2.ets#L51-L53 | 10f28c707f6e04da4430bee6738ff7733f8e0bf0 | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets | arkts | publicDeleteKeyFunc | 调用deleteKeyItem删除密钥操作 | async function publicDeleteKeyFunc(keyAlias: string, huksOptions: huks.HuksOptions) {
console.info(`enter promise deleteKeyItem`);
let throwObject: ThrowObject = { isThrow: false };
try {
await deleteKeyItem(keyAlias, huksOptions, throwObject)
.then((data) => {
console.info(`promise: deleteKeyIt... | AST#function_declaration#Left async function publicDeleteKeyFunc AST#parameter_list#Left ( AST#parameter#Left keyAlias : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left huksOptions : AST#type_annotation#Left AST#primary_type... | async function publicDeleteKeyFunc(keyAlias: string, huksOptions: huks.HuksOptions) {
console.info(`enter promise deleteKeyItem`);
let throwObject: ThrowObject = { isThrow: false };
try {
await deleteKeyItem(keyAlias, huksOptions, throwObject)
.then((data) => {
console.info(`promise: deleteKeyIt... | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/UniversalKeystoreKit/KeyUsage/KeyExchange/entry/src/main/ets/pages/X25519.ets#L345-L365 | b6cf81b724d7a0a04f242180b372538e58ed3d6b | gitee |
openharmony/applications_app_samples | a826ab0e75fe51d028c1c5af58188e908736b53b | code/SystemFeature/Media/Camera/entry/src/main/ets/pages/Camera.ets | arkts | videoEvent | 录像事件 | videoEvent() {
if (this.currentModel === CameraMode.modePhoto) {
animateTo(this.animateParam, () => {
this.isPointShow = false;
this.textMove = this.textMove - 56;
});
this.currentModel = CameraMode.modeVideo;
this.imageThumbnail = '';
}
} | AST#method_declaration#Left videoEvent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#member_expression#Left AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left... | videoEvent() {
if (this.currentModel === CameraMode.modePhoto) {
animateTo(this.animateParam, () => {
this.isPointShow = false;
this.textMove = this.textMove - 56;
});
this.currentModel = CameraMode.modeVideo;
this.imageThumbnail = '';
}
} | https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Media/Camera/entry/src/main/ets/pages/Camera.ets#L210-L219 | caa3d00ce5d7a0cec78413d3b6bbad0d8fdb4fe9 | gitee |
pangpang20/wavecast.git | d3da8a0009eb44a576a2b9d9d9fe6195a2577e32 | entry/src/main/ets/service/PlayerService.ets | arkts | 定时器开始时间戳 | private constructor() {} | AST#constructor_declaration#Left private constructor AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { } AST#block_statement#Right AST#constructor_declaration#Right | private constructor() {} | https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/service/PlayerService.ets#L40-L40 | c222736aa0fbb02de638c87dda8440c50aaf2f68 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/services/analytics/AnalyticsService.ets | arkts | 使用情况统计 | export interface UsageStats {
dailyActiveTime: number;
weeklyActiveTime: number;
monthlyActiveTime: number;
totalLaunches: number;
averageSessionDuration: number;
featureUsage: { feature: string; count: number; percentage: number } | AST#export_declaration#Left export AST#interface_declaration#Left interface UsageStats AST#ERROR#Left { AST#type_member#Left dailyActiveTime : 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 weeklyActiveTime : AST#type_a... | export interface UsageStats {
dailyActiveTime: number;
weeklyActiveTime: number;
monthlyActiveTime: number;
totalLaunches: number;
averageSessionDuration: number;
featureUsage: { feature: string; count: number; percentage: number } | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/services/analytics/AnalyticsService.ets#L69-L75 | af5a22ad041de2f280486d8a57a5c779346aa705 | github | |
Application-Security-Automation/Arktan.git | 3ad9cb05235e38b00cd5828476aa59a345afa1c0 | dataset/completeness/expression/this_expression/this_expression_001_T.ets | arkts | Introduction this表达式 | export function this_expression_001_T(taint_src : string) {
let a = new A(taint_src);
taint.Sink(a.getValue());
} | AST#export_declaration#Left export AST#function_declaration#Left function this_expression_001_T AST#parameter_list#Left ( AST#parameter#Left taint_src : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_stateme... | export function this_expression_001_T(taint_src : string) {
let a = new A(taint_src);
taint.Sink(a.getValue());
} | https://github.com/Application-Security-Automation/Arktan.git/blob/3ad9cb05235e38b00cd5828476aa59a345afa1c0/dataset/completeness/expression/this_expression/this_expression_001_T.ets#L7-L11 | de573d40377451c8e5fc011b4e63a23df6cfddc0 | github | |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/GreetingsPage.ets | arkts | loadGreetings | 加载祝福语数据 | private async loadGreetings(): Promise<void> {
try {
this.loading = true;
this.greetings = await this.greetingService.searchGreetings({
pageSize: 1000 // 加载所有祝福语
} as GreetingSearchParams);
this.applyFilters();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConst... | AST#method_declaration#Left private async loadGreetings 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... | private async loadGreetings(): Promise<void> {
try {
this.loading = true;
this.greetings = await this.greetingService.searchGreetings({
pageSize: 1000
} as GreetingSearchParams);
this.applyFilters();
} catch (error) {
hilog.error(LogConstants.DOMAIN_APP, LogConstants.TAG_A... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/GreetingsPage.ets#L44-L56 | 3311851129de468e135330ecb8776a64f7ee8bbb | github |
openharmony/arkui_ace_engine | 30c7d1ee12fbedf0fabece54291d75897e2ad44f | examples/Overlay/entry/src/main/ets/pages/components/menu/stackMenuAvoid.ets | arkts | stackMenuAvoidBuilder | Copyright (c) 2025 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | @Builder
export function stackMenuAvoidBuilder(name: string, param: Object) {
stackMenuAvoidExample()
} | AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function stackMenuAvoidBuilder 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... | @Builder
export function stackMenuAvoidBuilder(name: string, param: Object) {
stackMenuAvoidExample()
} | https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/pages/components/menu/stackMenuAvoid.ets#L16-L19 | b021f49e66b08f667f938386505f108937cba62b | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/i18n/LanguageDetector.ets | arkts | recommendLanguages | 智能语言推荐 | async recommendLanguages(currentLanguage: SupportedLanguage): Promise<SupportedLanguage[]> {
try {
const recommendations: SupportedLanguage[] = [];
// 1. 基于系统语言推荐
const systemResult = await this.detectSystemLanguage();
if (systemResult.detectedLanguage !== currentLanguage) {
r... | AST#method_declaration#Left async recommendLanguages AST#parameter_list#Left ( AST#parameter#Left currentLanguage : AST#type_annotation#Left AST#primary_type#Left SupportedLanguage AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type... | async recommendLanguages(currentLanguage: SupportedLanguage): Promise<SupportedLanguage[]> {
try {
const recommendations: SupportedLanguage[] = [];
const systemResult = await this.detectSystemLanguage();
if (systemResult.detectedLanguage !== currentLanguage) {
recommendations... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/i18n/LanguageDetector.ets#L306-L337 | 63d2c244a899054e5caa8538f08b9bb992c8c374 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/basedict/utils/StringDealUtilityForBaseWord.ets | arkts | removedDuplicationsWithSeperator | /去重(按指定的符号分割后,去除重复的内容) | public static removedDuplicationsWithSeperator(
srcStr: string | null,
seperator: string,
subSeperator: string
): string | null {
if (srcStr === null) {
return null;
}
const tempList: Array<string> = [];
return StringDealUtilityForBaseWord.dealInternal(
srcStr,
seperat... | AST#method_declaration#Left public static removedDuplicationsWithSeperator AST#parameter_list#Left ( AST#parameter#Left srcStr : 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#R... | public static removedDuplicationsWithSeperator(
srcStr: string | null,
seperator: string,
subSeperator: string
): string | null {
if (srcStr === null) {
return null;
}
const tempList: Array<string> = [];
return StringDealUtilityForBaseWord.dealInternal(
srcStr,
seperat... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/basedict/utils/StringDealUtilityForBaseWord.ets#L54-L79 | 9cfaded8639dbc8e78f2e4a414e2d51d7814795d | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets | arkts | getOriginDataArray | 获取数据源 | public getOriginDataArray(): T[] {
return this.originDataArray;
} | AST#method_declaration#Left public getOriginDataArray AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left T [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#L... | public getOriginDataArray(): T[] {
return this.originDataArray;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/LazyIDataSource/BasicDataSource.ets#L20-L22 | d4f42dab9282eff4abff168bc8e602f6b85a73ee | github |
JHB11Hinson/mineMointorAPP.git | b6b853cf534021ac39e66c9b3a35113896a272b2 | entry/src/main/ets/pages/WorkerMonitoringPage.ets | arkts | aboutToAppear | 组件挂载时获取数据 | aboutToAppear() {
this.fetchData();
} | AST#method_declaration#Left aboutToAppear 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 . fetchData AST#member_e... | aboutToAppear() {
this.fetchData();
} | https://github.com/JHB11Hinson/mineMointorAPP.git/blob/b6b853cf534021ac39e66c9b3a35113896a272b2/entry/src/main/ets/pages/WorkerMonitoringPage.ets#L16-L18 | fe29f5ea307665fa3ae7d25d9d4738e255684135 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_web/src/main/ets/arkweb/ArkWebHelper.ets | arkts | fetchCookieSync | 获取指定url对应cookie的值。
@param url 要获取的cookie所属的url,建议使用完整的url。
@param incognito true表示获取隐私模式下webview的内存cookies,false表示正常非隐私模式下的cookies。
@returns | static fetchCookieSync(url: string, incognito?: boolean): string {
return webview.WebCookieManager.fetchCookieSync(url, incognito);
} | AST#method_declaration#Left static fetchCookieSync AST#parameter_list#Left ( AST#parameter#Left url : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left incognito ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#p... | static fetchCookieSync(url: string, incognito?: boolean): string {
return webview.WebCookieManager.fetchCookieSync(url, incognito);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkWebHelper.ets#L116-L118 | dde634d340cfd8fea40e744b7fa661248563c115 | gitee |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/iab/huawei/HwSubscriber.ets | arkts | restore | /启动时,默认执行一次自动恢复 | async restore(){
// 查询当前有效的订阅订单
///已购买但未交付的消耗型商品、非消耗型商品、自动续期订阅商品和非续期订阅商品。
await this.queryPurchases(iap.PurchaseQueryType.ALL);
} | AST#method_declaration#Left async restore 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#expressio... | async restore(){
await this.queryPurchases(iap.PurchaseQueryType.ALL);
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/iab/huawei/HwSubscriber.ets#L104-L108 | 397eb9883c3946428e0c6ccfe47651d14d3ab22d | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/crypto/RSA.ets | arkts | verifySegmentSync | 对数据进行分段验签,同步
@param data 待验签数据
@param signDataBlob 签名数据
@param pubKey 公钥
@param algName 指定签名算法(RSA1024|PKCS1|SHA256、RSA2048|PKCS1|SHA256、、等)。
@param len 自定义的数据拆分长度,此处取64
@returns | static verifySegmentSync(data: Uint8Array, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|SHA256', len: number = 64): boolean {
return CryptoUtil.verifySegmentSync(data, signDataBlob, pubKey, algName, len);
} | AST#method_declaration#Left static verifySegmentSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left Uint8Array AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left signDataBlob : AST#type_annotation#Left AST#primary_type#Left AST#q... | static verifySegmentSync(data: Uint8Array, signDataBlob: cryptoFramework.DataBlob, pubKey: cryptoFramework.PubKey, algName: string = 'RSA1024|PKCS1|SHA256', len: number = 64): boolean {
return CryptoUtil.verifySegmentSync(data, signDataBlob, pubKey, algName, len);
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/RSA.ets#L326-L328 | 75c5d5c94dfecc8dedc80a73f7e3aa19256dd764 | gitee |
liuchao0739/arkTS_universal_starter.git | 0ca845f5ae0e78db439dc09f712d100c0dd46ed3 | entry/src/main/ets/core/device/DeviceManager.ets | arkts | getDeviceId | 获取设备唯一标识 | async getDeviceId(): Promise<string> {
try {
const info = await this.getDeviceInfo();
// 使用设备序列号或生成唯一ID
return info.serial || `device_${Date.now()}`;
} catch (error) {
Logger.error('DeviceManager', `Failed to get device ID: ${String(error)}`);
return `device_${Date.now()}`;
}
... | AST#method_declaration#Left async getDeviceId AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right > AST#type_ar... | async getDeviceId(): Promise<string> {
try {
const info = await this.getDeviceInfo();
return info.serial || `device_${Date.now()}`;
} catch (error) {
Logger.error('DeviceManager', `Failed to get device ID: ${String(error)}`);
return `device_${Date.now()}`;
}
} | https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/core/device/DeviceManager.ets#L232-L241 | f9ddc83246388848935597bf39398f11eef46765 | github |
yunkss/ef-tool | 75f6761a0f2805d97183504745bf23c975ae514d | ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets | arkts | generateSM2Key | 生成SM2的非对称密钥
@param resultCoding 返回结果编码方式(hex/base64)-默认不传为base64格式
@returns SM2密钥{publicKey:公钥,privateKey:私钥} | static generateSM2Key(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> {
return CryptoSyncUtil.generateCryptoKey('SM2_256', resultCoding);
} | AST#method_declaration#Left static generateSM2Key AST#parameter_list#Left ( AST#parameter#Left resultCoding : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left buffer . BufferEncoding AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 'base64' AST#expres... | static generateSM2Key(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> {
return CryptoSyncUtil.generateCryptoKey('SM2_256', resultCoding);
} | https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/sm2/SM2Sync.ets#L34-L36 | 1569290d7577c6e0a43ab04a0832a496c41d9885 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/greetings/GreetingSendPage.ets | arkts | aboutToAppear | 页面生命周期 - 即将出现 | aboutToAppear() {
// 获取路由参数
const params = appRouter.getCurrentParams();
const paramsRecord = params as Record<string, string>;
this.contactId = paramsRecord.contactId;
this.greetingId = paramsRecord.greetingId;
if (this.contactId) {
this.initializePage();
} else {
hilog.err... | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { // 获取路由参数 AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left params = AST#expression#Left AST#call_expression#Left AST#expression#Left AST#member_expression#Left AST... | aboutToAppear() {
const params = appRouter.getCurrentParams();
const paramsRecord = params as Record<string, string>;
this.contactId = paramsRecord.contactId;
this.greetingId = paramsRecord.greetingId;
if (this.contactId) {
this.initializePage();
} else {
hilog.error(LogCon... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/greetings/GreetingSendPage.ets#L43-L56 | 2716266c6aed2b5983eaec05a6f4978bcda738df | github |
openharmony/codelabs | d899f32a52b2ae0dfdbb86e34e8d94645b5d4090 | Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets | arkts | rectToPoints | Get rectangle endpoints.
@param rect
@returns | static rectToPoints(rect: RectF): Array<Point> {
let points: Array<Point> = [];
points.push(new Point(rect.left, rect.top));
points.push(new Point(rect.right, rect.top));
points.push(new Point(rect.right, rect.bottom));
points.push(new Point(rect.left, rect.bottom));
return points;
} | AST#method_declaration#Left static rectToPoints AST#parameter_list#Left ( AST#parameter#Left rect : AST#type_annotation#Left AST#primary_type#Left RectF AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ... | static rectToPoints(rect: RectF): Array<Point> {
let points: Array<Point> = [];
points.push(new Point(rect.left, rect.top));
points.push(new Point(rect.right, rect.top));
points.push(new Point(rect.right, rect.bottom));
points.push(new Point(rect.left, rect.bottom));
return points;
} | https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Media/ImageEdit/entry/src/main/ets/utils/MathUtils.ets#L62-L69 | c1cb489db05848439467652d07bfbda67441062e | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/user/src/main/ets/view/ProfilePage.ets | arkts | SecurityCard | 安全设置卡片
@returns {void} 无返回值 | @Builder
private SecurityCard(): void {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
title: $r("app.string.change_password"),
hasBorder: true,
isLink: true,
cellPadd... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private SecurityCard AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_... | @Builder
private SecurityCard(): void {
Card() {
IBestCellGroup({
inset: true,
radius: $r("app.float.radius_medium"),
outerMargin: 0
}) {
IBestCell({
title: $r("app.string.change_password"),
hasBorder: true,
isLink: true,
cellPadd... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/view/ProfilePage.ets#L191-L214 | bee9fc185f994d9de1a803ab6ec59f9bebef6a16 | github |
BohanSu/LumosAgent-HarmonyOS.git | 9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76 | entry/src/main/ets/services/ConfigService.ets | arkts | saveApiKey | 保存API密钥
@param apiKey - API密钥 | async saveApiKey(apiKey: string): Promise<void> {
if (!this.dataPreferences) {
throw new Error('配置服务未初始化');
}
try {
// 验证API密钥格式
if (!this.validateApiKey(apiKey)) {
throw new Error('API密钥格式无效');
}
await this.dataPreferences.put(ConfigService.KEY_API_KEY, apiKey);
... | AST#method_declaration#Left async saveApiKey AST#parameter_list#Left ( AST#parameter#Left apiKey : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ... | async saveApiKey(apiKey: string): Promise<void> {
if (!this.dataPreferences) {
throw new Error('配置服务未初始化');
}
try {
if (!this.validateApiKey(apiKey)) {
throw new Error('API密钥格式无效');
}
await this.dataPreferences.put(ConfigService.KEY_API_KEY, apiKey);
await this... | https://github.com/BohanSu/LumosAgent-HarmonyOS.git/blob/9eee81c93b67318d9c1c5d5a831ffc1c1fa08e76/entry/src/main/ets/services/ConfigService.ets#L127-L148 | a2521bd22fa9a4dab295f624335c716bdac4aef3 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/services/game/InteractiveGameService.ets | arkts | 游戏配置接口 | export interface GameConfig {
id: string;
type: GameType;
name: string;
description: string;
difficulty: GameDifficulty;
icon: string;
maxTime: number; // 最大游戏时间(秒)
maxAttempts: number; // 最大尝试次数
pointsReward: number; // 积分奖励
energyCost: number; // 能量消耗
unlockLevel: number;... | AST#export_declaration#Left export AST#interface_declaration#Left interface GameConfig 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#Left AST#... | export interface GameConfig {
id: string;
type: GameType;
name: string;
description: string;
difficulty: GameDifficulty;
icon: string;
maxTime: number;
maxAttempts: number;
pointsReward: number;
energyCost: number;
unlockLevel: number;
rules: string[]; ... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/InteractiveGameService.ets#L51-L65 | fa0226e070e2911d975fed8aa6543bfe8a98ed84 | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets | arkts | addData | 改变单个数据
@param index
@param data | public addData(index: number, data: Comment): void {
this.commentArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | AST#method_declaration#Left public addData 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 data : AST#type_annotation#Left AST#primary_type#Left Comment AST#primary_type#R... | public addData(index: number, data: Comment): void {
this.commentArray.splice(index, 0, data);
this.notifyDataAdd(index);
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/webpagesnapshot/src/main/ets/components/model/DataModel.ets#L56-L59 | 2f5eb17b946581413375d61c18a4372d2d2764ca | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/viewmodel/HomeViewModel.ets | arkts | @file 首页 ViewModel
@author Joker.X | @ObservedV2
export default class HomeViewModel extends BaseNetWorkListViewModel<Goods> {
/**
* 商品仓库
*/
private goodsRepository: GoodsRepository = new GoodsRepository();
/**
* 页面数据仓库
*/
private pageRepository: PageRepository = new PageRepository();
/**
* 首页页面数据
*/
@Trace
pageData: Home = ... | AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class HomeViewModel extends AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BaseNetWorkListViewModel AST#type_arguments#Left < AST#type_annotation#Left AST#primary_typ... | @ObservedV2
export default class HomeViewModel extends BaseNetWorkListViewModel<Goods> {
private goodsRepository: GoodsRepository = new GoodsRepository();
private pageRepository: PageRepository = new PageRepository();
@Trace
pageData: Home = new Home();
protected requestListData(): Promise<Networ... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/viewmodel/HomeViewModel.ets#L10-L90 | cb6d917d91920d3d31ffd5f514213104ae174a74 | github | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/ui/src/main/ets/component/goods/OrderGoodsItem.ets | arkts | 构建订单商品条目
@returns {void} 无返回值 | build(): void {
RowStartCenter({
widthValue: P100,
paddingValue: {
left: this.selectSlot ? 0 : $r("app.float.space_horizontal_large"),
right: $r("app.float.space_horizontal_large"),
bottom: $r("app.float.space_vertical_large")
}
}) {
// 选择框插槽(购物车场景)
if (this... | AST#build_method#Left build ( ) : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left RowStartCenter ( AST#component_parameters#Left { AST#component_parameter#Left wi... | build(): void {
RowStartCenter({
widthValue: P100,
paddingValue: {
left: this.selectSlot ? 0 : $r("app.float.space_horizontal_large"),
right: $r("app.float.space_horizontal_large"),
bottom: $r("app.float.space_vertical_large")
}
}) {
if (this.selectSlot) {
... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/ui/src/main/ets/component/goods/OrderGoodsItem.ets#L71-L158 | f69b2106003de97623baad9ac90543f0c17e7311 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/hosts/bunch_of_settings.ets | arkts | register_setting | Private stuffs
Registers a setting
@param key A string, the key of the setting.
@param type A string, indicating the data type of the setting. Allow 'string' | 'number' | 'boolean'.
@param value A string, sets the default (initial) value of the setting.
@example bunch_of_settings.register_setting('sys_back_access_back... | private static register_setting(key: string, type: string, value: string) {
bunch_of_settings.settings_defaults_key.push(key);
bunch_of_settings.settings_defaults_type.push(type);
bunch_of_settings.settings_defaults_value.push(value);
} | AST#method_declaration#Left private static register_setting AST#parameter_list#Left ( AST#parameter#Left key : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left type : AST#type_annotation#Left AST#primary_type#Left string AST#... | private static register_setting(key: string, type: string, value: string) {
bunch_of_settings.settings_defaults_key.push(key);
bunch_of_settings.settings_defaults_type.push(type);
bunch_of_settings.settings_defaults_value.push(value);
} | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/hosts/bunch_of_settings.ets#L307-L311 | 0bc1541665bccff5db61ab7b57c44710fbdda547 | gitee |
kumaleap/ArkSwipeDeck.git | 5afa77b9b2a2a531595d31f895c54a3371e4249a | library/src/main/ets/components/SwipeCardStack.ets | arkts | getCardScale | 获取卡片缩放 | private getCardScale(stackIndex: number, dataIndex: number): ScaleOptions {
if (dataIndex === this.currentIndex) {
// 当前卡片
const scaleOptions: ScaleOptions = {
x: this.topCardAnimation.scale,
y: this.topCardAnimation.scale,
z: 1
};
return scaleOptions;
} else if (... | AST#method_declaration#Left private getCardScale AST#parameter_list#Left ( AST#parameter#Left stackIndex : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dataIndex : AST#type_annotation#Left AST#primary_type#Left number AST... | private getCardScale(stackIndex: number, dataIndex: number): ScaleOptions {
if (dataIndex === this.currentIndex) {
const scaleOptions: ScaleOptions = {
x: this.topCardAnimation.scale,
y: this.topCardAnimation.scale,
z: 1
};
return scaleOptions;
} else if (dataInd... | https://github.com/kumaleap/ArkSwipeDeck.git/blob/5afa77b9b2a2a531595d31f895c54a3371e4249a/library/src/main/ets/components/SwipeCardStack.ets#L305-L336 | d07201394f9c91261f26b2e0d475ccdcd6bd7ea7 | github |
lime-zz/Ark-ui_RubbishRecycleApp.git | c2a9bff8fbb5bc46d922934afad0327cc1696969 | rubbish/rubbish/entry/src/main/ets/pages/usemoney.ets | arkts | allView | 收入 tab 内容 | @Builder
allView() {
Column({ space: 10 }) {
ForEach([
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '支', place:'创意卫浴五件套 欧式高档漱口杯',way:'商城兑换', date: '2025-07-01',amount: '-25.0币' },
{ type: '现', place:'人民广场自助回收机',way:'手机提现', date: '2025-07-... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right allView AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_parameter#L... | @Builder
allView() {
Column({ space: 10 }) {
ForEach([
{ type: '收', place:'人民广场自助回收机',way:'自助回收', date: '2025-07-01',amount: '+400.0币' },
{ type: '支', place:'创意卫浴五件套 欧式高档漱口杯',way:'商城兑换', date: '2025-07-01',amount: '-25.0币' },
{ type: '现', place:'人民广场自助回收机',way:'手机提现', date: '2025-07-... | https://github.com/lime-zz/Ark-ui_RubbishRecycleApp.git/blob/c2a9bff8fbb5bc46d922934afad0327cc1696969/rubbish/rubbish/entry/src/main/ets/pages/usemoney.ets#L112-L177 | d926dbba8d4be9f958529fc35716fe092ae0e061 | github |
Piagari/arkts_example.git | a63b868eaa2a50dc480d487b84c4650cc6a40fc8 | hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets | arkts | 分类数据模型 | export interface Category {
id: number;
name: string;
pic: string;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface Category AST#object_type#Left { AST#type_member#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left name : AST#type_annotation#Left AST#pr... | export interface Category {
id: number;
name: string;
pic: string;
} | https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/coolmall-master/entry/src/main/ets/models/CommonModels.ets#L30-L34 | 2614c38757152c62ece43b811f65753348247601 | github | |
junw2024/hnchain-ArkTs.git | 0cc3c182ad418709b577fa24e9fe909a205232c6 | entry/src/main/ets/common/utils/http/HttpDataType.ets | arkts | Indicates the type of the returned data.
指定返回数据的类型
@since 9 | export enum HttpDataType {
STRING,
OBJECT = 1,
ARRAY_BUFFER = 2
} | AST#export_declaration#Left export AST#enum_declaration#Left enum HttpDataType AST#enum_body#Left { AST#enum_member#Left STRING AST#enum_member#Right , AST#enum_member#Left OBJECT = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left ARRAY_BUFFER = AST#expression#Left 2 AST#expressio... | export enum HttpDataType {
STRING,
OBJECT = 1,
ARRAY_BUFFER = 2
} | https://github.com/junw2024/hnchain-ArkTs.git/blob/0cc3c182ad418709b577fa24e9fe909a205232c6/entry/src/main/ets/common/utils/http/HttpDataType.ets#L6-L10 | ab02a1890ca6dfbc4fc7b5e95a0c0e38eb95f8cd | github | |
Vinson0709/arkdemo.git | 793491fe04b387f55dadfef86b30e28d0535d994 | entry/src/main/ets/pages/Scrolls.ets | arkts | aboutToAppear | body中的滚动条
生命周期函数,创建组件实例后,执行build渲染函数之前 | aboutToAppear() {
} | AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right | aboutToAppear() {
} | https://github.com/Vinson0709/arkdemo.git/blob/793491fe04b387f55dadfef86b30e28d0535d994/entry/src/main/ets/pages/Scrolls.ets#L20-L22 | f5fc9ccac387c5e731912e3f18ffe8970655b0f4 | github |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | harmony_utils/src/main/ets/utils/KeyboardUtil.ets | arkts | hide | 关闭键盘
@param uiContext 关闭键盘页面的UIContext,子窗口需要传入UIContext,不传默认为主窗口的UIContext | static hide(uiContext?: UIContext) {
(uiContext ?? AppUtil.getUIContext()).getFocusController().clearFocus();
} | AST#method_declaration#Left static hide AST#parameter_list#Left ( AST#parameter#Left uiContext ? : AST#type_annotation#Left AST#primary_type#Left UIContext AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#e... | static hide(uiContext?: UIContext) {
(uiContext ?? AppUtil.getUIContext()).getFocusController().clearFocus();
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/KeyboardUtil.ets#L45-L47 | 688f9c9cfdac025bf1cbeb8765fba38b0c4d7c7d | gitee |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/YAxisRendererHorizontalBarChart.ets | arkts | drawYLabels | draws the y-labels on the specified x-position
@param fixedPosition
@param positions | protected drawYLabels(c: CanvasRenderingContext2D, fixedPosition: number, positions: number[], offset: number): void {
if (!this.mYAxis) {
return;
}
this.mAxisLabelPaint.setFontFamily(this.mYAxis.getTypeface());
this.mAxisLabelPaint.setTextSize(this.mYAxis.getTextSize());
this.mAxisLabelPaint.... | AST#method_declaration#Left protected drawYLabels AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left AST#primary_type#Left CanvasRenderingContext2D AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left fixedPosition : AST#type_annotation#Left AST#primary_type#L... | protected drawYLabels(c: CanvasRenderingContext2D, fixedPosition: number, positions: number[], offset: number): void {
if (!this.mYAxis) {
return;
}
this.mAxisLabelPaint.setFontFamily(this.mYAxis.getTypeface());
this.mAxisLabelPaint.setTextSize(this.mYAxis.getTextSize());
this.mAxisLabelPaint.... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/YAxisRendererHorizontalBarChart.ets#L156-L180 | fad66cb55ba2ec3fd6c7bb192a68fc8e8040f5b8 | gitee |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/navigation/src/main/ets/market/MarketNavigator.ets | arkts | @file 营销模块导航封装
@author Joker.X | export class MarketNavigator {
/**
* 跳转到优惠券页面
* @returns {void} 无返回值
*/
static toCoupon(): void {
navigateTo(MarketRoutes.Coupon);
}
} | AST#export_declaration#Left export AST#class_declaration#Left class MarketNavigator AST#class_body#Left { /**
* 跳转到优惠券页面
* @returns {void} 无返回值
*/ AST#method_declaration#Left static toCoupon AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_t... | export class MarketNavigator {
static toCoupon(): void {
navigateTo(MarketRoutes.Coupon);
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/navigation/src/main/ets/market/MarketNavigator.ets#L8-L16 | 9fa45573fa9070a5da41dfb2f465fd8507addefe | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/datas/model/Part_Unit.ets | arkts | MARK: - 分类数据模型 | export class Part {
partId : number = 0;
partName: string = '';
units : Unit[] = [];
// 计算属性:获取活跃单元(包含未删除单词的单元)
get aliveUnits(): Unit[] {
return this.units.filter(unit => unit.aliveWords.length > 0);
}
// 计算属性:获取分类下的所有活跃单词
get aliveWords(): WordUser[] {
const aliveWords: WordUser[] = [... | AST#export_declaration#Left export AST#class_declaration#Left class Part AST#class_body#Left { AST#property_declaration#Left partId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_declaration#Right AST#p... | export class Part {
partId : number = 0;
partName: string = '';
units : Unit[] = [];
get aliveUnits(): Unit[] {
return this.units.filter(unit => unit.aliveWords.length > 0);
}
get aliveWords(): WordUser[] {
const aliveWords: WordUser[] = [];
for (const unit of this.aliveUnits) {
... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/model/Part_Unit.ets#L46-L82 | fdf51b956a917de3ab5cbd38a7f5001054c5fa84 | github | |
yycy134679/FoodieHarmony.git | e6971f0a8f7574ae278d02eb5c057e57e667dab5 | entry/src/main/ets/view/favorites/FavoriteTabContent.ets | arkts | aboutToAppear | 组件即将出现时加载收藏商家数据 | async aboutToAppear(): Promise<void> {
await this.loadFavoriteMerchants();
} | AST#method_declaration#Left async aboutToAppear 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_ar... | async aboutToAppear(): Promise<void> {
await this.loadFavoriteMerchants();
} | https://github.com/yycy134679/FoodieHarmony.git/blob/e6971f0a8f7574ae278d02eb5c057e57e667dab5/entry/src/main/ets/view/favorites/FavoriteTabContent.ets#L34-L36 | 0582ac40d83fb1992deb610965d46482d9cc7e32 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/common/utils/PathUtility.ets | arkts | 路径处理工具类
提供与Java版PathUtility相同的功能,适配HarmonyOS API | export class PathUtility {
/**
* 路径拼接工具函数(兼容多平台分隔符)
* @param segments 要拼接的路径片段数组
* @returns 标准化后的路径字符串(统一使用'/'分隔符)
* @since 13
* @example
* // 返回 "foo/bar/baz"
* PathUtils.join('foo', 'bar', 'baz');
* // 处理多余分隔符(返回 "a/b/c")
* PathUtils.join('a/', '/b/', '/c');
*/
static join(...segmen... | AST#export_declaration#Left export AST#class_declaration#Left class PathUtility AST#class_body#Left { /**
* 路径拼接工具函数(兼容多平台分隔符)
* @param segments 要拼接的路径片段数组
* @returns 标准化后的路径字符串(统一使用'/'分隔符)
* @since 13
* @example
* // 返回 "foo/bar/baz"
* PathUtils.join('foo', 'bar', 'baz');
* // 处理多余分隔符(返回 "a/b/c... | export class PathUtility {
static join(...segments: string[]): string {
let combinedPath = segments.join('/');
return combinedPath.replace(/\/+/g, '/');
}
static removeLastSlashOfDirectoryIfExists(path: string | null): string | null {
if (!path) return null;
return pat... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/PathUtility.ets#L10-L152 | d2939cac458e1d5f747ac365c293bbfe7c2e31e3 | github | |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/models/managers/setting/SettingManager.ets | arkts | loadPreference | MARK: - 加载设置 | private loadPreference(): void {
if (!this.preferences) return;
try {
this.hideTranslation = this.preferences.getSync(Pref.KEY_SETTING_HIDETRANSLATION , false) as boolean;
this.autoPlaySound = this.preferences.getSync(Pref.KEY_SETTING_AUTOPRONOUNCE , false) as boolean;
this.autoPlaySoun... | AST#method_declaration#Left private loadPreference AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#member_expressio... | private loadPreference(): void {
if (!this.preferences) return;
try {
this.hideTranslation = this.preferences.getSync(Pref.KEY_SETTING_HIDETRANSLATION , false) as boolean;
this.autoPlaySound = this.preferences.getSync(Pref.KEY_SETTING_AUTOPRONOUNCE , false) as boolean;
this.autoPlaySoun... | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/managers/setting/SettingManager.ets#L100-L126 | ad0b14e07516260f8ee4fb40666bc64eebba6d63 | github |
openharmony-sig/knowledge_demo_smart_home | 6cdf5d81ef84217f386c4200bfc4124a0ded5a0d | FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets | arkts | getDeviceInfo | 根据设备ID获取设备信息 | static async getDeviceInfo(deviceId: string, userId: string) {
let httpRequest = http.createHttp();
let data = await httpRequest.request(
`${DistScheduleService.distScheduleServer}/device/${deviceId}`,
{
method: RequestMethod.GET,
header: {
'userId': `${userId}`
},... | AST#method_declaration#Left static async getDeviceInfo AST#parameter_list#Left ( AST#parameter#Left deviceId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left string AS... | static async getDeviceInfo(deviceId: string, userId: string) {
let httpRequest = http.createHttp();
let data = await httpRequest.request(
`${DistScheduleService.distScheduleServer}/device/${deviceId}`,
{
method: RequestMethod.GET,
header: {
'userId': `${userId}`
},... | https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets#L129-L151 | 426d606cb526cfb9cb8fcf83f3257afa69bcca9a | gitee |
HomoArk/Homogram.git | 8a6e85898b6194fdd04ead75e732d348888a0c07 | features/home/src/main/ets/viewmodel/Chat/ChatDataSource.ets | arkts | modifyAt | I don't think this method will be used but just in case we need it | modifyAt(index: number, chat: Chat): void {
this.sortedUnpinnedChatsMap.set(chat.chatId.toString(), chat);
this.notifyDataChange(index);
} | AST#method_declaration#Left modifyAt 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 chat : AST#type_annotation#Left AST#primary_type#Left Chat AST#primary_type#Right AST#... | modifyAt(index: number, chat: Chat): void {
this.sortedUnpinnedChatsMap.set(chat.chatId.toString(), chat);
this.notifyDataChange(index);
} | https://github.com/HomoArk/Homogram.git/blob/8a6e85898b6194fdd04ead75e732d348888a0c07/features/home/src/main/ets/viewmodel/Chat/ChatDataSource.ets#L208-L211 | 0b61d48059265035bfe48fa4c46149281e257244 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets | arkts | ensureMigrated | 确保购物车表完成迁移
@returns {void} 无返回 | private ensureMigrated(): void {
if (!CartLocalDataSourceImpl.migrated) {
this.orm.migrate(CartEntity);
CartLocalDataSourceImpl.migrated = true;
}
} | AST#method_declaration#Left private ensureMigrated AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_control_flow#Left AST#ui_if_statement#Left if ( AST#expression#Left AST#m... | private ensureMigrated(): void {
if (!CartLocalDataSourceImpl.migrated) {
this.orm.migrate(CartEntity);
CartLocalDataSourceImpl.migrated = true;
}
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/database/src/main/ets/datasource/cart/CartLocalDataSourceImpl.ets#L32-L37 | c7363f6a98b26e96a580770a168e97f65ef319db | github |
harmonyos_samples/BestPracticeSnippets | 490ea539a6d4427dd395f3dac3cf4887719f37af | DealStrideSolution/entry/src/main/ets/pages/PageThree.ets | arkts | PageThree | [Start PageThree_start] | @Component
export struct PageThree {
pathStack: NavPathStack = new NavPathStack();
@State name: string = 'pageOne';
@State isShowStridePixel: boolean = false;
@StorageLink('stridePixel') @Watch('onStridePixel') stridePixel: image.PixelMap | undefined = undefined;
@State imageWidth: number = 1080;
@State ima... | AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct PageThree AST#component_body#Left { AST#property_declaration#Left pathStack : AST#type_annotation#Left AST#primary_type#Left NavPathStack AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call... | @Component
export struct PageThree {
pathStack: NavPathStack = new NavPathStack();
@State name: string = 'pageOne';
@State isShowStridePixel: boolean = false;
@StorageLink('stridePixel') @Watch('onStridePixel') stridePixel: image.PixelMap | undefined = undefined;
@State imageWidth: number = 1080;
@State ima... | https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/DealStrideSolution/entry/src/main/ets/pages/PageThree.ets#L28-L136 | bb531a24d5f081994ccc8071569ee9864db89385 | gitee |
Joker-x-dev/HarmonyKit.git | f97197ce157df7f303244fba42e34918306dfb08 | core/state/src/main/ets/model/BreakpointModel.ets | arkts | 断点规则 | export interface BreakpointRule {
/**
* 断点类型
*/
name: BreakpointType;
/**
* 最大宽度
*/
maxWidthVp: number;
} | AST#export_declaration#Left export AST#interface_declaration#Left interface BreakpointRule AST#object_type#Left { /**
* 断点类型
*/ AST#type_member#Left name : AST#type_annotation#Left AST#primary_type#Left BreakpointType AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; /**
* 最大宽度
*/ AST... | export interface BreakpointRule {
name: BreakpointType;
maxWidthVp: number;
} | https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/state/src/main/ets/model/BreakpointModel.ets#L31-L41 | 6c2185e7636c188144b020296bb1dc06835cf98c | github | |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | entry/src/main/ets/pages/utils/PickerUtilPage.ets | arkts | mock | 缓存本地Uri,上次保存的Uri。 | @MockSetup
mock() {
this.describe = new DescribeBean("PickerUtil", "拍照、文件(文件、图片、视频、音频)选择和保存,工具类");
} | AST#method_declaration#Left AST#decorator#Left @ MockSetup AST#decorator#Right mock 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#Ri... | @MockSetup
mock() {
this.describe = new DescribeBean("PickerUtil", "拍照、文件(文件、图片、视频、音频)选择和保存,工具类");
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/pages/utils/PickerUtilPage.ets#L26-L29 | 6247f5ed18c2fee8d90d2e3ce045133246557f2e | gitee |
tongyuyan/harmony-utils | 697472f011a43e783eeefaa28ef9d713c4171726 | entry/src/main/ets/pages/utils/WindowUtilPage.ets | arkts | mock | 子窗口 | @MockSetup
mock() {
this.describe = new DescribeBean("AppUtil", "窗口相关工具类");
} | AST#method_declaration#Left AST#decorator#Left @ MockSetup AST#decorator#Right mock 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#Ri... | @MockSetup
mock() {
this.describe = new DescribeBean("AppUtil", "窗口相关工具类");
} | https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/entry/src/main/ets/pages/utils/WindowUtilPage.ets#L33-L36 | fc29cfdf197857fb8c08594cbf3d68855664e00c | gitee |
tomorrowKreswell/Ledger.git | 1f2783ae70b8540d677af8a27f29db1b4089ea69 | ledger/entry/src/main/ets/common/database/tables/AccountTable.ets | arkts | query | 查询数据库表数据 | query(callback: Function, predicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates(CommonConstants.ACCOUNT_TABLE.tableName)) {
// 调用 Rdb 对象的查询方法,传入查询条件和回调函数
this.accountTable.query(predicates, (resultSet: relationalStore.ResultSet) => {
// 获取查询结果的行数
let count: number = resultSet... | AST#method_declaration#Left query AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#primary_type#Left Function AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left predicates : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left ... | query(callback: Function, predicates: relationalStore.RdbPredicates = new relationalStore.RdbPredicates(CommonConstants.ACCOUNT_TABLE.tableName)) {
this.accountTable.query(predicates, (resultSet: relationalStore.ResultSet) => {
let count: number = resultSet.rowCount;
if (count === 0 |... | https://github.com/tomorrowKreswell/Ledger.git/blob/1f2783ae70b8540d677af8a27f29db1b4089ea69/ledger/entry/src/main/ets/common/database/tables/AccountTable.ets#L75-L103 | 5db0eb014e7b75be586f91fa2ce00c940a01a178 | github |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/main/src/main/ets/view/MePage.ets | arkts | 构建我的页面
@returns {void} 无返回值 | build() {
AppNavDestination({
title: $r("app.string.me"),
viewModel: this.vm,
hideTitleBar: true,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset
}
}) {
this.M... | AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left AppNavDestination ( AST#component_parameters#Left { AST#component_parameter#Left title : AST#expression#Left AST#resource_expression#Left $r ( AST#expression#Left "app.string.me" AST#... | build() {
AppNavDestination({
title: $r("app.string.me"),
viewModel: this.vm,
hideTitleBar: true,
paddingValue: {
top: this.windowSafeAreaState.topInset,
left: this.windowSafeAreaState.leftInset,
right: this.windowSafeAreaState.rightInset
}
}) {
this.M... | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/main/src/main/ets/view/MePage.ets#L71-L84 | 5ad7499697a8ad4f883f591f00c82679754882fc | github | |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/styledtext/src/main/ets/pages/StyledText.ets | arkts | otherFunction | 分享、点赞、评论UI组件 | @Builder
otherFunction(imageStr: Resource, text: string | Resource) {
Row() {
Image(imageStr)
.height($r('app.integer.styled_text_other_function_image_width'))
.width($r('app.integer.styled_text_other_function_image_width'))
.objectFit(ImageFit.Contain)
.autoResize(false)
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right otherFunction AST#parameter_list#Left ( AST#parameter#Left imageStr : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left text : AST#type_annotation#... | @Builder
otherFunction(imageStr: Resource, text: string | Resource) {
Row() {
Image(imageStr)
.height($r('app.integer.styled_text_other_function_image_width'))
.width($r('app.integer.styled_text_other_function_image_width'))
.objectFit(ImageFit.Contain)
.autoResize(false)
... | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/styledtext/src/main/ets/pages/StyledText.ets#L245-L266 | 3e782b1c9e054e3451760f1064c24b1fa4eb1a86 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/common/types/NotificationTypes.ets | arkts | 通知优先级 | export enum NotificationPriority {
LOW = 'low',
NORMAL = 'normal',
HIGH = 'high',
URGENT = 'urgent'
} | AST#export_declaration#Left export AST#enum_declaration#Left enum NotificationPriority AST#enum_body#Left { AST#enum_member#Left LOW = AST#expression#Left 'low' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left NORMAL = AST#expression#Left 'normal' AST#expression#Right AST#enum_member#Right , AST#enum_m... | export enum NotificationPriority {
LOW = 'low',
NORMAL = 'normal',
HIGH = 'high',
URGENT = 'urgent'
} | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/NotificationTypes.ets#L19-L24 | 841f80aecd38df1ec1e66a3eebbff5760b8bf8cd | github | |
openharmony-tpc/ohos_mpchart | 4fb43a7137320ef2fee2634598f53d93975dfb4a | library/src/main/ets/components/renderer/AxisRenderer.ets | arkts | computeAxis | Computes the axis values.
@param min - the minimum value in the data object for this axis
@param max - the maximum value in the data object for this axis | public computeAxis(min: number, max: number, inverted: boolean, customYAxisLabels?: number[]) {
// calculate the starting and entry point of the y-labels (depending on
// zoom / contentrect bounds)
if (this.mTrans && this.mViewPortHandler != null && this.mViewPortHandler.contentWidth() > 10 && !this.mViewPo... | AST#method_declaration#Left public computeAxis AST#parameter_list#Left ( AST#parameter#Left min : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left max : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#R... | public computeAxis(min: number, max: number, inverted: boolean, customYAxisLabels?: number[]) {
if (this.mTrans && this.mViewPortHandler != null && this.mViewPortHandler.contentWidth() > 10 && !this.mViewPortHandler.isFullyZoomedOutY()) {
let p1: MPPointD | undefined = this.mTrans.getValuesByTouchP... | https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/AxisRenderer.ets#L120-L154 | 3faf681b73195a300d6e9686d8b75c6b1ba0f062 | gitee |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/processes/init_process.ets | arkts | Initializes all things.
Should be executed in HomeAbility.ets on each launch of entire app. | export async function meow_init_main(context: common.UIAbilityContext, storage: LocalStorage) {
// Get and set app version info
bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((bundleInfo) => {
console.log('[Meow][history] Saving app version: ' + bundleInfo.ver... | AST#export_declaration#Left export AST#function_declaration#Left async function meow_init_main 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... | export async function meow_init_main(context: common.UIAbilityContext, storage: LocalStorage) {
bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).then((bundleInfo) => {
console.log('[Meow][history] Saving app version: ' + bundleInfo.versionName + "(" + bundleInfo.ver... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/processes/init_process.ets#L26-L64 | fb36e88e65c4089387a5b6b1145d604ef0efe71a | gitee | |
Joker-x-dev/CoolMallArkTS.git | 9f3fabf89fb277692cb82daf734c220c7282919c | feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets | arkts | selectCancelReason | 选择取消原因
@param {DictItem} reason - 取消原因
@returns {void} 无返回值 | selectCancelReason(reason: DictItem): void {
this.selectedCancelReason = reason;
} | AST#method_declaration#Left selectCancelReason AST#parameter_list#Left ( AST#parameter#Left reason : AST#type_annotation#Left AST#primary_type#Left DictItem 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_t... | selectCancelReason(reason: DictItem): void {
this.selectedCancelReason = reason;
} | https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/viewmodel/OrderDetailViewModel.ets#L223-L225 | 6db46b995d9c302ccf756a78b333d30e83dfb1be | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index.ets | arkts | buildSettingsContent | 构建设置页面内容 | @Builder
buildSettingsContent() {
Column({ space: 16 }) {
// 用户信息卡片
this.buildUserProfile()
// 主题外观设置
this.buildThemeAppearanceSettings()
// 通知设置
this.buildNotificationSettings()
// 数据管理
this.buildDataManagement()
// 联系我们
this.buildContactUs()
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildSettingsContent AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#componen... | @Builder
buildSettingsContent() {
Column({ space: 16 }) {
this.buildUserProfile()
this.buildThemeAppearanceSettings()
this.buildNotificationSettings()
this.buildDataManagement()
this.buildContactUs()
this.buildPrivacyPolicy()
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L3433-L3463 | 3a7ff41a61ddc1d5652288247522acec59f3ac62 | github |
zqaini002/YaoYaoLingXian.git | 5095b12cbeea524a87c42d0824b1702978843d39 | YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets | arkts | 请求参数接口 | export type RequestParams = Record<string, string | number | boolean | undefined | null>; | AST#export_declaration#Left export AST#type_declaration#Left type RequestParams = 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_annotation#Left AST#un... | export type RequestParams = Record<string, string | number | boolean | undefined | null>; | https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/model/CommonTypes.ets#L258-L258 | 085de8aff45671fdc4b9c60a7fb80ab892cdf468 | github | |
kaina404/HarmonyStock.git | 99233a46fb0dfb21e02294c730fd80e2fb404f9b | entry/src/main/ets/pages/SearchStockPage.ets | arkts | _go2StockDetail | 点击搜索的个股条目跳转到股票详情页面
@param bean | _go2StockDetail(bean: SearchStockBean) {
openPage({ url: Path_StockDetailPage, params: {
'stockCode': bean.code,
'stockName': bean.name
} })
} | AST#method_declaration#Left _go2StockDetail AST#parameter_list#Left ( AST#parameter#Left bean : AST#type_annotation#Left AST#primary_type#Left SearchStockBean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui... | _go2StockDetail(bean: SearchStockBean) {
openPage({ url: Path_StockDetailPage, params: {
'stockCode': bean.code,
'stockName': bean.name
} })
} | https://github.com/kaina404/HarmonyStock.git/blob/99233a46fb0dfb21e02294c730fd80e2fb404f9b/entry/src/main/ets/pages/SearchStockPage.ets#L111-L116 | ebc004b7cd29944e46ecf53a05ca2718ea8d91b0 | github |
harmonyos-cases/cases | eccdb71f1cee10fa6ff955e16c454c1b59d3ae13 | CommonAppDevelopment/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets | arkts | titleExpansionContent | 默认内容样式
@returns | @Builder
titleExpansionContent(): void {
Column() {
Text("Text")
}
.height(Constants.ONE_HUNDRED_PERCENT)
.width(Constants.ONE_HUNDRED_PERCENT)
} | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right titleExpansionContent AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui... | @Builder
titleExpansionContent(): void {
Column() {
Text("Text")
}
.height(Constants.ONE_HUNDRED_PERCENT)
.width(Constants.ONE_HUNDRED_PERCENT)
} | https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/expandtitle/src/main/ets/utils/TitleExpansion.ets#L173-L180 | bc9fea699d22081f584195b66eb3d1d4cbcc55a0 | gitee |
openharmony/interface_sdk-js | c349adc73e2ec1f61f6fca489b5af059e3ed6999 | api/@ohos.arkui.advanced.ToolBar.d.ets | arkts | backgroundColor | Sets the backgroundColor of the toolBar.
@param { ResourceColor } backgroundColor - toolBar's backgroundColor.
@returns { ToolBarModifier } returns the instance of the ToolBarModifier.
@syscap SystemCapability.ArkUI.ArkUI.Full
@atomicservice
@since 13
Sets the backgroundColor of the toolBar.
@param { ResourceColor ... | backgroundColor(backgroundColor: ResourceColor): ToolBarModifier; | AST#method_declaration#Left backgroundColor AST#parameter_list#Left ( AST#parameter#Left backgroundColor : AST#type_annotation#Left AST#primary_type#Left ResourceColor AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ToolBar... | backgroundColor(backgroundColor: ResourceColor): ToolBarModifier; | https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.arkui.advanced.ToolBar.d.ets#L456-L456 | db4c921af44a12e7a406406f73c590d545e51237 | gitee |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | harmonyos/src/main/ets/widgets/pages/WidgetCard2x2.ets | arkts | buildContentView | 构建内容视图 | @Builder
buildContentView() {
Column({ space: 8 }) {
// 头部信息
Row() {
if (this.widgetData.contactAvatar) {
Image(this.widgetData.contactAvatar)
.width(24)
.height(24)
.borderRadius(12)
} else {
Circle({ width: 24, height: 24 })
... | AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right buildContentView AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( AST#component_parameters#Left { AST#component_pa... | @Builder
buildContentView() {
Column({ space: 8 }) {
Row() {
if (this.widgetData.contactAvatar) {
Image(this.widgetData.contactAvatar)
.width(24)
.height(24)
.borderRadius(12)
} else {
Circle({ width: 24, height: 24 })
... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/harmonyos/src/main/ets/widgets/pages/WidgetCard2x2.ets#L33-L112 | ddb69e29058215e307b3e175bcfd52d0499528d7 | github |
RedRackham-R/WanAndroidHarmoney.git | 0bb2a7c8d7b49194a96e42a380d43b7e106cdb22 | entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets | arkts | unSubscribeLoginEvent | 取消订阅登录事件 | unSubscribeLoginEvent(key: string) {
EventBus.getInstance().unregistByKey(WanEventId.EVENT_LOGIN, key);
} | AST#method_declaration#Left unSubscribeLoginEvent 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 AST#ex... | unSubscribeLoginEvent(key: string) {
EventBus.getInstance().unregistByKey(WanEventId.EVENT_LOGIN, key);
} | https://github.com/RedRackham-R/WanAndroidHarmoney.git/blob/0bb2a7c8d7b49194a96e42a380d43b7e106cdb22/entry/src/main/ets/global/viewmodel/GlobalUserViewModel.ets#L228-L230 | 9288ca8795471d617746fdb55489adc8435b1422 | github |
bigbear20240612/birthday_reminder.git | 647c411a6619affd42eb5d163ff18db4b34b27ff | entry/src/main/ets/pages/Index_backup.ets | arkts | sendTestNotification | 发送测试通知 | private async sendTestNotification(): Promise<void> {
try {
console.log('[Settings] Sending test notification...');
// 检查权限
const isEnabled = await notificationManager.isNotificationEnabled();
if (!isEnabled) {
promptAction.showToast({
message: '请先开启通知权限',
durati... | AST#method_declaration#Left private async sendTestNotification 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#Righ... | private async sendTestNotification(): Promise<void> {
try {
console.log('[Settings] Sending test notification...');
const isEnabled = await notificationManager.isNotificationEnabled();
if (!isEnabled) {
promptAction.showToast({
message: '请先开启通知权限',
duration: 200... | https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index_backup.ets#L1182-L1224 | b347c407a8518215084b0068dad861be7ee834b6 | github |
Delsin-Yu/JustPDF.git | d53f566e02820dac46e1752151750144acbed50a | entry/src/main/ets/components/PageInfo.ets | arkts | markPageChanged | Marks the page at the given global page index as changed.
This is used by PageInfo when it needs to notify the data source of changes.
@param globalPageIndex The global page index | public markPageChanged(globalPageIndex: number): void {
let pageCounter = 0;
for (let groupIndex = 0; groupIndex < this.pageGroups.length; groupIndex++) {
const group = this.pageGroups[groupIndex];
if (globalPageIndex < pageCounter + group.pages.length) {
const localPageIndex = globalPageInd... | AST#method_declaration#Left public markPageChanged AST#parameter_list#Left ( AST#parameter#Left globalPageIndex : 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 AS... | public markPageChanged(globalPageIndex: number): void {
let pageCounter = 0;
for (let groupIndex = 0; groupIndex < this.pageGroups.length; groupIndex++) {
const group = this.pageGroups[groupIndex];
if (globalPageIndex < pageCounter + group.pages.length) {
const localPageIndex = globalPageInd... | https://github.com/Delsin-Yu/JustPDF.git/blob/d53f566e02820dac46e1752151750144acbed50a/entry/src/main/ets/components/PageInfo.ets#L659-L671 | e898cf2dc76423268a79bbb3c6e1a4f6fb8e121c | github |
hqj201013136012/HarmonyMiliUiPro.git | 0625e681e07b771998a0ac4430824627d0eb60ed | entry/src/main/ets/viewmodel/SecurityData.ets | arkts | 安防模式 | export const SECURITY_MODE_TYPE = "1"
// 报警记录 | AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SECURITY_MODE_TYPE = AST#expression#Left "1" AST#expression#Right AST#variable_declarator#Right // 报警记录 AST#variable_declaration#Right AST#export_declaration#Right | export const SECURITY_MODE_TYPE = "1" | https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/SecurityData.ets#L2-L4 | 9959e031db1cc9f9db07c2bca023f81c5852791d | github | |
EL233/WeChat-HarmonyOS.git | b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e | entry/src/main/ets/view/component/Dialog.ets | arkts | setContext | 定义对话框选项变量,默认为undefined 设置UI上下文 | setContext(context: UIContext) {
this.ctx = context; // 将传入的上下文赋值给实例变量
} | AST#method_declaration#Left setContext 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_list#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expres... | setContext(context: UIContext) {
this.ctx = context;
} | https://github.com/EL233/WeChat-HarmonyOS.git/blob/b5fa65556eb5f5698a92ec289ffd9ebe4cc5bb3e/entry/src/main/ets/view/component/Dialog.ets#L16-L18 | 0d1c90c4d0ec6621c6416f948aa57f66b09cb1d0 | github |
KoStudio/ArkTS-WordTree.git | 78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324 | entry/src/main/ets/app/constants/AppContext.ets | arkts | 初始化 ApplicationContext(在应用入口调用) | export function initAppContext(context: common.UIAbilityContext): void {
AppContext.initAppContext(context)
} | AST#export_declaration#Left export AST#function_declaration#Left function initAppContext 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#p... | export function initAppContext(context: common.UIAbilityContext): void {
AppContext.initAppContext(context)
} | https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/app/constants/AppContext.ets#L83-L85 | 9a143b4fb4ebd881afad662004970750e93b7396 | github | |
awa_Liny/LinysBrowser_NEXT | a5cd96a9aa8114cae4972937f94a8967e55d4a10 | home/src/main/ets/utils/storage_tools.ets | arkts | Info
Returns the download folder uri.
@returns DOWNLOADS uri | export async function get_download_uri() {
let uri: string = '';
const documentViewPicker = new picker.DocumentViewPicker();
const documentSaveOptions = new picker.DocumentSaveOptions();
documentSaveOptions.pickerMode = picker.DocumentPickerMode.DOWNLOAD;
await documentViewPicker.save(documentSaveOptions).the... | AST#export_declaration#Left export AST#function_declaration#Left async function get_download_uri AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left uri : AST#type_annotation#Left AST#primary_type#Left string A... | export async function get_download_uri() {
let uri: string = '';
const documentViewPicker = new picker.DocumentViewPicker();
const documentSaveOptions = new picker.DocumentSaveOptions();
documentSaveOptions.pickerMode = picker.DocumentPickerMode.DOWNLOAD;
await documentViewPicker.save(documentSaveOptions).the... | https://github.com/awa_Liny/LinysBrowser_NEXT/blob/a5cd96a9aa8114cae4972937f94a8967e55d4a10/home/src/main/ets/utils/storage_tools.ets#L602-L613 | 97bd5e60a2d9a1a119bc1cb2df311bb8c05d07a1 | gitee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.