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
CongDuang/PlayHarmony.git
674a0459e1b20db9de8c837dff6a8d1f06330e79
entry/src/main/ets/pages/main/view/HomeView.ets
arkts
getBannerData
获取banner数据
async getBannerData() { const resp: BaseResp<HomeBannerModel[]> = await HttpUtil.getInstance().get<HomeBannerModel[], undefined>('/banner/json'); if (resp.errorCode === ErroCode.OK && resp.data) { this.banners = resp.data!; } }
AST#method_declaration#Left async getBannerData AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left const AST#variable_declarator#Left resp : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left BaseResp AST#type_arguments#Left...
async getBannerData() { const resp: BaseResp<HomeBannerModel[]> = await HttpUtil.getInstance().get<HomeBannerModel[], undefined>('/banner/json'); if (resp.errorCode === ErroCode.OK && resp.data) { this.banners = resp.data!; } }
https://github.com/CongDuang/PlayHarmony.git/blob/674a0459e1b20db9de8c837dff6a8d1f06330e79/entry/src/main/ets/pages/main/view/HomeView.ets#L28-L34
d427160c90e280cbb15734f4ac2d21795e94abca
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets
arkts
getFirstGridData
Get data of the first grid. @return {Array<PageResource>} firstGridData.
getFirstGridData(): Array<ItemData> { let firstGridData: ItemData[] = [ new ItemData($r('app.string.my_love'), $r('app.media.love')), new ItemData($r('app.string.history_record'), $r('app.media.record')), new ItemData($r('app.string.message'), $r('app.media.message')), new ItemData($r('app.s...
AST#method_declaration#Left getFirstGridData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left ItemData AST#primary_type#Right AST#type_annotation#Right > AST#type_arg...
getFirstGridData(): Array<ItemData> { let firstGridData: ItemData[] = [ new ItemData($r('app.string.my_love'), $r('app.media.love')), new ItemData($r('app.string.history_record'), $r('app.media.record')), new ItemData($r('app.string.message'), $r('app.media.message')), new ItemData($r('app.s...
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/ArkTSComponents/entry/src/main/ets/viewmodel/MainViewModel.ets#L43-L55
efd3e175abc8690e7176fea35895eb75c924ad6b
gitee
toly1994328/HarmonyUnit
318c99f475e5457350405fc905343d9b3e81812c
entry/src/main/ets/pages/painter/bloc/PainterBloc.ets
arkts
updateLine
平移更新时,为新线添加点
updateLine(x: number, y: number) { let lastLine = this.lines[this.lines.length-1]; let lastPoint = lastLine.points[lastLine.points.length-1] let distance = Math.sqrt(Math.pow((x - lastPoint.x), 2) + Math.pow((y - lastPoint.y), 2)) if (distance < 5) return; console.log(`==onPanUpdate:(${x},${y})=====...
AST#method_declaration#Left updateLine AST#parameter_list#Left ( AST#parameter#Left x : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left y : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#typ...
updateLine(x: number, y: number) { let lastLine = this.lines[this.lines.length-1]; let lastPoint = lastLine.points[lastLine.points.length-1] let distance = Math.sqrt(Math.pow((x - lastPoint.x), 2) + Math.pow((y - lastPoint.y), 2)) if (distance < 5) return; console.log(`==onPanUpdate:(${x},${y})=====...
https://github.com/toly1994328/HarmonyUnit/blob/318c99f475e5457350405fc905343d9b3e81812c/entry/src/main/ets/pages/painter/bloc/PainterBloc.ets#L76-L84
798025fbf3efe389a95cba23abc5fa82d9905307
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/renderer/scatter/SquareShapeRenderer.ets
arkts
Created by wajdic on 15/06/2016. Created at Time 09:08
export default class SquareShapeRenderer implements IShapeRenderer { public renderShape(c: CanvasRenderingContext2D, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler, posX: number, posY: number, renderPaint: Paint): void { const shapeSize: number = dataSet.getScatterShapeSize(); ...
AST#export_declaration#Left export default AST#class_declaration#Left class SquareShapeRenderer AST#implements_clause#Left implements IShapeRenderer AST#implements_clause#Right AST#class_body#Left { AST#method_declaration#Left public renderShape AST#parameter_list#Left ( AST#parameter#Left c : AST#type_annotation#Left ...
export default class SquareShapeRenderer implements IShapeRenderer { public renderShape(c: CanvasRenderingContext2D, dataSet: IScatterDataSet, viewPortHandler: ViewPortHandler, posX: number, posY: number, renderPaint: Paint): void { const shapeSize: number = dataSet.getScatterShapeSize(); ...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/renderer/scatter/SquareShapeRenderer.ets#L28-L89
ff3a9436a46a6bf34b9c4ba66629feab290d8bb2
gitee
WinWang/HarmoneyOpenEye.git
57f0542795336009aa0d46fd9fa5b07facc2ae87
entry/src/main/ets/http/apiService.ets
arkts
获取关注接口
export function getFocusData(pageIndex: number = 0) { return axiosClient.get<FocusModel>( { url: baseUrl + "api/v4/tabs/follow", params: { "start": pageIndex } } ) }
AST#export_declaration#Left export AST#function_declaration#Left function getFocusData AST#parameter_list#Left ( AST#parameter#Left pageIndex : 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#parameter#Right ) AST#pa...
export function getFocusData(pageIndex: number = 0) { return axiosClient.get<FocusModel>( { url: baseUrl + "api/v4/tabs/follow", params: { "start": pageIndex } } ) }
https://github.com/WinWang/HarmoneyOpenEye.git/blob/57f0542795336009aa0d46fd9fa5b07facc2ae87/entry/src/main/ets/http/apiService.ets#L43-L50
fc3f90b842b87efaba618a2c9c9239720579fa3d
github
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegFactory.ets
arkts
cut
视频裁剪(零拷贝)
public static cut(input: string, output: string, startTime: string, duration: string): string[] { return ['ffmpeg', '-ss', startTime, '-i', input, '-t', duration, '-c:v', 'copy', '-c:a', 'copy', '-avoid_negative_ts', 'make_zero', '-y', output]; }
AST#method_declaration#Left public static cut AST#parameter_list#Left ( AST#parameter#Left input : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left output : AST#type_annotation#Left AST#primary_type#Left string AST#primary_ty...
public static cut(input: string, output: string, startTime: string, duration: string): string[] { return ['ffmpeg', '-ss', startTime, '-i', input, '-t', duration, '-c:v', 'copy', '-c:a', 'copy', '-avoid_negative_ts', 'make_zero', '-y', output]; }
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegFactory.ets#L45-L47
453e00c0b608c5e7c0948b9760d199bfd5999aa1
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
advanced_ui_component/dialogv2/source/dialogv2.ets
arkts
isNewPropertiesHighPriority
is button buttonStyle and role properties high priority @param buttonOptions button properties @returns check result
private isNewPropertiesHighPriority(index: number): boolean { if (this.buttons?.[index].role === ButtonRole.ERROR) { return true; } if (this.buttons?.[index].buttonStyle !== undefined && this.buttons?.[index].buttonStyle !== ALERT_BUTTON_STYLE) { return true; } if (this.buttons?.[i...
AST#method_declaration#Left private isNewPropertiesHighPriority AST#parameter_list#Left ( AST#parameter#Left index : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left bool...
private isNewPropertiesHighPriority(index: number): boolean { if (this.buttons?.[index].role === ButtonRole.ERROR) { return true; } if (this.buttons?.[index].buttonStyle !== undefined && this.buttons?.[index].buttonStyle !== ALERT_BUTTON_STYLE) { return true; } if (this.buttons?.[i...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/advanced_ui_component/dialogv2/source/dialogv2.ets#L1485-L1497
2a88c2d41d97b39cfbe54654114943fc583fddbb
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/MoneyTrack-master/components/bill_data_processing/src/main/ets/utils/accountingdb/AccountingDB.ets
arkts
addTransaction
新增交易记录
public async addTransaction(userTx: UserTransaction): Promise<void> { const tx: TransactionTableBasis = { transactionId: new Date().getTime(), accountId: userTx.accountId, type: userTx.type, resource: userTx.resource, amount: userTx.amount, date: userTx.date, note: userTx.n...
AST#method_declaration#Left public async addTransaction AST#parameter_list#Left ( AST#parameter#Left userTx : AST#type_annotation#Left AST#primary_type#Left UserTransaction AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AS...
public async addTransaction(userTx: UserTransaction): Promise<void> { const tx: TransactionTableBasis = { transactionId: new Date().getTime(), accountId: userTx.accountId, type: userTx.type, resource: userTx.resource, amount: userTx.amount, date: userTx.date, note: userTx.n...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/MoneyTrack-master/components/bill_data_processing/src/main/ets/utils/accountingdb/AccountingDB.ets#L91-L117
fd2e61704851d4f34e7b4ac3e8095a4532500138
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/imageviewer/src/main/ets/view/ImageItemView.ets
arkts
evaluateBound
TODO:需求:在偏移时评估是否到达边界,以便进行位移限制与图片的切换 @returns:长度为4的boolean数组,表示上下左右是否到达边界
evaluateBound(): boolean[] { return [false, false, false, false]; }
AST#method_declaration#Left evaluateBound AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left boolean [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left re...
evaluateBound(): boolean[] { return [false, false, false, false]; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/imageviewer/src/main/ets/view/ImageItemView.ets#L124-L126
705501febe1fcb237407a23ee1be9237b6e87b5f
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/common/utils/strings/StringPyHelper.ets
arkts
isPinyinContainsPyTone
检查当前拼音是否含有声调 qíng/qing
static isPinyinContainsPyTone(str: string): boolean { // 去除前后空白 const s = StringPyHelper.convertUnicodeForPinyin(str.trim()); if (!s) return false; // 空字符串视为忽略 // 检查组合字符 for (let i = 0; i < s.length; i++) { const code = s.charCodeAt(i); if (code === 0x0304 || // "\u{0304}" 1声 co...
AST#method_declaration#Left static isPinyinContainsPyTone AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#...
static isPinyinContainsPyTone(str: string): boolean { const s = StringPyHelper.convertUnicodeForPinyin(str.trim()); if (!s) return false; for (let i = 0; i < s.length; i++) { const code = s.charCodeAt(i); if (code === 0x0304 || code === 0x0301 || code === 0x030c || ...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/common/utils/strings/StringPyHelper.ets#L77-L94
62b60ea909a99e49533665dd9394c612e61099f7
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ar/ARCardService.ets
arkts
AR交互配置接口
export interface ARInteractionConfig { enableTouchGestures: boolean; enableVoiceControl: boolean; enableHandTracking: boolean; touchHandlers: TouchHandler[]; voiceCommands: VoiceCommand[]; gestureRecognizers: GestureRecognizer[]; }
AST#export_declaration#Left export AST#interface_declaration#Left interface ARInteractionConfig AST#object_type#Left { AST#type_member#Left enableTouchGestures : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right ; AST#type_member#Left enableVoi...
export interface ARInteractionConfig { enableTouchGestures: boolean; enableVoiceControl: boolean; enableHandTracking: boolean; touchHandlers: TouchHandler[]; voiceCommands: VoiceCommand[]; gestureRecognizers: GestureRecognizer[]; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ar/ARCardService.ets#L186-L193
d7b0958dd513d52f0b4ac860d2e78544e2243a81
github
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
examples/Overlay/entry/src/main/ets/common/DataModel.ets
arkts
showDialog---title|message|buttons测试参数且无必填项
export class Model2 { public title?: string | Resource | number = undefined public message?: string | Resource | number = undefined public buttonText1?: string | Resource | number = undefined public buttonColor1?: string | Resource | number = undefined public buttonText2?: string | Resource = undefined publ...
AST#export_declaration#Left export AST#ERROR#Left class Model2 { AST#property_declaration#Left public title ? : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left string AST#primary_type#Right | AST#primary_type#Left Resource AST#primary_type#Right | AST#primary_type#Left number AST#primary_type#Right A...
export class Model2 { public title?: string | Resource | number = undefined public message?: string | Resource | number = undefined public buttonText1?: string | Resource | number = undefined public buttonColor1?: string | Resource | number = undefined public buttonText2?: string | Resource = undefined publ...
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/examples/Overlay/entry/src/main/ets/common/DataModel.ets#L29-L39
04b72988fa33ae31cea0261eb0b03d5e3e8d6f8f
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/components/AxisBase.ets
arkts
getGridLineWidth
Returns the width of the grid lines that are drawn away from each axis label. @return
public getGridLineWidth(): number { return this.mGridLineWidth; }
AST#method_declaration#Left public getGridLineWidth AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST#member_...
public getGridLineWidth(): number { return this.mGridLineWidth; }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/components/AxisBase.ets#L314-L316
b974c1390ed88614b4fcc13572d926855f0a683a
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
checkAndSendTodayBirthdayNotifications
检查并发送今日生日通知
private async checkAndSendTodayBirthdayNotifications(): Promise<void> { try { if (this.todayBirthdays.length > 0) { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[TestSimple] Found ${this.todayBirthdays.length} birthdays today, sending notifications`); // 发送今日生日通知 await t...
AST#method_declaration#Left private async checkAndSendTodayBirthdayNotifications 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#ty...
private async checkAndSendTodayBirthdayNotifications(): Promise<void> { try { if (this.todayBirthdays.length > 0) { hilog.info(LogConstants.DOMAIN_APP, LogConstants.TAG_APP, `[TestSimple] Found ${this.todayBirthdays.length} birthdays today, sending notifications`); await this.notific...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L936-L968
0970f4e1c003e752b50f68ab7de62317562fd1df
github
2763981847/Clock-Alarm.git
8949bedddb7d011021848196735f30ffe2bd1daf
entry/src/main/ets/viewmodel/AlarmClockViewModel.ets
arkts
queryDatabaseAlarms
查询数据库中的闹钟项。 @param callback (alarms: Array<AlarmItem>) => void 回调函数,用于处理查询结果
private queryDatabaseAlarms(callback: (alarms: Array<AlarmItem>) => void) { // 获取全局上下文中的 PreferencesHandler 实例 let preference = GlobalContext.getContext().getObject('preference') as PreferencesHandler; // 从数据库中获取闹钟项数据 preference.get(CommonConstants.ALARM_KEY).then((data: string) => { // 如果数据不为空 ...
AST#method_declaration#Left private queryDatabaseAlarms AST#parameter_list#Left ( AST#parameter#Left callback : AST#type_annotation#Left AST#function_type#Left AST#parameter_list#Left ( AST#parameter#Left alarms : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#t...
private queryDatabaseAlarms(callback: (alarms: Array<AlarmItem>) => void) { let preference = GlobalContext.getContext().getObject('preference') as PreferencesHandler; preference.get(CommonConstants.ALARM_KEY).then((data: string) => { if (!DataTypeUtils.isNull(data)) { thi...
https://github.com/2763981847/Clock-Alarm.git/blob/8949bedddb7d011021848196735f30ffe2bd1daf/entry/src/main/ets/viewmodel/AlarmClockViewModel.ets#L42-L57
f641c25c8ac71b3265019ce6da8933303c325a02
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
core/state/src/main/ets/UserState.ets
arkts
@file 全局用户状态(持久化),提供跨页面共享的响应式状态 @author Joker.X AppStorageV2 键名
export const USER_STATE_KEY: string = "user_state";
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left USER_STATE_KEY : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left "user_state" AST#expression#Right AST#variable_declarator#Right ; AST#variable...
export const USER_STATE_KEY: string = "user_state";
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/core/state/src/main/ets/UserState.ets#L15-L15
a67718eb359b9ac0c222ec2f9d4f8edcbbe7e402
github
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/viewmodel/ProfileViewModel.ets
arkts
getNickNameText
获取昵称展示文本 @returns {ResourceStr} 昵称文本
getNickNameText(): ResourceStr { return this.getUserInfo().nickName ?? $r("app.string.not_set"); }
AST#method_declaration#Left getNickNameText AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left ResourceStr 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_exp...
getNickNameText(): ResourceStr { return this.getUserInfo().nickName ?? $r("app.string.not_set"); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/viewmodel/ProfileViewModel.ets#L92-L94
a1cb54e46e8b834b2d93a866f1cb0d30ecaa6578
github
jjjjjjava/ffmpeg_tools.git
6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161
src/main/ets/ffmpeg/FFmpegCommandBuilder.ets
arkts
preset
设置 x264 预设
public preset(value: string): FFmpegCommandBuilder { this.presetValue = value; return this; }
AST#method_declaration#Left public preset AST#parameter_list#Left ( AST#parameter#Left value : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left FFmpegCommandBuilder AST#p...
public preset(value: string): FFmpegCommandBuilder { this.presetValue = value; return this; }
https://github.com/jjjjjjava/ffmpeg_tools.git/blob/6c73f7540bc7ca3f0d5b3edd7a6c10cb84a26161/src/main/ets/ffmpeg/FFmpegCommandBuilder.ets#L105-L108
0cb215db2cec8d11226359c974add740226ad3f2
github
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/auth/src/main/ets/navigation/LoginNav.ets
arkts
LoginNav
@file 登录页导航入口 @returns {void} 无返回值 @author Joker.X
@Builder export function LoginNav(): void { LoginPage(); }
AST#decorated_export_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right export function LoginNav AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#ui_custom_compo...
@Builder export function LoginNav(): void { LoginPage(); }
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/auth/src/main/ets/navigation/LoginNav.ets#L8-L11
800ea43aa8ff6a6c618a9b6854f1bbe131cfdcba
github
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/views/plan/PlanDetailView.ets
arkts
/ 参数类型
export interface Param { plan : Plan }
AST#export_declaration#Left export AST#interface_declaration#Left interface Param AST#object_type#Left { AST#type_member#Left plan : AST#type_annotation#Left AST#primary_type#Left Plan AST#primary_type#Right AST#type_annotation#Right AST#type_member#Right } AST#object_type#Right AST#interface_declaration#Right AST#expo...
export interface Param { plan : Plan }
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/views/plan/PlanDetailView.ets#L24-L26
5bd641507df8d2b0d3c6992e3114a11c623c25f6
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_web/src/main/ets/arkweb/ArkWebHelper.ets
arkts
clearAllCookiesSync
清除所有cookie。 @param incognito true表示清除隐私模式下webview的所有内存cookies,false表示清除正常非隐私模式下的持久化cookies。
static clearAllCookiesSync(incognito?: boolean): void { webview.WebCookieManager.clearAllCookiesSync(incognito); }
AST#method_declaration#Left static clearAllCookiesSync AST#parameter_list#Left ( AST#parameter#Left incognito ? : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void A...
static clearAllCookiesSync(incognito?: boolean): void { webview.WebCookieManager.clearAllCookiesSync(incognito); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_web/src/main/ets/arkweb/ArkWebHelper.ets#L206-L208
b84b592049f50ec594e9f4a4aeb16811fd87d8e6
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/PasteboardUtil.ets
arkts
hasDataSync
判断系统剪贴板中是否有内容。 @returns
static hasDataSync(): boolean { return PasteboardUtil.getSystemPasteboard().hasDataSync(); }
AST#method_declaration#Left static hasDataSync 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#call_expres...
static hasDataSync(): boolean { return PasteboardUtil.getSystemPasteboard().hasDataSync(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/PasteboardUtil.ets#L60-L62
1d43410e81c83c120630768829bca01f09d76db0
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
ETSUI/ListSample/entry/src/main/ets/viewmodel/PageViewModel.ets
arkts
getTabData
Get item information for the tab. @return {Array<TabItemInfo>} tabItems
getTabData(): Array<TabItemData> { let tabItems: Array<TabItemData> = []; for (let i = 0; i < CommonConstants.TAB_SIZE; i++) { let itemInfo: TabItemData = new TabItemData(); itemInfo.imageOriginal = $r("app.media.ic_normal"); itemInfo.imageActivated = $r("app.media.ic_activated"); itemIn...
AST#method_declaration#Left getTabData AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Array AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left TabItemData AST#primary_type#Right AST#type_annotation#Right > AST#type_argume...
getTabData(): Array<TabItemData> { let tabItems: Array<TabItemData> = []; for (let i = 0; i < CommonConstants.TAB_SIZE; i++) { let itemInfo: TabItemData = new TabItemData(); itemInfo.imageOriginal = $r("app.media.ic_normal"); itemInfo.imageActivated = $r("app.media.ic_activated"); itemIn...
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/ETSUI/ListSample/entry/src/main/ets/viewmodel/PageViewModel.ets#L34-L44
c0de150a8b65172a1eebd0f91e9ba6b887ae2aec
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/CharUtil.ets
arkts
isLowerCase
判断字符串char是否是小写字母 @param char @returns
static isLowerCase(char: string): boolean { return i18n.Unicode.isLowerCase(char); }
AST#method_declaration#Left static isLowerCase AST#parameter_list#Left ( AST#parameter#Left char : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left boolean AST#primary_ty...
static isLowerCase(char: string): boolean { return i18n.Unicode.isLowerCase(char); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/CharUtil.ets#L49-L51
4183e26e5e189081a689fa56469df9441f6a2d2c
gitee
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Service/DMPChannelProxyNext.ets
arkts
RenderToService
不再解析直接透传
public static RenderToService(dataString: string, app: DMPApp) { // DMPLogger.d(Tags.BRIDGE, `RenderToService ${dataString} `); if (app) { app.service.fromRender(dataString); } }
AST#method_declaration#Left public static RenderToService AST#parameter_list#Left ( AST#parameter#Left dataString : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left app : AST#type_annotation#Left AST#primary_type#Left DMPApp ...
public static RenderToService(dataString: string, app: DMPApp) { if (app) { app.service.fromRender(dataString); } }
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Service/DMPChannelProxyNext.ets#L143-L148
ac0cf05227a16387feae9aa56159e7a223e117e3
github
chongzi/Lucky-ArkTs.git
84fc104d4a68def780a483e2543ebf9f53e793fd
entry/src/main/ets/model/InterviewArticleModel.ets
arkts
面试文章模型
export interface InterviewArticleModel { id: number; title: string; summary: string; content: string; author: string; publishDate: string; readTime: number; // 阅读时间(分钟) category: InterviewArticleCategory; tags: string[]; viewCount: number; likeCount: number; isLiked: boolean; coverImage?: stri...
AST#export_declaration#Left export AST#interface_declaration#Left interface InterviewArticleModel 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 title : AST#type_annotati...
export interface InterviewArticleModel { id: number; title: string; summary: string; content: string; author: string; publishDate: string; readTime: number; category: InterviewArticleCategory; tags: string[]; viewCount: number; likeCount: number; isLiked: boolean; coverImage?: string; }
https://github.com/chongzi/Lucky-ArkTs.git/blob/84fc104d4a68def780a483e2543ebf9f53e793fd/entry/src/main/ets/model/InterviewArticleModel.ets#L4-L18
5cceb41ca3ca7504a219f96bd34c3f649307f853
github
zqaini002/YaoYaoLingXian.git
5095b12cbeea524a87c42d0824b1702978843d39
YaoYaoLingXian/entry/src/main/ets/pages/task/TaskEditPage.ets
arkts
cancelReminder
取消提醒
async cancelReminder() { if (this.reminderId < 0) return; try { await reminderAgent.cancelReminder(this.reminderId); console.info(`已取消提醒,ID: ${this.reminderId}`); this.reminderId = -1; } catch (error) { const err = error as BusinessError; console.error(`取消提醒失败: ${err.code}...
AST#method_declaration#Left async cancelReminder AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . rem...
async cancelReminder() { if (this.reminderId < 0) return; try { await reminderAgent.cancelReminder(this.reminderId); console.info(`已取消提醒,ID: ${this.reminderId}`); this.reminderId = -1; } catch (error) { const err = error as BusinessError; console.error(`取消提醒失败: ${err.code}...
https://github.com/zqaini002/YaoYaoLingXian.git/blob/5095b12cbeea524a87c42d0824b1702978843d39/YaoYaoLingXian/entry/src/main/ets/pages/task/TaskEditPage.ets#L393-L404
d903c9f9efc116295175d562369588639b2e1863
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/textAndInput/textStyledStringSample/IntroductionTitle.ets
arkts
IntroductionTitle
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, softw...
@Component export struct IntroductionTitle { private introduction!: Resource | string; build() { Column() { Blank() Text(this.introduction) .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.font_color_grey')) } .width('100%') .padding({ left: ...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct IntroductionTitle AST#component_body#Left { AST#property_declaration#Left private introduction AST#ERROR#Left ! AST#ERROR#Right : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left Resource AST#primary...
@Component export struct IntroductionTitle { private introduction!: Resource | string; build() { Column() { Blank() Text(this.introduction) .fontSize(14) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.font_color_grey')) } .width('100%') .padding({ left: ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/textAndInput/textStyledStringSample/IntroductionTitle.ets#L16-L32
be8de62e06dc348a03554be383e1e09688931e35
gitee
Joker-x-dev/HarmonyKit.git
f97197ce157df7f303244fba42e34918306dfb08
feature/demo/src/main/ets/viewmodel/StateManagementViewModel.ets
arkts
@file 状态管理示例页 ViewModel @author Joker.X
@ObservedV2 export default class StateManagementViewModel extends BaseViewModel { /** * 计数器状态 */ @Trace counterState: DemoCounterState = getDemoCounterState(); /** * 计数加一 * @returns {void} 无返回值 */ increment(): void { this.counterState.increment(); } /** * 计数减一 * @returns {void} ...
AST#decorated_export_declaration#Left AST#decorator#Left @ ObservedV2 AST#decorator#Right export default AST#class_declaration#Left class StateManagementViewModel extends AST#type_annotation#Left AST#primary_type#Left BaseViewModel AST#primary_type#Right AST#type_annotation#Right AST#class_body#Left { /** * 计数器状态 ...
@ObservedV2 export default class StateManagementViewModel extends BaseViewModel { @Trace counterState: DemoCounterState = getDemoCounterState(); increment(): void { this.counterState.increment(); } decrement(): void { this.counterState.decrement(); } reset(): void { this.counter...
https://github.com/Joker-x-dev/HarmonyKit.git/blob/f97197ce157df7f303244fba42e34918306dfb08/feature/demo/src/main/ets/viewmodel/StateManagementViewModel.ets#L8-L39
5d52d5cb067af867c6b4ac14dca5ee1667a873c8
github
bigbear20240612/planner_build-.git
89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1
entry/src/main/ets/viewmodel/WeatherManager.ets
arkts
fetchWeatherFromAPI
从API获取天气数据
private async fetchWeatherFromAPI(city: string): Promise<WeatherData> { return new Promise((resolve, reject) => { const httpRequest = http.createHttp(); // 由于API Key限制,这里使用模拟数据 // 实际项目中需要申请真实的天气API服务 setTimeout(() => { const mockData: WeatherData = { temperature: Math.floo...
AST#method_declaration#Left private async fetchWeatherFromAPI AST#parameter_list#Left ( AST#parameter#Left city : 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#gen...
private async fetchWeatherFromAPI(city: string): Promise<WeatherData> { return new Promise((resolve, reject) => { const httpRequest = http.createHttp(); setTimeout(() => { const mockData: WeatherData = { temperature: Math.floor(Math.random() * 20) + 15, weathe...
https://github.com/bigbear20240612/planner_build-.git/blob/89c0e0027d9c46fa1d0112b71fcc95bb0b97ace1/entry/src/main/ets/viewmodel/WeatherManager.ets#L93-L154
7d48339c0c64ce75c2052268669dc4574370a435
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/game/InteractiveGameService.ets
arkts
initializeGameConfigs
私有方法 初始化游戏配置
private initializeGameConfigs(): void { // 生日知识问答 this.gameConfigs.set(GameType.BIRTHDAY_QUIZ, { id: 'birthday_quiz', type: GameType.BIRTHDAY_QUIZ, name: '生日知识问答', description: '测试你的生日相关知识', difficulty: GameDifficulty.MEDIUM, icon: 'quiz', maxTime: 300, maxAttempt...
AST#method_declaration#Left private initializeGameConfigs AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { // 生日知识问答 AST#expression_statement#Left AST#expression#Left AST#call_expr...
private initializeGameConfigs(): void { this.gameConfigs.set(GameType.BIRTHDAY_QUIZ, { id: 'birthday_quiz', type: GameType.BIRTHDAY_QUIZ, name: '生日知识问答', description: '测试你的生日相关知识', difficulty: GameDifficulty.MEDIUM, icon: 'quiz', maxTime: 300, maxAttempts: 1, ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/game/InteractiveGameService.ets#L457-L562
2cb1d565744795464d09e5a4c9abe46cdb88d7f2
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
Data/SetAppFontSize/entry/src/main/ets/viewmodel/ItemDirection.ets
arkts
Chat list item direction.
export enum ItemDirection { /** * On the left. */ LEFT, /** * On the right. */ RIGHT }
AST#export_declaration#Left export AST#enum_declaration#Left enum ItemDirection AST#enum_body#Left { /** * On the left. */ AST#enum_member#Left LEFT AST#enum_member#Right , /** * On the right. */ AST#enum_member#Left RIGHT AST#enum_member#Right } AST#enum_body#Right AST#enum_declaration#Right AST#export_dec...
export enum ItemDirection { LEFT, RIGHT }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/Data/SetAppFontSize/entry/src/main/ets/viewmodel/ItemDirection.ets#L19-L29
6a6c0fc7576b550169da03347a6c68253e9ba0d7
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/VideoPlay/entry/src/main/ets/components/VideoPanel.ets
arkts
VideoPanel
网络视频索引
@Component export struct VideoPanel { @State videoList: Resource[] = [$r('app.string.video_res_1'), $r('app.string.video_res_2'), $r('app.string.video_res_3'), $r('app.string.video_res_4'), $r('app.string.video_res_5')]; @State selectColor: boolean = true; @Link show: boolean; @Link videoSelect: number; // 当前选择...
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct VideoPanel AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right videoList : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left Resource [ ] AST#array_t...
@Component export struct VideoPanel { @State videoList: Resource[] = [$r('app.string.video_res_1'), $r('app.string.video_res_2'), $r('app.string.video_res_3'), $r('app.string.video_res_4'), $r('app.string.video_res_5')]; @State selectColor: boolean = true; @Link show: boolean; @Link videoSelect: number; @Sto...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/VideoPlay/entry/src/main/ets/components/VideoPanel.ets#L24-L155
2a5f0518083a129052e774b0ee63c49decfffd5b
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videoscreendirectionswitching/src/main/ets/component/VideoComponent.ets
arkts
setSurfaceID
TODO 知识点:XComponent和AVPlayer通过surfaceId绑定
setSurfaceID(): void { logger.info('play video: surfaceID is:' + this.surfaceID); this.avPlayer.surfaceId = this.surfaceID; }
AST#method_declaration#Left setSurfaceID AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#...
setSurfaceID(): void { logger.info('play video: surfaceID is:' + this.surfaceID); this.avPlayer.surfaceId = this.surfaceID; }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videoscreendirectionswitching/src/main/ets/component/VideoComponent.ets#L167-L170
ed9ec2146e816e4440fdcca0c4263f7efb40698b
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/LocationUtil.ets
arkts
isLocationEnabled
判断位置服务是否已经使能(定位是否开启)。 @returns
static isLocationEnabled(): boolean { return geoLocationManager.isLocationEnabled(); }
AST#method_declaration#Left static isLocationEnabled 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#call_...
static isLocationEnabled(): boolean { return geoLocationManager.isLocationEnabled(); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/LocationUtil.ets#L36-L38
4380bd7e3b63921e8b930c806c4ce19036dc5eb4
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceSM2/entry/src/main/ets/pages/sm2/SM2EncryptionDecryptionAsync.ets
arkts
encryptMessagePromise
加密消息
async function encryptMessagePromise(publicKey: cryptoFramework.PubKey, plainText: cryptoFramework.DataBlob) { let cipher = cryptoFramework.createCipher('SM2_256|SM3'); await cipher.init(cryptoFramework.CryptoMode.ENCRYPT_MODE, publicKey, null); let encryptData = await cipher.doFinal(plainText); return encryptD...
AST#function_declaration#Left async function encryptMessagePromise AST#parameter_list#Left ( AST#parameter#Left publicKey : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left cryptoFramework . PubKey AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#...
async function encryptMessagePromise(publicKey: cryptoFramework.PubKey, plainText: cryptoFramework.DataBlob) { let cipher = cryptoFramework.createCipher('SM2_256|SM3'); await cipher.init(cryptoFramework.CryptoMode.ENCRYPT_MODE, publicKey, null); let encryptData = await cipher.doFinal(plainText); return encryptD...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/Security/CryptoArchitectureKit/EncryptionDecryption/EncryptionDecryptionGuidanceSM2/entry/src/main/ets/pages/sm2/SM2EncryptionDecryptionAsync.ets#L20-L25
d4a746704de51d0617471797a021ba00f2109283
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/textAndInput/richEditorSample/Title.ets
arkts
Title
Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
@Component export struct Title { private title!: Resource; build() { Column() { Row() { Text(this.title) .fontSize(24) .fontWeight(FontWeight.Bold) } .margin({top:"2%",left:"5%"}) .width('100%') } .height('100%') } }
AST#decorated_export_declaration#Left AST#decorator#Left @ Component AST#decorator#Right export struct Title AST#component_body#Left { AST#property_declaration#Left private title AST#ERROR#Left ! AST#ERROR#Right : AST#type_annotation#Left AST#primary_type#Left Resource AST#primary_type#Right AST#type_annotation#Right ;...
@Component export struct Title { private title!: Resource; build() { Column() { Row() { Text(this.title) .fontSize(24) .fontWeight(FontWeight.Bold) } .margin({top:"2%",left:"5%"}) .width('100%') } .height('100%') } }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/UI/ArkTsComponentCollection/ComponentCollection/entry/src/main/ets/pages/components/textAndInput/richEditorSample/Title.ets#L16-L32
b364ce5b6bdec924ec6c46d7ba5ce756a9e316e9
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/gridexchange/src/main/ets/model/AttributeModifier.ets
arkts
initializeModifier
定义组件普通状态时的样式 @param instance
initializeModifier(instance: ColumnAttribute): void { instance.translate({ x: 0, y: 0 }) .visibility(Visibility.Visible); }
AST#method_declaration#Left initializeModifier AST#parameter_list#Left ( AST#parameter#Left instance : AST#type_annotation#Left AST#primary_type#Left ColumnAttribute 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#...
initializeModifier(instance: ColumnAttribute): void { instance.translate({ x: 0, y: 0 }) .visibility(Visibility.Visible); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/gridexchange/src/main/ets/model/AttributeModifier.ets#L46-L49
985d22bb10896cd50030617ab25e5606cf21ca2a
gitee
openharmony/xts_acts
5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686
arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/getTarget/getTarget3.ets
arkts
Date类型创建代理
build() { Column() { Text(`this.observedObject === globalObservedObject ${this.observedObject === UIUtils.getTarget(globalObservedObject)}`).id('useGetTarget3_1') // true Text(`UIUtils.getTarget(this.numberList) === globalNumberList: ${UIUtils.getTarget(this.numberList) === globalNumberList}...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Text ( AST#expression#Left AST#template_literal#Left ` ...
build() { Column() { Text(`this.observedObject === globalObservedObject ${this.observedObject === UIUtils.getTarget(globalObservedObject)}`).id('useGetTarget3_1') Text(`UIUtils.getTarget(this.numberList) === globalNumberList: ${UIUtils.getTarget(this.numberList) === globalNumberList}`).id('...
https://github.com/openharmony/xts_acts/blob/5eb33396ca0ffafd9e5d0ba4b5dedfde44aff686/arkui/ace_ets_module_noui/ace_ets_module_StateMangagement/ace_ets_module_StateMangagement02_api12/entry/src/main/ets/MainAbility/pages/getTarget/getTarget3.ets#L36-L49
47e7638fbb1f1e1f278e69de416aca008ccb81cf
gitee
didi/dimina.git
7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2
harmony/dimina/src/main/ets/Bridges/DMPBridges.ets
arkts
invokeContainerMethodInfo
moduleName:module名 methodName:方法名 params: 传递的参数,可以为null,null表示不传递参数 unfold:是否将参数展开调用,默认false 传参方式 true: ...params false: params callback:回调,默认最后一个参数
private static invokeContainerMethodInfo(methodName: string, webViewId: number, params: DMPMap | number | string | boolean | object, callback: DMPBridgeCallback, moduleManager: DMPModuleManager): number | string | boolean | object { let moduleName = 'DMPContainerBridgesModule'; let invokeParams = params...
AST#method_declaration#Left private static invokeContainerMethodInfo AST#parameter_list#Left ( AST#parameter#Left methodName : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left webViewId : AST#type_annotation#Left AST#primary_...
private static invokeContainerMethodInfo(methodName: string, webViewId: number, params: DMPMap | number | string | boolean | object, callback: DMPBridgeCallback, moduleManager: DMPModuleManager): number | string | boolean | object { let moduleName = 'DMPContainerBridgesModule'; let invokeParams = params...
https://github.com/didi/dimina.git/blob/7ad9d89af58cd54e624b2e3d3eb14801cc8e05d2/harmony/dimina/src/main/ets/Bridges/DMPBridges.ets#L99-L124
f8d23d19897726825ebcf2932b8529c712ee4b66
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Legend.ets
arkts
setEntries
This method sets the automatically computed colors for the legend. Use setCustom(...) to set custom colors. @param entries
public setEntries(entries: JArrayList<LegendEntry>): void { this.mEntries = entries.toArray(new Array(entries.size())); }
AST#method_declaration#Left public setEntries AST#parameter_list#Left ( AST#parameter#Left entries : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left JArrayList AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left LegendEntry AST#primary_type#Right AST#type_annotation#Right > AST...
public setEntries(entries: JArrayList<LegendEntry>): void { this.mEntries = entries.toArray(new Array(entries.size())); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/Legend.ets#L147-L149
e708ebf64ea70b62af41baa4972ca73915263d84
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/model/src/main/ets/entity/Feedback.ets
arkts
@file 意见反馈模型 @author Joker.X
export class Feedback { /** * ID */ id: number = 0; /** * 用户ID */ userId: number = 0; /** * 联系方式 */ contact: string = ""; /** * 类型 */ type: number = 0; /** * 内容 */ content: string = ""; /** * 图片 */ images?: string[] | null = null; /** * 状态 0-未处理 1-已处理 ...
AST#export_declaration#Left export AST#class_declaration#Left class Feedback AST#class_body#Left { /** * ID */ AST#property_declaration#Left id : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left 0 AST#expression#Right ; AST#property_decla...
export class Feedback { id: number = 0; userId: number = 0; contact: string = ""; type: number = 0; content: string = ""; images?: string[] | null = null; status: number = 0; handlerId?: number | null = null; remark?: string | null = null; createTime?: string | null = n...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/model/src/main/ets/entity/Feedback.ets#L5-L67
28e53478377c155d05f892b7a9a31cd68e684bba
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/ArkWeb/UsingWebMultimedia/entry2/src/main/ets/pages/PlayerDemo.ets
arkts
setAVPlayerCallback
注册avplayer回调函数
setAVPlayerCallback(avPlayer: media.AVPlayer, listener?: AVPlayerListener) { // seek操作结果回调函数 avPlayer.on('seekDone', (seekDoneTime: number) => { console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`); }); // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程 avPlayer.on('error', (e...
AST#method_declaration#Left setAVPlayerCallback AST#parameter_list#Left ( AST#parameter#Left avPlayer : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left media . AVPlayer AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left listener ? : ...
setAVPlayerCallback(avPlayer: media.AVPlayer, listener?: AVPlayerListener) { avPlayer.on('seekDone', (seekDoneTime: number) => { console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`); }); avPlayer.on('error', (err: BusinessError) => { console.error(`Invoke avPlayer fail...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/ArkWeb/UsingWebMultimedia/entry2/src/main/ets/pages/PlayerDemo.ets#L62-L86
1cc72712b47f904e21595d6a2432b35bc80fbfe2
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/DocsSample/CoreFile/UserFile/UserFileURI/entry/src/main/ets/pages/Index.ets
arkts
documentURIExample
[Start function_example]
async documentURIExample() { let fileAccessHelper: fileAccess.FileAccessHelper; // wantInfos 从getFileAccessAbilityInfo()获取 let wantInfos: Want[] = [ { bundleName: 'com.ohos.UserFile.ExternalFileManager', abilityName: 'FileExtensionAbility', }, ]; try { fileAccessHel...
AST#method_declaration#Left async documentURIExample AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left fileAccessHelper : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left fileAccess . Fi...
async documentURIExample() { let fileAccessHelper: fileAccess.FileAccessHelper; let wantInfos: Want[] = [ { bundleName: 'com.ohos.UserFile.ExternalFileManager', abilityName: 'FileExtensionAbility', }, ]; try { fileAccessHelper = fileAccess.createFileAccessHelper(co...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/DocsSample/CoreFile/UserFile/UserFileURI/entry/src/main/ets/pages/Index.ets#L218-L257
083c2642d2368738e8667575036102c329be2dc6
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/ai/AIAssistantService.ets
arkts
recognizeIntent
意图识别
private async recognizeIntent(message: string, context: ConversationContext): Promise<IntentResult> { try { let bestIntent = 'general_chat'; let bestConfidence = 0; const entities: Record<string, string | number | boolean> = {}; // 规则匹配 for (const [intent, patterns] of this.intentPatt...
AST#method_declaration#Left private async recognizeIntent AST#parameter_list#Left ( AST#parameter#Left message : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left Conver...
private async recognizeIntent(message: string, context: ConversationContext): Promise<IntentResult> { try { let bestIntent = 'general_chat'; let bestConfidence = 0; const entities: Record<string, string | number | boolean> = {}; for (const [intent, patterns] of this.intentPatterns.en...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/ai/AIAssistantService.ets#L593-L648
c337edb4725f09a07a7235db7a39ac93b5b6186c
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/FileUtil.ets
arkts
mkdtempSync
创建临时目录,以同步的方法。 @param prefix string 用随机产生的字符串替换以“XXXXXX”结尾目录路径。 @returns
static mkdtempSync(prefix: string): string { return fs.mkdtempSync(prefix); }
AST#method_declaration#Left static mkdtempSync AST#parameter_list#Left ( AST#parameter#Left prefix : 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_t...
static mkdtempSync(prefix: string): string { return fs.mkdtempSync(prefix); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/FileUtil.ets#L846-L848
e683ff9c954f3a777e0399f6f0724de2bf003415
gitee
fengmingdev/protobuf-arkts-generator.git
75888d404fd6ce52a046cba2a94807ecf1350147
runtime/arkpb/BinaryEncodingVisitor.ets
arkts
Binary 编码 Visitor 将消息编码为 Protobuf wire format (二进制) 使用方式: ```typescript const visitor = new BinaryEncodingVisitor() message.traverse(visitor) const binary = visitor.finish() ``` 递归深度保护: - 最大嵌套深度:100 层 - 超过限制会抛出错误 - 防止恶意构造的深层嵌套消息导致栈溢出
export class BinaryEncodingVisitor implements Visitor { private writer: Writer private recursionDepth: number = 0 private readonly maxRecursionDepth: number = 100 constructor
AST#export_declaration#Left export AST#ERROR#Left class BinaryEncodingVisitor AST#implements_clause#Left implements Visitor AST#implements_clause#Right { AST#property_declaration#Left private writer : AST#type_annotation#Left AST#primary_type#Left Writer AST#primary_type#Right AST#type_annotation#Right AST#property_de...
export class BinaryEncodingVisitor implements Visitor { private writer: Writer private recursionDepth: number = 0 private readonly maxRecursionDepth: number = 100 constructor
https://github.com/fengmingdev/protobuf-arkts-generator.git/blob/75888d404fd6ce52a046cba2a94807ecf1350147/runtime/arkpb/BinaryEncodingVisitor.ets#L42-L47
d3c4dd106f53adc25afedb57b71ca04993be4cb0
github
openharmony/applications_launcher
f75dfb6bf7276e942793b75e7a9081bbcd015843
feature/form/src/main/ets/default/view/FormServiceComponent.ets
arkts
createAddFormToDesktopMenuInfo
添加卡片至桌面 @param formInfo 卡片信息
private createAddFormToDesktopMenuInfo(formItem: CardItemInfo): MenuInfo[] { let menuInfoList: MenuInfo[] = []; let addFormToDesktopMenuInfo: MenuInfo = new MenuInfo(); addFormToDesktopMenuInfo.menuType = CommonConstants.MENU_TYPE_FIXED; addFormToDesktopMenuInfo.menuImgSrc = '/common/pics/ic_form_addToD...
AST#method_declaration#Left private createAddFormToDesktopMenuInfo AST#parameter_list#Left ( AST#parameter#Left formItem : AST#type_annotation#Left AST#primary_type#Left CardItemInfo AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_ty...
private createAddFormToDesktopMenuInfo(formItem: CardItemInfo): MenuInfo[] { let menuInfoList: MenuInfo[] = []; let addFormToDesktopMenuInfo: MenuInfo = new MenuInfo(); addFormToDesktopMenuInfo.menuType = CommonConstants.MENU_TYPE_FIXED; addFormToDesktopMenuInfo.menuImgSrc = '/common/pics/ic_form_addToD...
https://github.com/openharmony/applications_launcher/blob/f75dfb6bf7276e942793b75e7a9081bbcd015843/feature/form/src/main/ets/default/view/FormServiceComponent.ets#L222-L236
33fd06d5c0bfc7a8c063adeacc74919d1666484b
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/ApplicationModels/CustomShare/ShareComponent/src/main/ets/pages/Dialog.ets
arkts
Data
button的弹窗
@CustomDialog export struct ButtonDialogBuilder { private controller?: CustomDialogController private shareDialogController?: CustomDialogController private detailTitleText: string = '' private detailPriceText: string = '' private title: string = '' private srcImage: string = '' private context?: AbilityC...
AST#decorated_export_declaration#Left AST#decorator#Left @ CustomDialog AST#decorator#Right export AST#ERROR#Left struct ButtonDialogBuilder { AST#property_declaration#Left private controller ? : AST#type_annotation#Left AST#primary_type#Left CustomDialogController AST#primary_type#Right AST#type_annotation#Right AST#...
@CustomDialog export struct ButtonDialogBuilder { private controller?: CustomDialogController private shareDialogController?: CustomDialogController private detailTitleText: string = '' private detailPriceText: string = '' private title: string = '' private srcImage: string = '' private context?: AbilityC...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/ApplicationModels/CustomShare/ShareComponent/src/main/ets/pages/Dialog.ets#L131-L187
39fa3256cd9fd39305e1b79fab4d7c9e6e1f1520
gitee
openharmony/arkui_ace_engine
30c7d1ee12fbedf0fabece54291d75897e2ad44f
frameworks/bridge/arkts_frontend/koala_mirror/ui2abc/libarkts/plugins/input/library.ets
arkts
Copyright (c) 2025 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
export function testFunction(): string { return "yes" }
AST#export_declaration#Left export AST#function_declaration#Left function testFunction 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 ret...
export function testFunction(): string { return "yes" }
https://github.com/openharmony/arkui_ace_engine/blob/30c7d1ee12fbedf0fabece54291d75897e2ad44f/frameworks/bridge/arkts_frontend/koala_mirror/ui2abc/libarkts/plugins/input/library.ets#L16-L18
5ddbdd46fb5e99fe82246c1106a2ae8d1b864b50
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/crypto/SHA.ets
arkts
digestSync
SHA摘要,同步 @param data 待摘要的数据 @param algName 摘要算法名(SHA1、SHA224、SHA256、SHA384、SHA512)。 @param resultCoding 摘要的编码方式(base64/hex),默认不传为hex。 @returns
static digestSync(data: string, algName: crypto.SHA = 'SHA256', resultCoding: crypto.BhCoding = 'hex'): string { return CryptoUtil.digestSync(data, algName, resultCoding); }
AST#method_declaration#Left static digestSync AST#parameter_list#Left ( AST#parameter#Left data : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left algName : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Le...
static digestSync(data: string, algName: crypto.SHA = 'SHA256', resultCoding: crypto.BhCoding = 'hex'): string { return CryptoUtil.digestSync(data, algName, resultCoding); }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/crypto/SHA.ets#L49-L52
cd3564856cc43b1bbc0722c12fe7368367bcc719
gitee
huaweicloud/huaweicloud-iot-device-sdk-arkts.git
72954bea19e7e7f93567487b036c0664457bdaf3
entry/src/main/ets/pages/components/ScrollerLog.ets
arkts
创建一个滚动控制器
build() { Column() { Scroll(this.scroller) { // 绑定滚动控制器 Column() { ForEach(this.logArr, (log: string) => { // ForEach语法循环创建子组件 Text(log) .fontSize(12) .width('98%') .borderRadius(10) .backgroundColor(Color.White) ...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Scroll ( AST#expression#Left AST#member_expression#Left...
build() { Column() { Scroll(this.scroller) { Column() { ForEach(this.logArr, (log: string) => { Text(log) .fontSize(12) .width('98%') .borderRadius(10) .backgroundColor(Color.White) .margin({ top: 10 }) ...
https://github.com/huaweicloud/huaweicloud-iot-device-sdk-arkts.git/blob/72954bea19e7e7f93567487b036c0664457bdaf3/entry/src/main/ets/pages/components/ScrollerLog.ets#L23-L56
709a19b2f445c4bba8f4a93ecddd81f3170e1b51
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/LegendRenderer.ets
arkts
computeLegend
Prepares the legend and calculates all needed forms, labels and colors. @param data
public computeLegend(data?: ChartData<IDataSet<EntryOhos>>): void { if (!this.mLegend.isLegendCustom() && data) { this.computedEntries.clear(); // loop for building up the colors and labels used in the legend for (let i: number = 0; i < data.getDataSetCount(); i++) { ...
AST#method_declaration#Left public computeLegend AST#parameter_list#Left ( AST#parameter#Left data ? : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left ChartData AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left IDataSet AST#type_arguments#Left < AST#type...
public computeLegend(data?: ChartData<IDataSet<EntryOhos>>): void { if (!this.mLegend.isLegendCustom() && data) { this.computedEntries.clear(); for (let i: number = 0; i < data.getDataSetCount(); i++) { let dataSet: IDataSet<EntryOhos> = data.getDataSetByInd...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/LegendRenderer.ets#L104-L208
8011f6adad1ce608c6efbbdf19fb3940249d9b42
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets
arkts
insertOrUpdateData
数据的增删改查操作 1、调用put()方法向键值数据库中插入数据(新增或修改数据)
async insertOrUpdateData(key: string, value: string) { if (kvStore !== undefined) { try { kvStore.put(key, value, (err) => { if (err !== undefined) { console.error(`Failed to put data. Code:${err.code},message:${err.message}`); return; } console.in...
AST#method_declaration#Left async insertOrUpdateData 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 value : AST#type_annotation#Left AST#primary_type#Left string AST#primar...
async insertOrUpdateData(key: string, value: string) { if (kvStore !== undefined) { try { kvStore.put(key, value, (err) => { if (err !== undefined) { console.error(`Failed to put data. Code:${err.code},message:${err.message}`); return; } console.in...
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/complete/ArkData/KVManagerDemo/entry/src/main/ets/database/KVManager.ets#L32-L47
96874a870b7d14e498a6bddffb9846a3f0ebbbf7
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets
arkts
incrementalVersion
差异版本号
static incrementalVersion(): string { return deviceInfo.incrementalVersion }
AST#method_declaration#Left static incrementalVersion 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#membe...
static incrementalVersion(): string { return deviceInfo.incrementalVersion }
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/DeviceManagement/DeviceManagementCollection/feature/capabilities/src/main/ets/util/DeviceUtil.ets#L120-L122
fcf0193768261a0ac7146e547b3a3f4feb9cfdb8
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ViewPortHandler.ets
arkts
Class that contains information about the charts current viewport settings, including offsets, scale & translation levels, ...
export default class ViewPortHandler { /** * matrix used for touch events */ public mMatrixTouch: Matrix = new Matrix(); /** * this rectangle defines the area in which graph values can be drawn */ protected mContentRect = new MyRect(); protected mChartWidth: number = 0.0; protected mChartHeight:...
AST#export_declaration#Left export default AST#ERROR#Left class ViewPortHandler { /** * matrix used for touch events */ AST#property_declaration#Left public mMatrixTouch : AST#type_annotation#Left AST#primary_type#Left Matrix AST#primary_type#Right AST#type_annotation#Right = AST#expression#Left AST#call_expressi...
export default class ViewPortHandler { public mMatrixTouch: Matrix = new Matrix(); protected mContentRect = new MyRect(); protected mChartWidth: number = 0.0; protected mChartHeight: number = 0.0; private mMinScaleY: number = 1.0; private mMaxScaleY: number = Number.MAX_VALUE; private mMinS...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ViewPortHandler.ets#L31-L397
dc928ff896550a70e518c32a5db11ca7669e6cde
gitee
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GlobalTypes.ets
arkts
加载状态枚举
export enum LoadingStatus { IDLE = 'idle', LOADING = 'loading', SUCCESS = 'success', ERROR = 'error' }
AST#export_declaration#Left export AST#enum_declaration#Left enum LoadingStatus AST#enum_body#Left { AST#enum_member#Left IDLE = AST#expression#Left 'idle' AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LOADING = AST#expression#Left 'loading' AST#expression#Right AST#enum_member#Right , AST#enum_memb...
export enum LoadingStatus { IDLE = 'idle', LOADING = 'loading', SUCCESS = 'success', ERROR = 'error' }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GlobalTypes.ets#L49-L54
df3023425e2b6bcf3aab1e71a5e6142e394f4fe6
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/dialog/DialogHelper.ets
arkts
TODO Dialog帮助工具类(全局自定义弹框,不依赖UI组件) author: 桃花镇童长老ᥫ᭡ since: 2024/08/01
export class DialogHelper { private static mainUIContext: UIContext | undefined; //MainWindow的UIContext /** * 设置默认统一样式 * @param configs */ static setDefaultConfig(configs: (config: DialogConfig) => void): void { configs(ActionParameter.config); } /** * 获取UIAbilityContext * @returns ...
AST#export_declaration#Left export AST#class_declaration#Left class DialogHelper AST#class_body#Left { AST#property_declaration#Left private static mainUIContext : AST#type_annotation#Left AST#union_type#Left AST#primary_type#Left UIContext AST#primary_type#Right | AST#primary_type#Left undefined AST#primary_type#Right...
export class DialogHelper { private static mainUIContext: UIContext | undefined; static setDefaultConfig(configs: (config: DialogConfig) => void): void { configs(ActionParameter.config); } static getUIAbilityContext(): common.UIAbilityContext { if (ActionParameter.config?.uiAbilityContext) {...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/dialog/DialogHelper.ets#L61-L444
c2eae4d0d5c699bc3a0e8d8ccdefa834fc813dbd
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/Rect.ets
arkts
copyOrNull
Returns a copy of {@code r} if {@code r} is not {@code null}, or {@code null} otherwise. @hide
public static copyOrNull(r: MyRect): MyRect { return r == null ? null : new MyRect(r.left, r.top, r.right, r.bottom); }
AST#method_declaration#Left public static copyOrNull AST#parameter_list#Left ( AST#parameter#Left r : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left MyRect AST#primary_...
public static copyOrNull(r: MyRect): MyRect { return r == null ? null : new MyRect(r.left, r.top, r.right, r.bottom); }
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/data/Rect.ets#L59-L61
f4b0938d1e964331431b7ebbd5c99db00ff27702
gitee
pangpang20/wavecast.git
d3da8a0009eb44a576a2b9d9d9fe6195a2577e32
entry/src/main/ets/pages/SearchPage.ets
arkts
performSearch
执行搜索
async performSearch() { if (this.searchKeyword.trim().length === 0) { return; } this.isSearching = true; this.currentOffset = 0; try { const results = await PodcastService.getInstance().searchPodcasts(this.searchKeyword, 0, this.pageSize); this.searchResults = results; ...
AST#method_declaration#Left async performSearch AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left AST#call_expression#Left AST#exp...
async performSearch() { if (this.searchKeyword.trim().length === 0) { return; } this.isSearching = true; this.currentOffset = 0; try { const results = await PodcastService.getInstance().searchPodcasts(this.searchKeyword, 0, this.pageSize); this.searchResults = results; ...
https://github.com/pangpang20/wavecast.git/blob/d3da8a0009eb44a576a2b9d9d9fe6195a2577e32/entry/src/main/ets/pages/SearchPage.ets#L294-L317
abbe85189195c1019e64726d3e6c94e62b6dd72b
github
ThePivotPoint/ArkTS-LSP-Server-Plugin.git
6231773905435f000d00d94b26504433082ba40b
packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets
arkts
Defines label options. @interface LabelOptions @syscap SystemCapability.ArkUI.ArkUI.Full @crossplatform @atomicservice @since 12
export interface LabelOptions { /** * Text content. * * @type { string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ text: string; }
AST#export_declaration#Left export AST#interface_declaration#Left interface LabelOptions AST#object_type#Left { /** * Text content. * * @type { string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ AST#type_member#Left text : AST#ty...
export interface LabelOptions { text: string; }
https://github.com/ThePivotPoint/ArkTS-LSP-Server-Plugin.git/blob/6231773905435f000d00d94b26504433082ba40b/packages/declarations/ets/api/@ohos.arkui.advanced.ChipGroup.d.ets#L61-L72
334d35f97bf8b17a659573bf54640673dcb4eb51
github
hqj201013136012/HarmonyMiliUiPro.git
0625e681e07b771998a0ac4430824627d0eb60ed
entry/src/main/ets/viewmodel/SecurityData.ets
arkts
在家撤防
export const SECURITY_AT_HOME_TYPE = "1" // 外出布防
AST#export_declaration#Left export AST#variable_declaration#Left const AST#variable_declarator#Left SECURITY_AT_HOME_TYPE = AST#expression#Left "1" AST#expression#Right AST#variable_declarator#Right // 外出布防 AST#variable_declaration#Right AST#export_declaration#Right
export const SECURITY_AT_HOME_TYPE = "1"
https://github.com/hqj201013136012/HarmonyMiliUiPro.git/blob/0625e681e07b771998a0ac4430824627d0eb60ed/entry/src/main/ets/viewmodel/SecurityData.ets#L58-L60
e6b8045558c22d15072deff595408132c27d4cbb
github
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/view/WeekViewItem.ets
arkts
updateWeekData
更新周数据
updateWeekData() { this.getWeekViewData(this.weekNum); }
AST#method_declaration#Left updateWeekData 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 . getWeekViewData AST#m...
updateWeekData() { this.getWeekViewData(this.weekNum); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/calendarswitch/src/main/ets/customcalendar/view/WeekViewItem.ets#L74-L76
1b38e7565887b4ea3ea07c455315c5badf083ee1
gitee
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/modules/map/MapManager.ets
arkts
getCurrentLocation
获取当前位置
async getCurrentLocation(): Promise<Location | null> { try { Logger.info('MapManager', 'Getting current location'); // Mock 位置(实际实现需要使用 @ohos.geolocation) return { latitude: 39.9042, longitude: 116.4074, address: '北京市' }; } catch (error) { Logger.error('MapM...
AST#method_declaration#Left async getCurrentLocation 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#union_type#Left AST#primary_type#Left Location AST#primary_type#Right | AST#prim...
async getCurrentLocation(): Promise<Location | null> { try { Logger.info('MapManager', 'Getting current location'); return { latitude: 39.9042, longitude: 116.4074, address: '北京市' }; } catch (error) { Logger.error('MapManager', `Failed to get current locati...
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/modules/map/MapManager.ets#L37-L50
669ef7c588f0e86c75a3e0ef9d02e6bb88cc6943
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/services/lunar/LunarService.ets
arkts
getLocalSolarTerms
获取本地简化节气数据 @param year 年份 @returns 节气信息列表
private getLocalSolarTerms(year: number): SolarTerm[] { const terms: SolarTerm[] = []; const solarTermsList = [ '立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种', '夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至', '小寒', '大寒' ]; // 简化的节气日期计算(实际日期会有小幅...
AST#method_declaration#Left private getLocalSolarTerms AST#parameter_list#Left ( AST#parameter#Left year : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#array_type...
private getLocalSolarTerms(year: number): SolarTerm[] { const terms: SolarTerm[] = []; const solarTermsList = [ '立春', '雨水', '惊蛰', '春分', '清明', '谷雨', '立夏', '小满', '芒种', '夏至', '小暑', '大暑', '立秋', '处暑', '白露', '秋分', '寒露', '霜降', '立冬', '小雪', '大雪', '冬至', '小寒', '大寒' ]; const termDates ...
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/services/lunar/LunarService.ets#L495-L522
41277198484c9a6169b2b5a716188ee8c5e3fc8e
github
harmonyos_samples/BestPracticeSnippets
490ea539a6d4427dd395f3dac3cf4887719f37af
NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets
arkts
getSignalType
[End get_network_status] [Start get_signal_type]
getSignalType() { let slotId: number = 0; radio.getSignalInformation(slotId, (err: BusinessError, data: Array<radio.SignalInformation>) => { if (err) { hilog.error(0x0000, 'Sample', 'getSignalInformation failed, callback: err->: %{public}s', JSON.stringify(err)); return; } hilo...
AST#method_declaration#Left getSignalType AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#variable_declaration#Left let AST#variable_declarator#Left slotId : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right = AS...
getSignalType() { let slotId: number = 0; radio.getSignalInformation(slotId, (err: BusinessError, data: Array<radio.SignalInformation>) => { if (err) { hilog.error(0x0000, 'Sample', 'getSignalInformation failed, callback: err->: %{public}s', JSON.stringify(err)); return; } hilo...
https://github.com/harmonyos_samples/BestPracticeSnippets/blob/490ea539a6d4427dd395f3dac3cf4887719f37af/NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets#L48-L61
9e021314104ba59e6cdb1a7d56362811f61d873b
gitee
mayuanwei/harmonyOS_bilibili
8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5
HCIA/demoCollect/startAbility/frame/AbilityKit/StartAbilityForResult/entry/src/main/ets/pages/Index.ets
arkts
startAccountAbilityForResult
TODO 启动AccountAbility
async startAccountAbilityForResult() { }
AST#method_declaration#Left async startAccountAbilityForResult AST#parameter_list#Left ( ) AST#parameter_list#Right AST#builder_function_body#Left { } AST#builder_function_body#Right AST#method_declaration#Right
async startAccountAbilityForResult() { }
https://github.com/mayuanwei/harmonyOS_bilibili/blob/8a36b68b1ddf4433e2e17ee10fee4993cce2a6c5/HCIA/demoCollect/startAbility/frame/AbilityKit/StartAbilityForResult/entry/src/main/ets/pages/Index.ets#L130-L132
ae0904ad5f2030370b61632eb5961fd01c73dfa8
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets
arkts
play
启动播放 @returns {void}
play(): void { this.avplayerModel.play(); }
AST#method_declaration#Left play AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression#Left AST...
play(): void { this.avplayerModel.play(); }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/foldablescreencases/src/main/ets/viewmodel/MusicPlayViewModel.ets#L213-L215
0e9adb3335010c9aa98cdda21aa0677bf545c3eb
gitee
Piagari/arkts_example.git
a63b868eaa2a50dc480d487b84c4650cc6a40fc8
hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/SystemUtils.ets
arkts
startBrowsableAbility
浏览器打开
async startBrowsableAbility(context: common.UIAbilityContext, uri: string): Promise<void> { let want: Want = { action: 'ohos.want.action.viewData', entities: ['entity.system.browsable'], uri: uri }; context.startAbility(want) .then(() => { console.error('Start browsableAbilit...
AST#method_declaration#Left async startBrowsableAbility AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Le...
async startBrowsableAbility(context: common.UIAbilityContext, uri: string): Promise<void> { let want: Want = { action: 'ohos.want.action.viewData', entities: ['entity.system.browsable'], uri: uri }; context.startAbility(want) .then(() => { console.error('Start browsableAbilit...
https://github.com/Piagari/arkts_example.git/blob/a63b868eaa2a50dc480d487b84c4650cc6a40fc8/hmos_app-main/hmos_app-main/legado-Harmony-master/entry/src/main/ets/common/utils/SystemUtils.ets#L11-L24
9e6dfa3e59b80bf98172644887a699a0be9b387d
github
YShelter/Accouting_ArkTS.git
8c663c85f2c11738d4eabf269c23dc1ec84eb013
entry/src/main/ets/common/database/Rdb/RdbHelperImp.ets
arkts
update
修改表格中的数据
update(values: dataRdb.ValuesBucket, rdbPredicates: dataRdb.RdbPredicates): Promise<number> { return this.rdbStore.update(values, rdbPredicates); }
AST#method_declaration#Left update AST#parameter_list#Left ( AST#parameter#Left values : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left dataRdb . ValuesBucket AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left rdbPredicates : AST#ty...
update(values: dataRdb.ValuesBucket, rdbPredicates: dataRdb.RdbPredicates): Promise<number> { return this.rdbStore.update(values, rdbPredicates); }
https://github.com/YShelter/Accouting_ArkTS.git/blob/8c663c85f2c11738d4eabf269c23dc1ec84eb013/entry/src/main/ets/common/database/Rdb/RdbHelperImp.ets#L151-L153
e7877ea4255f194b043e9ef699406d8add97873b
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/utils/LunarCalendar.ets
arkts
getSupportedYearRange
获取支持的年份范围
static getSupportedYearRange(): YearRange { return { min: 1900, max: 2100 } as YearRange; }
AST#method_declaration#Left static getSupportedYearRange AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left YearRange AST#primary_type#Right AST#type_annotation#Right AST#block_statement#Left { AST#statement#Left AST#return_statement#Left return AST#expression#Left AST...
static getSupportedYearRange(): YearRange { return { min: 1900, max: 2100 } as YearRange; }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/utils/LunarCalendar.ets#L194-L199
65685866b490ee0cbd07c750b53c11a9e2ba4ce7
github
openharmony/codelabs
d899f32a52b2ae0dfdbb86e34e8d94645b5d4090
ETSUI/SimpleCalculator/entry/src/main/ets/common/constants/CommonConstants.ets
arkts
Operator Precedence Enumeration.
export enum Priority { HIGH = 2, MEDIUM = 1, LOW = 0 }
AST#export_declaration#Left export AST#enum_declaration#Left enum Priority AST#enum_body#Left { AST#enum_member#Left HIGH = AST#expression#Left 2 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left MEDIUM = AST#expression#Left 1 AST#expression#Right AST#enum_member#Right , AST#enum_member#Left LOW = AST#e...
export enum Priority { HIGH = 2, MEDIUM = 1, LOW = 0 }
https://github.com/openharmony/codelabs/blob/d899f32a52b2ae0dfdbb86e34e8d94645b5d4090/ETSUI/SimpleCalculator/entry/src/main/ets/common/constants/CommonConstants.ets#L127-L131
83c9ab700beebf30f4ad0080206c41798e86ae28
gitee
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/BasicFeature/Media/VideoSwitching/entry/src/main/ets/component/VideoComponent.ets
arkts
init
初始化AVPlayer
async init(): Promise<void> { const context = getContext(this); // 获取fdSrc用于注册AVPlayer // TODO: 大概是由于avplayer还没有进入prepared状态就划到了当前视频并被执行播放 context.resourceManager.getRawFd(this.fileUrl).then(async (value: resourceManager.RawFileDescriptor) => { this.avPlayer = await media.createAVPlayer(); t...
AST#method_declaration#Left async init AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type#Left Promise AST#type_arguments#Left < AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right > AST#type_arguments#R...
async init(): Promise<void> { const context = getContext(this); context.resourceManager.getRawFd(this.fileUrl).then(async (value: resourceManager.RawFileDescriptor) => { this.avPlayer = await media.createAVPlayer(); this.isCreate = true; await this.setSourceInfo(); await this....
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/BasicFeature/Media/VideoSwitching/entry/src/main/ets/component/VideoComponent.ets#L109-L124
69bd647ae34996997a9519ab830776e30b2a59a4
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/videotrimmer/src/main/ets/uploadanddownload/RequestUpload.ets
arkts
deleteTask
取消任务
async deleteTask() { if (this.uploadTask === undefined) { return; } try { this.uploadTask.off('progress'); this.progressCallback = undefined; this.uploadTask.off('failed'); this.failedCallback = undefined this.uploadTask.off('completed'); this.completedCallback = un...
AST#method_declaration#Left async deleteTask AST#parameter_list#Left ( ) AST#parameter_list#Right AST#block_statement#Left { AST#statement#Left AST#if_statement#Left if ( AST#expression#Left AST#binary_expression#Left AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . uploadT...
async deleteTask() { if (this.uploadTask === undefined) { return; } try { this.uploadTask.off('progress'); this.progressCallback = undefined; this.uploadTask.off('failed'); this.failedCallback = undefined this.uploadTask.off('completed'); this.completedCallback = un...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/videotrimmer/src/main/ets/uploadanddownload/RequestUpload.ets#L110-L126
8084d490b2dab6e52e6013883d59602a8d9ca1b2
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/InfoCard.ets
arkts
选择的数据的数组
build() { Column() { List() { LazyForEach(this.siteList, (site: SiteItem) => { ListItem() { Column() { this.productDetails(site) this.productList(site.siteBale) } .padding({ bottom: $r('app.integer.multiple_screening_info_card_l...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Column ( ) AST#container_content_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left List ( ) AST#container_content_body#Left { AST#ui_contr...
build() { Column() { List() { LazyForEach(this.siteList, (site: SiteItem) => { ListItem() { Column() { this.productDetails(site) this.productList(site.siteBale) } .padding({ bottom: $r('app.integer.multiple_screening_info_card_l...
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/multiplescreening/src/main/ets/components/InfoCard.ets#L39-L70
4b7686afa7755f542dda7fc5aed19bb9511a2c7a
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/OrderCacheStoreRepository.ets
arkts
@file 订单缓存本地存储仓库,封装存取逻辑 使用两个 key: - carts: 从购物车来的商品项(仅购物车页面存储) - selectedGoodsList: 选中的商品列表(购物车和商品详情页都存储) @author Joker.X
export class OrderCacheStoreRepository { /** * 本地数据源实例 */ private dataSource: OrderCacheStoreDataSource; /** * 构造函数 * @param {OrderCacheStoreDataSource} [dataSource] 可选自定义数据源 */ constructor(dataSource?: OrderCacheStoreDataSource) { this.dataSource = dataSource ?? new OrderCacheStoreDataSourc...
AST#export_declaration#Left export AST#class_declaration#Left class OrderCacheStoreRepository AST#class_body#Left { /** * 本地数据源实例 */ AST#property_declaration#Left private dataSource : AST#type_annotation#Left AST#primary_type#Left OrderCacheStoreDataSource AST#primary_type#Right AST#type_annotation#Right ; AST#pr...
export class OrderCacheStoreRepository { private dataSource: OrderCacheStoreDataSource; constructor(dataSource?: OrderCacheStoreDataSource) { this.dataSource = dataSource ?? new OrderCacheStoreDataSourceImpl(); } saveCarts(carts: Cart[]): Promise<void> { return this.dataSource.setCarts(carts)...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/OrderCacheStoreRepository.ets#L12-L67
aa86a779e485a1cb45ad313570912f36f68fd86a
github
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/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) { // calculate the starting and entry point of the y-labels (depending on // zoom / contentrect bounds) if ( this.mViewPortHandler != null && this.mViewPortHandler.contentWidth() > 10 && !this.mViewPortHandler.isFullyZoomedOutY() ...
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) { if ( this.mViewPortHandler != null && this.mViewPortHandler.contentWidth() > 10 && !this.mViewPortHandler.isFullyZoomedOutY() ) { let p1: MPPointD = this.mTrans.getValuesByTouchPoint( this.mViewPortHandler.conten...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/renderer/AxisRenderer.ets#L123-L153
9f68b79c58e3a7e2464c677a1a082f567ac0d14e
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/user/src/main/ets/view/FootprintPage.ets
arkts
FootprintContent
足迹页面内容视图 @returns {void} 无返回值
@Builder private FootprintContent() { Text("足迹页面内容视图") }
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private FootprintContent 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 Text ( AST#expression#Left "足迹页面内容视图" AST#express...
@Builder private FootprintContent() { Text("足迹页面内容视图") }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/user/src/main/ets/view/FootprintPage.ets#L33-L36
b675239d4f8a2c2c4996dd3d53636235b9a17143
github
liuchao0739/arkTS_universal_starter.git
0ca845f5ae0e78db439dc09f712d100c0dd46ed3
entry/src/main/ets/pages/Splash.ets
arkts
aboutToAppear
防止重复跳转
aboutToAppear(): void { Logger.pageEnter('SplashPage'); Logger.info('SplashPage', 'Splash page appeared, starting countdown'); this.startCountdown(); }
AST#method_declaration#Left aboutToAppear AST#parameter_list#Left ( ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left void AST#primary_type#Right AST#type_annotation#Right AST#builder_function_body#Left { AST#expression_statement#Left AST#expression#Left AST#call_expression#Left AST#expression...
aboutToAppear(): void { Logger.pageEnter('SplashPage'); Logger.info('SplashPage', 'Splash page appeared, starting countdown'); this.startCountdown(); }
https://github.com/liuchao0739/arkTS_universal_starter.git/blob/0ca845f5ae0e78db439dc09f712d100c0dd46ed3/entry/src/main/ets/pages/Splash.ets#L17-L21
c42814b1b763885b6e8208539092c602cc5914fa
github
zeroone001/harmonyAPP.git
49c8fa1b56de89cb7513b25f3b1b753ba857968a
features/quickstart/src/main/ets/pages/QuickStartPage.ets
arkts
build 方法描述UI
build() { Navigation(this.articlePathStack) { Scroll() { Column() { Header() Banner() EnablementView() TutorialView() } } .layoutWeight(1) // scrollBar设置为BarState.Off,表示关闭滚动时的滚动条显示 .scrollBar(BarState.Off) .align(Alignment.T...
AST#build_method#Left build ( ) AST#build_body#Left { AST#arkts_ui_element#Left AST#ui_element_with_modifiers#Left AST#ui_component#Left Navigation ( AST#expression#Left AST#member_expression#Left AST#expression#Left this AST#expression#Right . articlePathStack AST#member_expression#Right AST#expression#Right ) AST#con...
build() { Navigation(this.articlePathStack) { Scroll() { Column() { Header() Banner() EnablementView() TutorialView() } } .layoutWeight(1) .scrollBar(BarState.Off) .align(Alignment.TopStart) } .navDestination(t...
https://github.com/zeroone001/harmonyAPP.git/blob/49c8fa1b56de89cb7513b25f3b1b753ba857968a/features/quickstart/src/main/ets/pages/QuickStartPage.ets#L30-L51
fd4214e078213f3130b7c2fa1ea0e3ddd4e140d8
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SystemFeature/Security/DLP/entry/src/main/ets/feature/FileManager.ets
arkts
getAllFiles
获取文件
async getAllFiles(context: common.UIAbilityContext, dlpFileInfos: Array<TestDlpFileInfo>): Promise<void> { Logger.info(TAG, 'getAllFiles begin'); Logger.info(TAG, 'getAllFiles begin' + JSON.stringify(dlpFileInfos)); this.fileInfos = []; let rootIterator = await this.fileAccessHelper.getRoots(); // 获...
AST#method_declaration#Left async getAllFiles AST#parameter_list#Left ( AST#parameter#Left context : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left common . UIAbilityContext AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left dlpFile...
async getAllFiles(context: common.UIAbilityContext, dlpFileInfos: Array<TestDlpFileInfo>): Promise<void> { Logger.info(TAG, 'getAllFiles begin'); Logger.info(TAG, 'getAllFiles begin' + JSON.stringify(dlpFileInfos)); this.fileInfos = []; let rootIterator = await this.fileAccessHelper.getRoots(); ...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SystemFeature/Security/DLP/entry/src/main/ets/feature/FileManager.ets#L97-L107
17d2c8eeb1e7db8c26e1482b228be8b518161a55
gitee
XiangRui_FuZi/harmony-oscourse
da885f9a777a1eace7a07e1cd81137746687974b
class1/entry/src/main/ets/model/DataModel.ets
arkts
addData
Change a single piece of data.
public addData(index: number, data: string): void { this.tabContent.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 string AST#primary_type#Ri...
public addData(index: number, data: string): void { this.tabContent.splice(index, 0, data); this.notifyDataAdd(index); }
https://github.com/XiangRui_FuZi/harmony-oscourse/blob/da885f9a777a1eace7a07e1cd81137746687974b/class1/entry/src/main/ets/model/DataModel.ets#L65-L68
5e2bf1bb1b3bd68df45c3592f2ce95242879f15c
gitee
harmonyos-cases/cases
eccdb71f1cee10fa6ff955e16c454c1b59d3ae13
CommonAppDevelopment/feature/bottompanelslide/src/main/ets/model/DataSource.ets
arkts
unregisterDataChangeListener
为对应的LazyForEach组件在数据源处去除listener监听 @param {DataChangeListener} listener - 监听对象
unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { console.info('remove listener'); this.listeners.splice(pos, 1); } }
AST#method_declaration#Left unregisterDataChangeListener AST#parameter_list#Left ( AST#parameter#Left listener : AST#type_annotation#Left AST#primary_type#Left DataChangeListener AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#L...
unregisterDataChangeListener(listener: DataChangeListener): void { const pos = this.listeners.indexOf(listener); if (pos >= 0) { console.info('remove listener'); this.listeners.splice(pos, 1); } }
https://github.com/harmonyos-cases/cases/blob/eccdb71f1cee10fa6ff955e16c454c1b59d3ae13/CommonAppDevelopment/feature/bottompanelslide/src/main/ets/model/DataSource.ets#L84-L90
1fcda1adc14b2a48ed84b0944afa4847c40db390
gitee
harmonyos/samples
f5d967efaa7666550ee3252d118c3c73a77686f5
HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/multiplexSample/MultiplexModel.ets
arkts
Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
export class MultiplexModel { private id: string; private img: Resource; constructor(id: string, img: Resource) { this.id = id; this.img = img; } getId():string { return this.id; } getImg():Resource { return this.img; } }
AST#export_declaration#Left export AST#class_declaration#Left class MultiplexModel AST#class_body#Left { AST#property_declaration#Left private id : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right ; AST#property_declaration#Right AST#property_declaration#Left privat...
export class MultiplexModel { private id: string; private img: Resource; constructor(id: string, img: Resource) { this.id = id; this.img = img; } getId():string { return this.id; } getImg():Resource { return this.img; } }
https://github.com/harmonyos/samples/blob/f5d967efaa7666550ee3252d118c3c73a77686f5/HarmonyOS_NEXT/ArkUI/ComponentCollection/entry/src/main/ets/pages/animations/TransitionAnimations/multiplexSample/MultiplexModel.ets#L16-L32
ab861e8553fc268218575a48d8b0dc5238e1dd0a
gitee
openharmony/developtools_profiler
73d26bb5acfcafb2b1f4f94ead5640241d1e5f73
host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets
arkts
getRequiredWidthSpace
This is for normal (not horizontal) charts horizontal spacing. @param p @return
public getRequiredWidthSpace(p: Paint): number { p.setTextSize(this.mTextSize); var label: string = super.getLongestLabel(); var width: number = Utils.calcTextWidth(p, label) + super.getXOffset() * 2; var minWidth: number = this.getMinWidth(); var maxWidth: number = this.getMax...
AST#method_declaration#Left public getRequiredWidthSpace AST#parameter_list#Left ( AST#parameter#Left p : AST#type_annotation#Left AST#primary_type#Left Paint AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left number AST#prima...
public getRequiredWidthSpace(p: Paint): number { p.setTextSize(this.mTextSize); var label: string = super.getLongestLabel(); var width: number = Utils.calcTextWidth(p, label) + super.getXOffset() * 2; var minWidth: number = this.getMinWidth(); var maxWidth: number = this.getMax...
https://github.com/openharmony/developtools_profiler/blob/73d26bb5acfcafb2b1f4f94ead5640241d1e5f73/host/smartperf/client/client_ui/entry/src/main/ets/common/ui/detail/chart/components/YAxis.ets#L349-L369
da04c6058e2f384ae74d4a36a0b5f2e97a306744
gitee
fengcreate/harmony-document
798534b0f76399dc84e7940f5b14b3ae4e53c6a9
BackupRestore/entry/src/main/ets/restore/sp/SpTransferManager.ets
arkts
parseXmlElement
Parse the XMLElement object corresponding to the XML file. @param xmlElement xmlElement. @return map store data in XML.
private parseXmlElement(xmlElement: XmlElement): Map<string, preferences.ValueType> { let dataMap = new Map<string, preferences.ValueType>(); if (!xmlElement._elements || xmlElement._elements.length == 0) { return dataMap; } let rootNode = xmlElement._elements[0]; if (!rootNode || !rootNode._e...
AST#method_declaration#Left private parseXmlElement AST#parameter_list#Left ( AST#parameter#Left xmlElement : AST#type_annotation#Left AST#primary_type#Left XmlElement AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#gen...
private parseXmlElement(xmlElement: XmlElement): Map<string, preferences.ValueType> { let dataMap = new Map<string, preferences.ValueType>(); if (!xmlElement._elements || xmlElement._elements.length == 0) { return dataMap; } let rootNode = xmlElement._elements[0]; if (!rootNode || !rootNode._e...
https://github.com/fengcreate/harmony-document/blob/798534b0f76399dc84e7940f5b14b3ae4e53c6a9/BackupRestore/entry/src/main/ets/restore/sp/SpTransferManager.ets#L208-L231
5727367bac7d08e4b2fe4ce8b6fc1e404b71854e
gitee
openharmony-sig/knowledge_demo_smart_home
6cdf5d81ef84217f386c4200bfc4124a0ded5a0d
FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets
arkts
getSchedule
根据时间获取当前的日程数据
static async getSchedule(userId: string, startTime: string, endTime: string) { let httpRequest = http.createHttp(); var urlObject = new Url.URL(`${DistScheduleService.distScheduleServer}/schedule/query?startTime=${startTime}&endTime=${endTime}`); let data = await httpRequest.request( // `${DistSche...
AST#method_declaration#Left static async getSchedule AST#parameter_list#Left ( AST#parameter#Left userId : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left startTime : AST#type_annotation#Left AST#primary_type#Left string AST...
static async getSchedule(userId: string, startTime: string, endTime: string) { let httpRequest = http.createHttp(); var urlObject = new Url.URL(`${DistScheduleService.distScheduleServer}/schedule/query?startTime=${startTime}&endTime=${endTime}`); let data = await httpRequest.request( urlObject.toString...
https://github.com/openharmony-sig/knowledge_demo_smart_home/blob/6cdf5d81ef84217f386c4200bfc4124a0ded5a0d/FA/DistScheduleEts/entry/src/main/ets/common/service/distScheduleService.ets#L276-L299
2fcfb082e524a302f35b4dc95d945f96e3272b01
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/SHA.ets
arkts
digestSHA512
SHA512摘要 @param str 带摘要的字符串 @returns 摘要后的字符串
static async digestSHA512(str: string): Promise<OutDTO<string>> { return CryptoUtil.digest(str, 'SHA512'); }
AST#method_declaration#Left static async digestSHA512 AST#parameter_list#Left ( AST#parameter#Left str : AST#type_annotation#Left AST#primary_type#Left string AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right : AST#type_annotation#Left AST#primary_type#Left AST#generic_type...
static async digestSHA512(str: string): Promise<OutDTO<string>> { return CryptoUtil.digest(str, 'SHA512'); }
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/SHA.ets#L69-L71
c4ae4beb8e463660c978535176a70a806b74d092
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
feature/order/src/main/ets/view/OrderDetailPage.ets
arkts
OrderDetailContent
订单详情页面内容视图 @returns {void} 无返回值
@Builder private OrderDetailContent() { Scroll() { Column() { AddressCard({ address: this.getOrderData().address ?? null, onTap: (): void => { } }); SpaceVerticalMedium(); ForEach(this.vm.cartList, (cart: Cart): void => { OrderGoodsCa...
AST#method_declaration#Left AST#decorator#Left @ Builder AST#decorator#Right private OrderDetailContent 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 Scroll ( ) AST#container_content_body#Left { AS...
@Builder private OrderDetailContent() { Scroll() { Column() { AddressCard({ address: this.getOrderData().address ?? null, onTap: (): void => { } }); SpaceVerticalMedium(); ForEach(this.vm.cartList, (cart: Cart): void => { OrderGoodsCa...
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/feature/order/src/main/ets/view/OrderDetailPage.ets#L130-L171
261de9a13d9a0afab14f539a84b0f88f33051653
github
openharmony/applications_app_samples
a826ab0e75fe51d028c1c5af58188e908736b53b
code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/pages/typicalScene/header/HeaderSample.ets
arkts
Header
Copyright (c) 2022 Huawei Device Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
@Entry @Component export default struct Header { @State needWrap: boolean = true build() { GridRow() { GridCol({ span: { sm: 12, md: 6, lg: 7 } }) { Row() { Text($r('app.string.recommended')).fontSize(24) Blank() Image($r('app.media.ic_public_more')) .wid...
AST#decorated_export_declaration#Left AST#decorator#Left @ Entry AST#decorator#Right AST#decorator#Left @ Component AST#decorator#Right export default struct Header AST#component_body#Left { AST#property_declaration#Left AST#decorator#Left @ State AST#decorator#Right needWrap : AST#type_annotation#Left AST#primary_type...
@Entry @Component export default struct Header { @State needWrap: boolean = true build() { GridRow() { GridCol({ span: { sm: 12, md: 6, lg: 7 } }) { Row() { Text($r('app.string.recommended')).fontSize(24) Blank() Image($r('app.media.ic_public_more')) .wid...
https://github.com/openharmony/applications_app_samples/blob/a826ab0e75fe51d028c1c5af58188e908736b53b/code/SuperFeature/MultiDeviceAppDev/AdaptiveCapabilities/entry/src/main/ets/pages/typicalScene/header/HeaderSample.ets#L16-L69
0313b69cbfcee7990c1386a2d15c650ec77e719e
gitee
openharmony/interface_sdk-js
c349adc73e2ec1f61f6fca489b5af059e3ed6999
api/@ohos.util.d.ets
arkts
isFinite
Checks whether the current RationalNumber object represents an infinite value. @returns { boolean } If the denominator is not 0, true is returned. Otherwise, false is returned. @syscap SystemCapability.Utils.Lang @crossplatform @atomicservice @since 20
isFinite(): boolean;
AST#method_declaration#Left isFinite 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#method_declaration#Right
isFinite(): boolean;
https://github.com/openharmony/interface_sdk-js/blob/c349adc73e2ec1f61f6fca489b5af059e3ed6999/api/@ohos.util.d.ets#L1003-L1003
f09a854e637e619e0749d4c13467aa70a0b6c3b9
gitee
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_utils/src/main/ets/utils/DeviceUtil.ets
arkts
getProductModel
获取认证型号。示例:ALN-AL00。
static getProductModel(): string { return deviceInfo.productModel; }
AST#method_declaration#Left static getProductModel 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_e...
static getProductModel(): string { return deviceInfo.productModel; }
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_utils/src/main/ets/utils/DeviceUtil.ets#L157-L159
e2fd0e57b2783a552854432902a5cdedbef92838
gitee
Joker-x-dev/CoolMallArkTS.git
9f3fabf89fb277692cb82daf734c220c7282919c
core/data/src/main/ets/repository/CustomerServiceRepository.ets
arkts
createSession
创建客服会话 @returns 客服会话信息
async createSession(): Promise<NetworkResponse<CsSession>> { return this.networkDataSource.createSession(); }
AST#method_declaration#Left async createSession 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 < AST...
async createSession(): Promise<NetworkResponse<CsSession>> { return this.networkDataSource.createSession(); }
https://github.com/Joker-x-dev/CoolMallArkTS.git/blob/9f3fabf89fb277692cb82daf734c220c7282919c/core/data/src/main/ets/repository/CustomerServiceRepository.ets#L26-L28
672da74a814b5f503755d6af8fbd2778b9898be2
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/pages/Index.ets
arkts
getFestivalIcon
获取节日图标
private getFestivalIcon(type: string): string { switch (type) { case 'legal': return '🎊'; case 'traditional': return '🏮'; case 'solar': return '🌸'; case 'international': return '🌍'; default: return '🎉'; } }
AST#method_declaration#Left private getFestivalIcon AST#parameter_list#Left ( AST#parameter#Left type : 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#primar...
private getFestivalIcon(type: string): string { switch (type) { case 'legal': return '🎊'; case 'traditional': return '🏮'; case 'solar': return '🌸'; case 'international': return '🌍'; default: return '🎉'; } }
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/pages/Index.ets#L4701-L4714
3ddb52886213903921605057d873f03c2d9982e9
github
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/Transformer.ets
arkts
rectValuesToPixel
transforms multiple rects with all matrices @param rects
public rectValuesToPixel(rects: MyRect[]) { let m: Matrix = this.getValueToPixelMatrix(); for (let i = 0; i < rects.length; i++) { m.mapRect(rects[i]); } }
AST#method_declaration#Left public rectValuesToPixel AST#parameter_list#Left ( AST#parameter#Left rects : AST#type_annotation#Left AST#primary_type#Left AST#array_type#Left MyRect [ ] AST#array_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_list#Right AST#block_statement...
public rectValuesToPixel(rects: MyRect[]) { let m: Matrix = this.getValueToPixelMatrix(); for (let i = 0; i < rects.length; i++) { m.mapRect(rects[i]); } }
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/Transformer.ets#L344-L351
1c86884427eca57a117645c12e61c3f799f83fb7
gitee
openharmony-tpc/ohos_mpchart
4fb43a7137320ef2fee2634598f53d93975dfb4a
library/src/main/ets/components/utils/ViewPortHandler.ets
arkts
setZoom
Sets the scale factor to the specified values. @param scaleX @param scaleY @return
public setZoom(scaleX: number, scaleY: number, x?: number, y?: number): Matrix { let save: Matrix = new Matrix(); save.reset(); save.set(this.mMatrixTouch); if (x != undefined && y != undefined) { save.setScale(scaleX, scaleY, x, y); } else { save.setScale(scaleX, scaleY); } ret...
AST#method_declaration#Left public setZoom AST#parameter_list#Left ( AST#parameter#Left scaleX : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right , AST#parameter#Left scaleY : AST#type_annotation#Left AST#primary_type#Left number AST#primary_type...
public setZoom(scaleX: number, scaleY: number, x?: number, y?: number): Matrix { let save: Matrix = new Matrix(); save.reset(); save.set(this.mMatrixTouch); if (x != undefined && y != undefined) { save.setScale(scaleX, scaleY, x, y); } else { save.setScale(scaleX, scaleY); } ret...
https://github.com/openharmony-tpc/ohos_mpchart/blob/4fb43a7137320ef2fee2634598f53d93975dfb4a/library/src/main/ets/components/utils/ViewPortHandler.ets#L253-L264
d7f0f73305ae4d8d4afb5ff36ca9d2debc2fe0e3
gitee
KoStudio/ArkTS-WordTree.git
78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324
entry/src/main/ets/models/datas/book/BookDbAccess.ets
arkts
createOneCigenDataFromRs
CigenData ResultSet → Model
private createOneCigenDataFromRs(rs: relationalStore.ResultSet): CigenData { let data = new CigenData() data.cigenId = rs.getLong(rs.getColumnIndex(Table.CigenData.Col.cigenId)) data.cigenName = ResultSetTool.decodeString(rs, Table.CigenData.Col.cigenName) data.textDb = ResultSetTool.decodeSt...
AST#method_declaration#Left private createOneCigenDataFromRs AST#parameter_list#Left ( AST#parameter#Left rs : AST#type_annotation#Left AST#primary_type#Left AST#qualified_type#Left relationalStore . ResultSet AST#qualified_type#Right AST#primary_type#Right AST#type_annotation#Right AST#parameter#Right ) AST#parameter_...
private createOneCigenDataFromRs(rs: relationalStore.ResultSet): CigenData { let data = new CigenData() data.cigenId = rs.getLong(rs.getColumnIndex(Table.CigenData.Col.cigenId)) data.cigenName = ResultSetTool.decodeString(rs, Table.CigenData.Col.cigenName) data.textDb = ResultSetTool.decodeSt...
https://github.com/KoStudio/ArkTS-WordTree.git/blob/78c2a8f8ef6cf4c6be8bab2212f04bfcfa7e7324/entry/src/main/ets/models/datas/book/BookDbAccess.ets#L178-L184
109f46c512c18359ffacfb40377b766be88ca136
github
bigbear20240612/birthday_reminder.git
647c411a6619affd42eb5d163ff18db4b34b27ff
entry/src/main/ets/common/types/GlobalTypes.ets
arkts
应用上下文类型
export type AppContext = common.UIAbilityContext;
AST#export_declaration#Left export AST#type_declaration#Left type AppContext = 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#type_declaration#Right AST#export_declaration#Right
export type AppContext = common.UIAbilityContext;
https://github.com/bigbear20240612/birthday_reminder.git/blob/647c411a6619affd42eb5d163ff18db4b34b27ff/entry/src/main/ets/common/types/GlobalTypes.ets#L197-L197
d0269d98a3960c6ad018f4c04e36111fadf62de8
github
tongyuyan/harmony-utils
697472f011a43e783eeefaa28ef9d713c4171726
harmony_dialog/src/main/ets/model/LoadingOptions.ets
arkts
TODO 加载框,参数类 author: 桃花镇童长老ᥫ᭡ since: 2024/08/18
export interface LoadingOptions extends BaseDialogOptions { loadType?: SpinType //动画类型 loadSize?: number; //加载动画或进度条的大小 loadColor?: ResourceColor; //加载动画的颜色 content?: ResourceStr; //加载动画的提示文字 fontSize?: number | string | Resource; //加载动画的文字大小 fontColor?: ResourceColor; //加载动画的文字颜色 backgroundColor?: Resou...
AST#export_declaration#Left export AST#interface_declaration#Left interface LoadingOptions AST#extends_clause#Left extends BaseDialogOptions AST#extends_clause#Right AST#object_type#Left { AST#type_member#Left loadType ? : AST#type_annotation#Left AST#primary_type#Left SpinType AST#primary_type#Right AST#type_annotatio...
export interface LoadingOptions extends BaseDialogOptions { loadType?: SpinType loadSize?: number; loadColor?: ResourceColor; content?: ResourceStr; fontSize?: number | string | Resource; fontColor?: ResourceColor; backgroundColor?: ResourceColor; borderRadius?: Length | BorderRadiuses; margi...
https://github.com/tongyuyan/harmony-utils/blob/697472f011a43e783eeefaa28ef9d713c4171726/harmony_dialog/src/main/ets/model/LoadingOptions.ets#L25-L39
c7fd47d86a4a314c35a04e60beaa77f9ecddc6c7
gitee
yunkss/ef-tool
75f6761a0f2805d97183504745bf23c975ae514d
ef_crypto_dto/src/main/ets/crypto/encryption/ECDSASync.ets
arkts
@Author csx @DateTime 2024/3/20 20:05 @TODO ECDSASync 同步操作类
export class ECDSASync { /** * 生成ECDSA的非对称密钥 * @param resultCoding 生成ECDSA秘钥的字符串格式-默认不传为base64格式 * @returns ECDSA密钥{publicKey:公钥,privateKey:私钥} */ static generateECDSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('ECC256', resultCodi...
AST#export_declaration#Left export AST#class_declaration#Left class ECDSASync AST#class_body#Left { /** * 生成ECDSA的非对称密钥 * @param resultCoding 生成ECDSA秘钥的字符串格式-默认不传为base64格式 * @returns ECDSA密钥{publicKey:公钥,privateKey:私钥} */ AST#method_declaration#Left static generateECDSAKey AST#parameter_list#Left ( AST#para...
export class ECDSASync { static generateECDSAKey(resultCoding: buffer.BufferEncoding = 'base64'): OutDTO<CryptoKey> { return CryptoSyncUtil.generateCryptoKey('ECC256', resultCoding); } static sign(str: string, priKey: string, keyCoding: buffer.BufferEncoding, resultCoding: buffer.BufferEncoding = ...
https://github.com/yunkss/ef-tool/blob/75f6761a0f2805d97183504745bf23c975ae514d/ef_crypto_dto/src/main/ets/crypto/encryption/ECDSASync.ets#L26-L63
805dfe0e25254654c99ddf13b63e5cb7ac6b0c08
gitee